Method: ANTLR3::Recognizer#memoize

Defined in:
lib/antlr3/recognizers.rb

#memoize(rule, start_index, success) ⇒ Object



878
879
880
881
# File 'lib/antlr3/recognizers.rb', line 878

def memoize( rule, start_index, success )
  stop_index = success ? @input.index - 1 : MEMO_RULE_FAILED
  memo = @state.rule_memory[ rule ] and memo[ start_index ] = stop_index
end