public void AppendEntities(EntityTable table)
        {
            if(table == null)
                throw new ArgumentNullException("table");

            #region Arithmetics
            table.Add(new NaryToOneGenericEntity("+", "Add", "Std", InfixNotation.LeftAssociativeInnerOperator, 60));
            table.Add(new NaryToOneGenericEntity("-", "Subtract", "Std", InfixNotation.LeftAssociativeInnerOperator, 60));
            table.Add(new NaryToOneGenericEntity("*", "Multiply", "Std", InfixNotation.LeftAssociativeInnerOperator, 50));
            table.Add(new NaryToOneGenericEntity("/", "Divide", "Std", InfixNotation.LeftAssociativeInnerOperator, 50));
            table.Add(new SymmetricGenericEntity("-", "Negate", "Std", InfixNotation.PreOperator, 20));
            table.Add(new SymmetricGenericEntity("inv", "Invert", "Std"));
            table.Add(new SymmetricGenericEntity("abs", "Absolute", "Std"));
            table.Add(new SymmetricGenericEntity("exp", "Exponential", "Std"));
            table.Add(new SymmetricGenericEntity("ln", "NaturalLogarithm", "Std"));
            table.Add(new SymmetricGenericEntity("sqr", "Square", "Std"));
            table.Add(new Entity("^", "Power", "Std", InfixNotation.RightAssociativeInnerOperator, 19, new string[] { "Power_base", "Power_radix" }, new string[] { "Power_out" }));
            table.Add(new Entity("!", "Factorial", "Std", InfixNotation.PostOperator, 45, new string[] { "Factorial_in" }, new string[] { "Factorial_out" }));
            #endregion
            #region Trigonometry
            table.Add(new SymmetricGenericEntity("sin", "Sine", "Std"));
            table.Add(new SymmetricGenericEntity("cos", "Cosine", "Std"));
            table.Add(new SymmetricGenericEntity("tan", "Tangent", "Std"));
            table.Add(new SymmetricGenericEntity("cot", "Cotangent", "Std"));
            table.Add(new SymmetricGenericEntity("sec", "Secant", "Std"));
            table.Add(new SymmetricGenericEntity("csc", "Cosecant", "Std"));
            table.Add(new SymmetricGenericEntity("asin", "InverseSine", "Std"));
            table.Add(new SymmetricGenericEntity("acos", "InverseCosine", "Std"));
            table.Add(new SymmetricGenericEntity("atan", "InverseTangent", "Std"));
            table.Add(new SymmetricGenericEntity("acot", "InverseCotangent", "Std"));
            table.Add(new SymmetricGenericEntity("asec", "InverseSecant", "Std"));
            table.Add(new SymmetricGenericEntity("acsc", "InverseCosecant", "Std"));
            table.Add(new SymmetricGenericEntity("sinh", "HyperbolicSine", "Std"));
            table.Add(new SymmetricGenericEntity("cosh", "HyperbolicCosine", "Std"));
            table.Add(new SymmetricGenericEntity("tanh", "HyperbolicTangent", "Std"));
            table.Add(new SymmetricGenericEntity("coth", "HyperbolicCotangent", "Std"));
            table.Add(new SymmetricGenericEntity("sech", "HyperbolicSecant", "Std"));
            table.Add(new SymmetricGenericEntity("csch", "HyperbolicCosecant", "Std"));
            table.Add(new SymmetricGenericEntity("asinh", "InverseHyperbolicSine", "Std"));
            table.Add(new SymmetricGenericEntity("acosh", "InverseHyperbolicCosine", "Std"));
            table.Add(new SymmetricGenericEntity("atanh", "InverseHyperbolicTangent", "Std"));
            table.Add(new SymmetricGenericEntity("acoth", "InverseHyperbolicCotangent", "Std"));
            table.Add(new SymmetricGenericEntity("asech", "InverseHyperbolicSecant", "Std"));
            table.Add(new SymmetricGenericEntity("acsch", "InverseHyperbolicCosecant", "Std"));
            #endregion
            #region Logic
            table.Add(new NaryToOneGenericEntity("and", "And", "Std", InfixNotation.LeftAssociativeInnerOperator, 250));
            table.Add(new NaryToOneGenericEntity("nand", "Nand", "Std", InfixNotation.LeftAssociativeInnerOperator, 250));
            table.Add(new NaryToOneGenericEntity("or", "Or", "Std", InfixNotation.LeftAssociativeInnerOperator, 250));
            table.Add(new NaryToOneGenericEntity("nor", "Nor", "Std", InfixNotation.LeftAssociativeInnerOperator, 250));
            table.Add(new NaryToOneGenericEntity("xor", "Xor", "Std", InfixNotation.LeftAssociativeInnerOperator, 250));
            table.Add(new NaryToOneGenericEntity("xnor", "Xnor", "Std", InfixNotation.LeftAssociativeInnerOperator, 250));
            table.Add(new NaryToOneGenericEntity("imp", "Imply", "Std", InfixNotation.LeftAssociativeInnerOperator, 250));
            table.Add(new SymmetricGenericEntity("not", "Not", "Std", InfixNotation.PreOperator, 250));
            #endregion
            #region Algebra & Analysis
            table.Add(new NearlySymmetricGenericEntity("diff", "Derive", "Std", 1, 0));
            table.Add(new SymmetricGenericEntity("asimplify", "AutoSimplify", "Std"));
            #endregion
            #region Flow
            table.Add(new SymmetricGenericEntity("<-", "Transport", "Std"));
            table.Add(new NearlySymmetricGenericEntity("$", "Sync", "Std", 1, 0));
            table.Add(new SymmetricGenericEntity("clk", "Clock", "Std"));
            #endregion
        }
