jfun.parsec
Class Expressions
java.lang.Object
jfun.parsec.Expressions
public final class Expressions
- extends java.lang.Object
Expressions provides helper functions to build parser for a operator-precedence expression grammar.
It supports prefix unary, postfix unary, infix left associative binary,
infix right associative binary and infix non-associative binary operators.
- Author:
- Ben Yu
Nov 19, 2004
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Expressions
public Expressions()
buildExpressionParser
public static <E,T extends E> Parser<E> buildExpressionParser(Parser<T> term,
OperatorTable<E> table)
- Creates a Parser object based on information described by OperatorTable.
- Parameters:
term
- parser for the terminals.table
- the operator table.
- Returns:
- the expression parser.
buildExpressionParser
public static <E,T extends E> Parser<E> buildExpressionParser(java.lang.String name,
Parser<T> term,
OperatorTable<E> table)
- Creates a Parser object based on information described by OperatorTable.
- Parameters:
name
- the name of the parser.term
- parser for the terminals.table
- the operator table.
- Returns:
- the expression parser.