jelan.simple
Class ExpressionParser
java.lang.Object
jelan.simple.ExpressionParser
public class ExpressionParser
- extends java.lang.Object
This is a recursive descent parser for parsing expressions using the standard
grammar for expressions
expression ::= term
::= term + expression
::= term - expression
term ::= factor
::= factor * term
::= factor / term
factor ::= number
::= - factor
::= ( expression )
This class has undergone basic though not thorough testing
- Author:
- Owen Astrachan
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ExpressionParser
public ExpressionParser(ElanParser ep)
- Parse expressions from a parser
- Parameters:
ep
- the parser from which tokens are obtained
parse
public Expression parse()