Class: CSSPool::SAC::Parser

Inherits:
CSS::Tokenizer show all
Defined in:
lib/csspool/sac/parser.rb

Constant Summary

Constants inherited from CSS::Parser

CSS::Parser::Racc_arg, CSS::Parser::Racc_debug_parser, CSS::Parser::Racc_token_to_s_table

Instance Attribute Summary collapse

Attributes inherited from CSS::Tokenizer

#filename, #lineno, #state

Instance Method Summary collapse

Methods inherited from CSS::Tokenizer

#_next_token, #action, #load_file, #next_token, #scan_file, #scan_setup, #scan_str, #st

Methods inherited from CSS::Parser

#_reduce_none

Constructor Details

#initialize(handler = CSSPool::CSS::DocumentHandler.new) ⇒ Parser

Returns a new instance of Parser.



6
7
8
# File 'lib/csspool/sac/parser.rb', line 6

def initialize handler = CSSPool::CSS::DocumentHandler.new
  @handler = handler
end

Instance Attribute Details

#handlerObject

Returns the value of attribute handler.



4
5
6
# File 'lib/csspool/sac/parser.rb', line 4

def handler
  @handler
end

Instance Method Details

#parse(string) ⇒ Object



10
11
12
13
# File 'lib/csspool/sac/parser.rb', line 10

def parse string
  scan_str string
  @handler.document
end