napg
v0.1.12
Published
Not another parser generator!
Downloads
2
Readme
NAPG - Not Another Parser Generator!
NAPG is a library for making recursive-descent parsers in TypeScript, with TypeScript. Its design goals are as follows:
- All output should be as typesafe as reasonably possible.
- No information should be lost in the output syntax tree.
- A user of this library can output whatever data structure they want.
- Parsers can have complete control over errors.
- Parsers should have support for memoization to eliminate the performance penalty of backtracking.
- Parsers should be able to function incrementally--- i.e. a change to a file shouldn't require that the entire file is re-parsed.
Due to the constraints above, NAPG is more suited toward writing compilers and tooling for programming languages, as opposed to, say, writing something to parse 10GB of JSON, or other massive amounts of data. Feature-completeness, developer experience, and expressivity are valued above performance for this project.
Okay, but how do I use it?
Here is a complete example use case for a four-function calculator.