public Rule_UnHighlight(Rule_Context pContext, Reduction pToken) { super(pContext); // <IdentifierList> ::= <IdentifierList> Identifier | Identifier if (pToken.size() > 2) { // <Hide_Except_Statement> ::= HIDE '*' EXCEPT <IdentifierList> this.IsExceptList = true; this.IdentifierList = this.ExtractIdentifier(pToken.get(3)).toString().split(" "); } else { // <Hide_Some_Statement> ::= HIDE <IdentifierList> this.IdentifierList = this.ExtractIdentifier(pToken.get(1)).toString().split(" "); } }
public Statements(GOLDParser parser) { Reduction reduction = parser.getCurrentReduction(); if (reduction != null) { if (reduction.size() > 0 && reduction.size() < 3) { statement1 = reduction.get(0).asReduction(); statement2 = (reduction.size() > 1) ? reduction.get(1).asReduction() : null; } else { parser.raiseParserException( Simple2.formatMessage( "error.param_count_range", "1", "2", String.valueOf(reduction.size()))); } } else { parser.raiseParserException(Simple2.formatMessage("error.no_reduction")); } }
public Rule_Begin_Click_Statement(Rule_Context pContext, Reduction pToken) { super(pContext); // <Begin_Click_statement> ::= Begin-Click <Statements> End | Begin-Click End | !Null if (pToken.size() > 2) { // NonterminalToken T = (NonterminalToken)pToken.Tokens[1]; // this.Statements = new Rule_Statements(pContext, T); this.Statements = EnterRule.BuildStatements(pContext, (Reduction) pToken.get(1).getData()); } }
public Print(GOLDParser parser) { theParser = parser; Reduction reduction = parser.getCurrentReduction(); if (reduction != null) { if (reduction.size() == 2) { dataToPrint = reduction.get(1).asReduction(); variableName = null; } else if (reduction.size() == 4) { dataToPrint = reduction.get(1).asReduction(); variableName = reduction.get(3).asString(); } else { if (reduction.size() < 3) { // print x form parser.raiseParserException( Simple3.formatMessage("error.param_count", "2", String.valueOf(reduction.size()))); } // print x read y form parser.raiseParserException( Simple3.formatMessage("error.param_count", "4", String.valueOf(reduction.size()))); } } else { parser.raiseParserException(Simple3.formatMessage("error.no_reduction")); } }