leavesIncompleteDT {xegaDerivationTrees}R Documentation

Returns the list of symbol identifiers of the leaves of a derivation tree.

Description

For incomplete derivation trees, non-terminal symbols are leaves.

Usage

leavesIncompleteDT(tree, ST, leavesList = list())

Arguments

tree

Derivation tree.

ST

Symbol table.

leavesList

List of symbol identifiers.

Details

Must perform a depth-first left-to-right tree traversal to collect all leave symbols (terminal and non-terminal symbols).

Value

List of symbol identifiers.

See Also

Other Decoder: decodeCDT(), decodeDTsym(), decodeDT(), decodeTree()

Examples

g<-compileBNF(booleanGrammar())
a<-randomDerivationTree(g$Start, g)
leavesIncompleteDT(a, g$ST) 


[Package xegaDerivationTrees version 1.0.0.0 Index]