/// <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); } }
/// <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); } }
// terms or numeric terms (derived from TermOrNumericAstNode) public virtual void Visit(IdentifierTermAstNode node) { }
/// <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("?")); }
/// <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)); }
/// <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)); }
/// <summary> /// Handles the AST node visit. /// </summary> /// <param name="astNode">AST node.</param> public override void Visit(IdentifierTermAstNode astNode) { ExpressionData = new NumericFunction(astNode.Name); }