https://github.com/begriffs/multiparse
Drafts for my parsing article
https://github.com/begriffs/multiparse
Last synced: 15 days ago
JSON representation
Drafts for my parsing article
- Host: GitHub
- URL: https://github.com/begriffs/multiparse
- Owner: begriffs
- Created: 2020-11-07T18:41:57.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-07-18T17:45:08.000Z (over 4 years ago)
- Last Synced: 2025-01-10T17:50:12.541Z (about 1 year ago)
- Language: Yacc
- Homepage: https://begriffs.com/posts/2021-11-28-practical-parsing.html
- Size: 2.8 MB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Multiparse
This is an experiment to see how to include multiple reentrant (pure) parsers
and lexers into the same static library. That way a program could parse both,
say, a network protocol and a configuration file.
Lex and Yacc are traditionally designed to output standalone programs, so this
project uses Flex and Bison extensions.
### Notes
To create the rules in morse.y from a dictionary of words, use this:
```sh
awk '{ word=$1; gsub(/./, "& ", word); printf("%s { $$ = \"%s\"; } %%merge \n", word, $1) }'
```