proxy.golang.org : github.com/rwxrob/rat
Package rat implements a PEG packrat parser that takes advantage of Go's unique ability to switch on type to create an interpreted meta-language consisting entirely of Go types. These types serve as tokens that any lexer would create when lexing a higher level meta language such as PEG, PEGN, or regular expressions. Passing these types to rat.Pack compiles (memoizes) them into a grammar of parsing functions not unlike compilation of regular expressions. The string representations of these structs consists of entirely of valid, compilable Go code suitable for parser code generation for parsers of any type, in any language. Simply printing a Grammar instance to a file is suitable to generate such a parser. Prefer Pack over Make* Although the individual Make* methods for each of the supported types have been exported publicly allowing developers to call them directly from within their own Rule implementations, most should use Pack instead. Consider it the equivalent of compiling a regular expression.
Registry
-
Source
- Documentation
- JSON
purl: pkg:golang/github.com/rwxrob/rat
Keywords:
abnf
, ebnf
, go
, golang
, grammar
, language
, packrat
, parser
, peg
, pegn
License: Apache-2.0
Latest release: over 2 years ago
First release: over 2 years ago
Namespace: github.com/rwxrob
Stars: 3 on GitHub
Forks: 0 on GitHub
See more repository details: repos.ecosyste.ms
Last synced: 4 days ago