Lines Matching full:follow
232 -(id) match:(id<IntStream>)anInput TokenType:(NSInteger)ttype Follow:(ANTLRBitSet *)follow
245 matchedSymbol = [self recoverFromMismatchedToken:anInput TokenType:ttype Follow:follow];
261 -(BOOL) mismatchIsMissingToken:(id<IntStream>)anInput Follow:(ANTLRBitSet *) follow
263 if ( follow == nil ) {
264 // we have no information about the follow; we can only consume
268 // compute what can follow this grammar element reference
269 if ( [follow member:TokenTypeEOR] ) {
271 follow = [follow or:viableTokensFollowingThisRule];
273 [follow remove:(TokenTypeEOR)];
280 //System.out.println("viable tokens="+follow.toString(getTokenNames()));
284 // in follow set to indicate that the fall of the start symbol is
285 // in the set (EOF can follow).
286 if ( [follow member:[anInput LA:1]] || [follow member:TokenTypeEOR] ) {
504 [self consumeUntilFollow:anInput Follow:followSet];
520 * follow that rule reference on the stack; this amounts to
522 * enclosing rule. This local follow set only includes tokens
531 * can legally follow a call to r *or* any rule that called r.
546 * At each rule invocation, the set of tokens that could follow
548 * follow sets:
550 * FOLLOW(b1_in_a) = FIRST(']') = ']'
551 * FOLLOW(b2_in_a) = FIRST(')') = ')'
552 * FOLLOW(c_in_b) = FIRST('^') = '^'
558 * and, hence, the follow context stack is:
560 * depth local follow set after call to rule
569 * For error recovery, we cannot consider FOLLOW(c)
571 * all context-sensitive FOLLOW sets--the set of all tokens that
572 * could follow any reference in the call chain. We need to
573 * resync to one of those tokens. Note that FOLLOW(c)='^' and if
606 * Like Grosch I implemented local FOLLOW sets that are combined
614 /** Compute the context-sensitive FOLLOW set for current rule.
615 * This is set of token types that can follow a specific rule
619 * definition of plain FOLLOW for rule r:
621 * FOLLOW(r)={x | S=>*alpha r beta in G and x in FIRST(beta)}
625 * FOLLOW(r) is the set of all tokens that can possibly follow
633 * stat : ID '=' expr ';' // FOLLOW(stat)=={EOF}
636 * expr : atom ('+' atom)* ; // FOLLOW(expr)=={';','.',')'}
637 * atom : INT // FOLLOW(atom)=={'+',')',';','.'}
641 * The FOLLOW sets are all inclusive whereas context-sensitive
642 * FOLLOW sets are precisely what could follow a rule reference.
656 * What can follow that specific nested ref to atom? Exactly ')'
658 * input. Contrast this with the FOLLOW(atom)={'+',')',';','.'}.
682 System.out.println("local follow depth "+i+"="+
690 // us know if have to include follow(start rule); i.e., EOF
729 * is in the set of tokens that can follow the ')' token
734 Follow:(ANTLRBitSet *)follow
755 if ( [self mismatchIsMissingToken:anInput Follow:follow] ) {
756 … id<Token> inserted = [self getMissingSymbol:anInput Exception:e TokenType:ttype Follow:follow];
769 Follow:(ANTLRBitSet *) follow
771 if ( [self mismatchIsMissingToken:anInput Follow:follow] ) {
775 return [self getMissingSymbol:anInput Exception:e TokenType:TokenTypeInvalid Follow:follow];
817 Follow:(ANTLRBitSet *)follow
834 -(void) consumeUntilFollow:(id<IntStream>)anInput Follow:(ANTLRBitSet *)set
845 /** Push a rule's follow set using our own hardcoded stack */
871 NSLog( @"Attempted to pop a follow when none exists on the stack\n" );