Class: Ripper::Lexer

Inherits:
Ripper show all
Defined in:
lib/ripper/lexer.rb

Overview

:nodoc: internal use only

Constant Summary

Constants inherited from Ripper

EVENTS, PARSER_EVENTS, SCANNER_EVENTS, Version

Instance Method Summary collapse

Methods inherited from Ripper

#column, #encoding, #end_seen?, #error?, #filename, #initialize, lex, #lineno, parse, sexp, sexp_raw, slice, token_match, tokenize, #yydebug, #yydebug=

Constructor Details

This class inherits a constructor from Ripper

Instance Method Details

#lexObject



51
52
53
# File 'lib/ripper/lexer.rb', line 51

def lex
  parse().sort_by {|pos, event, tok| pos }
end

#parseObject



55
56
57
58
59
# File 'lib/ripper/lexer.rb', line 55

def parse
  @buf = []
  super
  @buf
end

#tokenizeObject



47
48
49
# File 'lib/ripper/lexer.rb', line 47

def tokenize
  lex().map {|pos, event, tok| tok }
end