Skip to content

Intent Goal

Aniruddha. A edited this page Sep 11, 2016 · 3 revisions

The intent

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 than ANTLR (which leans towards java!)
  • GLR is good too, but I didn't find enough documentation on bisons GLR extensions and usage
  • peg/leg was my original choice, but after a few weeks of trial, discarded it, in favor of LPeg
  • LPeg is cool ;-)

[1] I am deliberately avoiding the term parser because this is not a parser in the traditional sense. This recognizes a yang like structure (block/nesting) using LPeg, and then rules are applied to make sure that its still valid.

Present state

Can recognize/match yangs in the wild. Have run this on close to 200 yangs (~32KLOC). A debugger and indenter included (FWIW).

Next

Need to add rules to make that yangs are valid (based on RFC6020)

Clone this wiki locally