Package org.oristool.lello.parse
Class LelloParser
java.lang.Object
org.oristool.lello.parse.LelloParser
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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionparse
(TerminalStream terminals) Parses a stream of terminal symbols and returns the parsed expression.
-
Constructor Details
-
LelloParser
public LelloParser()
-
-
Method Details
-
parse
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.
-