public ExoAtom(List <ExoAtom> packedValues) { this.IdentifiedType = ExoAtomType.pack; this.ValueCore = new PackedValueCore() { Values = packedValues }; }
public ExoAtom(ExoFunction function) { this.IdentifiedType = ExoAtomType.func; this.ValueCore = new FuncValueCore() { Value = function }; }
public ExoAtom(List <string> value) { if (!value.All(x => IsStringType(x))) { TraceUtility.Throw("Can't create merged ExoAtom from non-dictionary types!"); } this.IdentifiedType = ExoAtomType.dict; this.ValueCore = new HashSetValueCore() { Values = new HashSet <string>(value) }; }
public ExoAtom(string value) { if (IsReservedType(value) || value.All(x => char.IsDigit(x))) { this.IdentifiedType = ExoAtomType.prim; this.ValueCore = new SimpleAtomValueCore() { Value = value, CanBeVariable = false }; } else if (IsStringType(value)) { this.IdentifiedType = ExoAtomType.dict; this.ValueCore = new HashSetValueCore() { Values = new HashSet <string>() { value } }; // ?? } else if (value.Length <= 2 && FilterExoConfig.SimpleOperators.Contains(value[0]) || FilterExoConfig.CombinedOperators.Contains(value)) { this.IdentifiedType = ExoAtomType.oper; this.ValueCore = new SimpleAtomValueCore() { Value = value, CanBeVariable = false }; } else if (value.ContainsSpecialCharacters()) { TraceUtility.Throw("Unknown ExoAtom Type with special characters: " + value); } else { this.IdentifiedType = ExoAtomType.prim; this.ValueCore = new SimpleAtomValueCore() { Value = value, CanBeVariable = true }; } }