示例#1
0
 /// <summary>
 /// Handles the AST node visit.
 /// </summary>
 /// <param name="astNode">AST node.</param>
 public override void Visit(IdentifierTermAstNode astNode)
 {
     if (astNode.Name.Equals("total-time"))
     {
         ExpressionData = new MetricTotalTime();
     }
     else
     {
         ExpressionData = new MetricNumericFunction(astNode.Name);
     }
 }
示例#2
0
 /// <summary>
 /// Handles the AST node visit.
 /// </summary>
 /// <param name="astNode">AST node.</param>
 public override void Visit(IdentifierTermAstNode astNode)
 {
     if (MasterExporter.IsIdentifierTermObjectFunction(astNode))
     {
         TermData = new ObjectFunctionTerm(astNode.Name);
     }
     else if (MasterExporter.IsIdentifierTermVariable(astNode))
     {
         TermData = new VariableTerm(astNode.Name);
     }
     else
     {
         TermData = new ConstantTerm(astNode.Name);
     }
 }
示例#3
0
        // terms or numeric terms (derived from TermOrNumericAstNode)

        public virtual void Visit(IdentifierTermAstNode node)
        {
        }
示例#4
0
 /// <summary>
 /// Checks whether the given identifier term is a variable.
 /// </summary>
 /// <param name="termAstNode">AST node.</param>
 /// <returns>True if the term is a variable. False otherwise.</returns>
 public static bool IsIdentifierTermVariable(IdentifierTermAstNode termAstNode)
 {
     return(termAstNode.Name.StartsWith("?"));
 }
示例#5
0
 /// <summary>
 /// Checks whether the given identifier term is a numeric function.
 /// </summary>
 /// <param name="termAstNode">AST node.</param>
 /// <returns>True if the term is a numeric function. False otherwise.</returns>
 public static bool IsIdentifierTermNumericFunction(IdentifierTermAstNode termAstNode)
 {
     return(DomainContext.Functions.ContainsFunction(termAstNode.Name, 0, true));
 }
示例#6
0
 /// <summary>
 /// Checks whether the given identifier term is an object function.
 /// </summary>
 /// <param name="termAstNode">AST node.</param>
 /// <returns>True if the term is an object function.</returns>
 public static bool IsIdentifierTermObjectFunction(IdentifierTermAstNode termAstNode)
 {
     return(DomainContext.Functions.ContainsFunction(termAstNode.Name, 0, false));
 }
示例#7
0
 /// <summary>
 /// Handles the AST node visit.
 /// </summary>
 /// <param name="astNode">AST node.</param>
 public override void Visit(IdentifierTermAstNode astNode)
 {
     ExpressionData = new NumericFunction(astNode.Name);
 }