/// <inheritdoc /> IParsingProduct IGrammarProductsFactory.CreateOperatorNode( ISourceCodeFragment operatorTerm, IBinaryOperatorTermDefinition @operator, IParsingProduct exp1, IParsingProduct exp2) { return(GetFunction(operatorTerm, ExpressionTypeId.BinaryOperator, new[] { exp1, exp2 })); }
/// <inheritdoc /> public int CompareTo(IBinaryOperatorTermDefinition other) { if (other == null) { return(1); } return(Precedence.CompareTo(other.Precedence)); }
/// <inheritdoc /> public void Add(IBinaryOperatorTermDefinition operatorTermDefinition, ISourceCodeFragment codeFragment) { if (IsEmpty) { throw new InvalidOperationException( "No expression => can't chain operator, first item must be an expression."); } _last = _last.AddNext(operatorTermDefinition, codeFragment); }
public override ListNode AddNext(IBinaryOperatorTermDefinition definition, ISourceCodeFragment codeFragment) { throw new InvalidOperationException( "Last item is an operator => can't chain operator to operator, expression expected."); }
public OperatorListNode(IBinaryOperatorTermDefinition definition, ISourceCodeFragment codeFragment) { _definition = definition ?? throw new ArgumentNullException(nameof(definition)); _codeFragment = codeFragment ?? throw new ArgumentNullException(nameof(codeFragment)); }
public override ListNode AddNext(IBinaryOperatorTermDefinition definition, ISourceCodeFragment codeFragment) { Next = new OperatorListNode(definition, codeFragment); return(Next); }
public abstract ListNode AddNext( IBinaryOperatorTermDefinition definition, ISourceCodeFragment codeFragment);