tree: Print Tree

Description Usage Arguments Examples

View source: R/tree.R

Description

Prints a tree representing the result of applying a rule to a text input, when that result was obtained with the record parameter set to TRUE

Usage

1
tree(res)

Arguments

res,

a result obtained from parsing with record=TRUE

Examples

1
2
3
4
5
6
7
8
peg<-new.parser()
  peg<-add_rule(peg, "A<-'a'")
  peg<-add_rule(peg, "B<-'b'")
  peg<-add_rule(peg, "D<-'d'")
  peg<-add_rule(peg, "C<-'c'")
  peg<-add_rule(peg,"ROOT<-A B C D")
  apply_rule(peg,"ROOT","abcd", record=TRUE)->res
  tree(res)

mslegrand/pegr documentation built on May 23, 2019, 7:53 a.m.