makeProductionTable: Produces a production table.

View source: R/BNF.R

makeProductionTableR Documentation

Produces a production table.

Description

makeProductionTable() produces a production table from a specification of a BNF. Warning: No error checking implemented.

Usage

makeProductionTable(BNF, ST)

Arguments

BNF

A character string with the BNF.

ST

A symbol table.

Value

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].

Examples

a<-booleanGrammar()$BNF
ST<-makeSymbolTable(a)
makeProductionTable(a,ST)


xegaBNF documentation built on May 29, 2024, 10:23 a.m.