
Grammar
rule 1    expr -> optional_conditional
rule 2    conditional -> alternative
rule 3    conditional -> alternative '?' optional_conditional ':' conditional
rule 4    optional_conditional ->		/* empty */
rule 5    optional_conditional -> conditional
rule 6    alternative -> list
rule 7    alternative -> alternative '|' list
rule 8    alternative -> alternative '&' list
rule 9    list -> substitute
rule 10   list -> list substitute
rule 11   substitute -> string
rule 12   substitute -> substitute '~' string
rule 13   string -> '@'
rule 14   string -> TOKEN_LITERAL
rule 15   string -> TOKEN_LETTER
rule 16   string -> TOKEN_LETTER number
rule 17   string -> '%' TOKEN_LETTER
rule 18   string -> '%' digits
rule 19   string -> string '.' flag TOKEN_LETTER optional_number
rule 20   string -> string '+' number
rule 21   string -> string '-' number
rule 22   string -> string '*'
rule 23   string -> '(' optional_conditional ')'
rule 24   string -> '<' optional_conditional '>'
rule 25   optional_number ->		/* empty */
rule 26   optional_number -> number
rule 27   number -> TOKEN_DIGIT
rule 28   number -> number TOKEN_DIGIT
rule 29   digits -> TOKEN_DIGIT
rule 30   digits -> digits TOKEN_DIGIT
rule 31   flag ->		/* empty */
rule 32   flag -> '+'
rule 33   flag -> '-'

Terminals, with rules where they appear

$ (-1)
'%' (37) 17 18
'&' (38) 8
'(' (40) 23
')' (41) 23
'*' (42) 22
'+' (43) 20 32
'-' (45) 21 33
'.' (46) 19
':' (58) 3
'<' (60) 24
'>' (62) 24
'?' (63) 3
'@' (64) 13
'|' (124) 7
'~' (126) 12
error (256)
TOKEN_LETTER (258) 15 16 17 19
TOKEN_LITERAL (259) 14
TOKEN_DIGIT (260) 27 28 29 30

Nonterminals, with rules where they appear

expr (21)
    on left: 1
conditional (22)
    on left: 2 3, on right: 3 5
optional_conditional (23)
    on left: 4 5, on right: 1 3 23 24
alternative (24)
    on left: 6 7 8, on right: 2 3 7 8
list (25)
    on left: 9 10, on right: 6 7 8 10
substitute (26)
    on left: 11 12, on right: 9 10 12
string (27)
    on left: 13 14 15 16 17 18 19 20 21 22 23 24, on right: 11 12 19
    20 21 22
optional_number (28)
    on left: 25 26, on right: 19
number (29)
    on left: 27 28, on right: 16 20 21 26 28
digits (30)
    on left: 29 30, on right: 18 30
flag (31)
    on left: 31 32 33, on right: 19


state 0

    TOKEN_LETTER	shift, and go to state 1
    TOKEN_LITERAL	shift, and go to state 2
    '@' 	shift, and go to state 3
    '%' 	shift, and go to state 4
    '(' 	shift, and go to state 5
    '<' 	shift, and go to state 6

    $default	reduce using rule 4 (optional_conditional)

    expr	go to state 47
    conditional	go to state 7
    optional_conditional	go to state 8
    alternative	go to state 9
    list	go to state 10
    substitute	go to state 11
    string	go to state 12



state 1

    string  ->  TOKEN_LETTER .   (rule 15)
    string  ->  TOKEN_LETTER . number   (rule 16)

    TOKEN_DIGIT	shift, and go to state 13

    $default	reduce using rule 15 (string)

    number	go to state 14



state 2

    string  ->  TOKEN_LITERAL .   (rule 14)

    $default	reduce using rule 14 (string)



state 3

    string  ->  '@' .   (rule 13)

    $default	reduce using rule 13 (string)



state 4

    string  ->  '%' . TOKEN_LETTER   (rule 17)
    string  ->  '%' . digits   (rule 18)

    TOKEN_LETTER	shift, and go to state 15
    TOKEN_DIGIT	shift, and go to state 16

    digits	go to state 17



state 5

    string  ->  '(' . optional_conditional ')'   (rule 23)

    TOKEN_LETTER	shift, and go to state 1
    TOKEN_LITERAL	shift, and go to state 2
    '@' 	shift, and go to state 3
    '%' 	shift, and go to state 4
    '(' 	shift, and go to state 5
    '<' 	shift, and go to state 6

    $default	reduce using rule 4 (optional_conditional)

    conditional	go to state 7
    optional_conditional	go to state 18
    alternative	go to state 9
    list	go to state 10
    substitute	go to state 11
    string	go to state 12



state 6

    string  ->  '<' . optional_conditional '>'   (rule 24)

    TOKEN_LETTER	shift, and go to state 1
    TOKEN_LITERAL	shift, and go to state 2
    '@' 	shift, and go to state 3
    '%' 	shift, and go to state 4
    '(' 	shift, and go to state 5
    '<' 	shift, and go to state 6

    $default	reduce using rule 4 (optional_conditional)

    conditional	go to state 7
    optional_conditional	go to state 19
    alternative	go to state 9
    list	go to state 10
    substitute	go to state 11
    string	go to state 12



