diff options
author | Thomas Lively <7121787+tlively@users.noreply.github.com> | 2022-07-11 15:14:51 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-11 15:14:51 -0700 |
commit | 5aa2e182f12d17e8dcdd7f8e3df68616c3e61b5a (patch) | |
tree | 929a901f8f76676bb96e7bbbd4f20187227509e8 /src/wasm2js.h | |
parent | e2ce69c1d1ea634cd97599bd28fecc2a9b48e9af (diff) | |
download | binaryen-5aa2e182f12d17e8dcdd7f8e3df68616c3e61b5a.tar.gz binaryen-5aa2e182f12d17e8dcdd7f8e3df68616c3e61b5a.tar.bz2 binaryen-5aa2e182f12d17e8dcdd7f8e3df68616c3e61b5a.zip |
[Parser] Start to parse instructions (#4789)
Update gen-s-parser.py to produce a second version of its parsing code that
works with the new wat parser. The new version automatically replaces the `s`
element argument in the existing parser with the `ctx` and `in` arguments used
by the new parser, so adding new instructions will not require any additional
work in gen-s-parser.py after this change.
Also add stub `make***` functions to the new wat parser, with a few filled out,
namely `makeNop`, `makeUnreachable`, `makeConst`, and `makeRefNull`. Update the
`global` parser to parse global initializer instructions and update
wat-kitchen-sink.wast to demonstrate that the instructions are parsed correctly.
Adding new instruction classes will require adding a new `make***` function to
wat-parser.cpp in additional to wasm-s-parser.{h,cpp} after this change, but
adding a trivial failing implementation is good enough for the time being, so I
don't expect this to appreciably increase our maintenance burden in the near
term.
The infrastructure for parsing folded instructions, instructions with operands,
and control flow instructions will be implemented in future PRs.
Diffstat (limited to 'src/wasm2js.h')
0 files changed, 0 insertions, 0 deletions