sjm.examples.tests
Class Dangle
java.lang.Object
|
+--sjm.examples.tests.Dangle
- public class Dangle
- extends java.lang.Object
This class provides an ambiguous parser in its
statement method, which serves to show that
the test classes can find ambiguity.
The grammar this class supports is:
statement = iff | ifelse | callCustomer | sendBill;
iff = "if" comparison statement;
ifelse = "if" comparison statement
"else" statement;
comparison = '(' expression operator expression ')';
expression = Word | Num;
operator = '<' | '>' | '=' | "<=" | ">=" | "!=";
optionalElse = "else" statement | Empty;
callCustomer = "callCustomer" '('')' ';';
sendBill = "sendBill" '('')' ';';
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
statement
protected static Alternation statement
Dangle
public Dangle()
callCustomer
public static Parser callCustomer()
comparison
public static Parser comparison()
expression
public static Parser expression()
ifelse
public static Parser ifelse()
iff
public static Parser iff()
operator
public static Parser operator()
sendBill
public static Parser sendBill()
statement
public static Parser statement()
- Return a parser that recognizes the grammar:
statement = "if" comparison statement optionalElse |
callCustomer | sendBill;
- Returns:
- a parser that recognizes a statement