Interface ILocalParser


public interface ILocalParser
This interface is a parser in which one can define a scope and types before actually parsing the expression itself.
Since:
6.0
Author:
F. van der Meer
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    This method may be used to start a new scope in the parser.
    void
    declareVariable(String variableName, Type type)
    This method binds a variable to a type which will then be used within the parser to check whether the variable types are correct.
    void
    This method should be used to end a scope that was started with the "beginScope" method.
    parse(String id, String expression, IParseListener listener)
    This method parses the expression using the definitions provided into an expression object.
  • Method Details

    • 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 errors.
    • declareVariable

      void declareVariable(String variableName, Type type)
      This method binds a variable to a type which will then be used within the parser to check whether the variable types are correct.
      Parameters:
      variableName - The name of the variable which is mandatory.
      type - The type object the variable which is mandatory and cannot be null.
    • beginScope

      void beginScope()
      This method may be used to start a new scope in the parser. Any variables declared in the scope will only be available as long as the scope is not ended by the "endScope" method.
    • endScope

      void endScope()
      This method should be used to end a scope that was started with the "beginScope" method. Any variables declared in the scope will no longer be available after calling this method.