예제 #1
0
 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");
 }
예제 #2
0
        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));
        }
예제 #3
0
        internal static void CheckAst(Parser parser, ScriptBlockAst ast)
        {
            SemanticChecks visitor = new SemanticChecks(parser);

            ast.InternalVisit(visitor);
        }
예제 #4
0
 internal static void CheckAst(Parser parser, ScriptBlockAst ast)
 {
     SemanticChecks visitor = new SemanticChecks(parser);
     ast.InternalVisit(visitor);
 }