substituteSymbol {xegaDerivationTrees}R 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: generateDerivationTree(), randomDerivationTree(), rndsubk(), rndsub()

Examples

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


[Package xegaDerivationTrees version 1.0.0.0 Index]