rubyjedi-oga 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.yardopts +13 -0
- data/LICENSE +362 -0
- data/README.md +317 -0
- data/doc/css/common.css +77 -0
- data/doc/css_selectors.md +935 -0
- data/doc/manually_creating_documents.md +67 -0
- data/doc/migrating_from_nokogiri.md +169 -0
- data/doc/xml_namespaces.md +63 -0
- data/ext/c/extconf.rb +11 -0
- data/ext/c/lexer.c +2595 -0
- data/ext/c/lexer.h +16 -0
- data/ext/c/lexer.rl +198 -0
- data/ext/c/liboga.c +6 -0
- data/ext/c/liboga.h +11 -0
- data/ext/java/Liboga.java +14 -0
- data/ext/java/org/liboga/xml/Lexer.java +1363 -0
- data/ext/java/org/liboga/xml/Lexer.rl +223 -0
- data/ext/ragel/base_lexer.rl +633 -0
- data/lib/oga.rb +57 -0
- data/lib/oga/blacklist.rb +40 -0
- data/lib/oga/css/lexer.rb +743 -0
- data/lib/oga/css/parser.rb +976 -0
- data/lib/oga/entity_decoder.rb +21 -0
- data/lib/oga/html/entities.rb +2150 -0
- data/lib/oga/html/parser.rb +25 -0
- data/lib/oga/html/sax_parser.rb +18 -0
- data/lib/oga/lru.rb +160 -0
- data/lib/oga/oga.rb +57 -0
- data/lib/oga/version.rb +3 -0
- data/lib/oga/whitelist.rb +20 -0
- data/lib/oga/xml/attribute.rb +136 -0
- data/lib/oga/xml/cdata.rb +17 -0
- data/lib/oga/xml/character_node.rb +37 -0
- data/lib/oga/xml/comment.rb +17 -0
- data/lib/oga/xml/default_namespace.rb +13 -0
- data/lib/oga/xml/doctype.rb +82 -0
- data/lib/oga/xml/document.rb +108 -0
- data/lib/oga/xml/element.rb +428 -0
- data/lib/oga/xml/entities.rb +122 -0
- data/lib/oga/xml/html_void_elements.rb +15 -0
- data/lib/oga/xml/lexer.rb +550 -0
- data/lib/oga/xml/namespace.rb +48 -0
- data/lib/oga/xml/node.rb +219 -0
- data/lib/oga/xml/node_set.rb +333 -0
- data/lib/oga/xml/parser.rb +631 -0
- data/lib/oga/xml/processing_instruction.rb +37 -0
- data/lib/oga/xml/pull_parser.rb +175 -0
- data/lib/oga/xml/querying.rb +56 -0
- data/lib/oga/xml/sax_parser.rb +192 -0
- data/lib/oga/xml/text.rb +66 -0
- data/lib/oga/xml/traversal.rb +50 -0
- data/lib/oga/xml/xml_declaration.rb +65 -0
- data/lib/oga/xpath/evaluator.rb +1798 -0
- data/lib/oga/xpath/lexer.rb +1958 -0
- data/lib/oga/xpath/parser.rb +622 -0
- data/oga.gemspec +45 -0
- metadata +227 -0
@@ -0,0 +1,67 @@
|
|
1
|
+
# Manually Creating Documents
|
2
|
+
|
3
|
+
Besides being able to parse documents, Oga also allows you to create documents
|
4
|
+
manually. This can be useful if you want to dynamically generate XML/HTML.
|
5
|
+
|
6
|
+
Documents can be greated in two ways:
|
7
|
+
|
8
|
+
1. Full blown documents (using {Oga::XML::Document})
|
9
|
+
2. XML fragments (using just {Oga::XML::Element} and the likes)
|
10
|
+
|
11
|
+
For example, lets create a document with a specific encoding and a single
|
12
|
+
element:
|
13
|
+
|
14
|
+
xml_decl = Oga::XML::XmlDeclaration.new(:encoding => 'UTF-16')
|
15
|
+
document = Oga::XML::Document.new(:xml_declaration => xml_decl)
|
16
|
+
element = Oga::XML::Element.new(:name => 'example')
|
17
|
+
|
18
|
+
document.children << element
|
19
|
+
|
20
|
+
If you now serialize this back to XML (by calling `document.to_xml`) you'd get
|
21
|
+
the following XML:
|
22
|
+
|
23
|
+
<?xml version="1.0" encoding="UTF-16" ?>
|
24
|
+
<example />
|
25
|
+
|
26
|
+
You can also serialize elements on their own:
|
27
|
+
|
28
|
+
element.to_xml
|
29
|
+
|
30
|
+
This would output:
|
31
|
+
|
32
|
+
<example />
|
33
|
+
|
34
|
+
## Adding/Removing Attributes
|
35
|
+
|
36
|
+
The easiest way to add (or remove) attributes is by using {Oga::XML::Element#set}
|
37
|
+
and {Oga::XML::Element#unset}. For example, to add an attribute:
|
38
|
+
|
39
|
+
element = Oga::XML::Element.new(:name => 'example')
|
40
|
+
|
41
|
+
element.set('class', 'foo')
|
42
|
+
|
43
|
+
element.to_xml # => "<example class=\"foo\" />"
|
44
|
+
|
45
|
+
And to remove an attribute:
|
46
|
+
|
47
|
+
element.unset('class')
|
48
|
+
|
49
|
+
## Modifying Text
|
50
|
+
|
51
|
+
Modifying text of elements can be done in two ways:
|
52
|
+
|
53
|
+
1. Adding {Oga::XML::Text} instances to the list of child nodes of an
|
54
|
+
{Oga::XML::Element} instance
|
55
|
+
2. Using {Oga::XML::Element#inner\_text=}
|
56
|
+
|
57
|
+
The second option is the easiest and recommended way of doing this. Usage is
|
58
|
+
quite simple:
|
59
|
+
|
60
|
+
element = Oga::XML::Element.new(:name => 'p')
|
61
|
+
|
62
|
+
element.inner_text = 'Hello'
|
63
|
+
|
64
|
+
element.to_xml => "<p>Hello</p>"
|
65
|
+
|
66
|
+
Special characters such as `&` and `<` are escaped automatically when calling
|
67
|
+
{Oga::XML::Element#to_xml}.
|
@@ -0,0 +1,169 @@
|
|
1
|
+
# Migrating From Nokogiri
|
2
|
+
|
3
|
+
If you're parsing XML/HTML documents using Ruby, chances are you're using
|
4
|
+
[Nokogiri][nokogiri] for this. This guide aims to make it easier to switch from
|
5
|
+
Nokogiri to Oga.
|
6
|
+
|
7
|
+
## Parsing Documents
|
8
|
+
|
9
|
+
In Nokogiri there are two defacto ways of parsing documents:
|
10
|
+
|
11
|
+
* `Nokogiri.XML()` for XML documents
|
12
|
+
* `Nokogiri.HTML()` for HTML documents
|
13
|
+
|
14
|
+
For example, to parse an XML document you'd use the following:
|
15
|
+
|
16
|
+
Nokogiri::XML('<root>foo</root>')
|
17
|
+
|
18
|
+
Oga instead uses the following two methods:
|
19
|
+
|
20
|
+
* `Oga.parse_xml`
|
21
|
+
* `Oga.parse_html`
|
22
|
+
|
23
|
+
Their usage is similar:
|
24
|
+
|
25
|
+
Oga.parse_xml('<root>foo</root>')
|
26
|
+
|
27
|
+
Nokogiri returns two distinctive document classes based on what method was used
|
28
|
+
to parse a document:
|
29
|
+
|
30
|
+
* `Nokogiri::XML::Document` for XML documents
|
31
|
+
* `Nokogiri::HTML::Document` for HTML documents
|
32
|
+
|
33
|
+
Oga on the other hand always returns `Oga::XML::Document` instance, Oga
|
34
|
+
currently makes no distinction between XML and HTML documents other than on
|
35
|
+
lexer level. This might change in the future if deemed required.
|
36
|
+
|
37
|
+
## Querying Documents
|
38
|
+
|
39
|
+
Nokogiri allows one to query documents/elements using both XPath expressions and
|
40
|
+
CSS selectors. In Nokogiri one queries a document as following:
|
41
|
+
|
42
|
+
document = Nokogiri::XML('<root><foo>bar</foo></root>')
|
43
|
+
|
44
|
+
document.xpath('root/foo')
|
45
|
+
document.css('root foo')
|
46
|
+
|
47
|
+
Oga currently only supports XPath expressions, CSS selectors will be added in
|
48
|
+
the near future. Querying documents works similar to Nokogiri:
|
49
|
+
|
50
|
+
document = Oga.parse_xml('<root><foo>bar</foo></root>')
|
51
|
+
|
52
|
+
document.xpath('root/foo')
|
53
|
+
|
54
|
+
Nokogiri also allows you to query a document and return the first match, opposed
|
55
|
+
to an entire node set, using the method `at`. In Nokogiri this method can be
|
56
|
+
used for both XPath expression and CSS selectors. Oga has no such method,
|
57
|
+
instead it provides the following more dedicated methods:
|
58
|
+
|
59
|
+
* `at_xpath`: returns the first node of an XPath expression
|
60
|
+
|
61
|
+
For example:
|
62
|
+
|
63
|
+
document = Oga.parse_xml('<root><foo>bar</foo></root>')
|
64
|
+
|
65
|
+
document.at_xpath('root/foo')
|
66
|
+
|
67
|
+
By using a dedicated method Oga doesn't have to try and guess what type of
|
68
|
+
expression you're using (XPath or CSS), meaning it can never make any mistakes.
|
69
|
+
|
70
|
+
## Retrieving Attribute Values
|
71
|
+
|
72
|
+
Nokogiri provides two methods for retrieving attributes and attribute values:
|
73
|
+
|
74
|
+
* `Nokogiri::XML::Node#attribute`
|
75
|
+
* `Nokogiri::XML::Node#attr`
|
76
|
+
|
77
|
+
The first method always returns an instance of `Nokogiri::XML::Attribute`, the
|
78
|
+
second method returns the attribute value as a `String`. This behaviour,
|
79
|
+
especially due to the names used, is extremely confusing.
|
80
|
+
|
81
|
+
Oga on the other hand provides the following two methods:
|
82
|
+
|
83
|
+
* `Oga::XML::Element#attribute` (aliased as `attr`)
|
84
|
+
* `Oga::XML::Element#get`
|
85
|
+
|
86
|
+
The first method always returns a `Oga::XML::Attribute` instance, the second
|
87
|
+
returns the attribute value as a `String`. I deliberately chose `get` for
|
88
|
+
getting a value to remove the confusion of `attribute` vs `attr`. This also
|
89
|
+
allows for `attr` to simply be an alias of `attribute`.
|
90
|
+
|
91
|
+
As an example, this is how you'd get the value of a `class` attribute in
|
92
|
+
Nokogiri:
|
93
|
+
|
94
|
+
document = Nokogiri::XML('<root class="foo"></root>')
|
95
|
+
|
96
|
+
document.xpath('root').first.attr('class') # => "foo"
|
97
|
+
|
98
|
+
This is how you'd get the same value in Oga:
|
99
|
+
|
100
|
+
document = Oga.parse_xml('<root class="foo"></root>')
|
101
|
+
|
102
|
+
document.xpath('root').first.get('class') # => "foo"
|
103
|
+
|
104
|
+
## Modifying Documents
|
105
|
+
|
106
|
+
Modifying documents in Nokogiri is not as convenient as it perhaps could be. For
|
107
|
+
example, adding an element to a document is done as following:
|
108
|
+
|
109
|
+
document = Nokogiri::XML('<root></root>')
|
110
|
+
root = document.xpath('root').first
|
111
|
+
|
112
|
+
name = Nokogiri::XML::Element.new('name', document)
|
113
|
+
|
114
|
+
name.inner_html = 'Alice'
|
115
|
+
|
116
|
+
root.add_child(name)
|
117
|
+
|
118
|
+
The annoying part here is that we have to pass a document into an Element's
|
119
|
+
constructor. As such, you can not create elements without first creating a
|
120
|
+
document. Another thing is that Nokogiri has no method called `inner_text=`,
|
121
|
+
instead you have to use the method `inner_html=`.
|
122
|
+
|
123
|
+
In Oga you'd use the following:
|
124
|
+
|
125
|
+
document = Oga.parse_xml('<root></root>')
|
126
|
+
root = document.xpath('root').first
|
127
|
+
|
128
|
+
name = Oga::XML::Element.new(:name => 'name')
|
129
|
+
|
130
|
+
name.inner_text = 'Alice'
|
131
|
+
|
132
|
+
root.children << name
|
133
|
+
|
134
|
+
Adding attributes works similar for both Nokogiri and Oga. For Nokogiri you'd
|
135
|
+
use the following:
|
136
|
+
|
137
|
+
element.set_attribute('class', 'foo')
|
138
|
+
|
139
|
+
Alternatively you can do the following:
|
140
|
+
|
141
|
+
element['class'] = 'foo'
|
142
|
+
|
143
|
+
In Oga you'd instead use the method `set`:
|
144
|
+
|
145
|
+
element.set('class', 'foo')
|
146
|
+
|
147
|
+
This method automatically creates an attribute if it doesn't exist, including
|
148
|
+
the namespace if specified:
|
149
|
+
|
150
|
+
element.set('foo:class', 'foo')
|
151
|
+
|
152
|
+
## Serializing Documents
|
153
|
+
|
154
|
+
Serializing the document back to XML works the same in both libraries, simply
|
155
|
+
call `to_xml` on a document or element and you'll get a String back containing
|
156
|
+
the XML. There is one key difference here though: Nokogiri does not return the
|
157
|
+
exact same output as it was given as input, for example it adds XML declaration
|
158
|
+
tags:
|
159
|
+
|
160
|
+
Nokogiri::XML('<root></root>').to_xml # => "<?xml version=\"1.0\"?>\n<root/>\n"
|
161
|
+
|
162
|
+
Oga on the other hand does not do this:
|
163
|
+
|
164
|
+
Oga.parse_xml('<root></root>').to_xml # => "<root></root>"
|
165
|
+
|
166
|
+
Oga also doesn't insert random newlines or other possibly unexpected (or
|
167
|
+
unwanted) data.
|
168
|
+
|
169
|
+
[nokogiri]: http://nokogiri.org/
|
@@ -0,0 +1,63 @@
|
|
1
|
+
# XML Namespaces
|
2
|
+
|
3
|
+
Oga fully supports registering XML namespaces and querying elements using these
|
4
|
+
namespaces, including alternative default namespaces.
|
5
|
+
|
6
|
+
Namespaces can be registered in two ways:
|
7
|
+
|
8
|
+
1. Namespaces defined in the document itself (e.g. `xmlns:foo="..."`)
|
9
|
+
2. By using {Oga::XML::Element#register\_namespace}
|
10
|
+
|
11
|
+
Note that manually registering namespaces does not alter the input document when
|
12
|
+
serialized back to XML. To do so you'll have to manually add the corresponding
|
13
|
+
attributes using {Oga::XML::Element#set}.
|
14
|
+
|
15
|
+
## Document Namespaces
|
16
|
+
|
17
|
+
Documents can contain two types of namespaces:
|
18
|
+
|
19
|
+
1. Named namespaces
|
20
|
+
2. Default namespaces
|
21
|
+
|
22
|
+
The first are registered as following:
|
23
|
+
|
24
|
+
<root xmlns:foo="http://foo.com">
|
25
|
+
|
26
|
+
</root>
|
27
|
+
|
28
|
+
Here we register a new namespace with prefix "foo" and URI "http://foo.com".
|
29
|
+
|
30
|
+
Default namespaces are registered in a similar fashion, except they come without
|
31
|
+
a prefix:
|
32
|
+
|
33
|
+
<root xmlns="http://foo.com">
|
34
|
+
|
35
|
+
</root>
|
36
|
+
|
37
|
+
## Manually Registered Namespaces
|
38
|
+
|
39
|
+
If you ever want to register a namespace yourself, without having to first
|
40
|
+
change the input document, you can do so as following:
|
41
|
+
|
42
|
+
element = Oga::XML::Element.new(:name => 'root')
|
43
|
+
|
44
|
+
element.register_namespace('foo', 'http://foo.com')
|
45
|
+
|
46
|
+
Trying to register an already existing namespace will result in `ArgumentError`
|
47
|
+
being raised.
|
48
|
+
|
49
|
+
## Listing Namespaces
|
50
|
+
|
51
|
+
To query all the namespaces available to an element you can use
|
52
|
+
{Oga::XML::Element#available\_namespaces}. This method returns a Hash
|
53
|
+
containing all {Oga::XML::Namespace} instances available to the element. The
|
54
|
+
keys are the namespace prefixes, the values the Namespace instances. Inner
|
55
|
+
namespaces overwrite outer namespaces.
|
56
|
+
|
57
|
+
Example:
|
58
|
+
|
59
|
+
element = Oga::XML::Element.new(:name => 'root')
|
60
|
+
|
61
|
+
element.register_namespace('foo', 'http://foo.com')
|
62
|
+
|
63
|
+
element.available_namespaces # => {"foo" => Namespace(name: "foo", uri: "http://foo.com")}
|
data/ext/c/extconf.rb
ADDED
data/ext/c/lexer.c
ADDED
@@ -0,0 +1,2595 @@
|
|
1
|
+
|
2
|
+
#line 1 "ext/c/lexer.rl"
|
3
|
+
#include "lexer.h"
|
4
|
+
|
5
|
+
/*
|
6
|
+
The following two macros allow the Ragel grammar to use generic function calls
|
7
|
+
without relying on the setup of the C or Java lexer. Using these macros we can
|
8
|
+
also pass along `self` to the callback functions without having to hard-code
|
9
|
+
this in to the Ragel grammar.
|
10
|
+
|
11
|
+
In the C lexer we don't need the `data` variable (since this is pulled in based
|
12
|
+
on `ts` and `te`) so the macro ignores this argument.
|
13
|
+
*/
|
14
|
+
|
15
|
+
#define callback(name, data, encoding, start, stop) \
|
16
|
+
liboga_xml_lexer_callback(self, name, encoding, start, stop);
|
17
|
+
|
18
|
+
#define callback_simple(name) \
|
19
|
+
liboga_xml_lexer_callback_simple(self, name);
|
20
|
+
|
21
|
+
#define advance_line(amount) \
|
22
|
+
rb_funcall(self, id_advance_line, 1, INT2NUM(amount));
|
23
|
+
|
24
|
+
#define html_script_p() \
|
25
|
+
rb_funcall(self, id_html_script_p, 0) == Qtrue
|
26
|
+
|
27
|
+
#define html_style_p() \
|
28
|
+
rb_funcall(self, id_html_style_p, 0) == Qtrue
|
29
|
+
|
30
|
+
ID id_advance_line;
|
31
|
+
ID id_html_script_p;
|
32
|
+
ID id_html_style_p;
|
33
|
+
ID id_html_p;
|
34
|
+
|
35
|
+
|
36
|
+
#line 34 "ext/c/lexer.rl"
|
37
|
+
|
38
|
+
/**
|
39
|
+
* Calls a method defined in the Ruby side of the lexer. The String value is
|
40
|
+
* created based on the values of `ts` and `te` and uses the encoding specified
|
41
|
+
* in `encoding`.
|
42
|
+
*
|
43
|
+
* @example
|
44
|
+
* rb_encoding *encoding = rb_enc_get(...);
|
45
|
+
* liboga_xml_lexer_callback(self, "on_string", encoding, ts, te);
|
46
|
+
*/
|
47
|
+
void liboga_xml_lexer_callback(
|
48
|
+
VALUE self,
|
49
|
+
ID name,
|
50
|
+
rb_encoding *encoding,
|
51
|
+
const char *ts,
|
52
|
+
const char *te
|
53
|
+
)
|
54
|
+
{
|
55
|
+
VALUE value = rb_enc_str_new(ts, te - ts, encoding);
|
56
|
+
|
57
|
+
rb_funcall(self, name, 1, value);
|
58
|
+
}
|
59
|
+
|
60
|
+
/**
|
61
|
+
* Calls a method defined in the Ruby side of the lexer without passing it any
|
62
|
+
* arguments.
|
63
|
+
*
|
64
|
+
* @example
|
65
|
+
* liboga_xml_lexer_callback_simple(self, "on_cdata_start");
|
66
|
+
*/
|
67
|
+
void liboga_xml_lexer_callback_simple(VALUE self, VALUE name)
|
68
|
+
{
|
69
|
+
rb_funcall(self, name, 0);
|
70
|
+
}
|
71
|
+
|
72
|
+
|
73
|
+
#line 74 "ext/c/lexer.c"
|
74
|
+
static const int c_lexer_start = 32;
|
75
|
+
static const int c_lexer_first_final = 32;
|
76
|
+
static const int c_lexer_error = 0;
|
77
|
+
|
78
|
+
static const int c_lexer_en_comment_body = 38;
|
79
|
+
static const int c_lexer_en_cdata_body = 41;
|
80
|
+
static const int c_lexer_en_proc_ins_body = 44;
|
81
|
+
static const int c_lexer_en_string_squote = 47;
|
82
|
+
static const int c_lexer_en_string_dquote = 49;
|
83
|
+
static const int c_lexer_en_doctype_inline = 51;
|
84
|
+
static const int c_lexer_en_doctype = 53;
|
85
|
+
static const int c_lexer_en_xml_decl = 66;
|
86
|
+
static const int c_lexer_en_element_name = 69;
|
87
|
+
static const int c_lexer_en_element_close = 71;
|
88
|
+
static const int c_lexer_en_attribute_pre = 73;
|
89
|
+
static const int c_lexer_en_html_attribute_value = 75;
|
90
|
+
static const int c_lexer_en_xml_attribute_value = 77;
|
91
|
+
static const int c_lexer_en_element_head = 78;
|
92
|
+
static const int c_lexer_en_text = 82;
|
93
|
+
static const int c_lexer_en_html_script = 86;
|
94
|
+
static const int c_lexer_en_html_style = 90;
|
95
|
+
static const int c_lexer_en_main = 32;
|
96
|
+
|
97
|
+
|
98
|
+
#line 70 "ext/c/lexer.rl"
|
99
|
+
|
100
|
+
/**
|
101
|
+
* Lexes the String specifies as the method argument. Token values have the
|
102
|
+
* same encoding as the input value.
|
103
|
+
*
|
104
|
+
* This method keeps track of an internal state using the instance variables
|
105
|
+
* `@act` and `@cs`.
|
106
|
+
*/
|
107
|
+
VALUE oga_xml_lexer_advance(VALUE self, VALUE data_block)
|
108
|
+
{
|
109
|
+
OgaLexerState *state;
|
110
|
+
int lines;
|
111
|
+
|
112
|
+
/* Whether or not HTML mode is enabled */
|
113
|
+
int html_p = rb_funcall(self, id_html_p, 0) == Qtrue;
|
114
|
+
|
115
|
+
/* Make sure that all data passed back to Ruby has the proper encoding. */
|
116
|
+
rb_encoding *encoding = rb_enc_get(data_block);
|
117
|
+
|
118
|
+
char *data_str_val = StringValueCStr(data_block);
|
119
|
+
|
120
|
+
const char *p = data_str_val;
|
121
|
+
const char *pe = data_str_val + strlen(data_str_val);
|
122
|
+
const char *eof = pe;
|
123
|
+
const char *ts = 0;
|
124
|
+
const char *te = 0;
|
125
|
+
const char *mark = 0;
|
126
|
+
|
127
|
+
ID id_advance_line = rb_intern("advance_line");
|
128
|
+
ID id_on_attribute = rb_intern("on_attribute");
|
129
|
+
ID id_on_attribute_ns = rb_intern("on_attribute_ns");
|
130
|
+
ID id_on_cdata_start = rb_intern("on_cdata_start");
|
131
|
+
ID id_on_cdata_body = rb_intern("on_cdata_body");
|
132
|
+
ID id_on_cdata_end = rb_intern("on_cdata_end");
|
133
|
+
ID id_on_comment_start = rb_intern("on_comment_start");
|
134
|
+
ID id_on_comment_body = rb_intern("on_comment_body");
|
135
|
+
ID id_on_comment_end = rb_intern("on_comment_end");
|
136
|
+
ID id_on_doctype_end = rb_intern("on_doctype_end");
|
137
|
+
ID id_on_doctype_inline = rb_intern("on_doctype_inline");
|
138
|
+
ID id_on_doctype_name = rb_intern("on_doctype_name");
|
139
|
+
ID id_on_doctype_start = rb_intern("on_doctype_start");
|
140
|
+
ID id_on_doctype_type = rb_intern("on_doctype_type");
|
141
|
+
ID id_on_element_end = rb_intern("on_element_end");
|
142
|
+
ID id_on_element_name = rb_intern("on_element_name");
|
143
|
+
ID id_on_element_ns = rb_intern("on_element_ns");
|
144
|
+
ID id_on_element_open_end = rb_intern("on_element_open_end");
|
145
|
+
ID id_on_proc_ins_end = rb_intern("on_proc_ins_end");
|
146
|
+
ID id_on_proc_ins_name = rb_intern("on_proc_ins_name");
|
147
|
+
ID id_on_proc_ins_start = rb_intern("on_proc_ins_start");
|
148
|
+
ID id_on_proc_ins_body = rb_intern("on_proc_ins_body");
|
149
|
+
ID id_on_string_body = rb_intern("on_string_body");
|
150
|
+
ID id_on_string_dquote = rb_intern("on_string_dquote");
|
151
|
+
ID id_on_string_squote = rb_intern("on_string_squote");
|
152
|
+
ID id_on_text = rb_intern("on_text");
|
153
|
+
ID id_on_xml_decl_end = rb_intern("on_xml_decl_end");
|
154
|
+
ID id_on_xml_decl_start = rb_intern("on_xml_decl_start");
|
155
|
+
|
156
|
+
Data_Get_Struct(self, OgaLexerState, state);
|
157
|
+
|
158
|
+
lines = state->lines;
|
159
|
+
|
160
|
+
|
161
|
+
#line 162 "ext/c/lexer.c"
|
162
|
+
{
|
163
|
+
if ( p == pe )
|
164
|
+
goto _test_eof;
|
165
|
+
goto _resume;
|
166
|
+
|
167
|
+
_again:
|
168
|
+
switch ( ( state->cs) ) {
|
169
|
+
case 32: goto st32;
|
170
|
+
case 33: goto st33;
|
171
|
+
case 1: goto st1;
|
172
|
+
case 2: goto st2;
|
173
|
+
case 3: goto st3;
|
174
|
+
case 4: goto st4;
|
175
|
+
case 5: goto st5;
|
176
|
+
case 6: goto st6;
|
177
|
+
case 7: goto st7;
|
178
|
+
case 8: goto st8;
|
179
|
+
case 9: goto st9;
|
180
|
+
case 34: goto st34;
|
181
|
+
case 10: goto st10;
|
182
|
+
case 11: goto st11;
|
183
|
+
case 12: goto st12;
|
184
|
+
case 13: goto st13;
|
185
|
+
case 14: goto st14;
|
186
|
+
case 15: goto st15;
|
187
|
+
case 16: goto st16;
|
188
|
+
case 35: goto st35;
|
189
|
+
case 36: goto st36;
|
190
|
+
case 37: goto st37;
|
191
|
+
case 38: goto st38;
|
192
|
+
case 39: goto st39;
|
193
|
+
case 40: goto st40;
|
194
|
+
case 17: goto st17;
|
195
|
+
case 41: goto st41;
|
196
|
+
case 42: goto st42;
|
197
|
+
case 43: goto st43;
|
198
|
+
case 18: goto st18;
|
199
|
+
case 44: goto st44;
|
200
|
+
case 45: goto st45;
|
201
|
+
case 46: goto st46;
|
202
|
+
case 47: goto st47;
|
203
|
+
case 48: goto st48;
|
204
|
+
case 49: goto st49;
|
205
|
+
case 50: goto st50;
|
206
|
+
case 51: goto st51;
|
207
|
+
case 52: goto st52;
|
208
|
+
case 53: goto st53;
|
209
|
+
case 0: goto st0;
|
210
|
+
case 54: goto st54;
|
211
|
+
case 55: goto st55;
|
212
|
+
case 56: goto st56;
|
213
|
+
case 57: goto st57;
|
214
|
+
case 58: goto st58;
|
215
|
+
case 59: goto st59;
|
216
|
+
case 60: goto st60;
|
217
|
+
case 61: goto st61;
|
218
|
+
case 62: goto st62;
|
219
|
+
case 63: goto st63;
|
220
|
+
case 64: goto st64;
|
221
|
+
case 65: goto st65;
|
222
|
+
case 66: goto st66;
|
223
|
+
case 67: goto st67;
|
224
|
+
case 68: goto st68;
|
225
|
+
case 69: goto st69;
|
226
|
+
case 70: goto st70;
|
227
|
+
case 71: goto st71;
|
228
|
+
case 72: goto st72;
|
229
|
+
case 73: goto st73;
|
230
|
+
case 74: goto st74;
|
231
|
+
case 75: goto st75;
|
232
|
+
case 76: goto st76;
|
233
|
+
case 77: goto st77;
|
234
|
+
case 78: goto st78;
|
235
|
+
case 79: goto st79;
|
236
|
+
case 80: goto st80;
|
237
|
+
case 81: goto st81;
|
238
|
+
case 82: goto st82;
|
239
|
+
case 83: goto st83;
|
240
|
+
case 84: goto st84;
|
241
|
+
case 85: goto st85;
|
242
|
+
case 86: goto st86;
|
243
|
+
case 87: goto st87;
|
244
|
+
case 88: goto st88;
|
245
|
+
case 19: goto st19;
|
246
|
+
case 20: goto st20;
|
247
|
+
case 21: goto st21;
|
248
|
+
case 22: goto st22;
|
249
|
+
case 23: goto st23;
|
250
|
+
case 24: goto st24;
|
251
|
+
case 25: goto st25;
|
252
|
+
case 89: goto st89;
|
253
|
+
case 90: goto st90;
|
254
|
+
case 91: goto st91;
|
255
|
+
case 92: goto st92;
|
256
|
+
case 26: goto st26;
|
257
|
+
case 27: goto st27;
|
258
|
+
case 28: goto st28;
|
259
|
+
case 29: goto st29;
|
260
|
+
case 30: goto st30;
|
261
|
+
case 31: goto st31;
|
262
|
+
case 93: goto st93;
|
263
|
+
default: break;
|
264
|
+
}
|
265
|
+
|
266
|
+
if ( ++p == pe )
|
267
|
+
goto _test_eof;
|
268
|
+
_resume:
|
269
|
+
switch ( ( state->cs) )
|
270
|
+
{
|
271
|
+
tr0:
|
272
|
+
( state->cs) = 32;
|
273
|
+
#line 549 "ext/ragel/base_lexer.rl"
|
274
|
+
{{p = ((te))-1;}{
|
275
|
+
p--;
|
276
|
+
( state->cs) = 82;
|
277
|
+
}}
|
278
|
+
goto _again;
|
279
|
+
tr4:
|
280
|
+
( state->cs) = 32;
|
281
|
+
#line 84 "ext/ragel/base_lexer.rl"
|
282
|
+
{te = p+1;{
|
283
|
+
callback_simple(id_on_comment_start);
|
284
|
+
|
285
|
+
( state->cs) = 38;
|
286
|
+
}}
|
287
|
+
goto _again;
|
288
|
+
tr17:
|
289
|
+
( state->cs) = 32;
|
290
|
+
#line 123 "ext/ragel/base_lexer.rl"
|
291
|
+
{te = p+1;{
|
292
|
+
callback_simple(id_on_cdata_start);
|
293
|
+
|
294
|
+
( state->cs) = 41;
|
295
|
+
}}
|
296
|
+
goto _again;
|
297
|
+
tr39:
|
298
|
+
( state->cs) = 32;
|
299
|
+
#line 549 "ext/ragel/base_lexer.rl"
|
300
|
+
{te = p+1;{
|
301
|
+
p--;
|
302
|
+
( state->cs) = 82;
|
303
|
+
}}
|
304
|
+
goto _again;
|
305
|
+
tr41:
|
306
|
+
( state->cs) = 32;
|
307
|
+
#line 549 "ext/ragel/base_lexer.rl"
|
308
|
+
{te = p;p--;{
|
309
|
+
p--;
|
310
|
+
( state->cs) = 82;
|
311
|
+
}}
|
312
|
+
goto _again;
|
313
|
+
tr43:
|
314
|
+
( state->cs) = 32;
|
315
|
+
#line 366 "ext/ragel/base_lexer.rl"
|
316
|
+
{te = p+1;{
|
317
|
+
p--;
|
318
|
+
( state->cs) = 69;
|
319
|
+
}}
|
320
|
+
goto _again;
|
321
|
+
tr44:
|
322
|
+
( state->cs) = 32;
|
323
|
+
#line 371 "ext/ragel/base_lexer.rl"
|
324
|
+
{te = p+1;{
|
325
|
+
( state->cs) = 71;
|
326
|
+
}}
|
327
|
+
goto _again;
|
328
|
+
tr46:
|
329
|
+
( state->cs) = 32;
|
330
|
+
#line 255 "ext/ragel/base_lexer.rl"
|
331
|
+
{te = p;p--;{
|
332
|
+
callback_simple(id_on_doctype_start);
|
333
|
+
|
334
|
+
if ( lines > 0 )
|
335
|
+
{
|
336
|
+
advance_line(lines);
|
337
|
+
|
338
|
+
lines = 0;
|
339
|
+
}
|
340
|
+
|
341
|
+
( state->cs) = 53;
|
342
|
+
}}
|
343
|
+
goto _again;
|
344
|
+
tr47:
|
345
|
+
( state->cs) = 32;
|
346
|
+
#line 1 "NONE"
|
347
|
+
{ switch( ( state->act) ) {
|
348
|
+
case 54:
|
349
|
+
{{p = ((te))-1;}
|
350
|
+
callback_simple(id_on_xml_decl_start);
|
351
|
+
( state->cs) = 66;
|
352
|
+
}
|
353
|
+
break;
|
354
|
+
case 57:
|
355
|
+
{{p = ((te))-1;}
|
356
|
+
callback_simple(id_on_proc_ins_start);
|
357
|
+
callback(id_on_proc_ins_name, data, encoding, ts + 2, te);
|
358
|
+
|
359
|
+
( state->cs) = 44;
|
360
|
+
}
|
361
|
+
break;
|
362
|
+
}
|
363
|
+
}
|
364
|
+
goto _again;
|
365
|
+
tr48:
|
366
|
+
( state->cs) = 32;
|
367
|
+
#line 165 "ext/ragel/base_lexer.rl"
|
368
|
+
{te = p;p--;{
|
369
|
+
callback_simple(id_on_proc_ins_start);
|
370
|
+
callback(id_on_proc_ins_name, data, encoding, ts + 2, te);
|
371
|
+
|
372
|
+
( state->cs) = 44;
|
373
|
+
}}
|
374
|
+
goto _again;
|
375
|
+
st32:
|
376
|
+
#line 1 "NONE"
|
377
|
+
{ts = 0;}
|
378
|
+
if ( ++p == pe )
|
379
|
+
goto _test_eof32;
|
380
|
+
case 32:
|
381
|
+
#line 1 "NONE"
|
382
|
+
{ts = p;}
|
383
|
+
#line 384 "ext/c/lexer.c"
|
384
|
+
if ( (*p) == 60 )
|
385
|
+
goto tr40;
|
386
|
+
goto tr39;
|
387
|
+
tr40:
|
388
|
+
#line 1 "NONE"
|
389
|
+
{te = p+1;}
|
390
|
+
goto st33;
|
391
|
+
st33:
|
392
|
+
if ( ++p == pe )
|
393
|
+
goto _test_eof33;
|
394
|
+
case 33:
|
395
|
+
#line 396 "ext/c/lexer.c"
|
396
|
+
switch( (*p) ) {
|
397
|
+
case 33: goto st1;
|
398
|
+
case 47: goto tr44;
|
399
|
+
case 63: goto st16;
|
400
|
+
case 95: goto tr43;
|
401
|
+
}
|
402
|
+
if ( (*p) < 65 ) {
|
403
|
+
if ( 45 <= (*p) && (*p) <= 57 )
|
404
|
+
goto tr43;
|
405
|
+
} else if ( (*p) > 90 ) {
|
406
|
+
if ( 97 <= (*p) && (*p) <= 122 )
|
407
|
+
goto tr43;
|
408
|
+
} else
|
409
|
+
goto tr43;
|
410
|
+
goto tr41;
|
411
|
+
st1:
|
412
|
+
if ( ++p == pe )
|
413
|
+
goto _test_eof1;
|
414
|
+
case 1:
|
415
|
+
switch( (*p) ) {
|
416
|
+
case 45: goto st2;
|
417
|
+
case 68: goto st3;
|
418
|
+
case 91: goto st10;
|
419
|
+
case 100: goto st3;
|
420
|
+
}
|
421
|
+
goto tr0;
|
422
|
+
st2:
|
423
|
+
if ( ++p == pe )
|
424
|
+
goto _test_eof2;
|
425
|
+
case 2:
|
426
|
+
if ( (*p) == 45 )
|
427
|
+
goto tr4;
|
428
|
+
goto tr0;
|
429
|
+
st3:
|
430
|
+
if ( ++p == pe )
|
431
|
+
goto _test_eof3;
|
432
|
+
case 3:
|
433
|
+
switch( (*p) ) {
|
434
|
+
case 79: goto st4;
|
435
|
+
case 111: goto st4;
|
436
|
+
}
|
437
|
+
goto tr0;
|
438
|
+
st4:
|
439
|
+
if ( ++p == pe )
|
440
|
+
goto _test_eof4;
|
441
|
+
case 4:
|
442
|
+
switch( (*p) ) {
|
443
|
+
case 67: goto st5;
|
444
|
+
case 99: goto st5;
|
445
|
+
}
|
446
|
+
goto tr0;
|
447
|
+
st5:
|
448
|
+
if ( ++p == pe )
|
449
|
+
goto _test_eof5;
|
450
|
+
case 5:
|
451
|
+
switch( (*p) ) {
|
452
|
+
case 84: goto st6;
|
453
|
+
case 116: goto st6;
|
454
|
+
}
|
455
|
+
goto tr0;
|
456
|
+
st6:
|
457
|
+
if ( ++p == pe )
|
458
|
+
goto _test_eof6;
|
459
|
+
case 6:
|
460
|
+
switch( (*p) ) {
|
461
|
+
case 89: goto st7;
|
462
|
+
case 121: goto st7;
|
463
|
+
}
|
464
|
+
goto tr0;
|
465
|
+
st7:
|
466
|
+
if ( ++p == pe )
|
467
|
+
goto _test_eof7;
|
468
|
+
case 7:
|
469
|
+
switch( (*p) ) {
|
470
|
+
case 80: goto st8;
|
471
|
+
case 112: goto st8;
|
472
|
+
}
|
473
|
+
goto tr0;
|
474
|
+
st8:
|
475
|
+
if ( ++p == pe )
|
476
|
+
goto _test_eof8;
|
477
|
+
case 8:
|
478
|
+
switch( (*p) ) {
|
479
|
+
case 69: goto st9;
|
480
|
+
case 101: goto st9;
|
481
|
+
}
|
482
|
+
goto tr0;
|
483
|
+
st9:
|
484
|
+
if ( ++p == pe )
|
485
|
+
goto _test_eof9;
|
486
|
+
case 9:
|
487
|
+
switch( (*p) ) {
|
488
|
+
case 13: goto tr11;
|
489
|
+
case 32: goto tr11;
|
490
|
+
}
|
491
|
+
if ( 9 <= (*p) && (*p) <= 10 )
|
492
|
+
goto tr11;
|
493
|
+
goto tr0;
|
494
|
+
tr11:
|
495
|
+
#line 56 "ext/ragel/base_lexer.rl"
|
496
|
+
{
|
497
|
+
if ( (*p) == '\n' ) lines++;
|
498
|
+
}
|
499
|
+
goto st34;
|
500
|
+
st34:
|
501
|
+
if ( ++p == pe )
|
502
|
+
goto _test_eof34;
|
503
|
+
case 34:
|
504
|
+
#line 505 "ext/c/lexer.c"
|
505
|
+
switch( (*p) ) {
|
506
|
+
case 13: goto tr11;
|
507
|
+
case 32: goto tr11;
|
508
|
+
}
|
509
|
+
if ( 9 <= (*p) && (*p) <= 10 )
|
510
|
+
goto tr11;
|
511
|
+
goto tr46;
|
512
|
+
st10:
|
513
|
+
if ( ++p == pe )
|
514
|
+
goto _test_eof10;
|
515
|
+
case 10:
|
516
|
+
if ( (*p) == 67 )
|
517
|
+
goto st11;
|
518
|
+
goto tr0;
|
519
|
+
st11:
|
520
|
+
if ( ++p == pe )
|
521
|
+
goto _test_eof11;
|
522
|
+
case 11:
|
523
|
+
if ( (*p) == 68 )
|
524
|
+
goto st12;
|
525
|
+
goto tr0;
|
526
|
+
st12:
|
527
|
+
if ( ++p == pe )
|
528
|
+
goto _test_eof12;
|
529
|
+
case 12:
|
530
|
+
if ( (*p) == 65 )
|
531
|
+
goto st13;
|
532
|
+
goto tr0;
|
533
|
+
st13:
|
534
|
+
if ( ++p == pe )
|
535
|
+
goto _test_eof13;
|
536
|
+
case 13:
|
537
|
+
if ( (*p) == 84 )
|
538
|
+
goto st14;
|
539
|
+
goto tr0;
|
540
|
+
st14:
|
541
|
+
if ( ++p == pe )
|
542
|
+
goto _test_eof14;
|
543
|
+
case 14:
|
544
|
+
if ( (*p) == 65 )
|
545
|
+
goto st15;
|
546
|
+
goto tr0;
|
547
|
+
st15:
|
548
|
+
if ( ++p == pe )
|
549
|
+
goto _test_eof15;
|
550
|
+
case 15:
|
551
|
+
if ( (*p) == 91 )
|
552
|
+
goto tr17;
|
553
|
+
goto tr0;
|
554
|
+
st16:
|
555
|
+
if ( ++p == pe )
|
556
|
+
goto _test_eof16;
|
557
|
+
case 16:
|
558
|
+
switch( (*p) ) {
|
559
|
+
case 95: goto tr18;
|
560
|
+
case 120: goto st36;
|
561
|
+
}
|
562
|
+
if ( (*p) < 48 ) {
|
563
|
+
if ( 45 <= (*p) && (*p) <= 46 )
|
564
|
+
goto tr18;
|
565
|
+
} else if ( (*p) > 57 ) {
|
566
|
+
if ( (*p) > 90 ) {
|
567
|
+
if ( 97 <= (*p) && (*p) <= 122 )
|
568
|
+
goto tr18;
|
569
|
+
} else if ( (*p) >= 65 )
|
570
|
+
goto tr18;
|
571
|
+
} else
|
572
|
+
goto tr18;
|
573
|
+
goto tr0;
|
574
|
+
tr18:
|
575
|
+
#line 1 "NONE"
|
576
|
+
{te = p+1;}
|
577
|
+
#line 165 "ext/ragel/base_lexer.rl"
|
578
|
+
{( state->act) = 57;}
|
579
|
+
goto st35;
|
580
|
+
tr50:
|
581
|
+
#line 1 "NONE"
|
582
|
+
{te = p+1;}
|
583
|
+
#line 319 "ext/ragel/base_lexer.rl"
|
584
|
+
{( state->act) = 54;}
|
585
|
+
goto st35;
|
586
|
+
st35:
|
587
|
+
if ( ++p == pe )
|
588
|
+
goto _test_eof35;
|
589
|
+
case 35:
|
590
|
+
#line 591 "ext/c/lexer.c"
|
591
|
+
if ( (*p) == 95 )
|
592
|
+
goto tr18;
|
593
|
+
if ( (*p) < 48 ) {
|
594
|
+
if ( 45 <= (*p) && (*p) <= 46 )
|
595
|
+
goto tr18;
|
596
|
+
} else if ( (*p) > 57 ) {
|
597
|
+
if ( (*p) > 90 ) {
|
598
|
+
if ( 97 <= (*p) && (*p) <= 122 )
|
599
|
+
goto tr18;
|
600
|
+
} else if ( (*p) >= 65 )
|
601
|
+
goto tr18;
|
602
|
+
} else
|
603
|
+
goto tr18;
|
604
|
+
goto tr47;
|
605
|
+
st36:
|
606
|
+
if ( ++p == pe )
|
607
|
+
goto _test_eof36;
|
608
|
+
case 36:
|
609
|
+
switch( (*p) ) {
|
610
|
+
case 95: goto tr18;
|
611
|
+
case 109: goto st37;
|
612
|
+
}
|
613
|
+
if ( (*p) < 48 ) {
|
614
|
+
if ( 45 <= (*p) && (*p) <= 46 )
|
615
|
+
goto tr18;
|
616
|
+
} else if ( (*p) > 57 ) {
|
617
|
+
if ( (*p) > 90 ) {
|
618
|
+
if ( 97 <= (*p) && (*p) <= 122 )
|
619
|
+
goto tr18;
|
620
|
+
} else if ( (*p) >= 65 )
|
621
|
+
goto tr18;
|
622
|
+
} else
|
623
|
+
goto tr18;
|
624
|
+
goto tr48;
|
625
|
+
st37:
|
626
|
+
if ( ++p == pe )
|
627
|
+
goto _test_eof37;
|
628
|
+
case 37:
|
629
|
+
switch( (*p) ) {
|
630
|
+
case 95: goto tr18;
|
631
|
+
case 108: goto tr50;
|
632
|
+
}
|
633
|
+
if ( (*p) < 48 ) {
|
634
|
+
if ( 45 <= (*p) && (*p) <= 46 )
|
635
|
+
goto tr18;
|
636
|
+
} else if ( (*p) > 57 ) {
|
637
|
+
if ( (*p) > 90 ) {
|
638
|
+
if ( 97 <= (*p) && (*p) <= 122 )
|
639
|
+
goto tr18;
|
640
|
+
} else if ( (*p) >= 65 )
|
641
|
+
goto tr18;
|
642
|
+
} else
|
643
|
+
goto tr18;
|
644
|
+
goto tr48;
|
645
|
+
tr20:
|
646
|
+
#line 91 "ext/ragel/base_lexer.rl"
|
647
|
+
{{p = ((te))-1;}{
|
648
|
+
callback(id_on_comment_body, data, encoding, ts, te);
|
649
|
+
|
650
|
+
if ( lines > 0 )
|
651
|
+
{
|
652
|
+
advance_line(lines);
|
653
|
+
|
654
|
+
lines = 0;
|
655
|
+
}
|
656
|
+
}}
|
657
|
+
goto st38;
|
658
|
+
tr21:
|
659
|
+
( state->cs) = 38;
|
660
|
+
#line 102 "ext/ragel/base_lexer.rl"
|
661
|
+
{te = p+1;{
|
662
|
+
callback_simple(id_on_comment_end);
|
663
|
+
|
664
|
+
( state->cs) = 32;
|
665
|
+
}}
|
666
|
+
goto _again;
|
667
|
+
tr53:
|
668
|
+
#line 91 "ext/ragel/base_lexer.rl"
|
669
|
+
{te = p;p--;{
|
670
|
+
callback(id_on_comment_body, data, encoding, ts, te);
|
671
|
+
|
672
|
+
if ( lines > 0 )
|
673
|
+
{
|
674
|
+
advance_line(lines);
|
675
|
+
|
676
|
+
lines = 0;
|
677
|
+
}
|
678
|
+
}}
|
679
|
+
goto st38;
|
680
|
+
st38:
|
681
|
+
#line 1 "NONE"
|
682
|
+
{ts = 0;}
|
683
|
+
if ( ++p == pe )
|
684
|
+
goto _test_eof38;
|
685
|
+
case 38:
|
686
|
+
#line 1 "NONE"
|
687
|
+
{ts = p;}
|
688
|
+
#line 689 "ext/c/lexer.c"
|
689
|
+
if ( (*p) == 45 )
|
690
|
+
goto tr52;
|
691
|
+
goto tr51;
|
692
|
+
tr51:
|
693
|
+
#line 56 "ext/ragel/base_lexer.rl"
|
694
|
+
{
|
695
|
+
if ( (*p) == '\n' ) lines++;
|
696
|
+
}
|
697
|
+
goto st39;
|
698
|
+
st39:
|
699
|
+
if ( ++p == pe )
|
700
|
+
goto _test_eof39;
|
701
|
+
case 39:
|
702
|
+
#line 703 "ext/c/lexer.c"
|
703
|
+
if ( (*p) == 45 )
|
704
|
+
goto tr53;
|
705
|
+
goto tr51;
|
706
|
+
tr52:
|
707
|
+
#line 1 "NONE"
|
708
|
+
{te = p+1;}
|
709
|
+
#line 56 "ext/ragel/base_lexer.rl"
|
710
|
+
{
|
711
|
+
if ( (*p) == '\n' ) lines++;
|
712
|
+
}
|
713
|
+
goto st40;
|
714
|
+
st40:
|
715
|
+
if ( ++p == pe )
|
716
|
+
goto _test_eof40;
|
717
|
+
case 40:
|
718
|
+
#line 719 "ext/c/lexer.c"
|
719
|
+
if ( (*p) == 45 )
|
720
|
+
goto st17;
|
721
|
+
goto tr53;
|
722
|
+
st17:
|
723
|
+
if ( ++p == pe )
|
724
|
+
goto _test_eof17;
|
725
|
+
case 17:
|
726
|
+
if ( (*p) == 62 )
|
727
|
+
goto tr21;
|
728
|
+
goto tr20;
|
729
|
+
tr22:
|
730
|
+
#line 130 "ext/ragel/base_lexer.rl"
|
731
|
+
{{p = ((te))-1;}{
|
732
|
+
callback(id_on_cdata_body, data, encoding, ts, te);
|
733
|
+
|
734
|
+
if ( lines > 0 )
|
735
|
+
{
|
736
|
+
advance_line(lines);
|
737
|
+
|
738
|
+
lines = 0;
|
739
|
+
}
|
740
|
+
}}
|
741
|
+
goto st41;
|
742
|
+
tr23:
|
743
|
+
( state->cs) = 41;
|
744
|
+
#line 141 "ext/ragel/base_lexer.rl"
|
745
|
+
{te = p+1;{
|
746
|
+
callback_simple(id_on_cdata_end);
|
747
|
+
|
748
|
+
( state->cs) = 32;
|
749
|
+
}}
|
750
|
+
goto _again;
|
751
|
+
tr57:
|
752
|
+
#line 130 "ext/ragel/base_lexer.rl"
|
753
|
+
{te = p;p--;{
|
754
|
+
callback(id_on_cdata_body, data, encoding, ts, te);
|
755
|
+
|
756
|
+
if ( lines > 0 )
|
757
|
+
{
|
758
|
+
advance_line(lines);
|
759
|
+
|
760
|
+
lines = 0;
|
761
|
+
}
|
762
|
+
}}
|
763
|
+
goto st41;
|
764
|
+
st41:
|
765
|
+
#line 1 "NONE"
|
766
|
+
{ts = 0;}
|
767
|
+
if ( ++p == pe )
|
768
|
+
goto _test_eof41;
|
769
|
+
case 41:
|
770
|
+
#line 1 "NONE"
|
771
|
+
{ts = p;}
|
772
|
+
#line 773 "ext/c/lexer.c"
|
773
|
+
if ( (*p) == 93 )
|
774
|
+
goto tr56;
|
775
|
+
goto tr55;
|
776
|
+
tr55:
|
777
|
+
#line 56 "ext/ragel/base_lexer.rl"
|
778
|
+
{
|
779
|
+
if ( (*p) == '\n' ) lines++;
|
780
|
+
}
|
781
|
+
goto st42;
|
782
|
+
st42:
|
783
|
+
if ( ++p == pe )
|
784
|
+
goto _test_eof42;
|
785
|
+
case 42:
|
786
|
+
#line 787 "ext/c/lexer.c"
|
787
|
+
if ( (*p) == 93 )
|
788
|
+
goto tr57;
|
789
|
+
goto tr55;
|
790
|
+
tr56:
|
791
|
+
#line 1 "NONE"
|
792
|
+
{te = p+1;}
|
793
|
+
#line 56 "ext/ragel/base_lexer.rl"
|
794
|
+
{
|
795
|
+
if ( (*p) == '\n' ) lines++;
|
796
|
+
}
|
797
|
+
goto st43;
|
798
|
+
st43:
|
799
|
+
if ( ++p == pe )
|
800
|
+
goto _test_eof43;
|
801
|
+
case 43:
|
802
|
+
#line 803 "ext/c/lexer.c"
|
803
|
+
if ( (*p) == 93 )
|
804
|
+
goto st18;
|
805
|
+
goto tr57;
|
806
|
+
st18:
|
807
|
+
if ( ++p == pe )
|
808
|
+
goto _test_eof18;
|
809
|
+
case 18:
|
810
|
+
if ( (*p) == 62 )
|
811
|
+
goto tr23;
|
812
|
+
goto tr22;
|
813
|
+
tr61:
|
814
|
+
#line 173 "ext/ragel/base_lexer.rl"
|
815
|
+
{te = p;p--;{
|
816
|
+
callback(id_on_proc_ins_body, data, encoding, ts, te);
|
817
|
+
|
818
|
+
if ( lines > 0 )
|
819
|
+
{
|
820
|
+
advance_line(lines);
|
821
|
+
|
822
|
+
lines = 0;
|
823
|
+
}
|
824
|
+
}}
|
825
|
+
goto st44;
|
826
|
+
tr62:
|
827
|
+
( state->cs) = 44;
|
828
|
+
#line 184 "ext/ragel/base_lexer.rl"
|
829
|
+
{te = p+1;{
|
830
|
+
callback_simple(id_on_proc_ins_end);
|
831
|
+
|
832
|
+
( state->cs) = 32;
|
833
|
+
}}
|
834
|
+
goto _again;
|
835
|
+
st44:
|
836
|
+
#line 1 "NONE"
|
837
|
+
{ts = 0;}
|
838
|
+
if ( ++p == pe )
|
839
|
+
goto _test_eof44;
|
840
|
+
case 44:
|
841
|
+
#line 1 "NONE"
|
842
|
+
{ts = p;}
|
843
|
+
#line 844 "ext/c/lexer.c"
|
844
|
+
if ( (*p) == 63 )
|
845
|
+
goto tr60;
|
846
|
+
goto tr59;
|
847
|
+
tr59:
|
848
|
+
#line 56 "ext/ragel/base_lexer.rl"
|
849
|
+
{
|
850
|
+
if ( (*p) == '\n' ) lines++;
|
851
|
+
}
|
852
|
+
goto st45;
|
853
|
+
st45:
|
854
|
+
if ( ++p == pe )
|
855
|
+
goto _test_eof45;
|
856
|
+
case 45:
|
857
|
+
#line 858 "ext/c/lexer.c"
|
858
|
+
if ( (*p) == 63 )
|
859
|
+
goto tr61;
|
860
|
+
goto tr59;
|
861
|
+
tr60:
|
862
|
+
#line 56 "ext/ragel/base_lexer.rl"
|
863
|
+
{
|
864
|
+
if ( (*p) == '\n' ) lines++;
|
865
|
+
}
|
866
|
+
goto st46;
|
867
|
+
st46:
|
868
|
+
if ( ++p == pe )
|
869
|
+
goto _test_eof46;
|
870
|
+
case 46:
|
871
|
+
#line 872 "ext/c/lexer.c"
|
872
|
+
if ( (*p) == 62 )
|
873
|
+
goto tr62;
|
874
|
+
goto tr61;
|
875
|
+
tr64:
|
876
|
+
#line 226 "ext/ragel/base_lexer.rl"
|
877
|
+
{te = p+1;{
|
878
|
+
callback_simple(id_on_string_squote);
|
879
|
+
|
880
|
+
{( state->cs) = ( state->stack)[--( state->top)];goto _again;}
|
881
|
+
}}
|
882
|
+
goto st47;
|
883
|
+
tr65:
|
884
|
+
#line 200 "ext/ragel/base_lexer.rl"
|
885
|
+
{te = p;p--;{
|
886
|
+
callback(id_on_string_body, data, encoding, ts, te);
|
887
|
+
|
888
|
+
if ( lines > 0 )
|
889
|
+
{
|
890
|
+
advance_line(lines);
|
891
|
+
|
892
|
+
lines = 0;
|
893
|
+
}
|
894
|
+
}}
|
895
|
+
goto st47;
|
896
|
+
st47:
|
897
|
+
#line 1 "NONE"
|
898
|
+
{ts = 0;}
|
899
|
+
if ( ++p == pe )
|
900
|
+
goto _test_eof47;
|
901
|
+
case 47:
|
902
|
+
#line 1 "NONE"
|
903
|
+
{ts = p;}
|
904
|
+
#line 905 "ext/c/lexer.c"
|
905
|
+
if ( (*p) == 39 )
|
906
|
+
goto tr64;
|
907
|
+
goto tr63;
|
908
|
+
tr63:
|
909
|
+
#line 56 "ext/ragel/base_lexer.rl"
|
910
|
+
{
|
911
|
+
if ( (*p) == '\n' ) lines++;
|
912
|
+
}
|
913
|
+
goto st48;
|
914
|
+
st48:
|
915
|
+
if ( ++p == pe )
|
916
|
+
goto _test_eof48;
|
917
|
+
case 48:
|
918
|
+
#line 919 "ext/c/lexer.c"
|
919
|
+
if ( (*p) == 39 )
|
920
|
+
goto tr65;
|
921
|
+
goto tr63;
|
922
|
+
tr67:
|
923
|
+
#line 236 "ext/ragel/base_lexer.rl"
|
924
|
+
{te = p+1;{
|
925
|
+
callback_simple(id_on_string_dquote);
|
926
|
+
|
927
|
+
{( state->cs) = ( state->stack)[--( state->top)];goto _again;}
|
928
|
+
}}
|
929
|
+
goto st49;
|
930
|
+
tr68:
|
931
|
+
#line 200 "ext/ragel/base_lexer.rl"
|
932
|
+
{te = p;p--;{
|
933
|
+
callback(id_on_string_body, data, encoding, ts, te);
|
934
|
+
|
935
|
+
if ( lines > 0 )
|
936
|
+
{
|
937
|
+
advance_line(lines);
|
938
|
+
|
939
|
+
lines = 0;
|
940
|
+
}
|
941
|
+
}}
|
942
|
+
goto st49;
|
943
|
+
st49:
|
944
|
+
#line 1 "NONE"
|
945
|
+
{ts = 0;}
|
946
|
+
if ( ++p == pe )
|
947
|
+
goto _test_eof49;
|
948
|
+
case 49:
|
949
|
+
#line 1 "NONE"
|
950
|
+
{ts = p;}
|
951
|
+
#line 952 "ext/c/lexer.c"
|
952
|
+
if ( (*p) == 34 )
|
953
|
+
goto tr67;
|
954
|
+
goto tr66;
|
955
|
+
tr66:
|
956
|
+
#line 56 "ext/ragel/base_lexer.rl"
|
957
|
+
{
|
958
|
+
if ( (*p) == '\n' ) lines++;
|
959
|
+
}
|
960
|
+
goto st50;
|
961
|
+
st50:
|
962
|
+
if ( ++p == pe )
|
963
|
+
goto _test_eof50;
|
964
|
+
case 50:
|
965
|
+
#line 966 "ext/c/lexer.c"
|
966
|
+
if ( (*p) == 34 )
|
967
|
+
goto tr68;
|
968
|
+
goto tr66;
|
969
|
+
tr70:
|
970
|
+
( state->cs) = 51;
|
971
|
+
#line 281 "ext/ragel/base_lexer.rl"
|
972
|
+
{te = p+1;{ ( state->cs) = 53; }}
|
973
|
+
goto _again;
|
974
|
+
tr71:
|
975
|
+
#line 270 "ext/ragel/base_lexer.rl"
|
976
|
+
{te = p;p--;{
|
977
|
+
callback(id_on_doctype_inline, data, encoding, ts, te);
|
978
|
+
|
979
|
+
if ( lines > 0 )
|
980
|
+
{
|
981
|
+
advance_line(lines);
|
982
|
+
|
983
|
+
lines = 0;
|
984
|
+
}
|
985
|
+
}}
|
986
|
+
goto st51;
|
987
|
+
st51:
|
988
|
+
#line 1 "NONE"
|
989
|
+
{ts = 0;}
|
990
|
+
if ( ++p == pe )
|
991
|
+
goto _test_eof51;
|
992
|
+
case 51:
|
993
|
+
#line 1 "NONE"
|
994
|
+
{ts = p;}
|
995
|
+
#line 996 "ext/c/lexer.c"
|
996
|
+
if ( (*p) == 93 )
|
997
|
+
goto tr70;
|
998
|
+
goto tr69;
|
999
|
+
tr69:
|
1000
|
+
#line 56 "ext/ragel/base_lexer.rl"
|
1001
|
+
{
|
1002
|
+
if ( (*p) == '\n' ) lines++;
|
1003
|
+
}
|
1004
|
+
goto st52;
|
1005
|
+
st52:
|
1006
|
+
if ( ++p == pe )
|
1007
|
+
goto _test_eof52;
|
1008
|
+
case 52:
|
1009
|
+
#line 1010 "ext/c/lexer.c"
|
1010
|
+
if ( (*p) == 93 )
|
1011
|
+
goto tr71;
|
1012
|
+
goto tr69;
|
1013
|
+
tr72:
|
1014
|
+
#line 309 "ext/ragel/base_lexer.rl"
|
1015
|
+
{te = p+1;}
|
1016
|
+
goto st53;
|
1017
|
+
tr74:
|
1018
|
+
#line 60 "ext/ragel/base_lexer.rl"
|
1019
|
+
{te = p+1;{
|
1020
|
+
advance_line(1);
|
1021
|
+
}}
|
1022
|
+
goto st53;
|
1023
|
+
tr76:
|
1024
|
+
#line 217 "ext/ragel/base_lexer.rl"
|
1025
|
+
{te = p+1;{
|
1026
|
+
callback_simple(id_on_string_dquote);
|
1027
|
+
|
1028
|
+
{( state->stack)[( state->top)++] = 53; goto st49;}
|
1029
|
+
}}
|
1030
|
+
goto st53;
|
1031
|
+
tr77:
|
1032
|
+
#line 211 "ext/ragel/base_lexer.rl"
|
1033
|
+
{te = p+1;{
|
1034
|
+
callback_simple(id_on_string_squote);
|
1035
|
+
|
1036
|
+
{( state->stack)[( state->top)++] = 53; goto st47;}
|
1037
|
+
}}
|
1038
|
+
goto st53;
|
1039
|
+
tr79:
|
1040
|
+
( state->cs) = 53;
|
1041
|
+
#line 302 "ext/ragel/base_lexer.rl"
|
1042
|
+
{te = p+1;{
|
1043
|
+
callback_simple(id_on_doctype_end);
|
1044
|
+
( state->cs) = 32;
|
1045
|
+
}}
|
1046
|
+
goto _again;
|
1047
|
+
tr82:
|
1048
|
+
( state->cs) = 53;
|
1049
|
+
#line 292 "ext/ragel/base_lexer.rl"
|
1050
|
+
{te = p+1;{ ( state->cs) = 51; }}
|
1051
|
+
goto _again;
|
1052
|
+
tr83:
|
1053
|
+
#line 60 "ext/ragel/base_lexer.rl"
|
1054
|
+
{te = p;p--;{
|
1055
|
+
advance_line(1);
|
1056
|
+
}}
|
1057
|
+
goto st53;
|
1058
|
+
tr84:
|
1059
|
+
#line 1 "NONE"
|
1060
|
+
{ switch( ( state->act) ) {
|
1061
|
+
case 13:
|
1062
|
+
{{p = ((te))-1;}
|
1063
|
+
callback(id_on_doctype_type, data, encoding, ts, te);
|
1064
|
+
}
|
1065
|
+
break;
|
1066
|
+
case 17:
|
1067
|
+
{{p = ((te))-1;}
|
1068
|
+
callback(id_on_doctype_name, data, encoding, ts, te);
|
1069
|
+
}
|
1070
|
+
break;
|
1071
|
+
}
|
1072
|
+
}
|
1073
|
+
goto st53;
|
1074
|
+
tr85:
|
1075
|
+
#line 298 "ext/ragel/base_lexer.rl"
|
1076
|
+
{te = p;p--;{
|
1077
|
+
callback(id_on_doctype_name, data, encoding, ts, te);
|
1078
|
+
}}
|
1079
|
+
goto st53;
|
1080
|
+
st53:
|
1081
|
+
#line 1 "NONE"
|
1082
|
+
{ts = 0;}
|
1083
|
+
if ( ++p == pe )
|
1084
|
+
goto _test_eof53;
|
1085
|
+
case 53:
|
1086
|
+
#line 1 "NONE"
|
1087
|
+
{ts = p;}
|
1088
|
+
#line 1089 "ext/c/lexer.c"
|
1089
|
+
switch( (*p) ) {
|
1090
|
+
case 9: goto tr72;
|
1091
|
+
case 10: goto tr74;
|
1092
|
+
case 13: goto st54;
|
1093
|
+
case 32: goto tr72;
|
1094
|
+
case 34: goto tr76;
|
1095
|
+
case 39: goto tr77;
|
1096
|
+
case 62: goto tr79;
|
1097
|
+
case 80: goto st56;
|
1098
|
+
case 83: goto st61;
|
1099
|
+
case 91: goto tr82;
|
1100
|
+
case 95: goto tr78;
|
1101
|
+
}
|
1102
|
+
if ( (*p) < 48 ) {
|
1103
|
+
if ( 45 <= (*p) && (*p) <= 46 )
|
1104
|
+
goto tr78;
|
1105
|
+
} else if ( (*p) > 57 ) {
|
1106
|
+
if ( (*p) > 90 ) {
|
1107
|
+
if ( 97 <= (*p) && (*p) <= 122 )
|
1108
|
+
goto tr78;
|
1109
|
+
} else if ( (*p) >= 65 )
|
1110
|
+
goto tr78;
|
1111
|
+
} else
|
1112
|
+
goto tr78;
|
1113
|
+
goto st0;
|
1114
|
+
st0:
|
1115
|
+
( state->cs) = 0;
|
1116
|
+
goto _out;
|
1117
|
+
st54:
|
1118
|
+
if ( ++p == pe )
|
1119
|
+
goto _test_eof54;
|
1120
|
+
case 54:
|
1121
|
+
if ( (*p) == 10 )
|
1122
|
+
goto tr74;
|
1123
|
+
goto tr83;
|
1124
|
+
tr78:
|
1125
|
+
#line 1 "NONE"
|
1126
|
+
{te = p+1;}
|
1127
|
+
#line 298 "ext/ragel/base_lexer.rl"
|
1128
|
+
{( state->act) = 17;}
|
1129
|
+
goto st55;
|
1130
|
+
tr90:
|
1131
|
+
#line 1 "NONE"
|
1132
|
+
{te = p+1;}
|
1133
|
+
#line 287 "ext/ragel/base_lexer.rl"
|
1134
|
+
{( state->act) = 13;}
|
1135
|
+
goto st55;
|
1136
|
+
st55:
|
1137
|
+
if ( ++p == pe )
|
1138
|
+
goto _test_eof55;
|
1139
|
+
case 55:
|
1140
|
+
#line 1141 "ext/c/lexer.c"
|
1141
|
+
if ( (*p) == 95 )
|
1142
|
+
goto tr78;
|
1143
|
+
if ( (*p) < 48 ) {
|
1144
|
+
if ( 45 <= (*p) && (*p) <= 46 )
|
1145
|
+
goto tr78;
|
1146
|
+
} else if ( (*p) > 57 ) {
|
1147
|
+
if ( (*p) > 90 ) {
|
1148
|
+
if ( 97 <= (*p) && (*p) <= 122 )
|
1149
|
+
goto tr78;
|
1150
|
+
} else if ( (*p) >= 65 )
|
1151
|
+
goto tr78;
|
1152
|
+
} else
|
1153
|
+
goto tr78;
|
1154
|
+
goto tr84;
|
1155
|
+
st56:
|
1156
|
+
if ( ++p == pe )
|
1157
|
+
goto _test_eof56;
|
1158
|
+
case 56:
|
1159
|
+
switch( (*p) ) {
|
1160
|
+
case 85: goto st57;
|
1161
|
+
case 95: goto tr78;
|
1162
|
+
}
|
1163
|
+
if ( (*p) < 48 ) {
|
1164
|
+
if ( 45 <= (*p) && (*p) <= 46 )
|
1165
|
+
goto tr78;
|
1166
|
+
} else if ( (*p) > 57 ) {
|
1167
|
+
if ( (*p) > 90 ) {
|
1168
|
+
if ( 97 <= (*p) && (*p) <= 122 )
|
1169
|
+
goto tr78;
|
1170
|
+
} else if ( (*p) >= 65 )
|
1171
|
+
goto tr78;
|
1172
|
+
} else
|
1173
|
+
goto tr78;
|
1174
|
+
goto tr85;
|
1175
|
+
st57:
|
1176
|
+
if ( ++p == pe )
|
1177
|
+
goto _test_eof57;
|
1178
|
+
case 57:
|
1179
|
+
switch( (*p) ) {
|
1180
|
+
case 66: goto st58;
|
1181
|
+
case 95: goto tr78;
|
1182
|
+
}
|
1183
|
+
if ( (*p) < 48 ) {
|
1184
|
+
if ( 45 <= (*p) && (*p) <= 46 )
|
1185
|
+
goto tr78;
|
1186
|
+
} else if ( (*p) > 57 ) {
|
1187
|
+
if ( (*p) > 90 ) {
|
1188
|
+
if ( 97 <= (*p) && (*p) <= 122 )
|
1189
|
+
goto tr78;
|
1190
|
+
} else if ( (*p) >= 65 )
|
1191
|
+
goto tr78;
|
1192
|
+
} else
|
1193
|
+
goto tr78;
|
1194
|
+
goto tr85;
|
1195
|
+
st58:
|
1196
|
+
if ( ++p == pe )
|
1197
|
+
goto _test_eof58;
|
1198
|
+
case 58:
|
1199
|
+
switch( (*p) ) {
|
1200
|
+
case 76: goto st59;
|
1201
|
+
case 95: goto tr78;
|
1202
|
+
}
|
1203
|
+
if ( (*p) < 48 ) {
|
1204
|
+
if ( 45 <= (*p) && (*p) <= 46 )
|
1205
|
+
goto tr78;
|
1206
|
+
} else if ( (*p) > 57 ) {
|
1207
|
+
if ( (*p) > 90 ) {
|
1208
|
+
if ( 97 <= (*p) && (*p) <= 122 )
|
1209
|
+
goto tr78;
|
1210
|
+
} else if ( (*p) >= 65 )
|
1211
|
+
goto tr78;
|
1212
|
+
} else
|
1213
|
+
goto tr78;
|
1214
|
+
goto tr85;
|
1215
|
+
st59:
|
1216
|
+
if ( ++p == pe )
|
1217
|
+
goto _test_eof59;
|
1218
|
+
case 59:
|
1219
|
+
switch( (*p) ) {
|
1220
|
+
case 73: goto st60;
|
1221
|
+
case 95: goto tr78;
|
1222
|
+
}
|
1223
|
+
if ( (*p) < 48 ) {
|
1224
|
+
if ( 45 <= (*p) && (*p) <= 46 )
|
1225
|
+
goto tr78;
|
1226
|
+
} else if ( (*p) > 57 ) {
|
1227
|
+
if ( (*p) > 90 ) {
|
1228
|
+
if ( 97 <= (*p) && (*p) <= 122 )
|
1229
|
+
goto tr78;
|
1230
|
+
} else if ( (*p) >= 65 )
|
1231
|
+
goto tr78;
|
1232
|
+
} else
|
1233
|
+
goto tr78;
|
1234
|
+
goto tr85;
|
1235
|
+
st60:
|
1236
|
+
if ( ++p == pe )
|
1237
|
+
goto _test_eof60;
|
1238
|
+
case 60:
|
1239
|
+
switch( (*p) ) {
|
1240
|
+
case 67: goto tr90;
|
1241
|
+
case 95: goto tr78;
|
1242
|
+
}
|
1243
|
+
if ( (*p) < 48 ) {
|
1244
|
+
if ( 45 <= (*p) && (*p) <= 46 )
|
1245
|
+
goto tr78;
|
1246
|
+
} else if ( (*p) > 57 ) {
|
1247
|
+
if ( (*p) > 90 ) {
|
1248
|
+
if ( 97 <= (*p) && (*p) <= 122 )
|
1249
|
+
goto tr78;
|
1250
|
+
} else if ( (*p) >= 65 )
|
1251
|
+
goto tr78;
|
1252
|
+
} else
|
1253
|
+
goto tr78;
|
1254
|
+
goto tr85;
|
1255
|
+
st61:
|
1256
|
+
if ( ++p == pe )
|
1257
|
+
goto _test_eof61;
|
1258
|
+
case 61:
|
1259
|
+
switch( (*p) ) {
|
1260
|
+
case 89: goto st62;
|
1261
|
+
case 95: goto tr78;
|
1262
|
+
}
|
1263
|
+
if ( (*p) < 48 ) {
|
1264
|
+
if ( 45 <= (*p) && (*p) <= 46 )
|
1265
|
+
goto tr78;
|
1266
|
+
} else if ( (*p) > 57 ) {
|
1267
|
+
if ( (*p) > 90 ) {
|
1268
|
+
if ( 97 <= (*p) && (*p) <= 122 )
|
1269
|
+
goto tr78;
|
1270
|
+
} else if ( (*p) >= 65 )
|
1271
|
+
goto tr78;
|
1272
|
+
} else
|
1273
|
+
goto tr78;
|
1274
|
+
goto tr85;
|
1275
|
+
st62:
|
1276
|
+
if ( ++p == pe )
|
1277
|
+
goto _test_eof62;
|
1278
|
+
case 62:
|
1279
|
+
switch( (*p) ) {
|
1280
|
+
case 83: goto st63;
|
1281
|
+
case 95: goto tr78;
|
1282
|
+
}
|
1283
|
+
if ( (*p) < 48 ) {
|
1284
|
+
if ( 45 <= (*p) && (*p) <= 46 )
|
1285
|
+
goto tr78;
|
1286
|
+
} else if ( (*p) > 57 ) {
|
1287
|
+
if ( (*p) > 90 ) {
|
1288
|
+
if ( 97 <= (*p) && (*p) <= 122 )
|
1289
|
+
goto tr78;
|
1290
|
+
} else if ( (*p) >= 65 )
|
1291
|
+
goto tr78;
|
1292
|
+
} else
|
1293
|
+
goto tr78;
|
1294
|
+
goto tr85;
|
1295
|
+
st63:
|
1296
|
+
if ( ++p == pe )
|
1297
|
+
goto _test_eof63;
|
1298
|
+
case 63:
|
1299
|
+
switch( (*p) ) {
|
1300
|
+
case 84: goto st64;
|
1301
|
+
case 95: goto tr78;
|
1302
|
+
}
|
1303
|
+
if ( (*p) < 48 ) {
|
1304
|
+
if ( 45 <= (*p) && (*p) <= 46 )
|
1305
|
+
goto tr78;
|
1306
|
+
} else if ( (*p) > 57 ) {
|
1307
|
+
if ( (*p) > 90 ) {
|
1308
|
+
if ( 97 <= (*p) && (*p) <= 122 )
|
1309
|
+
goto tr78;
|
1310
|
+
} else if ( (*p) >= 65 )
|
1311
|
+
goto tr78;
|
1312
|
+
} else
|
1313
|
+
goto tr78;
|
1314
|
+
goto tr85;
|
1315
|
+
st64:
|
1316
|
+
if ( ++p == pe )
|
1317
|
+
goto _test_eof64;
|
1318
|
+
case 64:
|
1319
|
+
switch( (*p) ) {
|
1320
|
+
case 69: goto st65;
|
1321
|
+
case 95: goto tr78;
|
1322
|
+
}
|
1323
|
+
if ( (*p) < 48 ) {
|
1324
|
+
if ( 45 <= (*p) && (*p) <= 46 )
|
1325
|
+
goto tr78;
|
1326
|
+
} else if ( (*p) > 57 ) {
|
1327
|
+
if ( (*p) > 90 ) {
|
1328
|
+
if ( 97 <= (*p) && (*p) <= 122 )
|
1329
|
+
goto tr78;
|
1330
|
+
} else if ( (*p) >= 65 )
|
1331
|
+
goto tr78;
|
1332
|
+
} else
|
1333
|
+
goto tr78;
|
1334
|
+
goto tr85;
|
1335
|
+
st65:
|
1336
|
+
if ( ++p == pe )
|
1337
|
+
goto _test_eof65;
|
1338
|
+
case 65:
|
1339
|
+
switch( (*p) ) {
|
1340
|
+
case 77: goto tr90;
|
1341
|
+
case 95: goto tr78;
|
1342
|
+
}
|
1343
|
+
if ( (*p) < 48 ) {
|
1344
|
+
if ( 45 <= (*p) && (*p) <= 46 )
|
1345
|
+
goto tr78;
|
1346
|
+
} else if ( (*p) > 57 ) {
|
1347
|
+
if ( (*p) > 90 ) {
|
1348
|
+
if ( 97 <= (*p) && (*p) <= 122 )
|
1349
|
+
goto tr78;
|
1350
|
+
} else if ( (*p) >= 65 )
|
1351
|
+
goto tr78;
|
1352
|
+
} else
|
1353
|
+
goto tr78;
|
1354
|
+
goto tr85;
|
1355
|
+
tr95:
|
1356
|
+
#line 56 "ext/ragel/base_lexer.rl"
|
1357
|
+
{
|
1358
|
+
if ( (*p) == '\n' ) lines++;
|
1359
|
+
}
|
1360
|
+
#line 354 "ext/ragel/base_lexer.rl"
|
1361
|
+
{te = p+1;}
|
1362
|
+
goto st66;
|
1363
|
+
tr96:
|
1364
|
+
#line 217 "ext/ragel/base_lexer.rl"
|
1365
|
+
{te = p+1;{
|
1366
|
+
callback_simple(id_on_string_dquote);
|
1367
|
+
|
1368
|
+
{( state->stack)[( state->top)++] = 66; goto st49;}
|
1369
|
+
}}
|
1370
|
+
#line 56 "ext/ragel/base_lexer.rl"
|
1371
|
+
{
|
1372
|
+
if ( (*p) == '\n' ) lines++;
|
1373
|
+
}
|
1374
|
+
goto st66;
|
1375
|
+
tr97:
|
1376
|
+
#line 211 "ext/ragel/base_lexer.rl"
|
1377
|
+
{te = p+1;{
|
1378
|
+
callback_simple(id_on_string_squote);
|
1379
|
+
|
1380
|
+
{( state->stack)[( state->top)++] = 66; goto st47;}
|
1381
|
+
}}
|
1382
|
+
#line 56 "ext/ragel/base_lexer.rl"
|
1383
|
+
{
|
1384
|
+
if ( (*p) == '\n' ) lines++;
|
1385
|
+
}
|
1386
|
+
goto st66;
|
1387
|
+
tr100:
|
1388
|
+
#line 340 "ext/ragel/base_lexer.rl"
|
1389
|
+
{te = p;p--;{
|
1390
|
+
if ( lines > 0 )
|
1391
|
+
{
|
1392
|
+
advance_line(lines);
|
1393
|
+
|
1394
|
+
lines = 0;
|
1395
|
+
}
|
1396
|
+
|
1397
|
+
callback(id_on_attribute, data, encoding, ts, te);
|
1398
|
+
}}
|
1399
|
+
goto st66;
|
1400
|
+
tr102:
|
1401
|
+
#line 354 "ext/ragel/base_lexer.rl"
|
1402
|
+
{te = p;p--;}
|
1403
|
+
goto st66;
|
1404
|
+
tr103:
|
1405
|
+
( state->cs) = 66;
|
1406
|
+
#line 326 "ext/ragel/base_lexer.rl"
|
1407
|
+
{te = p+1;{
|
1408
|
+
if ( lines > 0 )
|
1409
|
+
{
|
1410
|
+
advance_line(lines);
|
1411
|
+
|
1412
|
+
lines = 0;
|
1413
|
+
}
|
1414
|
+
|
1415
|
+
callback_simple(id_on_xml_decl_end);
|
1416
|
+
|
1417
|
+
( state->cs) = 32;
|
1418
|
+
}}
|
1419
|
+
goto _again;
|
1420
|
+
st66:
|
1421
|
+
#line 1 "NONE"
|
1422
|
+
{ts = 0;}
|
1423
|
+
if ( ++p == pe )
|
1424
|
+
goto _test_eof66;
|
1425
|
+
case 66:
|
1426
|
+
#line 1 "NONE"
|
1427
|
+
{ts = p;}
|
1428
|
+
#line 1429 "ext/c/lexer.c"
|
1429
|
+
switch( (*p) ) {
|
1430
|
+
case 34: goto tr96;
|
1431
|
+
case 39: goto tr97;
|
1432
|
+
case 63: goto tr99;
|
1433
|
+
case 95: goto tr98;
|
1434
|
+
}
|
1435
|
+
if ( (*p) < 48 ) {
|
1436
|
+
if ( 45 <= (*p) && (*p) <= 46 )
|
1437
|
+
goto tr98;
|
1438
|
+
} else if ( (*p) > 57 ) {
|
1439
|
+
if ( (*p) > 90 ) {
|
1440
|
+
if ( 97 <= (*p) && (*p) <= 122 )
|
1441
|
+
goto tr98;
|
1442
|
+
} else if ( (*p) >= 65 )
|
1443
|
+
goto tr98;
|
1444
|
+
} else
|
1445
|
+
goto tr98;
|
1446
|
+
goto tr95;
|
1447
|
+
tr98:
|
1448
|
+
#line 56 "ext/ragel/base_lexer.rl"
|
1449
|
+
{
|
1450
|
+
if ( (*p) == '\n' ) lines++;
|
1451
|
+
}
|
1452
|
+
goto st67;
|
1453
|
+
st67:
|
1454
|
+
if ( ++p == pe )
|
1455
|
+
goto _test_eof67;
|
1456
|
+
case 67:
|
1457
|
+
#line 1458 "ext/c/lexer.c"
|
1458
|
+
if ( (*p) == 95 )
|
1459
|
+
goto st67;
|
1460
|
+
if ( (*p) < 48 ) {
|
1461
|
+
if ( 45 <= (*p) && (*p) <= 46 )
|
1462
|
+
goto st67;
|
1463
|
+
} else if ( (*p) > 57 ) {
|
1464
|
+
if ( (*p) > 90 ) {
|
1465
|
+
if ( 97 <= (*p) && (*p) <= 122 )
|
1466
|
+
goto st67;
|
1467
|
+
} else if ( (*p) >= 65 )
|
1468
|
+
goto st67;
|
1469
|
+
} else
|
1470
|
+
goto st67;
|
1471
|
+
goto tr100;
|
1472
|
+
tr99:
|
1473
|
+
#line 56 "ext/ragel/base_lexer.rl"
|
1474
|
+
{
|
1475
|
+
if ( (*p) == '\n' ) lines++;
|
1476
|
+
}
|
1477
|
+
goto st68;
|
1478
|
+
st68:
|
1479
|
+
if ( ++p == pe )
|
1480
|
+
goto _test_eof68;
|
1481
|
+
case 68:
|
1482
|
+
#line 1483 "ext/c/lexer.c"
|
1483
|
+
if ( (*p) == 62 )
|
1484
|
+
goto tr103;
|
1485
|
+
goto tr102;
|
1486
|
+
tr105:
|
1487
|
+
( state->cs) = 69;
|
1488
|
+
#line 394 "ext/ragel/base_lexer.rl"
|
1489
|
+
{te = p;p--;{
|
1490
|
+
callback(id_on_element_name, data, encoding, ts, te);
|
1491
|
+
( state->cs) = 78;
|
1492
|
+
}}
|
1493
|
+
goto _again;
|
1494
|
+
tr106:
|
1495
|
+
#line 390 "ext/ragel/base_lexer.rl"
|
1496
|
+
{te = p+1;{
|
1497
|
+
callback(id_on_element_ns, data, encoding, ts, te - 1);
|
1498
|
+
}}
|
1499
|
+
goto st69;
|
1500
|
+
st69:
|
1501
|
+
#line 1 "NONE"
|
1502
|
+
{ts = 0;}
|
1503
|
+
if ( ++p == pe )
|
1504
|
+
goto _test_eof69;
|
1505
|
+
case 69:
|
1506
|
+
#line 1 "NONE"
|
1507
|
+
{ts = p;}
|
1508
|
+
#line 1509 "ext/c/lexer.c"
|
1509
|
+
if ( (*p) == 95 )
|
1510
|
+
goto st70;
|
1511
|
+
if ( (*p) < 48 ) {
|
1512
|
+
if ( 45 <= (*p) && (*p) <= 46 )
|
1513
|
+
goto st70;
|
1514
|
+
} else if ( (*p) > 57 ) {
|
1515
|
+
if ( (*p) > 90 ) {
|
1516
|
+
if ( 97 <= (*p) && (*p) <= 122 )
|
1517
|
+
goto st70;
|
1518
|
+
} else if ( (*p) >= 65 )
|
1519
|
+
goto st70;
|
1520
|
+
} else
|
1521
|
+
goto st70;
|
1522
|
+
goto st0;
|
1523
|
+
st70:
|
1524
|
+
if ( ++p == pe )
|
1525
|
+
goto _test_eof70;
|
1526
|
+
case 70:
|
1527
|
+
switch( (*p) ) {
|
1528
|
+
case 58: goto tr106;
|
1529
|
+
case 95: goto st70;
|
1530
|
+
}
|
1531
|
+
if ( (*p) < 48 ) {
|
1532
|
+
if ( 45 <= (*p) && (*p) <= 46 )
|
1533
|
+
goto st70;
|
1534
|
+
} else if ( (*p) > 57 ) {
|
1535
|
+
if ( (*p) > 90 ) {
|
1536
|
+
if ( 97 <= (*p) && (*p) <= 122 )
|
1537
|
+
goto st70;
|
1538
|
+
} else if ( (*p) >= 65 )
|
1539
|
+
goto st70;
|
1540
|
+
} else
|
1541
|
+
goto st70;
|
1542
|
+
goto tr105;
|
1543
|
+
tr107:
|
1544
|
+
#line 56 "ext/ragel/base_lexer.rl"
|
1545
|
+
{
|
1546
|
+
if ( (*p) == '\n' ) lines++;
|
1547
|
+
}
|
1548
|
+
#line 419 "ext/ragel/base_lexer.rl"
|
1549
|
+
{te = p+1;}
|
1550
|
+
goto st71;
|
1551
|
+
tr109:
|
1552
|
+
( state->cs) = 71;
|
1553
|
+
#line 408 "ext/ragel/base_lexer.rl"
|
1554
|
+
{te = p+1;{
|
1555
|
+
if ( lines > 0 )
|
1556
|
+
{
|
1557
|
+
advance_line(lines);
|
1558
|
+
|
1559
|
+
lines = 0;
|
1560
|
+
}
|
1561
|
+
|
1562
|
+
( state->cs) = 32;
|
1563
|
+
}}
|
1564
|
+
#line 56 "ext/ragel/base_lexer.rl"
|
1565
|
+
{
|
1566
|
+
if ( (*p) == '\n' ) lines++;
|
1567
|
+
}
|
1568
|
+
goto _again;
|
1569
|
+
tr110:
|
1570
|
+
#line 375 "ext/ragel/base_lexer.rl"
|
1571
|
+
{te = p;p--;{
|
1572
|
+
callback(id_on_element_end, data, encoding, ts, te);
|
1573
|
+
}}
|
1574
|
+
goto st71;
|
1575
|
+
tr112:
|
1576
|
+
#line 404 "ext/ragel/base_lexer.rl"
|
1577
|
+
{te = p+1;}
|
1578
|
+
goto st71;
|
1579
|
+
st71:
|
1580
|
+
#line 1 "NONE"
|
1581
|
+
{ts = 0;}
|
1582
|
+
if ( ++p == pe )
|
1583
|
+
goto _test_eof71;
|
1584
|
+
case 71:
|
1585
|
+
#line 1 "NONE"
|
1586
|
+
{ts = p;}
|
1587
|
+
#line 1588 "ext/c/lexer.c"
|
1588
|
+
switch( (*p) ) {
|
1589
|
+
case 62: goto tr109;
|
1590
|
+
case 95: goto tr108;
|
1591
|
+
}
|
1592
|
+
if ( (*p) < 48 ) {
|
1593
|
+
if ( 45 <= (*p) && (*p) <= 46 )
|
1594
|
+
goto tr108;
|
1595
|
+
} else if ( (*p) > 57 ) {
|
1596
|
+
if ( (*p) > 90 ) {
|
1597
|
+
if ( 97 <= (*p) && (*p) <= 122 )
|
1598
|
+
goto tr108;
|
1599
|
+
} else if ( (*p) >= 65 )
|
1600
|
+
goto tr108;
|
1601
|
+
} else
|
1602
|
+
goto tr108;
|
1603
|
+
goto tr107;
|
1604
|
+
tr108:
|
1605
|
+
#line 56 "ext/ragel/base_lexer.rl"
|
1606
|
+
{
|
1607
|
+
if ( (*p) == '\n' ) lines++;
|
1608
|
+
}
|
1609
|
+
goto st72;
|
1610
|
+
st72:
|
1611
|
+
if ( ++p == pe )
|
1612
|
+
goto _test_eof72;
|
1613
|
+
case 72:
|
1614
|
+
#line 1615 "ext/c/lexer.c"
|
1615
|
+
switch( (*p) ) {
|
1616
|
+
case 58: goto tr112;
|
1617
|
+
case 95: goto st72;
|
1618
|
+
}
|
1619
|
+
if ( (*p) < 48 ) {
|
1620
|
+
if ( 45 <= (*p) && (*p) <= 46 )
|
1621
|
+
goto st72;
|
1622
|
+
} else if ( (*p) > 57 ) {
|
1623
|
+
if ( (*p) > 90 ) {
|
1624
|
+
if ( 97 <= (*p) && (*p) <= 122 )
|
1625
|
+
goto st72;
|
1626
|
+
} else if ( (*p) >= 65 )
|
1627
|
+
goto st72;
|
1628
|
+
} else
|
1629
|
+
goto st72;
|
1630
|
+
goto tr110;
|
1631
|
+
tr113:
|
1632
|
+
( state->cs) = 73;
|
1633
|
+
#line 434 "ext/ragel/base_lexer.rl"
|
1634
|
+
{te = p+1;{
|
1635
|
+
p--;
|
1636
|
+
|
1637
|
+
if ( lines > 0 )
|
1638
|
+
{
|
1639
|
+
advance_line(lines);
|
1640
|
+
|
1641
|
+
lines = 0;
|
1642
|
+
}
|
1643
|
+
|
1644
|
+
if ( html_p )
|
1645
|
+
{
|
1646
|
+
( state->cs) = 75;
|
1647
|
+
}
|
1648
|
+
else
|
1649
|
+
{
|
1650
|
+
( state->cs) = 77;
|
1651
|
+
}
|
1652
|
+
}}
|
1653
|
+
goto _again;
|
1654
|
+
tr114:
|
1655
|
+
#line 56 "ext/ragel/base_lexer.rl"
|
1656
|
+
{
|
1657
|
+
if ( (*p) == '\n' ) lines++;
|
1658
|
+
}
|
1659
|
+
#line 432 "ext/ragel/base_lexer.rl"
|
1660
|
+
{te = p+1;}
|
1661
|
+
goto st73;
|
1662
|
+
tr116:
|
1663
|
+
#line 432 "ext/ragel/base_lexer.rl"
|
1664
|
+
{te = p;p--;}
|
1665
|
+
goto st73;
|
1666
|
+
st73:
|
1667
|
+
#line 1 "NONE"
|
1668
|
+
{ts = 0;}
|
1669
|
+
if ( ++p == pe )
|
1670
|
+
goto _test_eof73;
|
1671
|
+
case 73:
|
1672
|
+
#line 1 "NONE"
|
1673
|
+
{ts = p;}
|
1674
|
+
#line 1675 "ext/c/lexer.c"
|
1675
|
+
switch( (*p) ) {
|
1676
|
+
case 13: goto tr115;
|
1677
|
+
case 32: goto tr114;
|
1678
|
+
}
|
1679
|
+
if ( 9 <= (*p) && (*p) <= 10 )
|
1680
|
+
goto tr114;
|
1681
|
+
goto tr113;
|
1682
|
+
tr115:
|
1683
|
+
#line 56 "ext/ragel/base_lexer.rl"
|
1684
|
+
{
|
1685
|
+
if ( (*p) == '\n' ) lines++;
|
1686
|
+
}
|
1687
|
+
goto st74;
|
1688
|
+
st74:
|
1689
|
+
if ( ++p == pe )
|
1690
|
+
goto _test_eof74;
|
1691
|
+
case 74:
|
1692
|
+
#line 1693 "ext/c/lexer.c"
|
1693
|
+
if ( (*p) == 10 )
|
1694
|
+
goto tr114;
|
1695
|
+
goto tr116;
|
1696
|
+
tr118:
|
1697
|
+
#line 64 "ext/ragel/base_lexer.rl"
|
1698
|
+
{te = p+1;{
|
1699
|
+
p--;
|
1700
|
+
{( state->cs) = ( state->stack)[--( state->top)];goto _again;}
|
1701
|
+
}}
|
1702
|
+
goto st75;
|
1703
|
+
tr119:
|
1704
|
+
( state->cs) = 75;
|
1705
|
+
#line 457 "ext/ragel/base_lexer.rl"
|
1706
|
+
{te = p+1;{
|
1707
|
+
p--;
|
1708
|
+
( state->cs) = 77;
|
1709
|
+
}}
|
1710
|
+
goto _again;
|
1711
|
+
tr120:
|
1712
|
+
#line 1 "NONE"
|
1713
|
+
{ switch( ( state->act) ) {
|
1714
|
+
case 35:
|
1715
|
+
{{p = ((te))-1;}
|
1716
|
+
callback_simple(id_on_string_squote);
|
1717
|
+
|
1718
|
+
callback(id_on_string_body, data, encoding, ts, te);
|
1719
|
+
|
1720
|
+
callback_simple(id_on_string_squote);
|
1721
|
+
}
|
1722
|
+
break;
|
1723
|
+
case 36:
|
1724
|
+
{{p = ((te))-1;}
|
1725
|
+
p--;
|
1726
|
+
{( state->cs) = ( state->stack)[--( state->top)];goto _again;}
|
1727
|
+
}
|
1728
|
+
break;
|
1729
|
+
}
|
1730
|
+
}
|
1731
|
+
goto st75;
|
1732
|
+
st75:
|
1733
|
+
#line 1 "NONE"
|
1734
|
+
{ts = 0;}
|
1735
|
+
if ( ++p == pe )
|
1736
|
+
goto _test_eof75;
|
1737
|
+
case 75:
|
1738
|
+
#line 1 "NONE"
|
1739
|
+
{ts = p;}
|
1740
|
+
#line 1741 "ext/c/lexer.c"
|
1741
|
+
switch( (*p) ) {
|
1742
|
+
case 13: goto tr118;
|
1743
|
+
case 32: goto tr118;
|
1744
|
+
case 34: goto tr119;
|
1745
|
+
case 39: goto tr119;
|
1746
|
+
}
|
1747
|
+
if ( 9 <= (*p) && (*p) <= 10 )
|
1748
|
+
goto tr118;
|
1749
|
+
goto tr117;
|
1750
|
+
tr117:
|
1751
|
+
#line 1 "NONE"
|
1752
|
+
{te = p+1;}
|
1753
|
+
#line 64 "ext/ragel/base_lexer.rl"
|
1754
|
+
{( state->act) = 36;}
|
1755
|
+
goto st76;
|
1756
|
+
tr121:
|
1757
|
+
#line 1 "NONE"
|
1758
|
+
{te = p+1;}
|
1759
|
+
#line 464 "ext/ragel/base_lexer.rl"
|
1760
|
+
{( state->act) = 35;}
|
1761
|
+
goto st76;
|
1762
|
+
st76:
|
1763
|
+
if ( ++p == pe )
|
1764
|
+
goto _test_eof76;
|
1765
|
+
case 76:
|
1766
|
+
#line 1767 "ext/c/lexer.c"
|
1767
|
+
switch( (*p) ) {
|
1768
|
+
case 13: goto tr120;
|
1769
|
+
case 32: goto tr120;
|
1770
|
+
case 96: goto tr120;
|
1771
|
+
}
|
1772
|
+
if ( (*p) > 10 ) {
|
1773
|
+
if ( 60 <= (*p) && (*p) <= 62 )
|
1774
|
+
goto tr120;
|
1775
|
+
} else if ( (*p) >= 9 )
|
1776
|
+
goto tr120;
|
1777
|
+
goto tr121;
|
1778
|
+
tr122:
|
1779
|
+
#line 64 "ext/ragel/base_lexer.rl"
|
1780
|
+
{te = p+1;{
|
1781
|
+
p--;
|
1782
|
+
{( state->cs) = ( state->stack)[--( state->top)];goto _again;}
|
1783
|
+
}}
|
1784
|
+
goto st77;
|
1785
|
+
tr123:
|
1786
|
+
( state->cs) = 77;
|
1787
|
+
#line 486 "ext/ragel/base_lexer.rl"
|
1788
|
+
{te = p+1;{
|
1789
|
+
callback_simple(id_on_string_dquote);
|
1790
|
+
|
1791
|
+
( state->cs) = 49;
|
1792
|
+
}}
|
1793
|
+
goto _again;
|
1794
|
+
tr124:
|
1795
|
+
( state->cs) = 77;
|
1796
|
+
#line 480 "ext/ragel/base_lexer.rl"
|
1797
|
+
{te = p+1;{
|
1798
|
+
callback_simple(id_on_string_squote);
|
1799
|
+
|
1800
|
+
( state->cs) = 47;
|
1801
|
+
}}
|
1802
|
+
goto _again;
|
1803
|
+
st77:
|
1804
|
+
#line 1 "NONE"
|
1805
|
+
{ts = 0;}
|
1806
|
+
if ( ++p == pe )
|
1807
|
+
goto _test_eof77;
|
1808
|
+
case 77:
|
1809
|
+
#line 1 "NONE"
|
1810
|
+
{ts = p;}
|
1811
|
+
#line 1812 "ext/c/lexer.c"
|
1812
|
+
switch( (*p) ) {
|
1813
|
+
case 34: goto tr123;
|
1814
|
+
case 39: goto tr124;
|
1815
|
+
}
|
1816
|
+
goto tr122;
|
1817
|
+
tr125:
|
1818
|
+
#line 538 "ext/ragel/base_lexer.rl"
|
1819
|
+
{te = p+1;}
|
1820
|
+
goto st78;
|
1821
|
+
tr126:
|
1822
|
+
#line 60 "ext/ragel/base_lexer.rl"
|
1823
|
+
{te = p+1;{
|
1824
|
+
advance_line(1);
|
1825
|
+
}}
|
1826
|
+
goto st78;
|
1827
|
+
tr130:
|
1828
|
+
#line 510 "ext/ragel/base_lexer.rl"
|
1829
|
+
{te = p+1;{
|
1830
|
+
{( state->stack)[( state->top)++] = 78; goto st73;}
|
1831
|
+
}}
|
1832
|
+
goto st78;
|
1833
|
+
tr131:
|
1834
|
+
( state->cs) = 78;
|
1835
|
+
#line 515 "ext/ragel/base_lexer.rl"
|
1836
|
+
{te = p+1;{
|
1837
|
+
callback_simple(id_on_element_open_end);
|
1838
|
+
|
1839
|
+
if ( html_script_p() )
|
1840
|
+
{
|
1841
|
+
( state->cs) = 86;
|
1842
|
+
}
|
1843
|
+
else if ( html_style_p() )
|
1844
|
+
{
|
1845
|
+
( state->cs) = 90;
|
1846
|
+
}
|
1847
|
+
else
|
1848
|
+
{
|
1849
|
+
( state->cs) = 32;
|
1850
|
+
}
|
1851
|
+
}}
|
1852
|
+
goto _again;
|
1853
|
+
tr132:
|
1854
|
+
#line 60 "ext/ragel/base_lexer.rl"
|
1855
|
+
{te = p;p--;{
|
1856
|
+
advance_line(1);
|
1857
|
+
}}
|
1858
|
+
goto st78;
|
1859
|
+
tr133:
|
1860
|
+
#line 505 "ext/ragel/base_lexer.rl"
|
1861
|
+
{te = p;p--;{
|
1862
|
+
callback(id_on_attribute, data, encoding, ts, te);
|
1863
|
+
}}
|
1864
|
+
goto st78;
|
1865
|
+
tr134:
|
1866
|
+
#line 501 "ext/ragel/base_lexer.rl"
|
1867
|
+
{te = p+1;{
|
1868
|
+
callback(id_on_attribute_ns, data, encoding, ts, te - 1);
|
1869
|
+
}}
|
1870
|
+
goto st78;
|
1871
|
+
tr135:
|
1872
|
+
#line 538 "ext/ragel/base_lexer.rl"
|
1873
|
+
{te = p;p--;}
|
1874
|
+
goto st78;
|
1875
|
+
tr136:
|
1876
|
+
( state->cs) = 78;
|
1877
|
+
#line 533 "ext/ragel/base_lexer.rl"
|
1878
|
+
{te = p+1;{
|
1879
|
+
callback_simple(id_on_element_end);
|
1880
|
+
( state->cs) = 32;
|
1881
|
+
}}
|
1882
|
+
goto _again;
|
1883
|
+
st78:
|
1884
|
+
#line 1 "NONE"
|
1885
|
+
{ts = 0;}
|
1886
|
+
if ( ++p == pe )
|
1887
|
+
goto _test_eof78;
|
1888
|
+
case 78:
|
1889
|
+
#line 1 "NONE"
|
1890
|
+
{ts = p;}
|
1891
|
+
#line 1892 "ext/c/lexer.c"
|
1892
|
+
switch( (*p) ) {
|
1893
|
+
case 10: goto tr126;
|
1894
|
+
case 13: goto st79;
|
1895
|
+
case 47: goto st81;
|
1896
|
+
case 61: goto tr130;
|
1897
|
+
case 62: goto tr131;
|
1898
|
+
case 95: goto st80;
|
1899
|
+
}
|
1900
|
+
if ( (*p) < 65 ) {
|
1901
|
+
if ( 45 <= (*p) && (*p) <= 57 )
|
1902
|
+
goto st80;
|
1903
|
+
} else if ( (*p) > 90 ) {
|
1904
|
+
if ( 97 <= (*p) && (*p) <= 122 )
|
1905
|
+
goto st80;
|
1906
|
+
} else
|
1907
|
+
goto st80;
|
1908
|
+
goto tr125;
|
1909
|
+
st79:
|
1910
|
+
if ( ++p == pe )
|
1911
|
+
goto _test_eof79;
|
1912
|
+
case 79:
|
1913
|
+
if ( (*p) == 10 )
|
1914
|
+
goto tr126;
|
1915
|
+
goto tr132;
|
1916
|
+
st80:
|
1917
|
+
if ( ++p == pe )
|
1918
|
+
goto _test_eof80;
|
1919
|
+
case 80:
|
1920
|
+
switch( (*p) ) {
|
1921
|
+
case 58: goto tr134;
|
1922
|
+
case 95: goto st80;
|
1923
|
+
}
|
1924
|
+
if ( (*p) < 48 ) {
|
1925
|
+
if ( 45 <= (*p) && (*p) <= 46 )
|
1926
|
+
goto st80;
|
1927
|
+
} else if ( (*p) > 57 ) {
|
1928
|
+
if ( (*p) > 90 ) {
|
1929
|
+
if ( 97 <= (*p) && (*p) <= 122 )
|
1930
|
+
goto st80;
|
1931
|
+
} else if ( (*p) >= 65 )
|
1932
|
+
goto st80;
|
1933
|
+
} else
|
1934
|
+
goto st80;
|
1935
|
+
goto tr133;
|
1936
|
+
st81:
|
1937
|
+
if ( ++p == pe )
|
1938
|
+
goto _test_eof81;
|
1939
|
+
case 81:
|
1940
|
+
if ( (*p) == 62 )
|
1941
|
+
goto tr136;
|
1942
|
+
goto tr135;
|
1943
|
+
tr139:
|
1944
|
+
( state->cs) = 82;
|
1945
|
+
#line 575 "ext/ragel/base_lexer.rl"
|
1946
|
+
{te = p;p--;{
|
1947
|
+
callback(id_on_text, data, encoding, ts, te);
|
1948
|
+
|
1949
|
+
if ( lines > 0 )
|
1950
|
+
{
|
1951
|
+
advance_line(lines);
|
1952
|
+
|
1953
|
+
lines = 0;
|
1954
|
+
}
|
1955
|
+
|
1956
|
+
( state->cs) = 32;
|
1957
|
+
}}
|
1958
|
+
goto _again;
|
1959
|
+
tr141:
|
1960
|
+
( state->cs) = 82;
|
1961
|
+
#line 589 "ext/ragel/base_lexer.rl"
|
1962
|
+
{te = p+1;{
|
1963
|
+
callback(id_on_text, data, encoding, ts, mark);
|
1964
|
+
|
1965
|
+
p = mark - 1;
|
1966
|
+
mark = 0;
|
1967
|
+
|
1968
|
+
if ( lines > 0 )
|
1969
|
+
{
|
1970
|
+
advance_line(lines);
|
1971
|
+
|
1972
|
+
lines = 0;
|
1973
|
+
}
|
1974
|
+
|
1975
|
+
( state->cs) = 32;
|
1976
|
+
}}
|
1977
|
+
goto _again;
|
1978
|
+
tr142:
|
1979
|
+
( state->cs) = 82;
|
1980
|
+
#line 575 "ext/ragel/base_lexer.rl"
|
1981
|
+
{te = p+1;{
|
1982
|
+
callback(id_on_text, data, encoding, ts, te);
|
1983
|
+
|
1984
|
+
if ( lines > 0 )
|
1985
|
+
{
|
1986
|
+
advance_line(lines);
|
1987
|
+
|
1988
|
+
lines = 0;
|
1989
|
+
}
|
1990
|
+
|
1991
|
+
( state->cs) = 32;
|
1992
|
+
}}
|
1993
|
+
goto _again;
|
1994
|
+
st82:
|
1995
|
+
#line 1 "NONE"
|
1996
|
+
{ts = 0;}
|
1997
|
+
if ( ++p == pe )
|
1998
|
+
goto _test_eof82;
|
1999
|
+
case 82:
|
2000
|
+
#line 1 "NONE"
|
2001
|
+
{ts = p;}
|
2002
|
+
#line 2003 "ext/c/lexer.c"
|
2003
|
+
if ( (*p) == 60 )
|
2004
|
+
goto tr138;
|
2005
|
+
goto tr137;
|
2006
|
+
tr137:
|
2007
|
+
#line 56 "ext/ragel/base_lexer.rl"
|
2008
|
+
{
|
2009
|
+
if ( (*p) == '\n' ) lines++;
|
2010
|
+
}
|
2011
|
+
goto st83;
|
2012
|
+
st83:
|
2013
|
+
if ( ++p == pe )
|
2014
|
+
goto _test_eof83;
|
2015
|
+
case 83:
|
2016
|
+
#line 2017 "ext/c/lexer.c"
|
2017
|
+
if ( (*p) == 60 )
|
2018
|
+
goto tr140;
|
2019
|
+
goto tr137;
|
2020
|
+
tr140:
|
2021
|
+
#line 56 "ext/ragel/base_lexer.rl"
|
2022
|
+
{
|
2023
|
+
if ( (*p) == '\n' ) lines++;
|
2024
|
+
}
|
2025
|
+
#line 589 "ext/ragel/base_lexer.rl"
|
2026
|
+
{ mark = p; }
|
2027
|
+
goto st84;
|
2028
|
+
st84:
|
2029
|
+
if ( ++p == pe )
|
2030
|
+
goto _test_eof84;
|
2031
|
+
case 84:
|
2032
|
+
#line 2033 "ext/c/lexer.c"
|
2033
|
+
switch( (*p) ) {
|
2034
|
+
case 33: goto tr141;
|
2035
|
+
case 60: goto tr140;
|
2036
|
+
case 63: goto tr141;
|
2037
|
+
case 95: goto tr141;
|
2038
|
+
}
|
2039
|
+
if ( (*p) < 65 ) {
|
2040
|
+
if ( 45 <= (*p) && (*p) <= 57 )
|
2041
|
+
goto tr141;
|
2042
|
+
} else if ( (*p) > 90 ) {
|
2043
|
+
if ( 97 <= (*p) && (*p) <= 122 )
|
2044
|
+
goto tr141;
|
2045
|
+
} else
|
2046
|
+
goto tr141;
|
2047
|
+
goto tr137;
|
2048
|
+
tr138:
|
2049
|
+
#line 56 "ext/ragel/base_lexer.rl"
|
2050
|
+
{
|
2051
|
+
if ( (*p) == '\n' ) lines++;
|
2052
|
+
}
|
2053
|
+
#line 589 "ext/ragel/base_lexer.rl"
|
2054
|
+
{ mark = p; }
|
2055
|
+
goto st85;
|
2056
|
+
st85:
|
2057
|
+
if ( ++p == pe )
|
2058
|
+
goto _test_eof85;
|
2059
|
+
case 85:
|
2060
|
+
#line 2061 "ext/c/lexer.c"
|
2061
|
+
switch( (*p) ) {
|
2062
|
+
case 33: goto tr142;
|
2063
|
+
case 60: goto tr140;
|
2064
|
+
case 63: goto tr142;
|
2065
|
+
case 95: goto tr142;
|
2066
|
+
}
|
2067
|
+
if ( (*p) < 65 ) {
|
2068
|
+
if ( 45 <= (*p) && (*p) <= 57 )
|
2069
|
+
goto tr142;
|
2070
|
+
} else if ( (*p) > 90 ) {
|
2071
|
+
if ( 97 <= (*p) && (*p) <= 122 )
|
2072
|
+
goto tr142;
|
2073
|
+
} else
|
2074
|
+
goto tr142;
|
2075
|
+
goto tr137;
|
2076
|
+
tr24:
|
2077
|
+
#line 563 "ext/ragel/base_lexer.rl"
|
2078
|
+
{{p = ((te))-1;}{
|
2079
|
+
callback(id_on_text, data, encoding, ts, te);
|
2080
|
+
|
2081
|
+
if ( lines > 0 )
|
2082
|
+
{
|
2083
|
+
advance_line(lines);
|
2084
|
+
|
2085
|
+
lines = 0;
|
2086
|
+
}
|
2087
|
+
}}
|
2088
|
+
goto st86;
|
2089
|
+
tr31:
|
2090
|
+
( state->cs) = 86;
|
2091
|
+
#line 379 "ext/ragel/base_lexer.rl"
|
2092
|
+
{te = p+1;{
|
2093
|
+
callback_simple(id_on_element_end);
|
2094
|
+
|
2095
|
+
( state->cs) = 32;
|
2096
|
+
}}
|
2097
|
+
goto _again;
|
2098
|
+
tr145:
|
2099
|
+
#line 563 "ext/ragel/base_lexer.rl"
|
2100
|
+
{te = p;p--;{
|
2101
|
+
callback(id_on_text, data, encoding, ts, te);
|
2102
|
+
|
2103
|
+
if ( lines > 0 )
|
2104
|
+
{
|
2105
|
+
advance_line(lines);
|
2106
|
+
|
2107
|
+
lines = 0;
|
2108
|
+
}
|
2109
|
+
}}
|
2110
|
+
goto st86;
|
2111
|
+
st86:
|
2112
|
+
#line 1 "NONE"
|
2113
|
+
{ts = 0;}
|
2114
|
+
if ( ++p == pe )
|
2115
|
+
goto _test_eof86;
|
2116
|
+
case 86:
|
2117
|
+
#line 1 "NONE"
|
2118
|
+
{ts = p;}
|
2119
|
+
#line 2120 "ext/c/lexer.c"
|
2120
|
+
if ( (*p) == 60 )
|
2121
|
+
goto tr144;
|
2122
|
+
goto tr143;
|
2123
|
+
tr143:
|
2124
|
+
#line 56 "ext/ragel/base_lexer.rl"
|
2125
|
+
{
|
2126
|
+
if ( (*p) == '\n' ) lines++;
|
2127
|
+
}
|
2128
|
+
goto st87;
|
2129
|
+
st87:
|
2130
|
+
if ( ++p == pe )
|
2131
|
+
goto _test_eof87;
|
2132
|
+
case 87:
|
2133
|
+
#line 2134 "ext/c/lexer.c"
|
2134
|
+
if ( (*p) == 60 )
|
2135
|
+
goto tr145;
|
2136
|
+
goto tr143;
|
2137
|
+
tr144:
|
2138
|
+
#line 1 "NONE"
|
2139
|
+
{te = p+1;}
|
2140
|
+
#line 56 "ext/ragel/base_lexer.rl"
|
2141
|
+
{
|
2142
|
+
if ( (*p) == '\n' ) lines++;
|
2143
|
+
}
|
2144
|
+
goto st88;
|
2145
|
+
st88:
|
2146
|
+
if ( ++p == pe )
|
2147
|
+
goto _test_eof88;
|
2148
|
+
case 88:
|
2149
|
+
#line 2150 "ext/c/lexer.c"
|
2150
|
+
switch( (*p) ) {
|
2151
|
+
case 47: goto st19;
|
2152
|
+
case 60: goto tr147;
|
2153
|
+
}
|
2154
|
+
goto tr145;
|
2155
|
+
st19:
|
2156
|
+
if ( ++p == pe )
|
2157
|
+
goto _test_eof19;
|
2158
|
+
case 19:
|
2159
|
+
if ( (*p) == 115 )
|
2160
|
+
goto st20;
|
2161
|
+
goto tr24;
|
2162
|
+
st20:
|
2163
|
+
if ( ++p == pe )
|
2164
|
+
goto _test_eof20;
|
2165
|
+
case 20:
|
2166
|
+
if ( (*p) == 99 )
|
2167
|
+
goto st21;
|
2168
|
+
goto tr24;
|
2169
|
+
st21:
|
2170
|
+
if ( ++p == pe )
|
2171
|
+
goto _test_eof21;
|
2172
|
+
case 21:
|
2173
|
+
if ( (*p) == 114 )
|
2174
|
+
goto st22;
|
2175
|
+
goto tr24;
|
2176
|
+
st22:
|
2177
|
+
if ( ++p == pe )
|
2178
|
+
goto _test_eof22;
|
2179
|
+
case 22:
|
2180
|
+
if ( (*p) == 105 )
|
2181
|
+
goto st23;
|
2182
|
+
goto tr24;
|
2183
|
+
st23:
|
2184
|
+
if ( ++p == pe )
|
2185
|
+
goto _test_eof23;
|
2186
|
+
case 23:
|
2187
|
+
if ( (*p) == 112 )
|
2188
|
+
goto st24;
|
2189
|
+
goto tr24;
|
2190
|
+
st24:
|
2191
|
+
if ( ++p == pe )
|
2192
|
+
goto _test_eof24;
|
2193
|
+
case 24:
|
2194
|
+
if ( (*p) == 116 )
|
2195
|
+
goto st25;
|
2196
|
+
goto tr24;
|
2197
|
+
st25:
|
2198
|
+
if ( ++p == pe )
|
2199
|
+
goto _test_eof25;
|
2200
|
+
case 25:
|
2201
|
+
if ( (*p) == 62 )
|
2202
|
+
goto tr31;
|
2203
|
+
goto tr24;
|
2204
|
+
tr147:
|
2205
|
+
#line 56 "ext/ragel/base_lexer.rl"
|
2206
|
+
{
|
2207
|
+
if ( (*p) == '\n' ) lines++;
|
2208
|
+
}
|
2209
|
+
goto st89;
|
2210
|
+
st89:
|
2211
|
+
if ( ++p == pe )
|
2212
|
+
goto _test_eof89;
|
2213
|
+
case 89:
|
2214
|
+
#line 2215 "ext/c/lexer.c"
|
2215
|
+
if ( (*p) == 60 )
|
2216
|
+
goto tr147;
|
2217
|
+
goto tr145;
|
2218
|
+
tr32:
|
2219
|
+
#line 563 "ext/ragel/base_lexer.rl"
|
2220
|
+
{{p = ((te))-1;}{
|
2221
|
+
callback(id_on_text, data, encoding, ts, te);
|
2222
|
+
|
2223
|
+
if ( lines > 0 )
|
2224
|
+
{
|
2225
|
+
advance_line(lines);
|
2226
|
+
|
2227
|
+
lines = 0;
|
2228
|
+
}
|
2229
|
+
}}
|
2230
|
+
goto st90;
|
2231
|
+
tr38:
|
2232
|
+
( state->cs) = 90;
|
2233
|
+
#line 379 "ext/ragel/base_lexer.rl"
|
2234
|
+
{te = p+1;{
|
2235
|
+
callback_simple(id_on_element_end);
|
2236
|
+
|
2237
|
+
( state->cs) = 32;
|
2238
|
+
}}
|
2239
|
+
goto _again;
|
2240
|
+
tr150:
|
2241
|
+
#line 563 "ext/ragel/base_lexer.rl"
|
2242
|
+
{te = p;p--;{
|
2243
|
+
callback(id_on_text, data, encoding, ts, te);
|
2244
|
+
|
2245
|
+
if ( lines > 0 )
|
2246
|
+
{
|
2247
|
+
advance_line(lines);
|
2248
|
+
|
2249
|
+
lines = 0;
|
2250
|
+
}
|
2251
|
+
}}
|
2252
|
+
goto st90;
|
2253
|
+
st90:
|
2254
|
+
#line 1 "NONE"
|
2255
|
+
{ts = 0;}
|
2256
|
+
if ( ++p == pe )
|
2257
|
+
goto _test_eof90;
|
2258
|
+
case 90:
|
2259
|
+
#line 1 "NONE"
|
2260
|
+
{ts = p;}
|
2261
|
+
#line 2262 "ext/c/lexer.c"
|
2262
|
+
if ( (*p) == 60 )
|
2263
|
+
goto tr149;
|
2264
|
+
goto tr148;
|
2265
|
+
tr148:
|
2266
|
+
#line 56 "ext/ragel/base_lexer.rl"
|
2267
|
+
{
|
2268
|
+
if ( (*p) == '\n' ) lines++;
|
2269
|
+
}
|
2270
|
+
goto st91;
|
2271
|
+
st91:
|
2272
|
+
if ( ++p == pe )
|
2273
|
+
goto _test_eof91;
|
2274
|
+
case 91:
|
2275
|
+
#line 2276 "ext/c/lexer.c"
|
2276
|
+
if ( (*p) == 60 )
|
2277
|
+
goto tr150;
|
2278
|
+
goto tr148;
|
2279
|
+
tr149:
|
2280
|
+
#line 1 "NONE"
|
2281
|
+
{te = p+1;}
|
2282
|
+
#line 56 "ext/ragel/base_lexer.rl"
|
2283
|
+
{
|
2284
|
+
if ( (*p) == '\n' ) lines++;
|
2285
|
+
}
|
2286
|
+
goto st92;
|
2287
|
+
st92:
|
2288
|
+
if ( ++p == pe )
|
2289
|
+
goto _test_eof92;
|
2290
|
+
case 92:
|
2291
|
+
#line 2292 "ext/c/lexer.c"
|
2292
|
+
switch( (*p) ) {
|
2293
|
+
case 47: goto st26;
|
2294
|
+
case 60: goto tr152;
|
2295
|
+
}
|
2296
|
+
goto tr150;
|
2297
|
+
st26:
|
2298
|
+
if ( ++p == pe )
|
2299
|
+
goto _test_eof26;
|
2300
|
+
case 26:
|
2301
|
+
if ( (*p) == 115 )
|
2302
|
+
goto st27;
|
2303
|
+
goto tr32;
|
2304
|
+
st27:
|
2305
|
+
if ( ++p == pe )
|
2306
|
+
goto _test_eof27;
|
2307
|
+
case 27:
|
2308
|
+
if ( (*p) == 116 )
|
2309
|
+
goto st28;
|
2310
|
+
goto tr32;
|
2311
|
+
st28:
|
2312
|
+
if ( ++p == pe )
|
2313
|
+
goto _test_eof28;
|
2314
|
+
case 28:
|
2315
|
+
if ( (*p) == 121 )
|
2316
|
+
goto st29;
|
2317
|
+
goto tr32;
|
2318
|
+
st29:
|
2319
|
+
if ( ++p == pe )
|
2320
|
+
goto _test_eof29;
|
2321
|
+
case 29:
|
2322
|
+
if ( (*p) == 108 )
|
2323
|
+
goto st30;
|
2324
|
+
goto tr32;
|
2325
|
+
st30:
|
2326
|
+
if ( ++p == pe )
|
2327
|
+
goto _test_eof30;
|
2328
|
+
case 30:
|
2329
|
+
if ( (*p) == 101 )
|
2330
|
+
goto st31;
|
2331
|
+
goto tr32;
|
2332
|
+
st31:
|
2333
|
+
if ( ++p == pe )
|
2334
|
+
goto _test_eof31;
|
2335
|
+
case 31:
|
2336
|
+
if ( (*p) == 62 )
|
2337
|
+
goto tr38;
|
2338
|
+
goto tr32;
|
2339
|
+
tr152:
|
2340
|
+
#line 56 "ext/ragel/base_lexer.rl"
|
2341
|
+
{
|
2342
|
+
if ( (*p) == '\n' ) lines++;
|
2343
|
+
}
|
2344
|
+
goto st93;
|
2345
|
+
st93:
|
2346
|
+
if ( ++p == pe )
|
2347
|
+
goto _test_eof93;
|
2348
|
+
case 93:
|
2349
|
+
#line 2350 "ext/c/lexer.c"
|
2350
|
+
if ( (*p) == 60 )
|
2351
|
+
goto tr152;
|
2352
|
+
goto tr150;
|
2353
|
+
}
|
2354
|
+
_test_eof32: ( state->cs) = 32; goto _test_eof;
|
2355
|
+
_test_eof33: ( state->cs) = 33; goto _test_eof;
|
2356
|
+
_test_eof1: ( state->cs) = 1; goto _test_eof;
|
2357
|
+
_test_eof2: ( state->cs) = 2; goto _test_eof;
|
2358
|
+
_test_eof3: ( state->cs) = 3; goto _test_eof;
|
2359
|
+
_test_eof4: ( state->cs) = 4; goto _test_eof;
|
2360
|
+
_test_eof5: ( state->cs) = 5; goto _test_eof;
|
2361
|
+
_test_eof6: ( state->cs) = 6; goto _test_eof;
|
2362
|
+
_test_eof7: ( state->cs) = 7; goto _test_eof;
|
2363
|
+
_test_eof8: ( state->cs) = 8; goto _test_eof;
|
2364
|
+
_test_eof9: ( state->cs) = 9; goto _test_eof;
|
2365
|
+
_test_eof34: ( state->cs) = 34; goto _test_eof;
|
2366
|
+
_test_eof10: ( state->cs) = 10; goto _test_eof;
|
2367
|
+
_test_eof11: ( state->cs) = 11; goto _test_eof;
|
2368
|
+
_test_eof12: ( state->cs) = 12; goto _test_eof;
|
2369
|
+
_test_eof13: ( state->cs) = 13; goto _test_eof;
|
2370
|
+
_test_eof14: ( state->cs) = 14; goto _test_eof;
|
2371
|
+
_test_eof15: ( state->cs) = 15; goto _test_eof;
|
2372
|
+
_test_eof16: ( state->cs) = 16; goto _test_eof;
|
2373
|
+
_test_eof35: ( state->cs) = 35; goto _test_eof;
|
2374
|
+
_test_eof36: ( state->cs) = 36; goto _test_eof;
|
2375
|
+
_test_eof37: ( state->cs) = 37; goto _test_eof;
|
2376
|
+
_test_eof38: ( state->cs) = 38; goto _test_eof;
|
2377
|
+
_test_eof39: ( state->cs) = 39; goto _test_eof;
|
2378
|
+
_test_eof40: ( state->cs) = 40; goto _test_eof;
|
2379
|
+
_test_eof17: ( state->cs) = 17; goto _test_eof;
|
2380
|
+
_test_eof41: ( state->cs) = 41; goto _test_eof;
|
2381
|
+
_test_eof42: ( state->cs) = 42; goto _test_eof;
|
2382
|
+
_test_eof43: ( state->cs) = 43; goto _test_eof;
|
2383
|
+
_test_eof18: ( state->cs) = 18; goto _test_eof;
|
2384
|
+
_test_eof44: ( state->cs) = 44; goto _test_eof;
|
2385
|
+
_test_eof45: ( state->cs) = 45; goto _test_eof;
|
2386
|
+
_test_eof46: ( state->cs) = 46; goto _test_eof;
|
2387
|
+
_test_eof47: ( state->cs) = 47; goto _test_eof;
|
2388
|
+
_test_eof48: ( state->cs) = 48; goto _test_eof;
|
2389
|
+
_test_eof49: ( state->cs) = 49; goto _test_eof;
|
2390
|
+
_test_eof50: ( state->cs) = 50; goto _test_eof;
|
2391
|
+
_test_eof51: ( state->cs) = 51; goto _test_eof;
|
2392
|
+
_test_eof52: ( state->cs) = 52; goto _test_eof;
|
2393
|
+
_test_eof53: ( state->cs) = 53; goto _test_eof;
|
2394
|
+
_test_eof54: ( state->cs) = 54; goto _test_eof;
|
2395
|
+
_test_eof55: ( state->cs) = 55; goto _test_eof;
|
2396
|
+
_test_eof56: ( state->cs) = 56; goto _test_eof;
|
2397
|
+
_test_eof57: ( state->cs) = 57; goto _test_eof;
|
2398
|
+
_test_eof58: ( state->cs) = 58; goto _test_eof;
|
2399
|
+
_test_eof59: ( state->cs) = 59; goto _test_eof;
|
2400
|
+
_test_eof60: ( state->cs) = 60; goto _test_eof;
|
2401
|
+
_test_eof61: ( state->cs) = 61; goto _test_eof;
|
2402
|
+
_test_eof62: ( state->cs) = 62; goto _test_eof;
|
2403
|
+
_test_eof63: ( state->cs) = 63; goto _test_eof;
|
2404
|
+
_test_eof64: ( state->cs) = 64; goto _test_eof;
|
2405
|
+
_test_eof65: ( state->cs) = 65; goto _test_eof;
|
2406
|
+
_test_eof66: ( state->cs) = 66; goto _test_eof;
|
2407
|
+
_test_eof67: ( state->cs) = 67; goto _test_eof;
|
2408
|
+
_test_eof68: ( state->cs) = 68; goto _test_eof;
|
2409
|
+
_test_eof69: ( state->cs) = 69; goto _test_eof;
|
2410
|
+
_test_eof70: ( state->cs) = 70; goto _test_eof;
|
2411
|
+
_test_eof71: ( state->cs) = 71; goto _test_eof;
|
2412
|
+
_test_eof72: ( state->cs) = 72; goto _test_eof;
|
2413
|
+
_test_eof73: ( state->cs) = 73; goto _test_eof;
|
2414
|
+
_test_eof74: ( state->cs) = 74; goto _test_eof;
|
2415
|
+
_test_eof75: ( state->cs) = 75; goto _test_eof;
|
2416
|
+
_test_eof76: ( state->cs) = 76; goto _test_eof;
|
2417
|
+
_test_eof77: ( state->cs) = 77; goto _test_eof;
|
2418
|
+
_test_eof78: ( state->cs) = 78; goto _test_eof;
|
2419
|
+
_test_eof79: ( state->cs) = 79; goto _test_eof;
|
2420
|
+
_test_eof80: ( state->cs) = 80; goto _test_eof;
|
2421
|
+
_test_eof81: ( state->cs) = 81; goto _test_eof;
|
2422
|
+
_test_eof82: ( state->cs) = 82; goto _test_eof;
|
2423
|
+
_test_eof83: ( state->cs) = 83; goto _test_eof;
|
2424
|
+
_test_eof84: ( state->cs) = 84; goto _test_eof;
|
2425
|
+
_test_eof85: ( state->cs) = 85; goto _test_eof;
|
2426
|
+
_test_eof86: ( state->cs) = 86; goto _test_eof;
|
2427
|
+
_test_eof87: ( state->cs) = 87; goto _test_eof;
|
2428
|
+
_test_eof88: ( state->cs) = 88; goto _test_eof;
|
2429
|
+
_test_eof19: ( state->cs) = 19; goto _test_eof;
|
2430
|
+
_test_eof20: ( state->cs) = 20; goto _test_eof;
|
2431
|
+
_test_eof21: ( state->cs) = 21; goto _test_eof;
|
2432
|
+
_test_eof22: ( state->cs) = 22; goto _test_eof;
|
2433
|
+
_test_eof23: ( state->cs) = 23; goto _test_eof;
|
2434
|
+
_test_eof24: ( state->cs) = 24; goto _test_eof;
|
2435
|
+
_test_eof25: ( state->cs) = 25; goto _test_eof;
|
2436
|
+
_test_eof89: ( state->cs) = 89; goto _test_eof;
|
2437
|
+
_test_eof90: ( state->cs) = 90; goto _test_eof;
|
2438
|
+
_test_eof91: ( state->cs) = 91; goto _test_eof;
|
2439
|
+
_test_eof92: ( state->cs) = 92; goto _test_eof;
|
2440
|
+
_test_eof26: ( state->cs) = 26; goto _test_eof;
|
2441
|
+
_test_eof27: ( state->cs) = 27; goto _test_eof;
|
2442
|
+
_test_eof28: ( state->cs) = 28; goto _test_eof;
|
2443
|
+
_test_eof29: ( state->cs) = 29; goto _test_eof;
|
2444
|
+
_test_eof30: ( state->cs) = 30; goto _test_eof;
|
2445
|
+
_test_eof31: ( state->cs) = 31; goto _test_eof;
|
2446
|
+
_test_eof93: ( state->cs) = 93; goto _test_eof;
|
2447
|
+
|
2448
|
+
_test_eof: {}
|
2449
|
+
if ( p == eof )
|
2450
|
+
{
|
2451
|
+
switch ( ( state->cs) ) {
|
2452
|
+
case 33: goto tr41;
|
2453
|
+
case 1: goto tr0;
|
2454
|
+
case 2: goto tr0;
|
2455
|
+
case 3: goto tr0;
|
2456
|
+
case 4: goto tr0;
|
2457
|
+
case 5: goto tr0;
|
2458
|
+
case 6: goto tr0;
|
2459
|
+
case 7: goto tr0;
|
2460
|
+
case 8: goto tr0;
|
2461
|
+
case 9: goto tr0;
|
2462
|
+
case 34: goto tr46;
|
2463
|
+
case 10: goto tr0;
|
2464
|
+
case 11: goto tr0;
|
2465
|
+
case 12: goto tr0;
|
2466
|
+
case 13: goto tr0;
|
2467
|
+
case 14: goto tr0;
|
2468
|
+
case 15: goto tr0;
|
2469
|
+
case 16: goto tr0;
|
2470
|
+
case 35: goto tr47;
|
2471
|
+
case 36: goto tr48;
|
2472
|
+
case 37: goto tr48;
|
2473
|
+
case 39: goto tr53;
|
2474
|
+
case 40: goto tr53;
|
2475
|
+
case 17: goto tr20;
|
2476
|
+
case 42: goto tr57;
|
2477
|
+
case 43: goto tr57;
|
2478
|
+
case 18: goto tr22;
|
2479
|
+
case 45: goto tr61;
|
2480
|
+
case 46: goto tr61;
|
2481
|
+
case 48: goto tr65;
|
2482
|
+
case 50: goto tr68;
|
2483
|
+
case 52: goto tr71;
|
2484
|
+
case 54: goto tr83;
|
2485
|
+
case 55: goto tr84;
|
2486
|
+
case 56: goto tr85;
|
2487
|
+
case 57: goto tr85;
|
2488
|
+
case 58: goto tr85;
|
2489
|
+
case 59: goto tr85;
|
2490
|
+
case 60: goto tr85;
|
2491
|
+
case 61: goto tr85;
|
2492
|
+
case 62: goto tr85;
|
2493
|
+
case 63: goto tr85;
|
2494
|
+
case 64: goto tr85;
|
2495
|
+
case 65: goto tr85;
|
2496
|
+
case 67: goto tr100;
|
2497
|
+
case 68: goto tr102;
|
2498
|
+
case 70: goto tr105;
|
2499
|
+
case 72: goto tr110;
|
2500
|
+
case 74: goto tr116;
|
2501
|
+
case 76: goto tr120;
|
2502
|
+
case 79: goto tr132;
|
2503
|
+
case 80: goto tr133;
|
2504
|
+
case 81: goto tr135;
|
2505
|
+
case 83: goto tr139;
|
2506
|
+
case 84: goto tr139;
|
2507
|
+
case 85: goto tr139;
|
2508
|
+
case 87: goto tr145;
|
2509
|
+
case 88: goto tr145;
|
2510
|
+
case 19: goto tr24;
|
2511
|
+
case 20: goto tr24;
|
2512
|
+
case 21: goto tr24;
|
2513
|
+
case 22: goto tr24;
|
2514
|
+
case 23: goto tr24;
|
2515
|
+
case 24: goto tr24;
|
2516
|
+
case 25: goto tr24;
|
2517
|
+
case 89: goto tr145;
|
2518
|
+
case 91: goto tr150;
|
2519
|
+
case 92: goto tr150;
|
2520
|
+
case 26: goto tr32;
|
2521
|
+
case 27: goto tr32;
|
2522
|
+
case 28: goto tr32;
|
2523
|
+
case 29: goto tr32;
|
2524
|
+
case 30: goto tr32;
|
2525
|
+
case 31: goto tr32;
|
2526
|
+
case 93: goto tr150;
|
2527
|
+
}
|
2528
|
+
}
|
2529
|
+
|
2530
|
+
_out: {}
|
2531
|
+
}
|
2532
|
+
|
2533
|
+
#line 132 "ext/c/lexer.rl"
|
2534
|
+
|
2535
|
+
state->lines = lines;
|
2536
|
+
|
2537
|
+
return Qnil;
|
2538
|
+
}
|
2539
|
+
|
2540
|
+
/**
|
2541
|
+
* Resets the internal state of the lexer.
|
2542
|
+
*/
|
2543
|
+
VALUE oga_xml_lexer_reset(VALUE self)
|
2544
|
+
{
|
2545
|
+
OgaLexerState *state;
|
2546
|
+
|
2547
|
+
Data_Get_Struct(self, OgaLexerState, state);
|
2548
|
+
|
2549
|
+
state->act = 0;
|
2550
|
+
state->cs = c_lexer_start;
|
2551
|
+
state->lines = 0;
|
2552
|
+
state->top = 0;
|
2553
|
+
|
2554
|
+
return Qnil;
|
2555
|
+
}
|
2556
|
+
|
2557
|
+
/**
|
2558
|
+
* Frees the associated lexer state struct.
|
2559
|
+
*/
|
2560
|
+
void oga_xml_lexer_free(void *state)
|
2561
|
+
{
|
2562
|
+
free((OgaLexerState *) state);
|
2563
|
+
}
|
2564
|
+
|
2565
|
+
/**
|
2566
|
+
* Allocates and wraps the C lexer state struct. This state is used to keep
|
2567
|
+
* track of the current position, line numbers, etc.
|
2568
|
+
*/
|
2569
|
+
VALUE oga_xml_lexer_allocate(VALUE klass)
|
2570
|
+
{
|
2571
|
+
OgaLexerState *state = malloc(sizeof(OgaLexerState));
|
2572
|
+
|
2573
|
+
return Data_Wrap_Struct(klass, NULL, oga_xml_lexer_free, state);
|
2574
|
+
}
|
2575
|
+
|
2576
|
+
|
2577
|
+
#line 181 "ext/c/lexer.rl"
|
2578
|
+
|
2579
|
+
|
2580
|
+
void Init_liboga_xml_lexer()
|
2581
|
+
{
|
2582
|
+
VALUE mOga = rb_const_get(rb_cObject, rb_intern("Oga"));
|
2583
|
+
VALUE mXML = rb_const_get(mOga, rb_intern("XML"));
|
2584
|
+
VALUE cLexer = rb_define_class_under(mXML, "Lexer", rb_cObject);
|
2585
|
+
|
2586
|
+
id_advance_line = rb_intern("advance_line");
|
2587
|
+
id_html_script_p = rb_intern("html_script?");
|
2588
|
+
id_html_style_p = rb_intern("html_style?");
|
2589
|
+
id_html_p = rb_intern("html?");
|
2590
|
+
|
2591
|
+
rb_define_method(cLexer, "advance_native", oga_xml_lexer_advance, 1);
|
2592
|
+
rb_define_method(cLexer, "reset_native", oga_xml_lexer_reset, 0);
|
2593
|
+
|
2594
|
+
rb_define_alloc_func(cLexer, oga_xml_lexer_allocate);
|
2595
|
+
}
|