state 7

    optional_conditional  ->  conditional .   (rule 5)

    $default	reduce using rule 5 (optional_conditional)



state 8

    expr  ->  optional_conditional .   (rule 1)

    $default	reduce using rule 1 (expr)



state 9

    conditional  ->  alternative .   (rule 2)
    conditional  ->  alternative . '?' optional_conditional ':' conditional   (rule 3)
    alternative  ->  alternative . '|' list   (rule 7)
    alternative  ->  alternative . '&' list   (rule 8)

    '?' 	shift, and go to state 20
    '|' 	shift, and go to state 21
    '&' 	shift, and go to state 22

    $default	reduce using rule 2 (conditional)



state 10

    alternative  ->  list .   (rule 6)
    list  ->  list . substitute   (rule 10)

    TOKEN_LETTER	shift, and go to state 1
    TOKEN_LITERAL	shift, and go to state 2
    '@' 	shift, and go to state 3
    '%' 	shift, and go to state 4
    '(' 	shift, and go to state 5
    '<' 	shift, and go to state 6

    $default	reduce using rule 6 (alternative)

    substitute	go to state 23
    string	go to state 12



state 11

    list  ->  substitute .   (rule 9)
    substitute  ->  substitute . '~' string   (rule 12)

    '~' 	shift, and go to state 24

    $default	reduce using rule 9 (list)



state 12

    substitute  ->  string .   (rule 11)
    string  ->  string . '.' flag TOKEN_LETTER optional_number   (rule 19)
    string  ->  string . '+' number   (rule 20)
    string  ->  string . '-' number   (rule 21)
    string  ->  string . '*'   (rule 22)

    '.' 	shift, and go to state 25
    '+' 	shift, and go to state 26
    '-' 	shift, and go to state 27
    '*' 	shift, and go to state 28

    $default	reduce using rule 11 (substitute)



state 13

    number  ->  TOKEN_DIGIT .   (rule 27)

    $default	reduce using rule 27 (number)



state 14

    string  ->  TOKEN_LETTER number .   (rule 16)
    number  ->  number . TOKEN_DIGIT   (rule 28)

    TOKEN_DIGIT	shift, and go to state 29

    $default	reduce using rule 16 (string)



state 15

    string  ->  '%' TOKEN_LETTER .   (rule 17)

    $default	reduce using rule 17 (string)



state 16

    digits  ->  TOKEN_DIGIT .   (rule 29)

    $default	reduce using rule 29 (digits)



state 17

    string  ->  '%' digits .   (rule 18)
    digits  ->  digits . TOKEN_DIGIT   (rule 30)

    TOKEN_DIGIT	shift, and go to state 30

    $default	reduce using rule 18 (string)



state 18

    string  ->  '(' optional_conditional . ')'   (rule 23)

    ')' 	shift, and go to state 31



state 19

    string  ->  '<' optional_conditional . '>'   (rule 24)

    '>' 	shift, and go to state 32



state 20

    conditional  ->  alternative '?' . optional_conditional ':' conditional   (rule 3)

    TOKEN_LETTER	shift, and go to state 1
    TOKEN_LITERAL	shift, and go to state 2
    '@' 	shift, and go to state 3
    '%' 	shift, and go to state 4
    '(' 	shift, and go to state 5
    '<' 	shift, and go to state 6

    $default	reduce using rule 4 (optional_conditional)

    conditional	go to state 7
    optional_conditional	go to state 33
    alternative	go to state 9
    list	go to state 10
    substitute	go to state 11
    string	go to state 12



state 21

    alternative  ->  alternative '|' . list   (rule 7)

    TOKEN_LETTER	shift, and go to state 1
    TOKEN_LITERAL	shift, and go to state 2
    '@' 	shift, and go to state 3
    '%' 	shift, and go to state 4
    '(' 	shift, and go to state 5
    '<' 	shift, and go to state 6

    list	go to state 34
    substitute	go to state 11
    string	go to state 12



state 22

    alternative  ->  alternative '&' . list   (rule 8)

    TOKEN_LETTER	shift, and go to state 1
    TOKEN_LITERAL	shift, and go to state 2
    '@' 	shift, and go to state 3
    '%' 	shift, and go to state 4
    '(' 	shift, and go to state 5
    '<' 	shift, and go to state 6

    list	go to state 35
    substitute	go to state 11
    string	go to state 12



state 23

    list  ->  list substitute .   (rule 10)
    substitute  ->  substitute . '~' string   (rule 12)

    '~' 	shift, and go to state 24

    $default	reduce using rule 10 (list)



state 24

    substitute  ->  substitute '~' . string   (rule 12)

    TOKEN_LETTER	shift, and go to state 1
    TOKEN_LITERAL	shift, and go to state 2
    '@' 	shift, and go to state 3
    '%' 	shift, and go to state 4
    '(' 	shift, and go to state 5
    '<' 	shift, and go to state 6

    string	go to state 36



