예제 #1
0
 public override void ExitForStatement([NotNull] PigeonParser.ForStatementContext context)
 {
     CheckExprType(context.expr(0), PigeonType.Int);
     CheckExprType(context.expr(1), PigeonType.Int);
     scope = scope.Parent;
 }
예제 #2
0
 public override void EnterForStatement([NotNull] PigeonParser.ForStatementContext context)
 {
     scope = new Scope(scope);
     scope.DeclareVariable(PigeonType.Int, context.ID().GetText(), false);
 }