printDerivations: Print derivations.

View source: R/printDerivations.R

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


xegaDerivationTrees documentation built on April 16, 2025, 5:11 p.m.