diff options
author | Ben Smith <binjimin@gmail.com> | 2017-08-15 14:36:20 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-15 14:36:20 -0700 |
commit | 3d3920f6d9388c46af6725dabb34d98752958d8d (patch) | |
tree | cf77acb6d4140b2fb791f91d4af38d59ad8f66a3 /Makefile | |
parent | 68e8642fea319253466bb3bddece75306f808a69 (diff) | |
download | wabt-3d3920f6d9388c46af6725dabb34d98752958d8d.tar.gz wabt-3d3920f6d9388c46af6725dabb34d98752958d8d.tar.bz2 wabt-3d3920f6d9388c46af6725dabb34d98752958d8d.zip |
Rewrite parser as recursive descent (#591)
* Remove Bison dependency
* Remove pre-generated parser files
* Rename build config from no-re2c-bison to no-re2c
* Add a simple make_unique implementation
* Move handling of module bindings into ir.cc
* Simplify lexer
- Remove lookahead, the parser handles this now
- Unify Token/LexerToken, it only contains terminal values now
- Refactor setting token type and value into one function (e.g.
LITERAL, RETURN => RETURN_LITERAL)
* New Parser
- Uses two tokens of lookahead (use Peek(0) or Peek(1))
- Consume() consumes one token of any kind
- Match(t) consumes the current token if it matches
- PeekMatch(t) returns true iff the token matches, but doesn't consume
- Basic error synchronization; plenty of room for improvement here
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 14 |
1 files changed, 5 insertions, 9 deletions
@@ -31,7 +31,7 @@ DEFAULT_SUFFIX = clang-debug COMPILERS := GCC GCC_I686 GCC_FUZZ CLANG EMSCRIPTEN BUILD_TYPES := DEBUG RELEASE SANITIZERS := ASAN MSAN LSAN UBSAN -CONFIGS := NORMAL $(SANITIZERS) COV NO_RE2C_BISON NO_TESTS +CONFIGS := NORMAL $(SANITIZERS) COV NO_RE2C NO_TESTS # directory names GCC_DIR := gcc/ @@ -46,7 +46,7 @@ ASAN_DIR := asan/ MSAN_DIR := msan/ LSAN_DIR := lsan/ UBSAN_DIR := ubsan/ -NO_RE2C_BISON_DIR := no-re2c-bison/ +NO_RE2C_DIR := no-re2c/ COV_DIR := cov/ NO_TESTS_DIR := no-tests/ @@ -65,7 +65,7 @@ MSAN_FLAG := -DUSE_MSAN=ON LSAN_FLAG := -DUSE_LSAN=ON UBSAN_FLAG := -DUSE_UBSAN=ON COV_FLAG := -DCODE_COVERAGE=ON -NO_RE2C_BISON_FLAG := -DRUN_BISON=OFF -DRUN_RE2C=OFF +NO_RE2C_FLAG := -DRUN_RE2C=OFF NO_TESTS_FLAG := -DBUILD_TESTS=OFF # make target prefixes @@ -82,7 +82,7 @@ MSAN_PREFIX := -msan LSAN_PREFIX := -lsan UBSAN_PREFIX := -ubsan COV_PREFIX := -cov -NO_RE2C_BISON_PREFIX := -no-re2c-bison +NO_RE2C_PREFIX := -no-re2c NO_TESTS_PREFIX := -no-tests ifeq ($(USE_NINJA),1) @@ -140,13 +140,9 @@ clean: .PHONY: test-everything test-everything: -.PHONY: update-bison update-re2c -update-bison: src/prebuilt/wast-parser-gen.cc +.PHONY: update-re2c update-re2c: src/prebuilt/wast-lexer-gen.cc -src/prebuilt/wast-parser-gen.cc: src/wast-parser.y - bison -o $@ $< --defines=src/prebuilt/wast-parser-gen.hh --report=state - src/prebuilt/wast-lexer-gen.cc: src/wast-lexer.cc re2c -W -Werror --no-generation-date -bc8 -o $@ $< |