Class LelloParser

java.lang.Object
org.oristool.lello.parse.LelloParser

public class LelloParser extends Object
Lello syntax analyzer (parser).

This class is responsible for reading a stream of terminal symbols and build the expression they represent.

This class implements a recursive descent parser, so it basically consists in a set of methods which are mutually recursive. Such methods have names that starts with the word 'rule'.

Concerning the language it parses, it is C-like; variables and function calls are supported; the modulus operator '%' works also with floating point numbers according to the IEEE 754 specification. More information is available in the user documentation.

  • Constructor Details

    • LelloParser

      public LelloParser()
  • Method Details

    • parse

      public Expression parse(TerminalStream terminals)
      Parses a stream of terminal symbols and returns the parsed expression. It delegates all the work to the root rule, which is implemented by the ruleExpr method.
      Parameters:
      terminals - Stream of terminal symbols to parse.
      Returns:
      The parsed expression.