| compileBNF | R Documentation |
compileBNF() produces a context-free grammar
from its specification in Backus-Naur form (BNF).
Warning: No error checking implemented.
compileBNF(g, verbose = FALSE)
g |
A character string with a BNF. |
verbose |
Boolean. TRUE: Show progress. Default: FALSE. |
A grammar consists of the symbol table ST, the production
table PT, the start symbol Start,
and the short production
table SPT. An example BNF is provided
by booleanGrammar().
The function performs the following steps:
Make the symbol table.
Make the production table.
Extract the start symbol.
Compile a short production table.
Return the grammar.
For a full documentation, see <https://CRAN.R-project.org/package=xegaBNF>
A grammar object (list) with the attributes
name (the filename of the grammar),
ST (symbol table),
PT (production table),
Start (the start symbol of the grammar),
and SPT (the short production table).
Other Grammar:
booleanGrammar()
g<-compileBNF(booleanGrammar())
g$ST
g$PT
g$Start
g$SPT
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.