Class: Parslet::Atoms::Rule::Position::LR::Head

Inherits:
Struct
  • Object
show all
Defined in:
lib/parslet/atoms/rule/position.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#eval_rulesObject

Returns the value of attribute eval_rules

Returns:

  • (Object)

    the current value of eval_rules



12
13
14
# File 'lib/parslet/atoms/rule/position.rb', line 12

def eval_rules
  @eval_rules
end

#involved_rulesObject

Returns the value of attribute involved_rules

Returns:

  • (Object)

    the current value of involved_rules



12
13
14
# File 'lib/parslet/atoms/rule/position.rb', line 12

def involved_rules
  @involved_rules
end

#ruleObject

Returns the value of attribute rule

Returns:

  • (Object)

    the current value of rule



12
13
14
# File 'lib/parslet/atoms/rule/position.rb', line 12

def rule
  @rule
end

Instance Method Details

#eval?(rule) ⇒ Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/parslet/atoms/rule/position.rb', line 17

def eval?(rule)
  eval_rules.include?(rule)
end

#exclude_eval_rule!(rule) ⇒ Object



21
22
23
# File 'lib/parslet/atoms/rule/position.rb', line 21

def exclude_eval_rule!(rule)
  eval_rules.delete(rule)
end

#involved?(rule) ⇒ Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/parslet/atoms/rule/position.rb', line 13

def involved?(rule)
  self.rule == rule || self.involved_rules.include?(rule)
end

#reset_eval_rulesObject



25
26
27
# File 'lib/parslet/atoms/rule/position.rb', line 25

def reset_eval_rules
  self.eval_rules = self.involved_rules.dup
end