Class: ANTLR3::Debug::RecognizerSharedState

Inherits:
Struct
  • Object
show all
Defined in:
lib/antlr3/debug.rb,
lib/antlr3/debug.rb

Overview

ANTLR3::Debug::RecognizerSharedState is identical to ANTLR3::RecognizerSharedState, but adds additional fields used for recognizers generated in debug or profiling mode.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeRecognizerSharedState

Returns a new instance of RecognizerSharedState.



105
106
107
108
109
110
111
112
113
114
115
# File 'lib/antlr3/debug.rb', line 105

def initialize
  super( [], false, [], false, -1, 0, nil, 0, nil, -1 )
  # ^-- same as this --v 
  # self.following = []
  # self.error_recovery = false
  # self.last_error_index = -1
  # self.backtracking = 0
  # self.syntax_errors = 0
  # self.rule_level = 0
  # self.token_start_position = -1
end

Instance Attribute Details

#backtrackingObject

Returns the value of attribute backtracking

Returns:

  • (Object)

    the current value of backtracking



63
64
65
# File 'lib/antlr3/debug.rb', line 63

def backtracking
  @backtracking
end

#channelObject

Returns the value of attribute channel

Returns:

  • (Object)

    the current value of channel



63
64
65
# File 'lib/antlr3/debug.rb', line 63

def channel
  @channel
end

#cyclic_decisionObject

Returns the value of attribute cyclic_decision

Returns:

  • (Object)

    the current value of cyclic_decision



63
64
65
# File 'lib/antlr3/debug.rb', line 63

def cyclic_decision
  @cyclic_decision
end

#error_recoveryObject

Returns the value of attribute error_recovery

Returns:

  • (Object)

    the current value of error_recovery



63
64
65
# File 'lib/antlr3/debug.rb', line 63

def error_recovery
  @error_recovery
end

#followingObject

Returns the value of attribute following

Returns:

  • (Object)

    the current value of following



63
64
65
# File 'lib/antlr3/debug.rb', line 63

def following
  @following
end

#last_error_indexObject

Returns the value of attribute last_error_index

Returns:

  • (Object)

    the current value of last_error_index



63
64
65
# File 'lib/antlr3/debug.rb', line 63

def last_error_index
  @last_error_index
end

#rule_invocation_stackObject

Returns the value of attribute rule_invocation_stack

Returns:

  • (Object)

    the current value of rule_invocation_stack



63
64
65
# File 'lib/antlr3/debug.rb', line 63

def rule_invocation_stack
  @rule_invocation_stack
end

#rule_memoryObject

Returns the value of attribute rule_memory

Returns:

  • (Object)

    the current value of rule_memory



63
64
65
# File 'lib/antlr3/debug.rb', line 63

def rule_memory
  @rule_memory
end

#syntax_errorsObject

Returns the value of attribute syntax_errors

Returns:

  • (Object)

    the current value of syntax_errors



63
64
65
# File 'lib/antlr3/debug.rb', line 63

def syntax_errors
  @syntax_errors
end

#textObject

Returns the value of attribute text

Returns:

  • (Object)

    the current value of text



63
64
65
# File 'lib/antlr3/debug.rb', line 63

def text
  @text
end

#tokenObject

Returns the value of attribute token

Returns:

  • (Object)

    the current value of token



63
64
65
# File 'lib/antlr3/debug.rb', line 63

def token
  @token
end

#token_start_columnObject

Returns the value of attribute token_start_column

Returns:

  • (Object)

    the current value of token_start_column



63
64
65
# File 'lib/antlr3/debug.rb', line 63

def token_start_column
  @token_start_column
end

#token_start_lineObject

Returns the value of attribute token_start_line

Returns:

  • (Object)

    the current value of token_start_line



63
64
65
# File 'lib/antlr3/debug.rb', line 63

def token_start_line
  @token_start_line
end

#token_start_positionObject

Returns the value of attribute token_start_position

Returns:

  • (Object)

    the current value of token_start_position



63
64
65
# File 'lib/antlr3/debug.rb', line 63

def token_start_position
  @token_start_position
end

#typeObject

Returns the value of attribute type

Returns:

  • (Object)

    the current value of type



63
64
65
# File 'lib/antlr3/debug.rb', line 63

def type
  @type
end

Instance Method Details

#reset!Object



117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
# File 'lib/antlr3/debug.rb', line 117

def reset!
  self.following.clear
  self.error_recovery = false
  self.last_error_index = -1
  self.backtracking = 0
  self.rule_memory and rule_memory.clear
  self.syntax_errors = 0
  self.token = nil
  self.token_start_position = -1
  self.token_start_line = nil
  self.token_start_column = nil
  self.channel = nil
  self.type = nil
  self.text = nil
  self.rule_invocation_stack.clear
end