rizin/subprojects/rizin-shell-parser/README.md
Riccardo Schirone 6f40dfe493
Move remaining things from shlr/ to meson subprojects (#2126)
* Move binrz meson directives to binrz/ dir

* Move rizin-shell-parser to a subproject

* Move bochs to a meson subproject

* Move rzqnx to meson subproject

* Move winkd to a meson subproject

* Move rzar to a meson subproject

* Move rzw32dbg_wrap to a meson subproject

* Move ptrace-wrap to a meson subproject

* Move rzgdb to a meson subproject

* Rename w32dbg_wrap to rzw32dbg_wrap

* Update CODEOWNERS

* Remove old references to shlr

* Move shlr/heap stuff in core and remove shlr/arm

* Move spp to a meson subproject

* Remove last references to shlr

* Remove use_webui option

* Move include files directives to librz/include/meson.build

* Move librz meson directives into librz/meson.build

* Handle d/ directories inside the specific module meson.build

* Move plugins listing to specific module meson.build

* Move rzheap to its own subproject

* Fix js linter and licenses

* Use meson.override_dependency for all rz_ modules
2021-12-22 09:20:39 +08:00

26 lines
1.2 KiB
Markdown

# rizin-shell-parser
This is the parser for rizin shell language.
See https://tree-sitter.github.io/tree-sitter/creating-parsers for more info on
how to create a parser with tree-sitter.
## Sources
- grammar.js: defines the basic grammar
- src/scanner.c: external scanner used to scan some tokens that cannot be parsed
with the regular js grammar, as that includes only the context-free part of
the language.
- src/parser.c: this file is auto-generated by tree-sitter based on grammar.js
- corpus/\*: list of test files used to ensure the grammar works well
## How to update grammar
When you update something in grammar.js or src/scanner.c you have to re-generate
the parser. The process works as follows:
1. Do changes as needed to grammar.js and/or src/scanner.c
2. Install npm dependencies with: `cd subprojects/rizin-shell-parser ; npm install`
3. Make sure tree-sitter is in PATH: `export PATH=$PATH:./node_modules/.bin`
4. Re-generate the parser files: `tree-sitter generate`
5. Check tests still pass: `tree-sitter test`. Use `tree-sitter parse
./example-file` if you want to see the syntax tree of a custom input provided
in `./example-file`
6. Commit auto-generated files and modified grammar.js and src/scanner.c into git.