Class: Packcr::Node::CaptureNode
- Inherits:
-
Packcr::Node
- Object
- Packcr::Node
- Packcr::Node::CaptureNode
- Defined in:
- lib/packcr/node/capture_node.rb
Instance Attribute Summary collapse
-
#expr ⇒ Object
Returns the value of attribute expr.
-
#index ⇒ Object
Returns the value of attribute index.
Instance Method Summary collapse
- #debug_dump(indent = 0) ⇒ Object
- #generate_code(gen, onfail, indent, bare) ⇒ Object
- #link_references(ctx) ⇒ Object
- #verify_captures(ctx, capts) ⇒ Object
- #verify_variables(vars) ⇒ Object
Instance Attribute Details
#expr ⇒ Object
Returns the value of attribute expr.
4 5 6 |
# File 'lib/packcr/node/capture_node.rb', line 4 def expr @expr end |
#index ⇒ Object
Returns the value of attribute index.
4 5 6 |
# File 'lib/packcr/node/capture_node.rb', line 4 def index @index end |
Instance Method Details
#debug_dump(indent = 0) ⇒ Object
6 7 8 9 10 11 12 |
# File 'lib/packcr/node/capture_node.rb', line 6 def debug_dump(indent = 0) $stdout.print "#{" " * indent}Capture(index:" Packcr.dump_integer_value(index) $stdout.print ") {\n" expr.debug_dump(indent + 2) $stdout.print "#{" " * indent}}\n" end |
#generate_code(gen, onfail, indent, bare) ⇒ Object
14 15 16 17 18 |
# File 'lib/packcr/node/capture_node.rb', line 14 def generate_code(gen, onfail, indent, ) r = nil gen.write Packcr.template("node/capture.#{gen.lang}.erb", binding, indent: indent) return r end |
#link_references(ctx) ⇒ Object
29 30 31 |
# File 'lib/packcr/node/capture_node.rb', line 29 def link_references(ctx) expr.link_references(ctx) end |
#verify_captures(ctx, capts) ⇒ Object
24 25 26 27 |
# File 'lib/packcr/node/capture_node.rb', line 24 def verify_captures(ctx, capts) expr.verify_captures(ctx, capts) capts.push(self) end |
#verify_variables(vars) ⇒ Object
20 21 22 |
# File 'lib/packcr/node/capture_node.rb', line 20 def verify_variables(vars) expr.verify_variables(vars) end |