ruby_lexer.rb

Path: lib/ruby_lexer.rb
Last Update: Fri Dec 28 03:12:14 -0500 2012

encoding: US-ASCII

Methods

Constants

IDENT_RE = /^#{IDENT_CHAR_RE}+/
ESC_RE = /\\((?>[0-7]{1,3}|x[0-9a-fA-F]{1,2}|M-[^\\]|(C-|c)[^\\]|[^0-7xMCc]))/
EOF = :eof_haha!
STR_FUNC_BORING = 0x00   ruby constants for strings (should this be moved somewhere else?)
STR_FUNC_ESCAPE = 0x01
STR_FUNC_EXPAND = 0x02
STR_FUNC_REGEXP = 0x04
STR_FUNC_QWORDS = 0x08
STR_FUNC_SYMBOL = 0x10
STR_FUNC_INDENT = 0x20
STR_SQUOTE = STR_FUNC_BORING
STR_DQUOTE = STR_FUNC_BORING | STR_FUNC_EXPAND
STR_XQUOTE = STR_FUNC_BORING | STR_FUNC_EXPAND
STR_REGEXP = STR_FUNC_REGEXP | STR_FUNC_ESCAPE | STR_FUNC_EXPAND
STR_SSYM = STR_FUNC_SYMBOL
STR_DSYM = STR_FUNC_SYMBOL | STR_FUNC_EXPAND
TOKENS = { "!" => :tBANG, "!=" => :tNEQ, "!~" => :tNMATCH, "," => :tCOMMA, ".." => :tDOT2, "..." => :tDOT3, "=" => :tEQL, "==" => :tEQ, "===" => :tEQQ, "=>" => :tASSOC, "=~" => :tMATCH, "->" => :tLAMBDA, }
ESCAPES = { "a" => "\007", "b" => "\010", "e" => "\033", "f" => "\f", "n" => "\n", "r" => "\r", "s" => " ", "t" => "\t", "v" => "\13", "\\" => '\\', "\n" => "", "C-\?" => 127.chr, "c\?" => 127.chr, }

Public Class methods

Public Instance methods

How the parser advances to the next token.

@return true if not at end of file (EOF).

 Parse a number from the input stream.

@param c The first character of the number. @return A int constant wich represents a token.

Returns the next token. Also sets yy_val is needed.

@return Description of the Returned Value

[Validate]