Class TslParserImpl

java.lang.Object
com.aquima.interactions.expressions.tsl.TslParserImpl

public class TslParserImpl extends Object
TSL parser implementation class. This class can be used to parse strings to TslText objects.
Since:
5.0
Author:
O. Kerpershoek
  • Constructor Details

    • TslParserImpl

      public TslParserImpl(IExprParser exprParser, IDefinitionSource definitions)
      Constructs the parser with an expression parser and an object that can provide the definitions for the objects used in the expressions.
      Parameters:
      exprParser - The expression parser that should be used to parse expression in the TSL.
      definitions - Object containing the definition of the model.
  • Method Details

    • parse

      public TslText parse(String id, String text, IParseListener listener)
      This method parses the TSL string provided into a TSL text object.
      Parameters:
      id - Optional unique ID for 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 TSL could not be parsed.
    • parseText

      public static IParseNode parseText(String id, String text, IParseListener listener)
    • parseSuggestions

      public static void parseSuggestions(String unitName, String text, ISuggestionListener listener)
      This method parses the syntax of the expression and notifies the listener of possible other symbols. The method is intended for use for syntax highlighting and auto completion. *
      Parameters:
      unitName - the name of the unit
      text - the text
      listener - the listener
      Throws:
      ParseException - when something goes wrong