Learn R Programming

xegaDerivationTrees (version 1.0.0.6)

leavesIncompleteDT: 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())

Value

List of symbol identifiers.

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).

See Also

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

Examples

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

Run the code above in your browser using DataLab