Class: Propose::AtomFinder
- Inherits:
-
Object
- Object
- Propose::AtomFinder
- Includes:
- Visitor
- Defined in:
- lib/propose/atom_finder.rb
Overview
Finds all atoms in a parse tree.
Instance Attribute Summary collapse
-
#atoms ⇒ Object
readonly
Returns the value of attribute atoms.
Instance Method Summary collapse
-
#initialize(formula) ⇒ AtomFinder
constructor
A new instance of AtomFinder.
- #visit_atom(atom) ⇒ Object
Methods included from Visitor
Constructor Details
#initialize(formula) ⇒ AtomFinder
Returns a new instance of AtomFinder.
10 11 12 13 |
# File 'lib/propose/atom_finder.rb', line 10 def initialize(formula) @atoms = Set.new visit(formula) end |
Instance Attribute Details
#atoms ⇒ Object (readonly)
Returns the value of attribute atoms.
8 9 10 |
# File 'lib/propose/atom_finder.rb', line 8 def atoms @atoms end |
Instance Method Details
#visit_atom(atom) ⇒ Object
15 16 17 |
# File 'lib/propose/atom_finder.rb', line 15 def visit_atom(atom) @atoms << atom end |