Example #1
0
        /// <summary>
        /// Handles the AST node visit.
        /// </summary>
        /// <param name="astNode">AST node.</param>
        public override void Visit(FunctionTermAstNode astNode)
        {
            NumericFunction function = new NumericFunction(astNode.Name);

            astNode.Terms.ForEach(term => function.Terms.Add(MasterExporter.ToTerm(term)));
            ExpressionData = function;
        }
Example #2
0
        /// <summary>
        /// Handles the AST node visit.
        /// </summary>
        /// <param name="astNode">AST node.</param>
        public override void Visit(FunctionTermAstNode astNode)
        {
            ObjectFunctionTerm functionTerm = new ObjectFunctionTerm(astNode.Name);

            astNode.Terms.ForEach(argTerm => functionTerm.Terms.Add(MasterExporter.ToTerm(argTerm)));
            TermData = functionTerm;
        }
Example #3
0
 /// <summary>
 /// Handles the AST node visit.
 /// </summary>
 /// <param name="astNode">AST node.</param>
 public override void Visit(FunctionTermAstNode astNode)
 {
     if (astNode.Name.Equals("total-time"))
     {
         ExpressionData = new MetricTotalTime();
     }
     else
     {
         MetricNumericFunction function = new MetricNumericFunction(astNode.Name);
         astNode.Terms.ForEach(term => function.Terms.Add(MasterExporter.ToConstantTerm(term)));
         ExpressionData = function;
     }
 }
Example #4
0
 public virtual void Visit(FunctionTermAstNode node)
 {
 }
Example #5
0
 /// <summary>
 /// Checks whether the given function term is a object function.
 /// </summary>
 /// <param name="functionTermAstNode">AST node.</param>
 /// <returns>True if the function term is a object function. False otherwise.</returns>
 public static bool IsObjectFunction(FunctionTermAstNode functionTermAstNode)
 {
     return(DomainContext.Functions.ContainsFunction(functionTermAstNode.Name, functionTermAstNode.Terms.Count, false));
 }
Example #6
0
 /// <summary>
 /// Checks whether the given function term is a numeric function.
 /// </summary>
 /// <param name="functionTermAstNode">AST node.</param>
 /// <returns>True if the function term is a numeric function. False otherwise.</returns>
 public static bool IsNumericFunction(FunctionTermAstNode functionTermAstNode)
 {
     return(DomainContext.Functions.ContainsFunction(functionTermAstNode.Name, functionTermAstNode.Terms.Count, true));
 }