Beispiel #1
0
 public ExoAtom(List <ExoAtom> packedValues)
 {
     this.IdentifiedType = ExoAtomType.pack;
     this.ValueCore      = new PackedValueCore()
     {
         Values = packedValues
     };
 }
Beispiel #2
0
 public ExoAtom(ExoFunction function)
 {
     this.IdentifiedType = ExoAtomType.func;
     this.ValueCore      = new FuncValueCore()
     {
         Value = function
     };
 }
Beispiel #3
0
        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)
            };
        }
Beispiel #4
0
 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
         };
     }
 }