Learn R Programming

xegaDerivationTrees (version 1.0.0.6)

printDerivations: Print derivations.

Description

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

Usage

printDerivations(tree, G, verbose = FALSE)

Value

A list of derivations.

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.

Examples

Run this code

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

Run the code above in your browser using DataLab