334 lines
8.9 KiB
Plaintext
334 lines
8.9 KiB
Plaintext
|
Created by PLY version 3.11 (http://www.dabeaz.com/ply)
|
||
|
|
||
|
Unused terminals:
|
||
|
|
||
|
COMMENT
|
||
|
|
||
|
Grammar
|
||
|
|
||
|
Rule 0 S' -> statement
|
||
|
Rule 1 value -> BASE16
|
||
|
Rule 2 value -> BASE10
|
||
|
Rule 3 value -> STRING
|
||
|
Rule 4 value -> ATOM
|
||
|
Rule 5 attribute -> ATOM ATTRIB value
|
||
|
Rule 6 attributes -> attributes attribute
|
||
|
Rule 7 attributes -> attribute
|
||
|
Rule 8 section -> SECTION ATOM
|
||
|
Rule 9 section -> SECTION ATOM attributes
|
||
|
Rule 10 values -> values value
|
||
|
Rule 11 values -> value
|
||
|
Rule 12 element -> ATOM values
|
||
|
Rule 13 element -> ATOM values attributes
|
||
|
Rule 14 element -> ATOM attributes
|
||
|
Rule 15 statement -> element
|
||
|
Rule 16 statement -> DEEP element
|
||
|
Rule 17 statement -> section
|
||
|
|
||
|
Terminals, with rules where they appear
|
||
|
|
||
|
ATOM : 4 5 8 9 12 13 14
|
||
|
ATTRIB : 5
|
||
|
BASE10 : 2
|
||
|
BASE16 : 1
|
||
|
COMMENT :
|
||
|
DEEP : 16
|
||
|
SECTION : 8 9
|
||
|
STRING : 3
|
||
|
error :
|
||
|
|
||
|
Nonterminals, with rules where they appear
|
||
|
|
||
|
attribute : 6 7
|
||
|
attributes : 6 9 13 14
|
||
|
element : 15 16
|
||
|
section : 17
|
||
|
statement : 0
|
||
|
value : 5 10 11
|
||
|
values : 10 12 13
|
||
|
|
||
|
Parsing method: LALR
|
||
|
|
||
|
state 0
|
||
|
|
||
|
(0) S' -> . statement
|
||
|
(15) statement -> . element
|
||
|
(16) statement -> . DEEP element
|
||
|
(17) statement -> . section
|
||
|
(12) element -> . ATOM values
|
||
|
(13) element -> . ATOM values attributes
|
||
|
(14) element -> . ATOM attributes
|
||
|
(8) section -> . SECTION ATOM
|
||
|
(9) section -> . SECTION ATOM attributes
|
||
|
|
||
|
DEEP shift and go to state 3
|
||
|
ATOM shift and go to state 5
|
||
|
SECTION shift and go to state 6
|
||
|
|
||
|
statement shift and go to state 1
|
||
|
element shift and go to state 2
|
||
|
section shift and go to state 4
|
||
|
|
||
|
state 1
|
||
|
|
||
|
(0) S' -> statement .
|
||
|
|
||
|
|
||
|
|
||
|
state 2
|
||
|
|
||
|
(15) statement -> element .
|
||
|
|
||
|
$end reduce using rule 15 (statement -> element .)
|
||
|
|
||
|
|
||
|
state 3
|
||
|
|
||
|
(16) statement -> DEEP . element
|
||
|
(12) element -> . ATOM values
|
||
|
(13) element -> . ATOM values attributes
|
||
|
(14) element -> . ATOM attributes
|
||
|
|
||
|
ATOM shift and go to state 5
|
||
|
|
||
|
element shift and go to state 7
|
||
|
|
||
|
state 4
|
||
|
|
||
|
(17) statement -> section .
|
||
|
|
||
|
$end reduce using rule 17 (statement -> section .)
|
||
|
|
||
|
|
||
|
state 5
|
||
|
|
||
|
(12) element -> ATOM . values
|
||
|
(13) element -> ATOM . values attributes
|
||
|
(14) element -> ATOM . attributes
|
||
|
(10) values -> . values value
|
||
|
(11) values -> . value
|
||
|
(6) attributes -> . attributes attribute
|
||
|
(7) attributes -> . attribute
|
||
|
(1) value -> . BASE16
|
||
|
(2) value -> . BASE10
|
||
|
(3) value -> . STRING
|
||
|
(4) value -> . ATOM
|
||
|
(5) attribute -> . ATOM ATTRIB value
|
||
|
|
||
|
BASE16 shift and go to state 13
|
||
|
BASE10 shift and go to state 14
|
||
|
STRING shift and go to state 15
|
||
|
ATOM shift and go to state 8
|
||
|
|
||
|
values shift and go to state 9
|
||
|
attributes shift and go to state 10
|
||
|
value shift and go to state 11
|
||
|
attribute shift and go to state 12
|
||
|
|
||
|
state 6
|
||
|
|
||
|
(8) section -> SECTION . ATOM
|
||
|
(9) section -> SECTION . ATOM attributes
|
||
|
|
||
|
ATOM shift and go to state 16
|
||
|
|
||
|
|
||
|
state 7
|
||
|
|
||
|
(16) statement -> DEEP element .
|
||
|
|
||
|
$end reduce using rule 16 (statement -> DEEP element .)
|
||
|
|
||
|
|
||
|
state 8
|
||
|
|
||
|
(4) value -> ATOM .
|
||
|
(5) attribute -> ATOM . ATTRIB value
|
||
|
|
||
|
BASE16 reduce using rule 4 (value -> ATOM .)
|
||
|
BASE10 reduce using rule 4 (value -> ATOM .)
|
||
|
STRING reduce using rule 4 (value -> ATOM .)
|
||
|
ATOM reduce using rule 4 (value -> ATOM .)
|
||
|
$end reduce using rule 4 (value -> ATOM .)
|
||
|
ATTRIB shift and go to state 17
|
||
|
|
||
|
|
||
|
state 9
|
||
|
|
||
|
(12) element -> ATOM values .
|
||
|
(13) element -> ATOM values . attributes
|
||
|
(10) values -> values . value
|
||
|
(6) attributes -> . attributes attribute
|
||
|
(7) attributes -> . attribute
|
||
|
(1) value -> . BASE16
|
||
|
(2) value -> . BASE10
|
||
|
(3) value -> . STRING
|
||
|
(4) value -> . ATOM
|
||
|
(5) attribute -> . ATOM ATTRIB value
|
||
|
|
||
|
$end reduce using rule 12 (element -> ATOM values .)
|
||
|
BASE16 shift and go to state 13
|
||
|
BASE10 shift and go to state 14
|
||
|
STRING shift and go to state 15
|
||
|
ATOM shift and go to state 8
|
||
|
|
||
|
attributes shift and go to state 18
|
||
|
value shift and go to state 19
|
||
|
attribute shift and go to state 12
|
||
|
|
||
|
state 10
|
||
|
|
||
|
(14) element -> ATOM attributes .
|
||
|
(6) attributes -> attributes . attribute
|
||
|
(5) attribute -> . ATOM ATTRIB value
|
||
|
|
||
|
$end reduce using rule 14 (element -> ATOM attributes .)
|
||
|
ATOM shift and go to state 20
|
||
|
|
||
|
attribute shift and go to state 21
|
||
|
|
||
|
state 11
|
||
|
|
||
|
(11) values -> value .
|
||
|
|
||
|
BASE16 reduce using rule 11 (values -> value .)
|
||
|
BASE10 reduce using rule 11 (values -> value .)
|
||
|
STRING reduce using rule 11 (values -> value .)
|
||
|
ATOM reduce using rule 11 (values -> value .)
|
||
|
$end reduce using rule 11 (values -> value .)
|
||
|
|
||
|
|
||
|
state 12
|
||
|
|
||
|
(7) attributes -> attribute .
|
||
|
|
||
|
ATOM reduce using rule 7 (attributes -> attribute .)
|
||
|
$end reduce using rule 7 (attributes -> attribute .)
|
||
|
|
||
|
|
||
|
state 13
|
||
|
|
||
|
(1) value -> BASE16 .
|
||
|
|
||
|
BASE16 reduce using rule 1 (value -> BASE16 .)
|
||
|
BASE10 reduce using rule 1 (value -> BASE16 .)
|
||
|
STRING reduce using rule 1 (value -> BASE16 .)
|
||
|
ATOM reduce using rule 1 (value -> BASE16 .)
|
||
|
$end reduce using rule 1 (value -> BASE16 .)
|
||
|
|
||
|
|
||
|
state 14
|
||
|
|
||
|
(2) value -> BASE10 .
|
||
|
|
||
|
BASE16 reduce using rule 2 (value -> BASE10 .)
|
||
|
BASE10 reduce using rule 2 (value -> BASE10 .)
|
||
|
STRING reduce using rule 2 (value -> BASE10 .)
|
||
|
ATOM reduce using rule 2 (value -> BASE10 .)
|
||
|
$end reduce using rule 2 (value -> BASE10 .)
|
||
|
|
||
|
|
||
|
state 15
|
||
|
|
||
|
(3) value -> STRING .
|
||
|
|
||
|
BASE16 reduce using rule 3 (value -> STRING .)
|
||
|
BASE10 reduce using rule 3 (value -> STRING .)
|
||
|
STRING reduce using rule 3 (value -> STRING .)
|
||
|
ATOM reduce using rule 3 (value -> STRING .)
|
||
|
$end reduce using rule 3 (value -> STRING .)
|
||
|
|
||
|
|
||
|
state 16
|
||
|
|
||
|
(8) section -> SECTION ATOM .
|
||
|
(9) section -> SECTION ATOM . attributes
|
||
|
(6) attributes -> . attributes attribute
|
||
|
(7) attributes -> . attribute
|
||
|
(5) attribute -> . ATOM ATTRIB value
|
||
|
|
||
|
$end reduce using rule 8 (section -> SECTION ATOM .)
|
||
|
ATOM shift and go to state 20
|
||
|
|
||
|
attributes shift and go to state 22
|
||
|
attribute shift and go to state 12
|
||
|
|
||
|
state 17
|
||
|
|
||
|
(5) attribute -> ATOM ATTRIB . value
|
||
|
(1) value -> . BASE16
|
||
|
(2) value -> . BASE10
|
||
|
(3) value -> . STRING
|
||
|
(4) value -> . ATOM
|
||
|
|
||
|
BASE16 shift and go to state 13
|
||
|
BASE10 shift and go to state 14
|
||
|
STRING shift and go to state 15
|
||
|
ATOM shift and go to state 23
|
||
|
|
||
|
value shift and go to state 24
|
||
|
|
||
|
state 18
|
||
|
|
||
|
(13) element -> ATOM values attributes .
|
||
|
(6) attributes -> attributes . attribute
|
||
|
(5) attribute -> . ATOM ATTRIB value
|
||
|
|
||
|
$end reduce using rule 13 (element -> ATOM values attributes .)
|
||
|
ATOM shift and go to state 20
|
||
|
|
||
|
attribute shift and go to state 21
|
||
|
|
||
|
state 19
|
||
|
|
||
|
(10) values -> values value .
|
||
|
|
||
|
BASE16 reduce using rule 10 (values -> values value .)
|
||
|
BASE10 reduce using rule 10 (values -> values value .)
|
||
|
STRING reduce using rule 10 (values -> values value .)
|
||
|
ATOM reduce using rule 10 (values -> values value .)
|
||
|
$end reduce using rule 10 (values -> values value .)
|
||
|
|
||
|
|
||
|
state 20
|
||
|
|
||
|
(5) attribute -> ATOM . ATTRIB value
|
||
|
|
||
|
ATTRIB shift and go to state 17
|
||
|
|
||
|
|
||
|
state 21
|
||
|
|
||
|
(6) attributes -> attributes attribute .
|
||
|
|
||
|
ATOM reduce using rule 6 (attributes -> attributes attribute .)
|
||
|
$end reduce using rule 6 (attributes -> attributes attribute .)
|
||
|
|
||
|
|
||
|
state 22
|
||
|
|
||
|
(9) section -> SECTION ATOM attributes .
|
||
|
(6) attributes -> attributes . attribute
|
||
|
(5) attribute -> . ATOM ATTRIB value
|
||
|
|
||
|
$end reduce using rule 9 (section -> SECTION ATOM attributes .)
|
||
|
ATOM shift and go to state 20
|
||
|
|
||
|
attribute shift and go to state 21
|
||
|
|
||
|
state 23
|
||
|
|
||
|
(4) value -> ATOM .
|
||
|
|
||
|
ATOM reduce using rule 4 (value -> ATOM .)
|
||
|
$end reduce using rule 4 (value -> ATOM .)
|
||
|
|
||
|
|
||
|
state 24
|
||
|
|
||
|
(5) attribute -> ATOM ATTRIB value .
|
||
|
|
||
|
ATOM reduce using rule 5 (attribute -> ATOM ATTRIB value .)
|
||
|
$end reduce using rule 5 (attribute -> ATOM ATTRIB value .)
|
||
|
|