Home | History | Annotate | Download | only in antlr3

Lines Matching refs:follow

59         # Track the set of token types that can follow any rule invocation.
197 def match(self, input, ttype, follow):
208 to the set of symbols that can follow rule ref.
221 matchedSymbol = self.recoverFromMismatchedToken(input, ttype, follow)
236 def mismatchIsMissingToken(self, input, follow):
237 if follow is None:
238 # we have no information about the follow; we can only consume
242 # compute what can follow this grammar element reference
243 if EOR_TOKEN_TYPE in follow:
245 follow = follow | viableTokensFollowingThisRule
249 follow = follow - set([EOR_TOKEN_TYPE])
254 if input.LA(1) in follow or EOR_TOKEN_TYPE in follow:
498 follow that rule reference on the stack; this amounts to
500 enclosing rule. This local follow set only includes tokens
509 can legally follow a call to r *or* any rule that called r.
524 At each rule invocation, the set of tokens that could follow
526 follow sets:
528 FOLLOW(b1_in_a) = FIRST(']') = ']'
529 FOLLOW(b2_in_a) = FIRST(')') = ')'
530 FOLLOW(c_in_b) = FIRST('^') = '^'
536 and, hence, the follow context stack is:
538 depth local follow set after call to rule
547 For error recovery, we cannot consider FOLLOW(c)
549 all context-sensitive FOLLOW sets--the set of all tokens that
550 could follow any reference in the call chain. We need to
551 resync to one of those tokens. Note that FOLLOW(c)='^' and if
584 Like Grosch I implemented local FOLLOW sets that are combined
593 Compute the context-sensitive FOLLOW set for current rule.
594 This is set of token types that can follow a specific rule
598 definition of plain FOLLOW for rule r:
600 FOLLOW(r)={x | S=>*alpha r beta in G and x in FIRST(beta)}
604 FOLLOW(r) is the set of all tokens that can possibly follow
612 stat : ID '=' expr ';' // FOLLOW(stat)=={EOF}
615 expr : atom ('+' atom)* ; // FOLLOW(expr)=={';','.',')'}
616 atom : INT // FOLLOW(atom)=={'+',')',';','.'}
620 The FOLLOW sets are all inclusive whereas context-sensitive
621 FOLLOW sets are precisely what could follow a rule reference.
635 What can follow that specific nested ref to atom? Exactly ')'
637 input. Contrast this with the FOLLOW(atom)={'+',')',';','.'}.
657 # us know if have to include follow(start rule); i.e., EOF
668 def recoverFromMismatchedToken(self, input, ttype, follow):
695 is in the set of tokens that can follow the ')' token
720 if self.mismatchIsMissingToken(input, follow):
721 inserted = self.getMissingSymbol(input, e, ttype, follow)
733 def recoverFromMismatchedSet(self, input, e, follow):
736 if self.mismatchIsMissingToken(input, follow):
739 return self.getMissingSymbol(input, e, INVALID_TOKEN_TYPE, follow)
760 def getMissingSymbol(self, input, e, expectedTokenType, follow):
784 ## def recoverFromMissingElement(self, input, e, follow):
792 ## if self.mismatchIsMissingToken(input, follow):
1383 def getMissingSymbol(self, input, e, expectedTokenType, follow):