public ExpressionParser(SharedParseData parseData, Token.Type terminator, SymbolTable scope, DefineMode defineMode, int end) { contextStack.Push(new Context(parseData.ast.Count, Context.Kind.STATEMENT)); this.terminator = terminator; this.parseData = parseData; this.defineMode = defineMode; this.canDefine = true; this.scope = scope; this.end = end; }
public static void Main(string[] args) { string source = File.ReadAllText("Program.jolly"); var tokens = new Tokenizer().tokenize(source, "Program.jolly"); // Lookup.casts.forEach(i => Console.WriteLine(i.GetHashCode())); var parseData = new SharedParseData { tokens = tokens, ast = new List <AST_Node>() }; var globalScope = new SymbolTable(null); new ScopeParser(parseData, tokens.Length - 1, globalScope).parse(ScopeParseMethod.GLOBAL); var instructions = Analyser.analyse(parseData.ast, globalScope); Debugger.Break(); }
public ScopeParser(SharedParseData parseData, int end, SymbolTable scope) { this.parseData = parseData; this.scope = scope; this.end = end; }