Пример #2
0
 public void AppendEntities(EntityTable table)
 {
     #region Arithmetics
     table.Add(new NaryToOneGenericEntity("+", "Add", "Std", InfixNotation.LeftAssociativeInnerOperator, 60));
     table.Add(new NaryToOneGenericEntity("-", "Subtract", "Std", InfixNotation.LeftAssociativeInnerOperator, 60));
     table.Add(new NaryToOneGenericEntity("*", "Multiply", "Std", InfixNotation.LeftAssociativeInnerOperator, 50));
     table.Add(new NaryToOneGenericEntity("/", "Divide", "Std", InfixNotation.LeftAssociativeInnerOperator, 50));
     table.Add(new SymmetricGenericEntity("-", "Negate", "Std", InfixNotation.PreOperator, 20));
     table.Add(new SymmetricGenericEntity("inv", "Invert", "Std"));
     table.Add(new SymmetricGenericEntity("abs", "Absolute", "Std"));
     table.Add(new SymmetricGenericEntity("exp", "Exponential", "Std"));
     table.Add(new SymmetricGenericEntity("ln", "NaturalLogarithm", "Std"));
     table.Add(new SymmetricGenericEntity("sqr", "Square", "Std"));
     table.Add(new Entity("^", "Power", "Std", InfixNotation.RightAssociativeInnerOperator, 19, new string[] { "Power_base", "Power_radix" }, new string[] { "Power_out" }));
     table.Add(new Entity("!", "Factorial", "Std", InfixNotation.PostOperator, 45, new string[] { "Factorial_in" }, new string[] { "Factorial_out" }));
     #endregion
     #region Trigonometry
     table.Add(new SymmetricGenericEntity("sin", "Sine", "Std"));
     table.Add(new SymmetricGenericEntity("cos", "Cosine", "Std"));
     table.Add(new SymmetricGenericEntity("tan", "Tangent", "Std"));
     table.Add(new SymmetricGenericEntity("cot", "Cotangent", "Std"));
     table.Add(new SymmetricGenericEntity("sec", "Secant", "Std"));
     table.Add(new SymmetricGenericEntity("csc", "Cosecant", "Std"));
     table.Add(new SymmetricGenericEntity("asin", "InverseSine", "Std"));
     table.Add(new SymmetricGenericEntity("acos", "InverseCosine", "Std"));
     table.Add(new SymmetricGenericEntity("atan", "InverseTangent", "Std"));
     table.Add(new SymmetricGenericEntity("acot", "InverseCotangent", "Std"));
     table.Add(new SymmetricGenericEntity("asec", "InverseSecant", "Std"));
     table.Add(new SymmetricGenericEntity("acsc", "InverseCosecant", "Std"));
     table.Add(new SymmetricGenericEntity("sinh", "HyperbolicSine", "Std"));
     table.Add(new SymmetricGenericEntity("cosh", "HyperbolicCosine", "Std"));
     table.Add(new SymmetricGenericEntity("tanh", "HyperbolicTangent", "Std"));
     table.Add(new SymmetricGenericEntity("coth", "HyperbolicCotangent", "Std"));
     table.Add(new SymmetricGenericEntity("sech", "HyperbolicSecant", "Std"));
     table.Add(new SymmetricGenericEntity("csch", "HyperbolicCosecant", "Std"));
     table.Add(new SymmetricGenericEntity("asinh", "InverseHyperbolicSine", "Std"));
     table.Add(new SymmetricGenericEntity("acosh", "InverseHyperbolicCosine", "Std"));
     table.Add(new SymmetricGenericEntity("atanh", "InverseHyperbolicTangent", "Std"));
     table.Add(new SymmetricGenericEntity("acoth", "InverseHyperbolicCotangent", "Std"));
     table.Add(new SymmetricGenericEntity("asech", "InverseHyperbolicSecant", "Std"));
     table.Add(new SymmetricGenericEntity("acsch", "InverseHyperbolicCosecant", "Std"));
     #endregion
     #region Logic
     table.Add(new NaryToOneGenericEntity("and", "And", "Std", InfixNotation.LeftAssociativeInnerOperator, 250));
     table.Add(new NaryToOneGenericEntity("nand", "Nand", "Std", InfixNotation.LeftAssociativeInnerOperator, 250));
     table.Add(new NaryToOneGenericEntity("or", "Or", "Std", InfixNotation.LeftAssociativeInnerOperator, 250));
     table.Add(new NaryToOneGenericEntity("nor", "Nor", "Std", InfixNotation.LeftAssociativeInnerOperator, 250));
     table.Add(new NaryToOneGenericEntity("xor", "Xor", "Std", InfixNotation.LeftAssociativeInnerOperator, 250));
     table.Add(new NaryToOneGenericEntity("xnor", "Xnor", "Std", InfixNotation.LeftAssociativeInnerOperator, 250));
     table.Add(new NaryToOneGenericEntity("imp", "Imply", "Std", InfixNotation.LeftAssociativeInnerOperator, 250));
     table.Add(new SymmetricGenericEntity("not", "Not", "Std", InfixNotation.PreOperator, 250));
     #endregion
     #region Algebra & Analysis
     table.Add(new NearlySymmetricGenericEntity("diff", "Derive", "Std", 1, 0));
     table.Add(new SymmetricGenericEntity("asimplify", "AutoSimplify", "Std"));
     #endregion
     #region Flow
     table.Add(new SymmetricGenericEntity("<-", "Transport", "Std"));
     table.Add(new NearlySymmetricGenericEntity("$", "Sync", "Std", 1, 0));
     table.Add(new SymmetricGenericEntity("clk", "Clock", "Std"));
     #endregion
 }
Пример #3
0
 public TEntity AddNew(TEntity entity)
 {
     EntityTable.Add(entity);
     SaveDb();
     return(entity);
 }