-
Notifications
You must be signed in to change notification settings - Fork 1
Intent Goal
Aniruddha. A edited this page Jan 30, 2017
·
3 revisions
To create a simple and maintainable yang
recognizer[1] and validator
using Lua
.
- I wanted an integrated scanner and parser
- I didn't want to go with traditional
LALR(1)
-
LL(k)
is good, but I didn't find any good tool other thanANTLR
(which leans towardsjava
!) -
GLR
is good too, but I didn't find enough documentation onbison
s GLR extensions and usage -
peg/leg
was my original choice, but after a few weeks of trial, discarded it, in favor ofLPeg
-
LPeg
is cool ;-)
[1] I am deliberately avoiding the term
parser
because this is not a parser in the traditional sense. This recognizes ayang
like structure (block/nesting) usingLPeg
, and then rules are applied to make sure that its still valid.
- Can recognize/match
yang
s in the wild. Have run this on close to200
yangs (~32
KLOC). - Rules to make sure
yang
s are valid (based onRFC6020
) - Debug (dump) and indenter included (FWIW).
- _filter_s can be applied at indent+dump (can cleanup/comment-out etc)
- A basic auto-completion CLI using
linenoise
- Persist data read from CLI (Lua tables?)
- Support
augment
statements