// parameter -> FUNCTION func_op param_op // parameter -> value param_op private void parameter(ParametersExpression parametersExpression) { if (_lookahead.TokenType == TokenTypes.Function) { // parameter -> FUNCTION func_op param_op String function = _lookahead.Sequence; nextToken(); ParametersExpression nestedParameters = funcOp(); var functionExpression = new FunctionExpression(function, nestedParameters); parametersExpression.NestedExpression = functionExpression.NestedExpression; paramOp(parametersExpression); } else { // parameter -> value param_op FieldOperatorNode fieldOperatorNode = paramOp(parametersExpression); fieldOperatorNode.Value = value(); parametersExpression.AddParameter(fieldOperatorNode); } }
// and_term -> CRITERIA field_op // and_term -> FUNCTION func_op // and_term -> argument private IExpression andTerm() { if (_lookahead.TokenType == TokenTypes.Criteria) { // and_term -> CRITERIA field_op String criteria = _lookahead.Sequence; nextToken(); FieldOperatorNode fieldOperator = fieldOp(); return(new CriteriaExpression(criteria, fieldOperator)); } if (_lookahead.TokenType == TokenTypes.Function) { // and_term -> FUNCTION func_op String function = _lookahead.Sequence; nextToken(); ParametersExpression parametersExpression = funcOp(); return(new FunctionExpression(function, parametersExpression)); } // and_term -> argument return(argument()); }
public CriteriaExpression(String criteriaName, FieldOperatorNode fieldOperator) { Name = criteriaName; Operator = fieldOperator.FieldOperator; Value = fieldOperator.Value; }
public void AddParameter(FieldOperatorNode parameter) { _fieldOperatorNodes.Insert(0, parameter); }