Class: Treetop::Compiler::Predicate
- Inherits:
-
ParsingExpression
- Object
- Runtime::SyntaxNode
- ParsingExpression
- Treetop::Compiler::Predicate
- Defined in:
- lib/puppet_x/wildfly/gems/treetop-1.6.8/lib/treetop/compiler/node_classes/predicate.rb
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from ParsingExpression
#address, #builder, #parent_expression, #subexpression_address, #var_symbols
Attributes inherited from Runtime::SyntaxNode
Instance Method Summary collapse
- #assign_failure ⇒ Object
- #assign_success ⇒ Object
- #compile(address, builder, parent_expression) ⇒ Object
Methods inherited from ParsingExpression
#accumulate_subexpression_result, #accumulator_var, #assign_lazily_instantiated_node, #assign_result, #begin_comment, #declared_module_name, #decorated?, #end_comment, #epsilon_node, #expected, #extend_result, #extend_result_with_declared_module, #extend_result_with_inline_module, #init_value, #inline_module_name, #node_class_name, #obtain_new_subexpression_address, #on_one_line, #optional_arg, #reset_index, #result_var, #start_index_var, #subexpression_result_var, #subexpression_success?, #use_vars, #var, #var_initialization
Methods inherited from Runtime::SyntaxNode
#<=>, #dot_id, #elements, #empty?, #extension_modules, #initialize, #inspect, #inspect_children, #inspect_self, #nonterminal?, #terminal?, #text_value, #write_dot, #write_dot_file
Constructor Details
This class inherits a constructor from Treetop::Runtime::SyntaxNode
Instance Method Details
#assign_failure ⇒ Object
15 16 17 18 |
# File 'lib/puppet_x/wildfly/gems/treetop-1.6.8/lib/treetop/compiler/node_classes/predicate.rb', line 15 def assign_failure reset_index super(start_index_var) end |
#assign_success ⇒ Object
20 21 22 23 |
# File 'lib/puppet_x/wildfly/gems/treetop-1.6.8/lib/treetop/compiler/node_classes/predicate.rb', line 20 def assign_success reset_index assign_result epsilon_node end |
#compile(address, builder, parent_expression) ⇒ Object
4 5 6 7 8 9 10 11 12 13 |
# File 'lib/puppet_x/wildfly/gems/treetop-1.6.8/lib/treetop/compiler/node_classes/predicate.rb', line 4 def compile(address, builder, parent_expression) super begin_comment(parent_expression) use_vars :result, :start_index obtain_new_subexpression_address parent_expression.prefixed_expression.compile(subexpression_address, builder) builder.if__(subexpression_success?) { when_success } builder.else_ { when_failure } end_comment(parent_expression) end |