printDerivations {xegaDerivationTrees}R Documentation

Print derivations.

Description

A depth-first left-to-right tree traversal without recursion.

Usage

printDerivations(tree, G, verbose = FALSE)

Arguments

tree

Derivation tree.

G

The context-free grammar.

verbose

If TRUE, the list of derivations is printed. Default: FALSE.

Details

Works with complete and incomplete derivation trees.

Value

A list of derivations.

Examples


g<-compileBNF(booleanGrammar())
a<-randomDerivationTree(g$Start, g)
l<-printDerivations(a, g, verbose=TRUE) 


[Package xegaDerivationTrees version 1.0.0.6 Index]