Class: Antlr4ruby::DFAState

Inherits:
Object
  • Object
show all
Defined in:
lib/antlr4ruby/dfa/dfa_state.rb

Defined Under Namespace

Classes: PredPrediction

Constant Summary collapse

INITIAL_NUM_TRANSITIONS =
4
INVALID_TYPE =
0
BASIC =
1
RULE_START =
2
BLOCK_START =
3
PLUS_BLOCK_START =
4
STAR_BLOCK_START =
5
TOKEN_START =
6
RULE_STOP =
7
BLOCK_END =
8
STAR_LOOP_BACK =
9
STAR_LOOP_ENTRY =
10
PLUS_LOOP_BACK =
11
LOOP_END =
12

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(configs) ⇒ DFAState

Returns a new instance of DFAState.



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/antlr4ruby/dfa/dfa_state.rb', line 40

def initialize(configs)
  @configs = ATNConfigSet.new
  @state_number = -1
  @edges = []
  @is_accept_state = false
  @prediction = 0
  @predicates = []

  if configs
    if configs.instance_of?(Integer)
      @state_number = configs
    elsif configs.instance_of?(ATNConfigSet)
      @configs = configs
    end
  end
end

Instance Attribute Details

#configsObject

Returns the value of attribute configs.



20
21
22
# File 'lib/antlr4ruby/dfa/dfa_state.rb', line 20

def configs
  @configs
end

#edgesObject

Returns the value of attribute edges.



20
21
22
# File 'lib/antlr4ruby/dfa/dfa_state.rb', line 20

def edges
  @edges
end

#is_accept_stateObject

Returns the value of attribute is_accept_state.



20
21
22
# File 'lib/antlr4ruby/dfa/dfa_state.rb', line 20

def is_accept_state
  @is_accept_state
end

#lexer_action_executorObject

Returns the value of attribute lexer_action_executor.



20
21
22
# File 'lib/antlr4ruby/dfa/dfa_state.rb', line 20

def lexer_action_executor
  @lexer_action_executor
end

#predicatesObject

Returns the value of attribute predicates.



20
21
22
# File 'lib/antlr4ruby/dfa/dfa_state.rb', line 20

def predicates
  @predicates
end

#predictionObject

Returns the value of attribute prediction.



20
21
22
# File 'lib/antlr4ruby/dfa/dfa_state.rb', line 20

def prediction
  @prediction
end

#requires_full_contextObject

Returns the value of attribute requires_full_context.



20
21
22
# File 'lib/antlr4ruby/dfa/dfa_state.rb', line 20

def requires_full_context
  @requires_full_context
end

#state_numberObject

Returns the value of attribute state_number.



20
21
22
# File 'lib/antlr4ruby/dfa/dfa_state.rb', line 20

def state_number
  @state_number
end

Instance Method Details

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


72
73
74
# File 'lib/antlr4ruby/dfa/dfa_state.rb', line 72

def eql?(other)
  # todo

end

#get_alt_setObject



57
58
59
60
61
62
63
64
65
66
# File 'lib/antlr4ruby/dfa/dfa_state.rb', line 57

def get_alt_set
  alts = Set.new
  if @configs
    # todo

  end
  if alts.empty?
    return nil
  end
  alts
end

#hashObject



68
69
70
# File 'lib/antlr4ruby/dfa/dfa_state.rb', line 68

def hash
  # todo

end

#to_sObject



76
77
78
# File 'lib/antlr4ruby/dfa/dfa_state.rb', line 76

def to_s
  # todo

end