@SuppressNode Rule firstOperatorOf(Operator... operators) { Rule[] rules = new Rule[operators.length]; int i = 0; for (Operator operator : operators) rules[i++] = operator(operator); return FirstOf(rules); }
@SuppressNode Rule firstOperatorOf(Operator... operators) { Rule[] rules = new Rule[operators.length]; int i = 0; for (Operator operator : operators) rules[i++] = operator(operator); return FirstOf(rules); }
Rule isOperation() { return Sequence( primary(), push(new OperationBinary(simplify(pop()))), ZeroOrMore( operator(IS), popValue(), mandatory( Sequence( FirstOf( Sequence( operator(NOT), popValue(), ((OperationBinary) peek()).addOperator(Operator.IS_NOT) ), ((OperationBinary) peek()).addOperator(Operator.IS) ), FirstOf( functionWithBrackets(), functionWithTwoWordsAsName(), variable(), keywordAsVariable(NULL) ), ((OperationBinary) peek(1)).add(simplify(pop())) ), new ParseException("Wrong binary operation syntax") ) ) ); }
Rule isOperation() { return Sequence( primary(), push(new OperationBinary(simplify(pop()))), ZeroOrMore( operator(IS), popValue(), mandatory( Sequence( FirstOf( Sequence( operator(NOT), popValue(), ((OperationBinary) peek()).addOperator(Operator.IS_NOT) ), ((OperationBinary) peek()).addOperator(Operator.IS) ), FirstOf( functionWithBrackets(), functionWithTwoWordsAsName(), variable(), keywordAsVariable(NULL) ), ((OperationBinary) peek(1)).add(simplify(pop())) ), new ParseException("Wrong binary operation syntax") ) ) ); }