Learn R Programming

xegaDerivationTrees (version 1.0.0.6)

substituteSymbol: Codes the substitution of a non-terminal symbol by the symbols derived by a production rule as a nested list.

Description

substituteSymbol() generates a nested list with the non-terminal symbol as the root (first list element) and the derived symbols as the second list element.

Usage

substituteSymbol(rindex, PT)

Value

2-element list.

Arguments

rindex

Rule index.

PT

Production table.

See Also

Other Generate Derivation Tree: generateCDT(), generateDerivationTree(), randomDerivationTree(), rndsub(), rndsubk()

Examples

Run this code
g<-compileBNF(booleanGrammar())
substituteSymbol(3, g$PT)

Run the code above in your browser using DataLab