CloseScope() protected abstract method

protected abstract CloseScope ( ) : void
return void
Ejemplo n.º 1
0
 public Function(ListNode body, string name, List <string> argumentNames, Scope parentScope)
 {
     Line          = body.Line;
     Name          = name;
     Body          = body;
     ArgumentNames = argumentNames;
     ParentScope   = parentScope.CloseScope(body);
     MetaType      = FunctionMetaType.Instance;
 }
Ejemplo n.º 2
0
        protected override void recStarter()
        {
            Scope.OpenScope();

            mustBe("PROGRAM");
            //program name identifier has no semantic value (ignore it)
            mustBe(Token.IdentifierToken);
            mustBe("WITH");
            RecVarDecls();
            mustBe("IN");
            do
            {
                RecStatement();                                                                                      // MIGHT NEED TO LOOP THIS ( ()+ so one or more) - recursively call itself
            } while (have(Token.IdentifierToken) || have("UNTIL") || have("IF") || have("INPUT") || have("OUTPUT")); // while has tokens for terminal operators for this
            mustBe("END");

            Scope.CloseScope();
        }