-
Notifications
You must be signed in to change notification settings - Fork 1
Intent Goal
Aniruddha. A edited this page Sep 11, 2016
·
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 to 200
yangs (~32
KLOC).
A debugger and indenter included (FWIW).
Need to add rules to make that yang
s are valid (based on RFC6020
)