Learn R Programming

xegaDerivationTrees (version 1.0.0.6)

rndsubk: Transforms a non-terminal symbol into a 1-level derivation tree for a given k.

Description

rndsubk() expands a non-terminal by a derivation specified by k and returns a 1-level derivation tree.

Usage

rndsubk(sym, k, PT)

Value

1-level derivation tree.

Arguments

sym

Non-terminal symbol.

k

Codon (An integer).

PT

Production table.

See Also

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

Examples

Run this code
g<-compileBNF(booleanGrammar())
rndsubk(g$Start, 207, g$PT)

Run the code above in your browser using DataLab