private bool AddTerm(Term value) { if (_isFraction) { if (_terms.Length > 0) { value = new PrimitiveTerm(UnitType.Unknown, _terms[0] + "/" + value); _terms = new TermList(); } _isFraction = false; } if (_functionBuffers.Count > 0) { _functionBuffers.Peek().TermList.Add(value); } else if (_terms.Length == 0) { _terms.AddTerm(value); } else if (_parsingContext == ParsingContext.InSingleValue) { _terms.AddTerm(value); } else { return(false); } return(true); }
private bool AddTerm(Term value) { var added = true; if (_isFraction) { if (_terms.Length > 0) { value = new PrimitiveTerm(UnitType.Unknown, _terms[_terms.Length - 1] + "/" + value); } _terms.SetLastTerm(value); _isFraction = false; } else if (_functionBuffers.Count > 0) { _functionBuffers.Peek().TermList.Add(value); } else if (_terms.Length == 0) { _terms.AddTerm(value); } else if (_parsingContext == ParsingContext.InSingleValue) { _terms.AddTerm(value); } else { added = false; } return(added); }
public GenericFunction(string name, IEnumerable<Term> arguments) { Name = name; var list = new TermList(); foreach (var term in arguments) { list.AddTerm(term); } Arguments = list; }
public GenericFunction(string name, IEnumerable <Term> arguments) { Name = name; var list = new TermList(); foreach (var term in arguments) { list.AddTerm(term); } Arguments = list; }
public GenericFunction(string name, List<Term> arguments) { this.Name = name; var list = new TermList(); for (int n = 0; n < arguments.Count; n++) { list.AddTerm(arguments[n]); if (n == arguments.Count - 1) break; list.AddSeparator(GrammarSegment.Comma); } this.Arguments = list; }
public GenericFunction(string name, List <Term> arguments) { this.Name = name; var list = new TermList(); for (int n = 0; n < arguments.Count; n++) { list.AddTerm(arguments[n]); if (n == arguments.Count - 1) { break; } list.AddSeparator(GrammarSegment.Comma); } this.Arguments = list; }