makeProductionTable {xegaBNF} | R Documentation |
makeProductionTable()
produces a production table
from a specification of a BNF.
Warning: No error checking implemented.
makeProductionTable(BNF, ST)
BNF |
A character string with the BNF. |
ST |
A symbol table. |
A production table is a named list with elements
$LHS
and $RHS
:
The left-hand side LHS
of non-terminal identifiers.
The right-hand side RHS
is represented as a
vector of vectors of numerical identifiers.
The non-terminal identifier LHS[i]
derives into RHS[i]
.
a<-booleanGrammar()$BNF
ST<-makeSymbolTable(a)
makeProductionTable(a,ST)