|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--oops.parser.Node | +--oops.parser.Rule
represents grammar rule: id : alt .
Field Summary | |
static boolean |
debug
determines default factory class: false: GoalAdapter, true: GoalDebug. |
protected boolean |
firstGoalWarning
|
protected boolean |
followChanged
set if follow has changed. |
protected GoalMaker |
gm
|
protected boolean |
inProgress
used to detect left recursion and to flag if follow needs to be recomputed. |
protected boolean |
marked
|
protected java.lang.String |
nt
nonterminal name. |
protected Node |
rhs
right hand side subtree. |
Fields inherited from class oops.parser.Node |
follow,
lookahead |
Constructor Summary | |
Rule(Id nt,
Node rhs)
|
Method Summary | |
boolean |
checkDeadLoop()
|
void |
checkLL1(Parser parser)
checks LL(1) for rule and rhs. |
int |
degree()
|
boolean |
followChanged()
resets before recomputing follow. |
java.lang.String |
getNt()
|
void |
parse(Scanner scanner,
Goal goal,
Parser parser,
oops.parser.Activation caller)
performs recognition. |
java.lang.Object |
parse(Scanner scanner,
Parser parser,
oops.parser.Activation caller)
|
protected Goal |
rhsParse(Scanner scanner,
Parser parser,
oops.parser.Activation caller)
|
void |
setFollow(Parser parser)
traverses rhs; should reach all rules from start rule. |
Set |
setFollow(Parser parser,
Set succ)
sets or adds to (new) follow set and reports changes to parser. |
void |
setFollow(Set s)
initialize follow with an empty set. |
void |
setGoalMaker(GoalMaker gm)
|
Set |
setLookahead(Parser parser)
gets lookahead from rhs, sets inProgress. |
java.lang.Object |
sub(int n)
|
java.lang.String |
toString()
|
java.lang.String |
toString(Parser parser)
|
Methods inherited from class oops.parser.Node |
add,
getLookahead,
node |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
protected boolean marked
public static boolean debug
protected java.lang.String nt
protected Node rhs
protected transient boolean inProgress
protected transient boolean followChanged
protected boolean firstGoalWarning
protected GoalMaker gm
Constructor Detail |
public Rule(Id nt, Node rhs)
Method Detail |
public Set setLookahead(Parser parser)
public boolean followChanged()
public void setFollow(Set s)
public void setFollow(Parser parser)
public Set setFollow(Parser parser, Set succ)
parser
- for report.succ
- to set/add to follow.public void checkLL1(Parser parser)
public boolean checkDeadLoop()
public java.lang.String toString()
public java.lang.String toString(Parser parser)
public java.lang.String getNt()
public int degree()
public java.lang.Object sub(int n)
protected Goal rhsParse(Scanner scanner, Parser parser, oops.parser.Activation caller) throws java.io.IOException, oops.parser.Activation
public void parse(Scanner scanner, Goal goal, Parser parser, oops.parser.Activation caller) throws java.io.IOException, oops.parser.Activation
scanner
- delivers input tokens.goal
- represents current nonterminal and is informed about shifts/reduces.caller
- Activation frame.public java.lang.Object parse(Scanner scanner, Parser parser, oops.parser.Activation caller) throws java.io.IOException, oops.parser.Activation
public void setGoalMaker(GoalMaker gm)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |