Lines Matching refs:follow

64   a stack that tracks follow sets for error recovery
382 # the symbol doesn't match, attempt to use the follow-set
383 # data provided by +follow+ to recover from the mismatched
385 def match( type, follow )
393 return recover_from_mismatched_token( type, follow )
535 # follow that rule reference on the stack; this amounts to
537 # enclosing rule. This local follow set only includes tokens
546 # can legally follow a call to r *or* any rule that called r.
561 # At each rule invocation, the set of tokens that could follow
563 # follow sets:
573 # and, hence, the follow context stack is:
575 # depth local follow set after call to rule
587 # could follow any reference in the call chain. We need to
627 def recover_from_mismatched_token( type, follow )
636 if mismatch_is_missing_token?( follow )
637 inserted = missing_symbol( nil, type, follow )
645 def recover_from_mismatched_set( e, follow )
646 if mismatch_is_missing_token?( follow )
648 return missing_symbol( e, INVALID_TOKEN_TYPE, follow )
653 def recover_from_mismatched_element( e, follow )
654 follow.nil? and return false
655 if follow.include?( EOR_TOKEN_TYPE )
657 follow = ( follow | viable_tokens ) - Set[ EOR_TOKEN_TYPE ]
659 if follow.include?( @input.peek )
684 def missing_symbol( error, expected_token_type, follow )
692 def mismatch_is_missing_token?( follow )
693 follow.nil? and return false
694 if follow.include?( EOR_TOKEN_TYPE )
696 follow = follow | viable_tokens
698 follow.delete( EOR_TOKEN_TYPE ) unless @state.following.empty?
700 if follow.include?( @input.peek ) or follow.include?( EOR_TOKEN_TYPE )
724 # This is set of token types that can follow a specific rule
734 # FOLLOW(r) is the set of all tokens that can possibly follow
751 # FOLLOW sets are precisely what could follow a rule reference.
765 # What can follow that specific nested ref to atom? Exactly ')'
1284 def missing_symbol( error, expected_type, follow )