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