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; }
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(); }