Пример #1
0
            public override void EnterMethod([NotNull] COOLParser.MethodContext context)
            {
                base.EnterMethod(context);
                if (IsScopeRule(context))
                {
                    SymbolTable parent = listener.depthTables.Peek();
                    SymbolTable child  = new SymbolTable(context.ToString());
                    listener.depthTables.Push(child);
                    parent.childs.Add(child);
                }

                //add current rule symbols
            }
Пример #2
0
 public override void EnterMethod([NotNull] COOLParser.MethodContext context)
 {
     base.EnterMethod(context);
     Log("enter Method");
     if (phase == Phase.Building)
     {
         symbolTableCreator.EnterMethod(context);
     }
     else
     {
         symbolTableTraverser.EnterMethod(context);
         semanticErrorChecker.EnterMethod(context);
     }
 }
Пример #3
0
 /// <summary>
 /// Visit a parse tree produced by the <c>method</c>
 /// labeled alternative in <see cref="COOLParser.feature"/>.
 /// <para>
 /// The default implementation returns the result of calling <see cref="AbstractParseTreeVisitor{Result}.VisitChildren(IRuleNode)"/>
 /// on <paramref name="context"/>.
 /// </para>
 /// </summary>
 /// <param name="context">The parse tree.</param>
 /// <return>The visitor result.</return>
 public virtual Result VisitMethod([NotNull] COOLParser.MethodContext context)
 {
     return(VisitChildren(context));
 }
Пример #4
0
 /// <summary>
 /// Exit a parse tree produced by the <c>method</c>
 /// labeled alternative in <see cref="COOLParser.feature"/>.
 /// <para>The default implementation does nothing.</para>
 /// </summary>
 /// <param name="context">The parse tree.</param>
 public virtual void ExitMethod([NotNull] COOLParser.MethodContext context)
 {
     System.Console.WriteLine("exit method");
 }
Пример #5
0
 public override void ExitMethod([NotNull] COOLParser.MethodContext context)
 {
     CheckExitScope(context);
 }