Grammar

This grammar is LALR(1)

Number of Rules 9

Number of Terminals 6

Number of Lr0 States3

Number of La States0

BNF

Accept ::= quotEntityValueSub

1: quotEntityValueSub ::= quotEntityValue

2: quotEntityValue ::= quotEntityValue reference

3: quotEntityValue ::=

4: quotEntityValue ::= quotEntityValue notQuotValue

5: reference ::= entityRef

6: reference ::= charRef

7: charRef ::= charRefDecimal

8: charRef ::= charRefHex

Terminals

peReference = '%[:A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\x{10000}-\x{10FFFF}][:A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\x{10000}-\x{10FFFF}\-\.0-9\xB7\u0300-\u036F\u203F-\u2040]*;'

Eof(singleQuot) = '"'

charRefHex = '\&#x[0-9a-fA-F]+;'

notQuotValue = '[^%\&"]+'

entityRef = '\&[:A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\x{10000}-\x{10FFFF}][:A-Z_a-z\xC0-\xD6\xD8-\xF6\xF8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\x{10000}-\x{10FFFF}\-\.0-9\xB7\u0300-\u036F\u203F-\u2040]*;'

charRefDecimal = '\&#[0-9]+;'

States

State 1

( )

Accept->.quotEntityValueSub

quotEntityValue->. (3)

quotEntityValueSub Goto 2

quotEntityValue Goto 3

entityRef Reduce 3

charRefDecimal Reduce 3

charRefHex Reduce 3

notQuotValue Reduce 3

Eof Reduce 3

State 2

( 1 )

Accept->quotEntityValueSub . (0)

Accept->quotEntityValueSub . (0)

Eof Reduce 0

State 3

( 1 )

quotEntityValueSub->quotEntityValue . (1)

quotEntityValue->quotEntityValue .reference

quotEntityValue->quotEntityValue .notQuotValue

quotEntityValueSub->quotEntityValue . (1)

notQuotValue Sh/Rd 4

entityRef Sh/Rd 5

charRefHex Sh/Rd 8

charRefDecimal Sh/Rd 7

reference Gt/Rd 2

charRef Gt/Rd 6

Eof Reduce 1

First Map for Nonterminals

quotEntityValue ==>> { entityRef charRefDecimal charRefHex Empty notQuotValue}

charRef ==>> { charRefDecimal charRefHex}

quotEntityValueSub ==>> { entityRef charRefDecimal charRefHex notQuotValue Empty}

reference ==>> { entityRef charRefDecimal charRefHex}

Accept ==>> { entityRef charRefDecimal charRefHex notQuotValue Eof(singleQuot)}

Closure for Nonterminals

quotEntityValue ==>> {}

charRef ==>> {}

quotEntityValueSub ==>> { quotEntityValue}

reference ==>> { charRef}

Accept ==>> { quotEntityValue quotEntityValueSub}

Nullable Nonterminals

quotEntityValue ==>> true

charRef ==>> false

quotEntityValueSub ==>> true

reference ==>> false

Accept ==>> false