public static CodeSentence Create(XElement xCodeSentence) { return(new CodeSentence( CodeCommentList.Create(xCodeSentence.Element(CodeCommentList.ElementName)), (CodeCompoundTerm)CodeTerm.Create(xCodeSentence.Element(CodeTerm.ElementName)), CodeCompoundTermList.Create(xCodeSentence.Element(CodeCompoundTermList.ElementName)))); }
public CodeList(IEnumerable <CodeTerm> head, CodeTerm tail) { if (head == null) { throw new ArgumentNullException("head"); } if (tail == null) { throw new ArgumentNullException("tail"); } if (tail.IsCodeList) { List <CodeTerm> headTerms = new List <CodeTerm>(head); headTerms.AddRange(tail.AsCodeList.Head); m_head = new CodeTermList(headTerms); m_tail = tail.AsCodeList.Tail; } else { m_head = new CodeTermList(new List <CodeTerm>(head)); m_tail = tail; } }
public static CodeCompoundTermList Create(XElement xCodeCompoundTermList) { List <CodeCompoundTerm> codeCompoundTerms = new List <CodeCompoundTerm>(); foreach (XElement xCodeCompoundTerm in xCodeCompoundTermList.Elements(CodeTerm.ElementName)) { codeCompoundTerms.Add((CodeCompoundTerm)CodeTerm.Create(xCodeCompoundTerm)); } return(new CodeCompoundTermList(codeCompoundTerms)); }
public new static CodeList Create(XElement xCodeList) { return(new CodeList( CodeTermList.Create(xCodeList.Element(CodeTermList.ElementName)), CodeTerm.Create(xCodeList.Element(CodeTerm.ElementName)))); }
public CodeList() { m_head = new CodeTermList(new List <CodeTerm>()); m_tail = new CodeCompoundTerm(CodeFunctor.NilFunctor); }
public override bool Equals(CodeTerm other) { return(Equals(other as CodeList)); }
public override bool Equals(CodeTerm other) { return(Equals(other as CodeCompoundTerm)); }
public override bool Equals(CodeTerm other) { return(Equals(other as CodeVariable)); }