Class: Nokogiri::CSS::Parser

Inherits:
GeneratedParser
  • Object
show all
Defined in:
lib/nokogiri/css/parser.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeParser

Returns a new instance of Parser.



10
11
12
# File 'lib/nokogiri/css/parser.rb', line 10

def initialize
  @tokenizer = Tokenizer.new
end

Class Method Details

.parse(string) ⇒ Object



5
6
7
# File 'lib/nokogiri/css/parser.rb', line 5

def parse string
  new.parse(string)
end

Instance Method Details

#next_tokenObject



19
20
21
# File 'lib/nokogiri/css/parser.rb', line 19

def next_token
  @tokenizer.next_token
end

#parse(string) ⇒ Object



14
15
16
17
# File 'lib/nokogiri/css/parser.rb', line 14

def parse string
  @tokenizer.scan string
  do_parse
end