private Reduction leftExpression;
private Reduction rightExpression;
public Expression(GOLDParser parser) {
theParser = parser;
Reduction reduction = parser.getCurrentReduction();
if (reduction != null) {
if (reduction.size() == 3) {
leftExpression = reduction.get(0).asReduction();
theOperator = reduction.get(1).asString();
rightExpression = reduction.get(2).asReduction();
if (validOperators.indexOf(theOperator + " ") == -1) {
parser.raiseParserException(Simple3.formatMessage("error.invalid_operator", validOperators, theOperator));
}
} else {
parser.raiseParserException(Simple3.formatMessage("error.param_count", "3", String.valueOf(reduction.size())));
}
} else {
parser.raiseParserException(Simple3.formatMessage("error.no_reduction"));
}
}