state 25

    string  ->  string '.' . flag TOKEN_LETTER optional_number   (rule 19)

    '+' 	shift, and go to state 37
    '-' 	shift, and go to state 38

    $default	reduce using rule 31 (flag)

    flag	go to state 39



state 26

    string  ->  string '+' . number   (rule 20)

    TOKEN_DIGIT	shift, and go to state 13

    number	go to state 40



state 27

    string  ->  string '-' . number   (rule 21)

    TOKEN_DIGIT	shift, and go to state 13

    number	go to state 41



state 28

    string  ->  string '*' .   (rule 22)

    $default	reduce using rule 22 (string)



state 29

    number  ->  number TOKEN_DIGIT .   (rule 28)

    $default	reduce using rule 28 (number)



state 30

    digits  ->  digits TOKEN_DIGIT .   (rule 30)

    $default	reduce using rule 30 (digits)



state 31

    string  ->  '(' optional_conditional ')' .   (rule 23)

    $default	reduce using rule 23 (string)



state 32

    string  ->  '<' optional_conditional '>' .   (rule 24)

    $default	reduce using rule 24 (string)



state 33

    conditional  ->  alternative '?' optional_conditional . ':' conditional   (rule 3)

    ':' 	shift, and go to state 42



state 34

    alternative  ->  alternative '|' list .   (rule 7)
    list  ->  list . substitute   (rule 10)

    TOKEN_LETTER	shift, and go to state 1
    TOKEN_LITERAL	shift, and go to state 2
    '@' 	shift, and go to state 3
    '%' 	shift, and go to state 4
    '(' 	shift, and go to state 5
    '<' 	shift, and go to state 6

    $default	reduce using rule 7 (alternative)

    substitute	go to state 23
    string	go to state 12



state 35

    alternative  ->  alternative '&' list .   (rule 8)
    list  ->  list . substitute   (rule 10)

    TOKEN_LETTER	shift, and go to state 1
    TOKEN_LITERAL	shift, and go to state 2
    '@' 	shift, and go to state 3
    '%' 	shift, and go to state 4
    '(' 	shift, and go to state 5
    '<' 	shift, and go to state 6

    $default	reduce using rule 8 (alternative)

    substitute	go to state 23
    string	go to state 12



state 36

    substitute  ->  substitute '~' string .   (rule 12)
    string  ->  string . '.' flag TOKEN_LETTER optional_number   (rule 19)
    string  ->  string . '+' number   (rule 20)
    string  ->  string . '-' number   (rule 21)
    string  ->  string . '*'   (rule 22)

    '.' 	shift, and go to state 25
    '+' 	shift, and go to state 26
    '-' 	shift, and go to state 27
    '*' 	shift, and go to state 28

    $default	reduce using rule 12 (substitute)



state 37

    flag  ->  '+' .   (rule 32)

    $default	reduce using rule 32 (flag)



state 38

    flag  ->  '-' .   (rule 33)

    $default	reduce using rule 33 (flag)



state 39

    string  ->  string '.' flag . TOKEN_LETTER optional_number   (rule 19)

    TOKEN_LETTER	shift, and go to state 43



state 40

    string  ->  string '+' number .   (rule 20)
    number  ->  number . TOKEN_DIGIT   (rule 28)

    TOKEN_DIGIT	shift, and go to state 29

    $default	reduce using rule 20 (string)



state 41

    string  ->  string '-' number .   (rule 21)
    number  ->  number . TOKEN_DIGIT   (rule 28)

    TOKEN_DIGIT	shift, and go to state 29

    $default	reduce using rule 21 (string)



state 42

    conditional  ->  alternative '?' optional_conditional ':' . conditional   (rule 3)

    TOKEN_LETTER	shift, and go to state 1
    TOKEN_LITERAL	shift, and go to state 2
    '@' 	shift, and go to state 3
    '%' 	shift, and go to state 4
    '(' 	shift, and go to state 5
    '<' 	shift, and go to state 6

    conditional	go to state 44
    alternative	go to state 9
    list	go to state 10
    substitute	go to state 11
    string	go to state 12



state 43

    string  ->  string '.' flag TOKEN_LETTER . optional_number   (rule 19)

    TOKEN_DIGIT	shift, and go to state 13

    $default	reduce using rule 25 (optional_number)

    optional_number	go to state 45
    number	go to state 46



state 44

    conditional  ->  alternative '?' optional_conditional ':' conditional .   (rule 3)

    $default	reduce using rule 3 (conditional)



state 45

    string  ->  string '.' flag TOKEN_LETTER optional_number .   (rule 19)

    $default	reduce using rule 19 (string)



state 46

    optional_number  ->  number .   (rule 26)
    number  ->  number . TOKEN_DIGIT   (rule 28)

    TOKEN_DIGIT	shift, and go to state 29

    $default	reduce using rule 26 (optional_number)



state 47

    $   	go to state 48



state 48

    $   	go to state 49



state 49

    $default	accept
