Grammar

This grammar is LALR(1)

Number of Rules 19

Number of Terminals 8

Number of Lr0 States9

Number of La States0

BNF

Accept ::= structures

structures ::= structure*

structure ::= table

structure ::= text

structure ::= title

7: table ::= tableTitle? start line+ end

12: line ::= ('\|' cell?)+ '[\r\n]+'

13: line ::= cell '[\r\n]+'

Terminals

start = '(\[[^\n]*[\r\n]+)?\|[=]+[\r\n]+'

cell = '[^\|\r\n]+'

end = '\|[=]+[\r\n]+'

title = '=[^\n]*[\r\n]+'

text = '[^=\.\[\|].*[\n]{2}'

tableTitle = '\.[^\n]*[\r\n]+'

States

State 1

( )

Accept->.structures

structure*->. (2)

structures Goto 2

structure* Goto 3

tableTitle Reduce 2

start Reduce 2

text Reduce 2

title Reduce 2

Eof Reduce 2

State 2

( 1 )

Accept->structures . (0)

Accept->structures . (0)

Eof Reduce 0

State 3

( 1 )

structures->structure* . (1)

structure*->structure* .structure

tableTitle?->. (9)

structures->structure* . (1)

title Sh/Rd 6

text Sh/Rd 5

tableTitle Sh/Rd 8

structure Gt/Rd 3

table Gt/Rd 4

tableTitle? Goto 4

start Reduce 9

Eof Reduce 1

State 4

( 3 )

table->tableTitle? .start line+ end

start Shift 5

State 5

( 4 )

table->tableTitle? start .line+ end

'|' Shift 7

cell Shift 8

line Gt/Rd 11

line+ Goto 6

('\|' cell?) Gt/Rd 14

('\|' cell?)+ Goto 9

State 6

( 5 )

table->tableTitle? start line+ .end

line+->line+ .line

end Sh/Rd 7

cell Shift 8

'|' Shift 7

line Gt/Rd 10

('\|' cell?)+ Goto 9

('\|' cell?) Gt/Rd 14

State 7

( 5 6 9 )

('\|' cell?)->'|' .cell?

cell?->. (17)

cell Sh/Rd 18

cell? Gt/Rd 16

'[\r\n]+' Reduce 17

'|' Reduce 17

State 8

( 5 6 )

line->cell .'[\r\n]+'

'[\r\n]+' Sh/Rd 13

State 9

( 5 6 )

line->('\|' cell?)+ .'[\r\n]+'

('\|' cell?)+->('\|' cell?)+ .('\|' cell?)

'[\r\n]+' Sh/Rd 12

'|' Shift 7

('\|' cell?) Gt/Rd 15

First Map for Nonterminals

cell? ==>> { Empty cell}

structure ==>> { tableTitle start text title}

('\|' cell?) ==>> { '\|'}

line+ ==>> { '\|' cell}

line ==>> { '\|' cell}

tableTitle? ==>> { tableTitle Empty}

table ==>> { tableTitle start}

('\|' cell?)+ ==>> { '\|'}

structure* ==>> { Empty tableTitle start text title}

structures ==>> { tableTitle start text title Empty}

Accept ==>> { tableTitle start text title Eof}

Closure for Nonterminals

cell? ==>> {}

structure ==>> { tableTitle¿ table}

('\|' cell?) ==>> {}

line+ ==>> { ?{'\|',cell¿}? ?{'\|',cell¿} line}

line ==>> { ?{'\|',cell¿} ?{'\|',cell¿}?}

tableTitle? ==>> {}

table ==>> { tableTitle¿}

('\|' cell?)+ ==>> { ?{'\|',cell¿}}

structure* ==>> {}

structures ==>> { structure?}

Accept ==>> { structure? structures}

Nullable Nonterminals

cell? ==>> true

structure ==>> false

('\|' cell?) ==>> false

line+ ==>> false

line ==>> false

tableTitle? ==>> true

table ==>> false

('\|' cell?)+ ==>> false

structure* ==>> true

structures ==>> true

Accept ==>> false