Class: Antlr4ruby::PredictionContext Abstract

Inherits:
Object
  • Object
show all
Defined in:
lib/antlr4ruby/atn/context/prediction_context.rb

Overview

This class is abstract.

Constant Summary collapse

EMPTY_RETURN_STATE =
2147483647

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(cached_hash_code) ⇒ PredictionContext

Returns a new instance of PredictionContext.



5
6
7
8
9
# File 'lib/antlr4ruby/atn/context/prediction_context.rb', line 5

def initialize(cached_hash_code)
  @cached_hash_code = cached_hash_code
  @id = @@global_node_count
  @@global_node_count += 1
end

Instance Attribute Details

#cached_hash_codeObject (readonly)

Returns the value of attribute cached_hash_code.



19
20
21
# File 'lib/antlr4ruby/atn/context/prediction_context.rb', line 19

def cached_hash_code
  @cached_hash_code
end

#idObject (readonly)

Returns the value of attribute id.



19
20
21
# File 'lib/antlr4ruby/atn/context/prediction_context.rb', line 19

def id
  @id
end

Class Method Details

.from_rule_context(atn, outer_context) ⇒ Object



54
55
56
# File 'lib/antlr4ruby/atn/context/prediction_context.rb', line 54

def from_rule_context(atn, outer_context)
  # todo
end

.get_all_context_nodes(context) ⇒ Object



82
83
84
# File 'lib/antlr4ruby/atn/context/prediction_context.rb', line 82

def get_all_context_nodes(context)
  # todo
end

.get_all_context_nodes_(context, nodes, visited) ⇒ Object



86
87
88
# File 'lib/antlr4ruby/atn/context/prediction_context.rb', line 86

def get_all_context_nodes_(context, nodes, visited)
  # todo
end

.get_cached_context(context, context_cache, visited) ⇒ Object



78
79
80
# File 'lib/antlr4ruby/atn/context/prediction_context.rb', line 78

def get_cached_context(context, context_cache, visited)
  # todo
end

.merge(a, b, root_is_wildcard, merge_cache) ⇒ Object



58
59
60
# File 'lib/antlr4ruby/atn/context/prediction_context.rb', line 58

def merge(a, b, root_is_wildcard, merge_cache)
  # todo
end

.merge_arrays(a, b, root_is_wildcard, merge_cache) ⇒ Object



70
71
72
# File 'lib/antlr4ruby/atn/context/prediction_context.rb', line 70

def merge_arrays(a, b, root_is_wildcard, merge_cache)
  # todo
end

.merge_root(a, b, root_is_wildcard) ⇒ Object



66
67
68
# File 'lib/antlr4ruby/atn/context/prediction_context.rb', line 66

def merge_root(a, b, root_is_wildcard)
  # todo
end

.merge_singletons(a, b, root_is_wildcard, merge_cache) ⇒ Object



62
63
64
# File 'lib/antlr4ruby/atn/context/prediction_context.rb', line 62

def merge_singletons(a, b, root_is_wildcard, merge_cache)
  # todo
end

.to_dot_string(context) ⇒ Object



74
75
76
# File 'lib/antlr4ruby/atn/context/prediction_context.rb', line 74

def to_dot_string(context)
  # todo
end

Instance Method Details

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


45
46
47
# File 'lib/antlr4ruby/atn/context/prediction_context.rb', line 45

def eql?(other)
  raise NotImplementedError.new("#{self.class.name}#eql? is abstract method")
end

#get_parent(index) ⇒ Object

Raises:

  • (NotImplementedError)


25
26
27
# File 'lib/antlr4ruby/atn/context/prediction_context.rb', line 25

def get_parent(index)
  raise NotImplementedError.new("#{self.class.name}#get_parent is abstract method")
end

#get_return_state(index) ⇒ Object

Raises:

  • (NotImplementedError)


29
30
31
# File 'lib/antlr4ruby/atn/context/prediction_context.rb', line 29

def get_return_state(index)
  raise NotImplementedError.new("#{self.class.name}#get_return_state is abstract method")
end

#has_empty_path?Boolean

Returns:

  • (Boolean)


37
38
39
# File 'lib/antlr4ruby/atn/context/prediction_context.rb', line 37

def has_empty_path?
  # todo
end

#hashObject



41
42
43
# File 'lib/antlr4ruby/atn/context/prediction_context.rb', line 41

def hash
  @cached_hash_code
end

#is_empty?Boolean

Returns:

  • (Boolean)


33
34
35
# File 'lib/antlr4ruby/atn/context/prediction_context.rb', line 33

def is_empty?
  # todo
end

#sizeObject

Raises:

  • (NotImplementedError)


21
22
23
# File 'lib/antlr4ruby/atn/context/prediction_context.rb', line 21

def size
  raise NotImplementedError.new("#{self.class.name}#size is abstract method")
end

#to_s(recognizer) ⇒ Object



49
50
51
# File 'lib/antlr4ruby/atn/context/prediction_context.rb', line 49

def to_s(recognizer)
  super()
end