inspect_rule: Inspects a given rule contained within a parser

Description Usage Arguments Value Examples

View source: R/inspect.R

Description

This is used to see what a comprises a given rule.

Usage

1
inspect_rule(peg, rule.id)

Arguments

parser,

a peg parser

rule_id,

a rule idenitifier, a.k.a. rule name

Value

ruleStruct, a container which when printed will produce a a summary of that rule

Examples

1
2
3
4
5
peg<-new.parser()
peg<-add_rule(peg, "DOG<-'fido' / 'spot' / 'rover'/ 'buddy'")
peg<-set_action(peg, "DOG", "list('bark')")
peg<-set_description(peg, "DOG", "sound of dog")
inspect_rule(peg, "DOG")

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