substituteSymbol: Codes the substitution of a non-terminal symbol by the...

View source: R/derivationTrees.R

substituteSymbolR Documentation

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)

Arguments

rindex

Rule index.

PT

Production table.

Value

2-element list.

See Also

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

Examples

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


xegaDerivationTrees documentation built on April 16, 2025, 5:11 p.m.