Class: Antlr4ruby::SemanticContext::Predicate
- Inherits:
- 
      Antlr4ruby::SemanticContext
      
        - Object
- Antlr4ruby::SemanticContext
- Antlr4ruby::SemanticContext::Predicate
 
- Defined in:
- lib/antlr4ruby/atn/context/semantic_context.rb
Instance Attribute Summary collapse
- 
  
    
      #is_ctx_dependent  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    Returns the value of attribute is_ctx_dependent. 
- 
  
    
      #pred_index  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    Returns the value of attribute pred_index. 
- 
  
    
      #rule_index  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    Returns the value of attribute rule_index. 
Instance Method Summary collapse
- #eql?(other) ⇒ Boolean
- #eval(parser, parser_call_stack) ⇒ Object
- #hash ⇒ Object
- 
  
    
      #initialize(rule_index, pred_index, is_ctx_dependent)  ⇒ Predicate 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    A new instance of Predicate. 
- #to_s ⇒ Object
Methods inherited from Antlr4ruby::SemanticContext
Constructor Details
#initialize(rule_index, pred_index, is_ctx_dependent) ⇒ Predicate
Returns a new instance of Predicate.
| 21 22 23 | # File 'lib/antlr4ruby/atn/context/semantic_context.rb', line 21 def initialize(rule_index, pred_index, is_ctx_dependent) @rule_index, @pred_index, @is_ctx_dependent = rule_index, pred_index, is_ctx_dependent end | 
Instance Attribute Details
#is_ctx_dependent ⇒ Object (readonly)
Returns the value of attribute is_ctx_dependent.
| 19 20 21 | # File 'lib/antlr4ruby/atn/context/semantic_context.rb', line 19 def is_ctx_dependent @is_ctx_dependent end | 
#pred_index ⇒ Object (readonly)
Returns the value of attribute pred_index.
| 19 20 21 | # File 'lib/antlr4ruby/atn/context/semantic_context.rb', line 19 def pred_index @pred_index end | 
#rule_index ⇒ Object (readonly)
Returns the value of attribute rule_index.
| 19 20 21 | # File 'lib/antlr4ruby/atn/context/semantic_context.rb', line 19 def rule_index @rule_index end | 
Instance Method Details
#eql?(other) ⇒ Boolean
| 34 35 36 | # File 'lib/antlr4ruby/atn/context/semantic_context.rb', line 34 def eql?(other) # todo end | 
#eval(parser, parser_call_stack) ⇒ Object
| 25 26 27 28 | # File 'lib/antlr4ruby/atn/context/semantic_context.rb', line 25 def eval(parser, parser_call_stack) local_ctx = is_ctx_dependent ? parser_call_stack : nil parser.sempred(local_ctx, rule_index, pred_index) end | 
#hash ⇒ Object
| 30 31 32 | # File 'lib/antlr4ruby/atn/context/semantic_context.rb', line 30 def hash # todo end | 
#to_s ⇒ Object
| 38 39 40 | # File 'lib/antlr4ruby/atn/context/semantic_context.rb', line 38 def to_s "{#{rule_index}:#{pred_index}}?" end |