Kwartz::Parser::Scanner (Class)

In: kwartz.rb
Parent: Object

usage.

  str = File.open('file.txt') { |f| f.read }
  scanner = Scanner.new(str)
  while (token = scanner.scan()) != nil do
    print token, ':', scanner.token_str, "\n"
  end

Methods

line   new   scan   scan_all  

Constants

Keywords = { ":if" => :if, ":elsif" => :elsif, ":else" => :else, ":while" => :while, ":loop" => :loop, ":foreach" => :foreach, #":for" => :for, ":macro" => :macro, ":expand" => :expand, ":set" => :set, ":print" => :print, ":end" => :end, ":rawcode" => :rawcode, ":elem" => :elem, #":stag" => :stag, #":cont" => :cont, #":etag" => :etag, ":value" => :value, ":load" => :load, }

Attributes

linenum  [R] 
newline  [R] 
token  [R] 
token_str  [R] 

Public Class methods

Public Instance methods

return a line string

return a token, and set @token_str. see token() and token_str().

for debug

[Validate]