Class: AmbiguityNode
- Inherits:
-
SyntaxTree
- Object
- SyntaxTree
- AmbiguityNode
- Defined in:
- lib/rpdf2txt-rockit/parsing_ambiguities.rb
Instance Attribute Summary
Attributes inherited from SyntaxTree
#attributes, #children_names, #childrens, #name, #raw_src
Instance Method Summary collapse
- #add_ambigoustree(tree) ⇒ Object
-
#initialize(alt1, alt2) ⇒ AmbiguityNode
constructor
A new instance of AmbiguityNode.
Methods inherited from SyntaxTree
#==, #[], #compact!, #compact_childrens, #each_breadth_first, #each_node, #inspect_compact, #inspect_multi, #method_missing, #to_graph
Constructor Details
#initialize(alt1, alt2) ⇒ AmbiguityNode
Returns a new instance of AmbiguityNode.
4 5 6 7 |
# File 'lib/rpdf2txt-rockit/parsing_ambiguities.rb', line 4 def initialize(alt1, alt2) @ambigous_trees = [alt1, alt2] super("_Ambiguity", ["ambigous_trees"], [@ambigous_trees]) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class SyntaxTree
Instance Method Details
#add_ambigoustree(tree) ⇒ Object
9 10 11 |
# File 'lib/rpdf2txt-rockit/parsing_ambiguities.rb', line 9 def add_ambigoustree(tree) @ambigous_trees.push tree unless @ambigous_trees.include?(tree) end |