internal static void CheckAst(Parser parser, ScriptBlockAst ast) { SemanticChecks semanticChecker = new SemanticChecks(parser); semanticChecker._scopeStack.Push(ast); ast.InternalVisit(semanticChecker); semanticChecker._scopeStack.Pop(); Diagnostics.Assert(semanticChecker._memberScopeStack.Count == 0, "Unbalanced push/pop of member scope stack"); Diagnostics.Assert(semanticChecker._scopeStack.Count == 0, "Unbalanced push/pop of scope stack"); }
public ScriptBlock GetScriptBlock() { Parser parser = new Parser(); SemanticChecks.CheckAst(parser, this); if (parser.ErrorList.Any <ParseError>()) { throw new ParseException(parser.ErrorList.ToArray()); } return(new ScriptBlock(this, false)); }
internal static void CheckAst(Parser parser, ScriptBlockAst ast) { SemanticChecks visitor = new SemanticChecks(parser); ast.InternalVisit(visitor); }