Class: Treetop::Compiler::NotPredicate

Inherits:
Predicate show all
Defined in:
lib/treetop/compiler/node_classes/predicate.rb

Instance Attribute Summary

Attributes inherited from ParsingExpression

#address, #builder, #parent_expression, #subexpression_address, #var_symbols

Attributes inherited from Runtime::SyntaxNode

#input, #interval, #parent

Instance Method Summary collapse

Methods inherited from Predicate

#assign_failure, #assign_success, #compile

Methods inherited from ParsingExpression

#accumulate_subexpression_result, #accumulator_var, #assign_failure, #assign_lazily_instantiated_node, #assign_result, #begin_comment, #compile, #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

#when_failureObject



44
45
46
47
48
49
# File 'lib/treetop/compiler/node_classes/predicate.rb', line 44

def when_failure
  if (e = parent.atomic.expected)
    builder << "@terminal_failures.pop"
  end
  assign_success
end

#when_successObject



37
38
39
40
41
42
# File 'lib/treetop/compiler/node_classes/predicate.rb', line 37

def when_success
  assign_failure
  if (e = parent.atomic.expected)
    builder << "terminal_parse_failure(#{e}, true)"
  end
end