yang pegjs
this is a pegjs file for yang language, and pegjs can generate yang language parser in javascript automatically with this file.
pegjs -o yang.js yang.pegjs
check https://pegjs.org, if you are not familiar with pegjs.
the original draft is from https://github.com/for-GET/core-pegjs/blob/master/src/ietf/rfc6020-yang.pegjs.