private CompoundTerm(SerializationInfo info, StreamingContext context) { CompoundTerm t = (CompoundTerm)Term.Parse(info.GetString("rep")); this.functionSymbol = t.functionSymbol; this.arguments = t.arguments; }
/// <summary> /// Parses a symbol from the given string /// </summary> public static Symbol Parse(string representation) { if (representation == null) { throw new ArgumentNullException("representation"); } try { Term term = Term.Parse(representation + "()"); CompoundTerm ct = (CompoundTerm)term; return(ct.Symbol); } catch (ArgumentException) { throw; } }
/// <summary> /// Parse the string into a compound term. /// </summary> /// <param name="s">given string representing a compound term</param> /// <returns>compound term represented by the string</returns> new public static CompoundTerm Parse(string s) { return((CompoundTerm)Term.Parse(s)); }