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 }
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); } }
/// <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)); }
/// <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"); }
public override void ExitMethod([NotNull] COOLParser.MethodContext context) { CheckExitScope(context); }