generateDerivationTree {xegaDerivationTrees} | R Documentation |
Generates a derivation tree from an integer vector.
Description
generateDerivationTree()
generates a derivation tree from an integer vector.
The derivation tree may be incomplete.
Usage
generateDerivationTree(sym, kvec, complete = TRUE, G, maxdepth = 5)
Arguments
sym |
Non-terminal symbol. |
kvec |
Integer vector. |
complete |
Boolean. FALSE for incomplete derivation trees. |
G |
Grammar. |
maxdepth |
Integer. Maximal depth of the derivation tree. |
Details
generateDerivationTree()
recursively expands
non-terminals and builds a derivation tree.
Value
A named list l$tree, l$kvec, l$complete.
See Also
Other Generate Derivation Tree:
randomDerivationTree()
,
rndsubk()
,
rndsub()
,
substituteSymbol()
Examples
g<-compileBNF(booleanGrammar())
a<-sample(100, 100, replace=TRUE)
b<-generateDerivationTree(sym=g$Start, kvec=a, G=g, maxdepth=10)
decodeDT(b$tree, g$ST)
[Package xegaDerivationTrees version 1.0.0.0 Index]