Interface IExprParser

All Known Implementing Classes:
ExprParserR7

public interface IExprParser
Basic interface for classes capable of parsing expressions.
Since:
5.0 IExprParser IExpr
Author:
O. Kerpershoek, F. van der Meer
  • Method Details

    • analyze

      ISemanticNode analyze(String id, String expression, IParseListener listener)
      This method parses the expression into a semantic tree.
      Parameters:
      id - Optional unique ID to identify the expression being parsed.
      expression - The string containing the expression that should be parsed.
      listener - a listener that will be notified on error or warning messages.
      Returns:
      Semantic tree for the expression.
      Throws:
      ParseException - This exception is thrown when the expression could not be parsed due to (syntax) errors.
    • analyze

      ISemanticNode analyze(String id, String expression, Type resultType, IParseListener listener)
      This method parses the expression into a semantic tree.
      Parameters:
      id - Optional unique ID to identify the expression being parsed.
      expression - The string containing the expression that should be parsed.
      resultType - The type the expression should result in.
      listener - a listener that will be notified on error or warning messages.
      Returns:
      Semantic tree for the expression.
      Throws:
      ParseException - This exception is thrown when the expression could not be parsed due to (syntax) errors.
    • parse

      IExpr parse(String id, String expression, IParseListener listener)
      This method parses the expression using the definitions provided into an expression object.
      Parameters:
      id - Optional unique ID to identify the expression being parsed.
      expression - The string containing the expression that should be parsed.
      listener - a listener that will be notified on error or warning messages.
      Returns:
      Expression object for the expression string passed.
      Throws:
      ParseException - This exception is thrown when the expression could not be parsed due to (syntax) errors.
    • parse

      IExpr parse(String id, String expression, Type resultType, IParseListener listener)
      This method parses the expression using the definitions provided into an expression object. The resulting expression will return a value of the provided type, or fail parsing when the expression result could not be converted to the requested type.
      Parameters:
      id - Optional unique ID to identify the expression being parsed.
      expression - The string containing the expression that should be parsed.
      resultType - The type the expression should result in.
      listener - a listener that will be notified on error or warning messages.
      Returns:
      Expression object for the expression string passed.
      Throws:
      ParseException - This exception is thrown when the expression could not be parsed due to errors.
    • parseTsl

      TslText parseTsl(String id, String text, IParseListener listener)
      This method parses the TSL string provided into a TSL text object. If an error of a tsl text occurs this parse function will fail.
      Parameters:
      id - Optional unique ID to identify the text being parsed.
      text - The text that should be parsed.
      listener - Listener that should be notified of errors and warnings.
      Returns:
      TslText object containing the parsed text.
      Throws:
      ParseException - This exception is thrown when the text could not be parsed due to (syntax) errors.
    • spawnLocalParser

      ILocalParser spawnLocalParser()
      Creates a localised expression parser which has a new scope in which one can define new variables etc.
      Returns:
      A localised parser which should never be null.