Module: ANTLR3::Profile::ParserEvents
- Includes:
- Debug::ParserEvents
- Defined in:
- lib/antlr3/profile.rb
Overview
ANTLR3::Profile::ParserEvents expands basic debugging events for use by recognition code generated by ANTLR when called with the -profile switch.
Instance Attribute Summary
Attributes included from Debug::ParserEvents
Class Method Summary (collapse)
Instance Method Summary (collapse)
- - (Boolean) already_parsed_rule?(rule)
-
- (ParserEvents) initialize(stream, options = {})
A new instance of ParserEvents.
- - (Object) memoize(rule, start_index, success)
- - (Object) profile
Methods included from Debug::ParserEvents
#backtrack, #begin_backtrack, #begin_resync, #cyclic_decision=, #cyclic_decision?, #end_backtrack, #end_resync, #in_alternative, #in_decision, #in_rule, #in_subrule, #missing_symbol, #predicate?, #report_error, #resync, #rule_invocation_stack, #rule_level
Methods included from Error
#EarlyExit, #FailedPredicate, #MismatchedNotSet, #MismatchedRange, #MismatchedSet, #MismatchedToken, #MismatchedTreeNode, #MissingToken, #NoViableAlternative, #RewriteCardinalityError, #RewriteEarlyExit, #RewriteEmptyStream, #UnwantedToken
Class Method Details
+ (Object) included(klass)
47 48 49 50 51 52 53 54 |
# File 'lib/antlr3/profile.rb', line 47 def self.included( klass ) super if klass.is_a?( ::Class ) def klass.profile? true end end end |
Instance Method Details
- (Boolean) already_parsed_rule?(rule)
61 62 63 64 |
# File 'lib/antlr3/profile.rb', line 61 def already_parsed_rule?( rule ) @debug_listener.examine_rule_memoization( rule ) super end |
- (ParserEvents) initialize(stream, options = {})
A new instance of ParserEvents
56 57 58 59 |
# File 'lib/antlr3/profile.rb', line 56 def initialize( stream, = {} ) [ :debug_listener ] ||= Profiler.new( self ) super( stream, ) end |
- (Object) memoize(rule, start_index, success)
70 71 72 73 |
# File 'lib/antlr3/profile.rb', line 70 def memoize( rule, start_index, success ) @debug_listener.memoize( rule, start_index, success ) super end |
- (Object) profile
66 67 68 |
# File 'lib/antlr3/profile.rb', line 66 def profile @debug_listener.profile end |