summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/apply-names.cc2
-rw-r--r--src/binary-reader-ir.cc (renamed from src/binary-reader-ast.cc)192
-rw-r--r--src/binary-reader-ir.h (renamed from src/binary-reader-ast.h)16
-rw-r--r--src/binary-writer-spec.cc2
-rw-r--r--src/binary-writer-spec.h2
-rw-r--r--src/binary-writer.cc2
-rw-r--r--src/emscripten-exported.json16
-rw-r--r--src/emscripten-helpers.cc42
-rw-r--r--src/generate-names.cc2
-rw-r--r--src/interpreter-opcode.def2
-rw-r--r--src/ir.cc (renamed from src/ast.cc)2
-rw-r--r--src/ir.h (renamed from src/ast.h)10
-rw-r--r--src/opcode.def2
-rw-r--r--src/prebuilt/wast-lexer-gen.cc (renamed from src/prebuilt/ast-lexer-gen.cc)1086
-rw-r--r--src/prebuilt/wast-parser-gen.cc (renamed from src/prebuilt/ast-parser-gen.cc)1074
-rw-r--r--src/prebuilt/wast-parser-gen.hh (renamed from src/prebuilt/ast-parser-gen.hh)46
-rw-r--r--src/prebuilt/wast-parser-gen.output (renamed from src/prebuilt/ast-parser-gen.output)0
-rw-r--r--src/resolve-names.cc14
-rw-r--r--src/resolve-names.h6
-rw-r--r--src/tools/wasm2wast.cc12
-rw-r--r--src/tools/wast-desugar.cc14
-rw-r--r--src/tools/wast2wasm.cc10
-rw-r--r--src/validator.cc13
-rw-r--r--src/validator.h6
-rw-r--r--src/wabt.js20
-rw-r--r--src/wast-lexer.cc (renamed from src/ast-lexer.cc)112
-rw-r--r--src/wast-lexer.h (renamed from src/ast-lexer.h)26
-rw-r--r--src/wast-parser-lexer-shared.cc (renamed from src/ast-parser-lexer-shared.cc)26
-rw-r--r--src/wast-parser-lexer-shared.h (renamed from src/ast-parser-lexer-shared.h)57
-rw-r--r--src/wast-parser.h (renamed from src/ast-parser.h)10
-rw-r--r--src/wast-parser.y (renamed from src/ast-parser.y)92
-rw-r--r--src/wat-writer.cc (renamed from src/ast-writer.cc)112
-rw-r--r--src/wat-writer.h (renamed from src/ast-writer.h)8
33 files changed, 1515 insertions, 1521 deletions
diff --git a/src/apply-names.cc b/src/apply-names.cc
index e3bfc964..894ad273 100644
--- a/src/apply-names.cc
+++ b/src/apply-names.cc
@@ -21,7 +21,7 @@
#include <vector>
-#include "ast.h"
+#include "ir.h"
#define CHECK_RESULT(expr) \
do { \
diff --git a/src/binary-reader-ast.cc b/src/binary-reader-ir.cc
index 2aafc341..b39dd89b 100644
--- a/src/binary-reader-ast.cc
+++ b/src/binary-reader-ir.cc
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "binary-reader-ast.h"
+#include "binary-reader-ir.h"
#include <assert.h>
#include <inttypes.h>
@@ -24,10 +24,10 @@
#include <vector>
-#include "ast.h"
#include "binary-error-handler.h"
#include "binary-reader-nop.h"
#include "common.h"
+#include "ir.h"
#define CHECK_RESULT(expr) \
do { \
@@ -50,9 +50,9 @@ struct LabelNode {
LabelNode::LabelNode(LabelType label_type, Expr** first)
: label_type(label_type), first(first), last(nullptr) {}
-class BinaryReaderAST : public BinaryReaderNop {
+class BinaryReaderIR : public BinaryReaderNop {
public:
- BinaryReaderAST(Module* out_module, BinaryErrorHandler* error_handler);
+ BinaryReaderIR(Module* out_module, BinaryErrorHandler* error_handler);
virtual bool OnError(const char* message);
@@ -208,22 +208,22 @@ class BinaryReaderAST : public BinaryReaderNop {
Expr** current_init_expr = nullptr;
};
-BinaryReaderAST::BinaryReaderAST(Module* out_module,
+BinaryReaderIR::BinaryReaderIR(Module* out_module,
BinaryErrorHandler* error_handler)
: error_handler(error_handler), module(out_module) {}
-void WABT_PRINTF_FORMAT(2, 3) BinaryReaderAST::PrintError(const char* format,
+void WABT_PRINTF_FORMAT(2, 3) BinaryReaderIR::PrintError(const char* format,
...) {
WABT_SNPRINTF_ALLOCA(buffer, length, format);
HandleError(WABT_UNKNOWN_OFFSET, buffer);
}
-void BinaryReaderAST::PushLabel(LabelType label_type, Expr** first) {
+void BinaryReaderIR::PushLabel(LabelType label_type, Expr** first) {
max_depth++;
label_stack.emplace_back(label_type, first);
}
-Result BinaryReaderAST::PopLabel() {
+Result BinaryReaderIR::PopLabel() {
if (label_stack.size() == 0) {
PrintError("popping empty label stack");
return Result::Error;
@@ -234,7 +234,7 @@ Result BinaryReaderAST::PopLabel() {
return Result::Ok;
}
-Result BinaryReaderAST::GetLabelAt(LabelNode** label, uint32_t depth) {
+Result BinaryReaderIR::GetLabelAt(LabelNode** label, uint32_t depth) {
if (depth >= label_stack.size()) {
PrintError("accessing stack depth: %u >= max: %" PRIzd, depth,
label_stack.size());
@@ -245,11 +245,11 @@ Result BinaryReaderAST::GetLabelAt(LabelNode** label, uint32_t depth) {
return Result::Ok;
}
-Result BinaryReaderAST::TopLabel(LabelNode** label) {
+Result BinaryReaderIR::TopLabel(LabelNode** label) {
return GetLabelAt(label, 0);
}
-Result BinaryReaderAST::AppendExpr(Expr* expr) {
+Result BinaryReaderIR::AppendExpr(Expr* expr) {
LabelNode* label;
if (WABT_FAILED(TopLabel(&label))) {
delete expr;
@@ -264,20 +264,20 @@ Result BinaryReaderAST::AppendExpr(Expr* expr) {
return Result::Ok;
}
-bool BinaryReaderAST::HandleError(uint32_t offset, const char* message) {
+bool BinaryReaderIR::HandleError(uint32_t offset, const char* message) {
return error_handler->OnError(offset, message);
}
-bool BinaryReaderAST::OnError(const char* message) {
+bool BinaryReaderIR::OnError(const char* message) {
return HandleError(state->offset, message);
}
-Result BinaryReaderAST::OnTypeCount(uint32_t count) {
+Result BinaryReaderIR::OnTypeCount(uint32_t count) {
module->func_types.reserve(count);
return Result::Ok;
}
-Result BinaryReaderAST::OnType(uint32_t index,
+Result BinaryReaderIR::OnType(uint32_t index,
uint32_t param_count,
Type* param_types,
uint32_t result_count,
@@ -293,12 +293,12 @@ Result BinaryReaderAST::OnType(uint32_t index,
return Result::Ok;
}
-Result BinaryReaderAST::OnImportCount(uint32_t count) {
+Result BinaryReaderIR::OnImportCount(uint32_t count) {
module->imports.reserve(count);
return Result::Ok;
}
-Result BinaryReaderAST::OnImport(uint32_t index,
+Result BinaryReaderIR::OnImport(uint32_t index,
StringSlice module_name,
StringSlice field_name) {
ModuleField* field = append_module_field(module);
@@ -312,7 +312,7 @@ Result BinaryReaderAST::OnImport(uint32_t index,
return Result::Ok;
}
-Result BinaryReaderAST::OnImportFunc(uint32_t import_index,
+Result BinaryReaderIR::OnImportFunc(uint32_t import_index,
StringSlice module_name,
StringSlice field_name,
uint32_t func_index,
@@ -332,7 +332,7 @@ Result BinaryReaderAST::OnImportFunc(uint32_t import_index,
return Result::Ok;
}
-Result BinaryReaderAST::OnImportTable(uint32_t import_index,
+Result BinaryReaderIR::OnImportTable(uint32_t import_index,
StringSlice module_name,
StringSlice field_name,
uint32_t table_index,
@@ -348,7 +348,7 @@ Result BinaryReaderAST::OnImportTable(uint32_t import_index,
return Result::Ok;
}
-Result BinaryReaderAST::OnImportMemory(uint32_t import_index,
+Result BinaryReaderIR::OnImportMemory(uint32_t import_index,
StringSlice module_name,
StringSlice field_name,
uint32_t memory_index,
@@ -363,7 +363,7 @@ Result BinaryReaderAST::OnImportMemory(uint32_t import_index,
return Result::Ok;
}
-Result BinaryReaderAST::OnImportGlobal(uint32_t import_index,
+Result BinaryReaderIR::OnImportGlobal(uint32_t import_index,
StringSlice module_name,
StringSlice field_name,
uint32_t global_index,
@@ -380,12 +380,12 @@ Result BinaryReaderAST::OnImportGlobal(uint32_t import_index,
return Result::Ok;
}
-Result BinaryReaderAST::OnFunctionCount(uint32_t count) {
+Result BinaryReaderIR::OnFunctionCount(uint32_t count) {
module->funcs.reserve(module->num_func_imports + count);
return Result::Ok;
}
-Result BinaryReaderAST::OnFunction(uint32_t index, uint32_t sig_index) {
+Result BinaryReaderIR::OnFunction(uint32_t index, uint32_t sig_index) {
ModuleField* field = append_module_field(module);
field->type = ModuleFieldType::Func;
field->func = new Func();
@@ -400,12 +400,12 @@ Result BinaryReaderAST::OnFunction(uint32_t index, uint32_t sig_index) {
return Result::Ok;
}
-Result BinaryReaderAST::OnTableCount(uint32_t count) {
+Result BinaryReaderIR::OnTableCount(uint32_t count) {
module->tables.reserve(module->num_table_imports + count);
return Result::Ok;
}
-Result BinaryReaderAST::OnTable(uint32_t index,
+Result BinaryReaderIR::OnTable(uint32_t index,
Type elem_type,
const Limits* elem_limits) {
ModuleField* field = append_module_field(module);
@@ -416,12 +416,12 @@ Result BinaryReaderAST::OnTable(uint32_t index,
return Result::Ok;
}
-Result BinaryReaderAST::OnMemoryCount(uint32_t count) {
+Result BinaryReaderIR::OnMemoryCount(uint32_t count) {
module->memories.reserve(module->num_memory_imports + count);
return Result::Ok;
}
-Result BinaryReaderAST::OnMemory(uint32_t index, const Limits* page_limits) {
+Result BinaryReaderIR::OnMemory(uint32_t index, const Limits* page_limits) {
ModuleField* field = append_module_field(module);
field->type = ModuleFieldType::Memory;
field->memory = new Memory();
@@ -430,12 +430,12 @@ Result BinaryReaderAST::OnMemory(uint32_t index, const Limits* page_limits) {
return Result::Ok;
}
-Result BinaryReaderAST::OnGlobalCount(uint32_t count) {
+Result BinaryReaderIR::OnGlobalCount(uint32_t count) {
module->globals.reserve(module->num_global_imports + count);
return Result::Ok;
}
-Result BinaryReaderAST::BeginGlobal(uint32_t index, Type type, bool mutable_) {
+Result BinaryReaderIR::BeginGlobal(uint32_t index, Type type, bool mutable_) {
ModuleField* field = append_module_field(module);
field->type = ModuleFieldType::Global;
field->global = new Global();
@@ -445,24 +445,24 @@ Result BinaryReaderAST::BeginGlobal(uint32_t index, Type type, bool mutable_) {
return Result::Ok;
}
-Result BinaryReaderAST::BeginGlobalInitExpr(uint32_t index) {
+Result BinaryReaderIR::BeginGlobalInitExpr(uint32_t index) {
assert(index == module->globals.size() - 1);
Global* global = module->globals[index];
current_init_expr = &global->init_expr;
return Result::Ok;
}
-Result BinaryReaderAST::EndGlobalInitExpr(uint32_t index) {
+Result BinaryReaderIR::EndGlobalInitExpr(uint32_t index) {
current_init_expr = nullptr;
return Result::Ok;
}
-Result BinaryReaderAST::OnExportCount(uint32_t count) {
+Result BinaryReaderIR::OnExportCount(uint32_t count) {
module->exports.reserve(count);
return Result::Ok;
}
-Result BinaryReaderAST::OnExport(uint32_t index,
+Result BinaryReaderIR::OnExport(uint32_t index,
ExternalKind kind,
uint32_t item_index,
StringSlice name) {
@@ -493,7 +493,7 @@ Result BinaryReaderAST::OnExport(uint32_t index,
return Result::Ok;
}
-Result BinaryReaderAST::OnStartFunction(uint32_t func_index) {
+Result BinaryReaderIR::OnStartFunction(uint32_t func_index) {
ModuleField* field = append_module_field(module);
field->type = ModuleFieldType::Start;
@@ -505,18 +505,18 @@ Result BinaryReaderAST::OnStartFunction(uint32_t func_index) {
return Result::Ok;
}
-Result BinaryReaderAST::OnFunctionBodyCount(uint32_t count) {
+Result BinaryReaderIR::OnFunctionBodyCount(uint32_t count) {
assert(module->num_func_imports + count == module->funcs.size());
return Result::Ok;
}
-Result BinaryReaderAST::BeginFunctionBody(uint32_t index) {
+Result BinaryReaderIR::BeginFunctionBody(uint32_t index) {
current_func = module->funcs[index];
PushLabel(LabelType::Func, &current_func->first_expr);
return Result::Ok;
}
-Result BinaryReaderAST::OnLocalDecl(uint32_t decl_index,
+Result BinaryReaderIR::OnLocalDecl(uint32_t decl_index,
uint32_t count,
Type type) {
TypeVector& types = current_func->local_types;
@@ -526,12 +526,12 @@ Result BinaryReaderAST::OnLocalDecl(uint32_t decl_index,
return Result::Ok;
}
-Result BinaryReaderAST::OnBinaryExpr(Opcode opcode) {
+Result BinaryReaderIR::OnBinaryExpr(Opcode opcode) {
Expr* expr = Expr::CreateBinary(opcode);
return AppendExpr(expr);
}
-Result BinaryReaderAST::OnBlockExpr(uint32_t num_types, Type* sig_types) {
+Result BinaryReaderIR::OnBlockExpr(uint32_t num_types, Type* sig_types) {
Expr* expr = Expr::CreateBlock(new Block());
expr->block->sig.assign(sig_types, sig_types + num_types);
AppendExpr(expr);
@@ -539,17 +539,17 @@ Result BinaryReaderAST::OnBlockExpr(uint32_t num_types, Type* sig_types) {
return Result::Ok;
}
-Result BinaryReaderAST::OnBrExpr(uint32_t depth) {
+Result BinaryReaderIR::OnBrExpr(uint32_t depth) {
Expr* expr = Expr::CreateBr(Var(depth));
return AppendExpr(expr);
}
-Result BinaryReaderAST::OnBrIfExpr(uint32_t depth) {
+Result BinaryReaderIR::OnBrIfExpr(uint32_t depth) {
Expr* expr = Expr::CreateBrIf(Var(depth));
return AppendExpr(expr);
}
-Result BinaryReaderAST::OnBrTableExpr(uint32_t num_targets,
+Result BinaryReaderIR::OnBrTableExpr(uint32_t num_targets,
uint32_t* target_depths,
uint32_t default_target_depth) {
VarVector* targets = new VarVector();
@@ -561,39 +561,39 @@ Result BinaryReaderAST::OnBrTableExpr(uint32_t num_targets,
return AppendExpr(expr);
}
-Result BinaryReaderAST::OnCallExpr(uint32_t func_index) {
+Result BinaryReaderIR::OnCallExpr(uint32_t func_index) {
assert(func_index < module->funcs.size());
Expr* expr = Expr::CreateCall(Var(func_index));
return AppendExpr(expr);
}
-Result BinaryReaderAST::OnCallIndirectExpr(uint32_t sig_index) {
+Result BinaryReaderIR::OnCallIndirectExpr(uint32_t sig_index) {
assert(sig_index < module->func_types.size());
Expr* expr = Expr::CreateCallIndirect(Var(sig_index));
return AppendExpr(expr);
}
-Result BinaryReaderAST::OnCompareExpr(Opcode opcode) {
+Result BinaryReaderIR::OnCompareExpr(Opcode opcode) {
Expr* expr = Expr::CreateCompare(opcode);
return AppendExpr(expr);
}
-Result BinaryReaderAST::OnConvertExpr(Opcode opcode) {
+Result BinaryReaderIR::OnConvertExpr(Opcode opcode) {
Expr* expr = Expr::CreateConvert(opcode);
return AppendExpr(expr);
}
-Result BinaryReaderAST::OnCurrentMemoryExpr() {
+Result BinaryReaderIR::OnCurrentMemoryExpr() {
Expr* expr = Expr::CreateCurrentMemory();
return AppendExpr(expr);
}
-Result BinaryReaderAST::OnDropExpr() {
+Result BinaryReaderIR::OnDropExpr() {
Expr* expr = Expr::CreateDrop();
return AppendExpr(expr);
}
-Result BinaryReaderAST::OnElseExpr() {
+Result BinaryReaderIR::OnElseExpr() {
LabelNode* label;
CHECK_RESULT(TopLabel(&label));
if (label->label_type != LabelType::If) {
@@ -611,46 +611,46 @@ Result BinaryReaderAST::OnElseExpr() {
return Result::Ok;
}
-Result BinaryReaderAST::OnEndExpr() {
+Result BinaryReaderIR::OnEndExpr() {
return PopLabel();
}
-Result BinaryReaderAST::OnF32ConstExpr(uint32_t value_bits) {
+Result BinaryReaderIR::OnF32ConstExpr(uint32_t value_bits) {
Expr* expr = Expr::CreateConst(Const(Const::F32(), value_bits));
return AppendExpr(expr);
}
-Result BinaryReaderAST::OnF64ConstExpr(uint64_t value_bits) {
+Result BinaryReaderIR::OnF64ConstExpr(uint64_t value_bits) {
Expr* expr = Expr::CreateConst(Const(Const::F64(), value_bits));
return AppendExpr(expr);
}
-Result BinaryReaderAST::OnGetGlobalExpr(uint32_t global_index) {
+Result BinaryReaderIR::OnGetGlobalExpr(uint32_t global_index) {
Expr* expr = Expr::CreateGetGlobal(Var(global_index));
return AppendExpr(expr);
}
-Result BinaryReaderAST::OnGetLocalExpr(uint32_t local_index) {
+Result BinaryReaderIR::OnGetLocalExpr(uint32_t local_index) {
Expr* expr = Expr::CreateGetLocal(Var(local_index));
return AppendExpr(expr);
}
-Result BinaryReaderAST::OnGrowMemoryExpr() {
+Result BinaryReaderIR::OnGrowMemoryExpr() {
Expr* expr = Expr::CreateGrowMemory();
return AppendExpr(expr);
}
-Result BinaryReaderAST::OnI32ConstExpr(uint32_t value) {
+Result BinaryReaderIR::OnI32ConstExpr(uint32_t value) {
Expr* expr = Expr::CreateConst(Const(Const::I32(), value));
return AppendExpr(expr);
}
-Result BinaryReaderAST::OnI64ConstExpr(uint64_t value) {
+Result BinaryReaderIR::OnI64ConstExpr(uint64_t value) {
Expr* expr = Expr::CreateConst(Const(Const::I64(), value));
return AppendExpr(expr);
}
-Result BinaryReaderAST::OnIfExpr(uint32_t num_types, Type* sig_types) {
+Result BinaryReaderIR::OnIfExpr(uint32_t num_types, Type* sig_types) {
Expr* expr = Expr::CreateIf(new Block());
expr->if_.true_->sig.assign(sig_types, sig_types + num_types);
expr->if_.false_ = nullptr;
@@ -659,14 +659,14 @@ Result BinaryReaderAST::OnIfExpr(uint32_t num_types, Type* sig_types) {
return Result::Ok;
}
-Result BinaryReaderAST::OnLoadExpr(Opcode opcode,
+Result BinaryReaderIR::OnLoadExpr(Opcode opcode,
uint32_t alignment_log2,
uint32_t offset) {
Expr* expr = Expr::CreateLoad(opcode, 1 << alignment_log2, offset);
return AppendExpr(expr);
}
-Result BinaryReaderAST::OnLoopExpr(uint32_t num_types, Type* sig_types) {
+Result BinaryReaderIR::OnLoopExpr(uint32_t num_types, Type* sig_types) {
Expr* expr = Expr::CreateLoop(new Block());
expr->loop->sig.assign(sig_types, sig_types + num_types);
AppendExpr(expr);
@@ -674,65 +674,65 @@ Result BinaryReaderAST::OnLoopExpr(uint32_t num_types, Type* sig_types) {
return Result::Ok;
}
-Result BinaryReaderAST::OnNopExpr() {
+Result BinaryReaderIR::OnNopExpr() {
Expr* expr = Expr::CreateNop();
return AppendExpr(expr);
}
-Result BinaryReaderAST::OnReturnExpr() {
+Result BinaryReaderIR::OnReturnExpr() {
Expr* expr = Expr::CreateReturn();
return AppendExpr(expr);
}
-Result BinaryReaderAST::OnSelectExpr() {
+Result BinaryReaderIR::OnSelectExpr() {
Expr* expr = Expr::CreateSelect();
return AppendExpr(expr);
}
-Result BinaryReaderAST::OnSetGlobalExpr(uint32_t global_index) {
+Result BinaryReaderIR::OnSetGlobalExpr(uint32_t global_index) {
Expr* expr = Expr::CreateSetGlobal(Var(global_index));
return AppendExpr(expr);
}
-Result BinaryReaderAST::OnSetLocalExpr(uint32_t local_index) {
+Result BinaryReaderIR::OnSetLocalExpr(uint32_t local_index) {
Expr* expr = Expr::CreateSetLocal(Var(local_index));
return AppendExpr(expr);
}
-Result BinaryReaderAST::OnStoreExpr(Opcode opcode,
+Result BinaryReaderIR::OnStoreExpr(Opcode opcode,
uint32_t alignment_log2,
uint32_t offset) {
Expr* expr = Expr::CreateStore(opcode, 1 << alignment_log2, offset);
return AppendExpr(expr);
}
-Result BinaryReaderAST::OnTeeLocalExpr(uint32_t local_index) {
+Result BinaryReaderIR::OnTeeLocalExpr(uint32_t local_index) {
Expr* expr = Expr::CreateTeeLocal(Var(local_index));
return AppendExpr(expr);
}
-Result BinaryReaderAST::OnUnaryExpr(Opcode opcode) {
+Result BinaryReaderIR::OnUnaryExpr(Opcode opcode) {
Expr* expr = Expr::CreateUnary(opcode);
return AppendExpr(expr);
}
-Result BinaryReaderAST::OnUnreachableExpr() {
+Result BinaryReaderIR::OnUnreachableExpr() {
Expr* expr = Expr::CreateUnreachable();
return AppendExpr(expr);
}
-Result BinaryReaderAST::EndFunctionBody(uint32_t index) {
+Result BinaryReaderIR::EndFunctionBody(uint32_t index) {
CHECK_RESULT(PopLabel());
current_func = nullptr;
return Result::Ok;
}
-Result BinaryReaderAST::OnElemSegmentCount(uint32_t count) {
+Result BinaryReaderIR::OnElemSegmentCount(uint32_t count) {
module->elem_segments.reserve(count);
return Result::Ok;
}
-Result BinaryReaderAST::BeginElemSegment(uint32_t index, uint32_t table_index) {
+Result BinaryReaderIR::BeginElemSegment(uint32_t index, uint32_t table_index) {
ModuleField* field = append_module_field(module);
field->type = ModuleFieldType::ElemSegment;
field->elem_segment = new ElemSegment();
@@ -742,19 +742,19 @@ Result BinaryReaderAST::BeginElemSegment(uint32_t index, uint32_t table_index) {
return Result::Ok;
}
-Result BinaryReaderAST::BeginElemSegmentInitExpr(uint32_t index) {
+Result BinaryReaderIR::BeginElemSegmentInitExpr(uint32_t index) {
assert(index == module->elem_segments.size() - 1);
ElemSegment* segment = module->elem_segments[index];
current_init_expr = &segment->offset;
return Result::Ok;
}
-Result BinaryReaderAST::EndElemSegmentInitExpr(uint32_t index) {
+Result BinaryReaderIR::EndElemSegmentInitExpr(uint32_t index) {
current_init_expr = nullptr;
return Result::Ok;
}
-Result BinaryReaderAST::OnElemSegmentFunctionIndexCount(uint32_t index,
+Result BinaryReaderIR::OnElemSegmentFunctionIndexCount(uint32_t index,
uint32_t count) {
assert(index == module->elem_segments.size() - 1);
ElemSegment* segment = module->elem_segments[index];
@@ -762,7 +762,7 @@ Result BinaryReaderAST::OnElemSegmentFunctionIndexCount(uint32_t index,
return Result::Ok;
}
-Result BinaryReaderAST::OnElemSegmentFunctionIndex(uint32_t index,
+Result BinaryReaderIR::OnElemSegmentFunctionIndex(uint32_t index,
uint32_t func_index) {
assert(index == module->elem_segments.size() - 1);
ElemSegment* segment = module->elem_segments[index];
@@ -773,12 +773,12 @@ Result BinaryReaderAST::OnElemSegmentFunctionIndex(uint32_t index,
return Result::Ok;
}
-Result BinaryReaderAST::OnDataSegmentCount(uint32_t count) {
+Result BinaryReaderIR::OnDataSegmentCount(uint32_t count) {
module->data_segments.reserve(count);
return Result::Ok;
}
-Result BinaryReaderAST::BeginDataSegment(uint32_t index,
+Result BinaryReaderIR::BeginDataSegment(uint32_t index,
uint32_t memory_index) {
ModuleField* field = append_module_field(module);
field->type = ModuleFieldType::DataSegment;
@@ -789,19 +789,19 @@ Result BinaryReaderAST::BeginDataSegment(uint32_t index,
return Result::Ok;
}
-Result BinaryReaderAST::BeginDataSegmentInitExpr(uint32_t index) {
+Result BinaryReaderIR::BeginDataSegmentInitExpr(uint32_t index) {
assert(index == module->data_segments.size() - 1);
DataSegment* segment = module->data_segments[index];
current_init_expr = &segment->offset;
return Result::Ok;
}
-Result BinaryReaderAST::EndDataSegmentInitExpr(uint32_t index) {
+Result BinaryReaderIR::EndDataSegmentInitExpr(uint32_t index) {
current_init_expr = nullptr;
return Result::Ok;
}
-Result BinaryReaderAST::OnDataSegmentData(uint32_t index,
+Result BinaryReaderIR::OnDataSegmentData(uint32_t index,
const void* data,
uint32_t size) {
assert(index == module->data_segments.size() - 1);
@@ -812,7 +812,7 @@ Result BinaryReaderAST::OnDataSegmentData(uint32_t index,
return Result::Ok;
}
-Result BinaryReaderAST::OnFunctionNamesCount(uint32_t count) {
+Result BinaryReaderIR::OnFunctionNamesCount(uint32_t count) {
if (count > module->funcs.size()) {
PrintError("expected function name count (%u) <= function count (%" PRIzd
")",
@@ -822,7 +822,7 @@ Result BinaryReaderAST::OnFunctionNamesCount(uint32_t count) {
return Result::Ok;
}
-Result BinaryReaderAST::OnFunctionName(uint32_t index, StringSlice name) {
+Result BinaryReaderIR::OnFunctionName(uint32_t index, StringSlice name) {
if (string_slice_is_empty(&name))
return Result::Ok;
@@ -832,7 +832,7 @@ Result BinaryReaderAST::OnFunctionName(uint32_t index, StringSlice name) {
return Result::Ok;
}
-Result BinaryReaderAST::OnLocalNameLocalCount(uint32_t index, uint32_t count) {
+Result BinaryReaderIR::OnLocalNameLocalCount(uint32_t index, uint32_t count) {
assert(index < module->funcs.size());
Func* func = module->funcs[index];
uint32_t num_params_and_locals = get_num_params_and_locals(func);
@@ -844,33 +844,33 @@ Result BinaryReaderAST::OnLocalNameLocalCount(uint32_t index, uint32_t count) {
return Result::Ok;
}
-Result BinaryReaderAST::OnInitExprF32ConstExpr(uint32_t index, uint32_t value) {
+Result BinaryReaderIR::OnInitExprF32ConstExpr(uint32_t index, uint32_t value) {
*current_init_expr = Expr::CreateConst(Const(Const::F32(), value));
return Result::Ok;
}
-Result BinaryReaderAST::OnInitExprF64ConstExpr(uint32_t index, uint64_t value) {
+Result BinaryReaderIR::OnInitExprF64ConstExpr(uint32_t index, uint64_t value) {
*current_init_expr = Expr::CreateConst(Const(Const::F64(), value));
return Result::Ok;
}
-Result BinaryReaderAST::OnInitExprGetGlobalExpr(uint32_t index,
+Result BinaryReaderIR::OnInitExprGetGlobalExpr(uint32_t index,
uint32_t global_index) {
*current_init_expr = Expr::CreateGetGlobal(Var(global_index));
return Result::Ok;
}
-Result BinaryReaderAST::OnInitExprI32ConstExpr(uint32_t index, uint32_t value) {
+Result BinaryReaderIR::OnInitExprI32ConstExpr(uint32_t index, uint32_t value) {
*current_init_expr = Expr::CreateConst(Const(Const::I32(), value));
return Result::Ok;
}
-Result BinaryReaderAST::OnInitExprI64ConstExpr(uint32_t index, uint64_t value) {
+Result BinaryReaderIR::OnInitExprI64ConstExpr(uint32_t index, uint64_t value) {
*current_init_expr = Expr::CreateConst(Const(Const::I64(), value));
return Result::Ok;
}
-Result BinaryReaderAST::OnLocalName(uint32_t func_index,
+Result BinaryReaderIR::OnLocalName(uint32_t func_index,
uint32_t local_index,
StringSlice name) {
if (string_slice_is_empty(&name))
@@ -895,12 +895,12 @@ Result BinaryReaderAST::OnLocalName(uint32_t func_index,
} // namespace
-Result read_binary_ast(const void* data,
- size_t size,
- const ReadBinaryOptions* options,
- BinaryErrorHandler* error_handler,
- struct Module* out_module) {
- BinaryReaderAST reader(out_module, error_handler);
+Result read_binary_ir(const void* data,
+ size_t size,
+ const ReadBinaryOptions* options,
+ BinaryErrorHandler* error_handler,
+ struct Module* out_module) {
+ BinaryReaderIR reader(out_module, error_handler);
Result result = read_binary(data, size, &reader, options);
return result;
}
diff --git a/src/binary-reader-ast.h b/src/binary-reader-ir.h
index 49d99d2e..50a95a0d 100644
--- a/src/binary-reader-ast.h
+++ b/src/binary-reader-ir.h
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-#ifndef WABT_BINARY_READER_AST_H_
-#define WABT_BINARY_READER_AST_H_
+#ifndef WABT_BINARY_READER_IR_H_
+#define WABT_BINARY_READER_IR_H_
#include "common.h"
@@ -25,12 +25,12 @@ struct Module;
struct ReadBinaryOptions;
class BinaryErrorHandler;
-Result read_binary_ast(const void* data,
- size_t size,
- const ReadBinaryOptions* options,
- BinaryErrorHandler*,
- Module* out_module);
+Result read_binary_ir(const void* data,
+ size_t size,
+ const ReadBinaryOptions* options,
+ BinaryErrorHandler*,
+ Module* out_module);
} // namespace wabt
-#endif /* WABT_BINARY_READER_AST_H_ */
+#endif /* WABT_BINARY_READER_IR_H_ */
diff --git a/src/binary-writer-spec.cc b/src/binary-writer-spec.cc
index 171b40e3..5ddbb4a0 100644
--- a/src/binary-writer-spec.cc
+++ b/src/binary-writer-spec.cc
@@ -19,10 +19,10 @@
#include <assert.h>
#include <inttypes.h>
-#include "ast.h"
#include "binary.h"
#include "binary-writer.h"
#include "config.h"
+#include "ir.h"
#include "stream.h"
#include "writer.h"
diff --git a/src/binary-writer-spec.h b/src/binary-writer-spec.h
index 9cc6b2ea..3266342e 100644
--- a/src/binary-writer-spec.h
+++ b/src/binary-writer-spec.h
@@ -17,9 +17,9 @@
#ifndef WABT_BINARY_WRITER_SPEC_H_
#define WABT_BINARY_WRITER_SPEC_H_
-#include "ast.h"
#include "binary-writer.h"
#include "common.h"
+#include "ir.h"
namespace wabt {
diff --git a/src/binary-writer.cc b/src/binary-writer.cc
index 3d76eec2..915a3949 100644
--- a/src/binary-writer.cc
+++ b/src/binary-writer.cc
@@ -26,8 +26,8 @@
#include <vector>
-#include "ast.h"
#include "binary.h"
+#include "ir.h"
#include "stream.h"
#include "writer.h"
diff --git a/src/emscripten-exported.json b/src/emscripten-exported.json
index 35f19bbf..c789924d 100644
--- a/src/emscripten-exported.json
+++ b/src/emscripten-exported.json
@@ -1,23 +1,23 @@
[
-"_wabt_destroy_ast_lexer",
-"_wabt_destroy_parse_ast_result",
"_wabt_destroy_output_buffer",
+"_wabt_destroy_parse_wast_result",
"_wabt_destroy_script",
"_wabt_destroy_source_error_handler_buffer",
+"_wabt_destroy_wast_lexer",
"_wabt_destroy_write_binary_module_result",
-"_wabt_new_ast_buffer_lexer",
"_wabt_new_source_error_handler_buffer",
+"_wabt_new_wast_buffer_lexer",
"_wabt_output_buffer_get_data",
"_wabt_output_buffer_get_size",
-"_wabt_parse_ast",
-"_wabt_parse_ast_result_get_result",
-"_wabt_parse_ast_result_release_script",
+"_wabt_parse_wast",
+"_wabt_parse_wast_result_get_result",
+"_wabt_parse_wast_result_release_script",
"_wabt_resolve_names_script",
"_wabt_source_error_handler_buffer_get_data",
"_wabt_source_error_handler_buffer_get_size",
"_wabt_validate_script",
"_wabt_write_binary_module",
+"_wabt_write_binary_module_result_get_result",
"_wabt_write_binary_module_result_release_binary_output_buffer",
-"_wabt_write_binary_module_result_release_log_output_buffer",
-"_wabt_write_binary_module_result_get_result"
+"_wabt_write_binary_module_result_release_log_output_buffer"
]
diff --git a/src/emscripten-helpers.cc b/src/emscripten-helpers.cc
index e7e8e2fc..4effb180 100644
--- a/src/emscripten-helpers.cc
+++ b/src/emscripten-helpers.cc
@@ -21,18 +21,18 @@
#include <memory>
-#include "ast.h"
-#include "ast-lexer.h"
-#include "ast-parser.h"
#include "binary-writer.h"
#include "common.h"
+#include "ir.h"
#include "resolve-names.h"
#include "source-error-handler.h"
#include "stream.h"
#include "validator.h"
+#include "wast-lexer.h"
+#include "wast-parser.h"
#include "writer.h"
-struct WabtParseAstResult {
+struct WabtParseWastResult {
wabt::Result result;
std::unique_ptr<wabt::Script> script;
};
@@ -45,32 +45,31 @@ struct WabtWriteBinaryModuleResult {
extern "C" {
-wabt::AstLexer* wabt_new_ast_buffer_lexer(const char* filename,
- const void* data,
- size_t size) {
- return wabt::new_ast_buffer_lexer(filename, data, size);
+wabt::WastLexer* wabt_new_wast_buffer_lexer(const char* filename,
+ const void* data,
+ size_t size) {
+ return wabt::new_wast_buffer_lexer(filename, data, size);
}
-WabtParseAstResult* wabt_parse_ast(
- wabt::AstLexer* lexer,
+WabtParseWastResult* wabt_parse_wast(
+ wabt::WastLexer* lexer,
wabt::SourceErrorHandlerBuffer* error_handler) {
- WabtParseAstResult* result = new WabtParseAstResult();
+ WabtParseWastResult* result = new WabtParseWastResult();
wabt::Script* script = nullptr;
- result->result = wabt::parse_ast(lexer, &script, error_handler);
+ result->result = wabt::parse_wast(lexer, &script, error_handler);
result->script.reset(script);
return result;
-
}
wabt::Result wabt_resolve_names_script(
- wabt::AstLexer* lexer,
+ wabt::WastLexer* lexer,
wabt::Script* script,
wabt::SourceErrorHandlerBuffer* error_handler) {
return resolve_names_script(lexer, script, error_handler);
}
wabt::Result wabt_validate_script(
- wabt::AstLexer* lexer,
+ wabt::WastLexer* lexer,
wabt::Script* script,
wabt::SourceErrorHandlerBuffer* error_handler) {
return validate_script(lexer, script, error_handler);
@@ -103,8 +102,8 @@ void wabt_destroy_script(wabt::Script* script) {
delete script;
}
-void wabt_destroy_ast_lexer(wabt::AstLexer* lexer) {
- destroy_ast_lexer(lexer);
+void wabt_destroy_wast_lexer(wabt::WastLexer* lexer) {
+ destroy_wast_lexer(lexer);
}
// SourceErrorHandlerBuffer
@@ -127,16 +126,17 @@ void wabt_destroy_source_error_handler_buffer(
delete error_handler;
}
-// WabtParseAstResult
-wabt::Result wabt_parse_ast_result_get_result(WabtParseAstResult* result) {
+// WabtParseWastResult
+wabt::Result wabt_parse_wast_result_get_result(WabtParseWastResult* result) {
return result->result;
}
-wabt::Script* wabt_parse_ast_result_release_script(WabtParseAstResult* result) {
+wabt::Script* wabt_parse_wast_result_release_script(
+ WabtParseWastResult* result) {
return result->script.release();
}
-void wabt_destroy_parse_ast_result(WabtParseAstResult* result) {
+void wabt_destroy_parse_wast_result(WabtParseWastResult* result) {
delete result;
}
diff --git a/src/generate-names.cc b/src/generate-names.cc
index e3ccfe6b..049860c9 100644
--- a/src/generate-names.cc
+++ b/src/generate-names.cc
@@ -22,7 +22,7 @@
#include <string>
#include <vector>
-#include "ast.h"
+#include "ir.h"
#define CHECK_RESULT(expr) \
do { \
diff --git a/src/interpreter-opcode.def b/src/interpreter-opcode.def
index 6b16b9df..72569337 100644
--- a/src/interpreter-opcode.def
+++ b/src/interpreter-opcode.def
@@ -25,7 +25,7 @@
* m: memory size of the operation, if any
* code: opcode
* Name: used to generate the opcode enum
- * text: a string of the opcode name in the AST format
+ * text: a string of the opcode name in the text format
*
* tr t1 t2 m code Name text
* ============================================================ */
diff --git a/src/ast.cc b/src/ir.cc
index d133399a..0fc11860 100644
--- a/src/ast.cc
+++ b/src/ir.cc
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "ast.h"
+#include "ir.h"
#include <assert.h>
#include <stddef.h>
diff --git a/src/ast.h b/src/ir.h
index 4359a982..cdbf65e4 100644
--- a/src/ast.h
+++ b/src/ir.h
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-#ifndef WABT_AST_H_
-#define WABT_AST_H_
+#ifndef WABT_IR_H_
+#define WABT_IR_H_
#include <assert.h>
#include <stddef.h>
@@ -506,7 +506,7 @@ ModuleField* append_module_field(Module*);
/* ownership of the function signature is passed to the module */
FuncType* append_implicit_func_type(Location*, Module*, FuncSignature*);
-/* destruction functions. not needed unless you're creating your own AST
+/* destruction functions. not needed unless you're creating your own IR
elements */
void destroy_expr_list(Expr*);
void destroy_var(Var*);
@@ -515,7 +515,7 @@ void destroy_var(Var*);
Result visit_func(Func* func, ExprVisitor*);
Result visit_expr_list(Expr* expr, ExprVisitor*);
-/* convenience functions for looking through the AST */
+/* convenience functions for looking through the IR */
int get_index_from_var(const BindingHash* bindings, const Var* var);
int get_func_index_by_var(const Module* module, const Var* var);
int get_global_index_by_var(const Module* func, const Var* var);
@@ -618,4 +618,4 @@ static WABT_INLINE const Location* get_raw_module_location(
} // namespace wabt
-#endif /* WABT_AST_H_ */
+#endif /* WABT_IR_H_ */
diff --git a/src/opcode.def b/src/opcode.def
index 8207500d..457108c0 100644
--- a/src/opcode.def
+++ b/src/opcode.def
@@ -25,7 +25,7 @@
* m: memory size of the operation, if any
* code: opcode
* Name: used to generate the opcode enum
- * text: a string of the opcode name in the AST format
+ * text: a string of the opcode name in the text format
*
* tr t1 t2 m code Name text
* ============================================================ */
diff --git a/src/prebuilt/ast-lexer-gen.cc b/src/prebuilt/wast-lexer-gen.cc
index ede11abb..4545dfd7 100644
--- a/src/prebuilt/ast-lexer-gen.cc
+++ b/src/prebuilt/wast-lexer-gen.cc
@@ -1,5 +1,5 @@
/* Generated by re2c 0.16 */
-#line 1 "src/ast-lexer.cc"
+#line 1 "src/wast-lexer.cc"
/*
* Copyright 2016 WebAssembly Community Group participants
*
@@ -16,18 +16,18 @@
* limitations under the License.
*/
-#include "ast-lexer.h"
+#include "wast-lexer.h"
#include <assert.h>
#include <stdio.h>
#include "config.h"
-#include "ast-parser.h"
-#include "ast-parser-lexer-shared.h"
+#include "wast-parser.h"
+#include "wast-parser-lexer-shared.h"
/* must be included after so some typedefs will be defined */
-#include "ast-parser-gen.hh"
+#include "wast-parser-gen.hh"
#define YYMAXFILL 29
@@ -47,7 +47,7 @@
#define ERROR(...) \
YY_USER_ACTION; \
- ast_parser_error(loc, lexer, parser, __VA_ARGS__)
+ wast_parser_error(loc, lexer, parser, __VA_ARGS__)
#define BEGIN(c) \
do { \
@@ -95,8 +95,8 @@
namespace wabt {
static Result fill(Location* loc,
- AstLexer* lexer,
- AstParser* parser,
+ WastLexer* lexer,
+ WastParser* parser,
size_t need) {
if (lexer->eof)
return Result::Error;
@@ -116,8 +116,8 @@ static Result fill(Location* loc,
char* new_buffer = new char[new_buffer_size];
if (!new_buffer) {
- ast_parser_error(loc, lexer, parser,
- "unable to reallocate lexer buffer.");
+ wast_parser_error(loc, lexer, parser,
+ "unable to reallocate lexer buffer.");
return Result::Error;
}
memmove(new_buffer, lexer->token, lexer->limit - lexer->token);
@@ -129,7 +129,7 @@ static Result fill(Location* loc,
lexer->limit = new_buffer + (lexer->limit - old_buffer) - free;
lexer->buffer_file_offset += free;
free += new_buffer_size - old_buffer_size;
- delete [] old_buffer;
+ delete[] old_buffer;
} else {
/* shift everything down to make more room in the buffer */
memmove(lexer->buffer, lexer->token, lexer->limit - lexer->token);
@@ -140,11 +140,11 @@ static Result fill(Location* loc,
lexer->buffer_file_offset += free;
}
/* read the new data into the buffer */
- if (lexer->source.type == AstLexerSourceType::File) {
+ if (lexer->source.type == WastLexerSourceType::File) {
lexer->limit += fread(lexer->limit, 1, free, lexer->source.file);
} else {
/* TODO(binji): could lex directly from buffer */
- assert(lexer->source.type == AstLexerSourceType::Buffer);
+ assert(lexer->source.type == WastLexerSourceType::Buffer);
size_t read_size = free;
size_t offset = lexer->source.buffer.read_offset;
size_t bytes_left = lexer->source.buffer.size - offset;
@@ -167,10 +167,10 @@ static Result fill(Location* loc,
return Result::Ok;
}
-int ast_lexer_lex(WABT_AST_PARSER_STYPE* lval,
- WABT_AST_PARSER_LTYPE* loc,
- AstLexer* lexer,
- AstParser* parser) {
+int wast_lexer_lex(WABT_WAST_PARSER_STYPE* lval,
+ WABT_WAST_PARSER_LTYPE* loc,
+ WastLexer* lexer,
+ WastParser* parser) {
enum {
YYCOND_INIT,
YYCOND_BAD_TEXT,
@@ -182,7 +182,7 @@ int ast_lexer_lex(WABT_AST_PARSER_STYPE* lval,
for (;;) {
lexer->token = lexer->cursor;
-#line 186 "src/prebuilt/ast-lexer-gen.cc"
+#line 186 "src/prebuilt/wast-lexer-gen.cc"
{
unsigned char yych;
if (cond < 2) {
@@ -221,35 +221,35 @@ YYCOND_BAD_TEXT:
}
}
++lexer->cursor;
-#line 237 "src/ast-lexer.cc"
+#line 237 "src/wast-lexer.cc"
{ ERROR("unexpected EOF"); RETURN(EOF); }
-#line 227 "src/prebuilt/ast-lexer-gen.cc"
+#line 227 "src/prebuilt/wast-lexer-gen.cc"
yy5:
++lexer->cursor;
yy6:
-#line 238 "src/ast-lexer.cc"
+#line 238 "src/wast-lexer.cc"
{ ERROR("illegal character in string");
continue; }
-#line 234 "src/prebuilt/ast-lexer-gen.cc"
+#line 234 "src/prebuilt/wast-lexer-gen.cc"
yy7:
++lexer->cursor;
BEGIN(YYCOND_i);
-#line 230 "src/ast-lexer.cc"
+#line 230 "src/wast-lexer.cc"
{ ERROR("newline in string");
NEWLINE;
continue; }
-#line 242 "src/prebuilt/ast-lexer-gen.cc"
+#line 242 "src/prebuilt/wast-lexer-gen.cc"
yy9:
++lexer->cursor;
-#line 229 "src/ast-lexer.cc"
+#line 229 "src/wast-lexer.cc"
{ continue; }
-#line 247 "src/prebuilt/ast-lexer-gen.cc"
+#line 247 "src/prebuilt/wast-lexer-gen.cc"
yy11:
++lexer->cursor;
BEGIN(YYCOND_i);
-#line 236 "src/ast-lexer.cc"
+#line 236 "src/wast-lexer.cc"
{ TEXT; RETURN(TEXT); }
-#line 253 "src/prebuilt/ast-lexer-gen.cc"
+#line 253 "src/prebuilt/wast-lexer-gen.cc"
yy13:
yych = *++lexer->cursor;
if (yych <= '@') {
@@ -283,11 +283,11 @@ yy13:
yy14:
++lexer->cursor;
yy15:
-#line 233 "src/ast-lexer.cc"
+#line 233 "src/wast-lexer.cc"
{ ERROR("bad escape \"%.*s\"",
static_cast<int>(yyleng), yytext);
continue; }
-#line 291 "src/prebuilt/ast-lexer-gen.cc"
+#line 291 "src/prebuilt/wast-lexer-gen.cc"
yy16:
++lexer->cursor;
if ((yych = *lexer->cursor) <= '@') {
@@ -315,20 +315,20 @@ YYCOND_BLOCK_COMMENT:
}
yy19:
++lexer->cursor;
-#line 464 "src/ast-lexer.cc"
+#line 464 "src/wast-lexer.cc"
{ ERROR("unexpected EOF"); RETURN(EOF); }
-#line 321 "src/prebuilt/ast-lexer-gen.cc"
+#line 321 "src/prebuilt/wast-lexer-gen.cc"
yy21:
++lexer->cursor;
yy22:
-#line 465 "src/ast-lexer.cc"
+#line 465 "src/wast-lexer.cc"
{ continue; }
-#line 327 "src/prebuilt/ast-lexer-gen.cc"
+#line 327 "src/prebuilt/wast-lexer-gen.cc"
yy23:
++lexer->cursor;
-#line 463 "src/ast-lexer.cc"
+#line 463 "src/wast-lexer.cc"
{ NEWLINE; continue; }
-#line 332 "src/prebuilt/ast-lexer-gen.cc"
+#line 332 "src/prebuilt/wast-lexer-gen.cc"
yy25:
yych = *++lexer->cursor;
if (yych == ';') goto yy27;
@@ -339,16 +339,16 @@ yy26:
goto yy22;
yy27:
++lexer->cursor;
-#line 459 "src/ast-lexer.cc"
+#line 459 "src/wast-lexer.cc"
{ COMMENT_NESTING++; continue; }
-#line 345 "src/prebuilt/ast-lexer-gen.cc"
+#line 345 "src/prebuilt/wast-lexer-gen.cc"
yy29:
++lexer->cursor;
-#line 460 "src/ast-lexer.cc"
+#line 460 "src/wast-lexer.cc"
{ if (--COMMENT_NESTING == 0)
BEGIN(YYCOND_INIT);
continue; }
-#line 352 "src/prebuilt/ast-lexer-gen.cc"
+#line 352 "src/prebuilt/wast-lexer-gen.cc"
/* *********************************** */
YYCOND_LINE_COMMENT:
{
@@ -393,9 +393,9 @@ YYCOND_LINE_COMMENT:
}
goto yy36;
yy33:
-#line 457 "src/ast-lexer.cc"
+#line 457 "src/wast-lexer.cc"
{ continue; }
-#line 399 "src/prebuilt/ast-lexer-gen.cc"
+#line 399 "src/prebuilt/wast-lexer-gen.cc"
yy34:
++lexer->cursor;
if (lexer->limit <= lexer->cursor) FILL(1);
@@ -407,9 +407,9 @@ yy34:
yy36:
++lexer->cursor;
BEGIN(YYCOND_i);
-#line 456 "src/ast-lexer.cc"
+#line 456 "src/wast-lexer.cc"
{ NEWLINE; continue; }
-#line 413 "src/prebuilt/ast-lexer-gen.cc"
+#line 413 "src/prebuilt/wast-lexer-gen.cc"
}
/* *********************************** */
YYCOND_i:
@@ -551,15 +551,15 @@ YYCOND_i:
}
yy40:
++lexer->cursor;
-#line 471 "src/ast-lexer.cc"
+#line 471 "src/wast-lexer.cc"
{ RETURN(EOF); }
-#line 557 "src/prebuilt/ast-lexer-gen.cc"
+#line 557 "src/prebuilt/wast-lexer-gen.cc"
yy42:
++lexer->cursor;
yy43:
-#line 472 "src/ast-lexer.cc"
+#line 472 "src/wast-lexer.cc"
{ ERROR("unexpected char"); continue; }
-#line 563 "src/prebuilt/ast-lexer-gen.cc"
+#line 563 "src/prebuilt/wast-lexer-gen.cc"
yy44:
++lexer->cursor;
if (lexer->limit <= lexer->cursor) FILL(1);
@@ -567,14 +567,14 @@ yy44:
if (yybm[0+yych] & 8) {
goto yy44;
}
-#line 467 "src/ast-lexer.cc"
+#line 467 "src/wast-lexer.cc"
{ continue; }
-#line 573 "src/prebuilt/ast-lexer-gen.cc"
+#line 573 "src/prebuilt/wast-lexer-gen.cc"
yy47:
++lexer->cursor;
-#line 466 "src/ast-lexer.cc"
+#line 466 "src/wast-lexer.cc"
{ NEWLINE; continue; }
-#line 578 "src/prebuilt/ast-lexer-gen.cc"
+#line 578 "src/prebuilt/wast-lexer-gen.cc"
yy49:
++lexer->cursor;
if (lexer->limit <= lexer->cursor) FILL(1);
@@ -584,20 +584,20 @@ yy50:
goto yy49;
}
yy51:
-#line 468 "src/ast-lexer.cc"
+#line 468 "src/wast-lexer.cc"
{ ERROR("unexpected token \"%.*s\"",
static_cast<int>(yyleng), yytext);
continue; }
-#line 592 "src/prebuilt/ast-lexer-gen.cc"
+#line 592 "src/prebuilt/wast-lexer-gen.cc"
yy52:
yych = *(lexer->marker = ++lexer->cursor);
if (yych <= 0x1F) goto yy53;
if (yych != 0x7F) goto yy83;
yy53:
BEGIN(YYCOND_BAD_TEXT);
-#line 228 "src/ast-lexer.cc"
+#line 228 "src/wast-lexer.cc"
{ continue; }
-#line 601 "src/prebuilt/ast-lexer-gen.cc"
+#line 601 "src/prebuilt/wast-lexer-gen.cc"
yy54:
yych = *++lexer->cursor;
if (yych <= ';') {
@@ -637,14 +637,14 @@ yy54:
yy55:
++lexer->cursor;
if ((yych = *lexer->cursor) == ';') goto yy91;
-#line 219 "src/ast-lexer.cc"
+#line 219 "src/wast-lexer.cc"
{ RETURN(LPAR); }
-#line 643 "src/prebuilt/ast-lexer-gen.cc"
+#line 643 "src/prebuilt/wast-lexer-gen.cc"
yy57:
++lexer->cursor;
-#line 220 "src/ast-lexer.cc"
+#line 220 "src/wast-lexer.cc"
{ RETURN(RPAR); }
-#line 648 "src/prebuilt/ast-lexer-gen.cc"
+#line 648 "src/prebuilt/wast-lexer-gen.cc"
yy59:
yych = *++lexer->cursor;
if (yych <= 'h') {
@@ -701,9 +701,9 @@ yy60:
}
}
yy61:
-#line 221 "src/ast-lexer.cc"
+#line 221 "src/wast-lexer.cc"
{ LITERAL(Int); RETURN(NAT); }
-#line 707 "src/prebuilt/ast-lexer-gen.cc"
+#line 707 "src/prebuilt/wast-lexer-gen.cc"
yy62:
++lexer->cursor;
if ((lexer->limit - lexer->cursor) < 3) FILL(3);
@@ -904,9 +904,9 @@ yy84:
goto yy53;
yy85:
++lexer->cursor;
-#line 227 "src/ast-lexer.cc"
+#line 227 "src/wast-lexer.cc"
{ TEXT; RETURN(TEXT); }
-#line 910 "src/prebuilt/ast-lexer-gen.cc"
+#line 910 "src/prebuilt/wast-lexer-gen.cc"
yy87:
++lexer->cursor;
if (lexer->limit <= lexer->cursor) FILL(1);
@@ -969,15 +969,15 @@ yy88:
}
}
yy90:
-#line 453 "src/ast-lexer.cc"
+#line 453 "src/wast-lexer.cc"
{ TEXT; RETURN(VAR); }
-#line 975 "src/prebuilt/ast-lexer-gen.cc"
+#line 975 "src/prebuilt/wast-lexer-gen.cc"
yy91:
++lexer->cursor;
BEGIN(YYCOND_BLOCK_COMMENT);
-#line 458 "src/ast-lexer.cc"
+#line 458 "src/wast-lexer.cc"
{ COMMENT_NESTING = 1; continue; }
-#line 981 "src/prebuilt/ast-lexer-gen.cc"
+#line 981 "src/prebuilt/wast-lexer-gen.cc"
yy93:
++lexer->cursor;
if ((yych = *lexer->cursor) <= 'D') {
@@ -1019,9 +1019,9 @@ yy93:
}
}
yy94:
-#line 222 "src/ast-lexer.cc"
+#line 222 "src/wast-lexer.cc"
{ LITERAL(Int); RETURN(INT); }
-#line 1025 "src/prebuilt/ast-lexer-gen.cc"
+#line 1025 "src/prebuilt/wast-lexer-gen.cc"
yy95:
++lexer->cursor;
if ((lexer->limit - lexer->cursor) < 3) FILL(3);
@@ -1118,9 +1118,9 @@ yy99:
}
}
yy101:
-#line 223 "src/ast-lexer.cc"
+#line 223 "src/wast-lexer.cc"
{ LITERAL(Float); RETURN(FLOAT); }
-#line 1124 "src/prebuilt/ast-lexer-gen.cc"
+#line 1124 "src/prebuilt/wast-lexer-gen.cc"
yy102:
yych = *++lexer->cursor;
if (yych <= ',') {
@@ -1141,9 +1141,9 @@ yy103:
yy104:
++lexer->cursor;
BEGIN(YYCOND_LINE_COMMENT);
-#line 455 "src/ast-lexer.cc"
+#line 455 "src/wast-lexer.cc"
{ continue; }
-#line 1147 "src/prebuilt/ast-lexer-gen.cc"
+#line 1147 "src/prebuilt/wast-lexer-gen.cc"
yy106:
yych = *++lexer->cursor;
if (yych == 'i') goto yy156;
@@ -1195,9 +1195,9 @@ yy110:
}
}
yy111:
-#line 253 "src/ast-lexer.cc"
+#line 253 "src/wast-lexer.cc"
{ RETURN(BR); }
-#line 1201 "src/prebuilt/ast-lexer-gen.cc"
+#line 1201 "src/prebuilt/wast-lexer-gen.cc"
yy112:
yych = *++lexer->cursor;
if (yych == 'l') goto yy161;
@@ -1294,9 +1294,9 @@ yy127:
}
}
yy128:
-#line 248 "src/ast-lexer.cc"
+#line 248 "src/wast-lexer.cc"
{ RETURN(IF); }
-#line 1300 "src/prebuilt/ast-lexer-gen.cc"
+#line 1300 "src/prebuilt/wast-lexer-gen.cc"
yy129:
yych = *++lexer->cursor;
if (yych == 'p') goto yy184;
@@ -1561,9 +1561,9 @@ yy167:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 260 "src/ast-lexer.cc"
+#line 260 "src/wast-lexer.cc"
{ RETURN(END); }
-#line 1567 "src/prebuilt/ast-lexer-gen.cc"
+#line 1567 "src/prebuilt/wast-lexer-gen.cc"
yy169:
yych = *++lexer->cursor;
if (yych == 'o') goto yy235;
@@ -1602,9 +1602,9 @@ yy170:
}
}
yy171:
-#line 242 "src/ast-lexer.cc"
+#line 242 "src/wast-lexer.cc"
{ TYPE(F32); RETURN(VALUE_TYPE); }
-#line 1608 "src/prebuilt/ast-lexer-gen.cc"
+#line 1608 "src/prebuilt/wast-lexer-gen.cc"
yy172:
++lexer->cursor;
if ((yych = *lexer->cursor) <= ':') {
@@ -1639,9 +1639,9 @@ yy172:
}
}
yy173:
-#line 243 "src/ast-lexer.cc"
+#line 243 "src/wast-lexer.cc"
{ TYPE(F64); RETURN(VALUE_TYPE); }
-#line 1645 "src/prebuilt/ast-lexer-gen.cc"
+#line 1645 "src/prebuilt/wast-lexer-gen.cc"
yy174:
yych = *++lexer->cursor;
if (yych == 'c') goto yy238;
@@ -1681,9 +1681,9 @@ yy175:
}
}
yy176:
-#line 440 "src/ast-lexer.cc"
+#line 440 "src/wast-lexer.cc"
{ RETURN(GET); }
-#line 1687 "src/prebuilt/ast-lexer-gen.cc"
+#line 1687 "src/prebuilt/wast-lexer-gen.cc"
yy177:
yych = *++lexer->cursor;
if (yych == 'b') goto yy241;
@@ -1726,9 +1726,9 @@ yy179:
}
}
yy180:
-#line 240 "src/ast-lexer.cc"
+#line 240 "src/wast-lexer.cc"
{ TYPE(I32); RETURN(VALUE_TYPE); }
-#line 1732 "src/prebuilt/ast-lexer-gen.cc"
+#line 1732 "src/prebuilt/wast-lexer-gen.cc"
yy181:
++lexer->cursor;
if ((yych = *lexer->cursor) <= ':') {
@@ -1763,9 +1763,9 @@ yy181:
}
}
yy182:
-#line 241 "src/ast-lexer.cc"
+#line 241 "src/wast-lexer.cc"
{ TYPE(I64); RETURN(VALUE_TYPE); }
-#line 1769 "src/prebuilt/ast-lexer-gen.cc"
+#line 1769 "src/prebuilt/wast-lexer-gen.cc"
yy183:
yych = *++lexer->cursor;
if (yych == 'e') goto yy245;
@@ -1809,9 +1809,9 @@ yy185:
}
}
yy186:
-#line 225 "src/ast-lexer.cc"
+#line 225 "src/wast-lexer.cc"
{ LITERAL(Infinity); RETURN(FLOAT); }
-#line 1815 "src/prebuilt/ast-lexer-gen.cc"
+#line 1815 "src/prebuilt/wast-lexer-gen.cc"
yy187:
yych = *++lexer->cursor;
if (yych == 'u') goto yy248;
@@ -1841,9 +1841,9 @@ yy193:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 245 "src/ast-lexer.cc"
+#line 245 "src/wast-lexer.cc"
{ RETURN(MUT); }
-#line 1847 "src/prebuilt/ast-lexer-gen.cc"
+#line 1847 "src/prebuilt/wast-lexer-gen.cc"
yy195:
++lexer->cursor;
if ((yych = *lexer->cursor) <= ';') {
@@ -1878,17 +1878,17 @@ yy195:
}
}
yy196:
-#line 226 "src/ast-lexer.cc"
+#line 226 "src/wast-lexer.cc"
{ LITERAL(Nan); RETURN(FLOAT); }
-#line 1884 "src/prebuilt/ast-lexer-gen.cc"
+#line 1884 "src/prebuilt/wast-lexer-gen.cc"
yy197:
++lexer->cursor;
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 246 "src/ast-lexer.cc"
+#line 246 "src/wast-lexer.cc"
{ RETURN(NOP); }
-#line 1892 "src/prebuilt/ast-lexer-gen.cc"
+#line 1892 "src/prebuilt/wast-lexer-gen.cc"
yy199:
yych = *++lexer->cursor;
if (yych == 's') goto yy256;
@@ -2110,9 +2110,9 @@ yy224:
}
}
yy225:
-#line 256 "src/ast-lexer.cc"
+#line 256 "src/wast-lexer.cc"
{ RETURN(CALL); }
-#line 2116 "src/prebuilt/ast-lexer-gen.cc"
+#line 2116 "src/prebuilt/wast-lexer-gen.cc"
yy226:
yych = *++lexer->cursor;
if (yych == 'e') goto yy285;
@@ -2122,33 +2122,33 @@ yy227:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 434 "src/ast-lexer.cc"
+#line 434 "src/wast-lexer.cc"
{ RETURN(DATA); }
-#line 2128 "src/prebuilt/ast-lexer-gen.cc"
+#line 2128 "src/prebuilt/wast-lexer-gen.cc"
yy229:
++lexer->cursor;
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 259 "src/ast-lexer.cc"
+#line 259 "src/wast-lexer.cc"
{ RETURN(DROP); }
-#line 2136 "src/prebuilt/ast-lexer-gen.cc"
+#line 2136 "src/prebuilt/wast-lexer-gen.cc"
yy231:
++lexer->cursor;
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 433 "src/ast-lexer.cc"
+#line 433 "src/wast-lexer.cc"
{ RETURN(ELEM); }
-#line 2144 "src/prebuilt/ast-lexer-gen.cc"
+#line 2144 "src/prebuilt/wast-lexer-gen.cc"
yy233:
++lexer->cursor;
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 251 "src/ast-lexer.cc"
+#line 251 "src/wast-lexer.cc"
{ RETURN(ELSE); }
-#line 2152 "src/prebuilt/ast-lexer-gen.cc"
+#line 2152 "src/prebuilt/wast-lexer-gen.cc"
yy235:
yych = *++lexer->cursor;
if (yych == 'r') goto yy286;
@@ -2193,9 +2193,9 @@ yy238:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 424 "src/ast-lexer.cc"
+#line 424 "src/wast-lexer.cc"
{ RETURN(FUNC); }
-#line 2199 "src/prebuilt/ast-lexer-gen.cc"
+#line 2199 "src/prebuilt/wast-lexer-gen.cc"
yy240:
yych = *++lexer->cursor;
if (yych == 'g') goto yy312;
@@ -2277,9 +2277,9 @@ yy251:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 252 "src/ast-lexer.cc"
+#line 252 "src/wast-lexer.cc"
{ RETURN(LOOP); }
-#line 2283 "src/prebuilt/ast-lexer-gen.cc"
+#line 2283 "src/prebuilt/wast-lexer-gen.cc"
yy253:
yych = *++lexer->cursor;
if (yych == 'r') goto yy353;
@@ -2342,17 +2342,17 @@ yy267:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 250 "src/ast-lexer.cc"
+#line 250 "src/wast-lexer.cc"
{ RETURN(THEN); }
-#line 2348 "src/prebuilt/ast-lexer-gen.cc"
+#line 2348 "src/prebuilt/wast-lexer-gen.cc"
yy269:
++lexer->cursor;
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 423 "src/ast-lexer.cc"
+#line 423 "src/wast-lexer.cc"
{ RETURN(TYPE); }
-#line 2356 "src/prebuilt/ast-lexer-gen.cc"
+#line 2356 "src/prebuilt/wast-lexer-gen.cc"
yy271:
yych = *++lexer->cursor;
if (yych == 'a') goto yy371;
@@ -2398,9 +2398,9 @@ yy273:
}
}
yy275:
-#line 224 "src/ast-lexer.cc"
+#line 224 "src/wast-lexer.cc"
{ LITERAL(Hexfloat); RETURN(FLOAT); }
-#line 2404 "src/prebuilt/ast-lexer-gen.cc"
+#line 2404 "src/prebuilt/wast-lexer-gen.cc"
yy276:
yych = *++lexer->cursor;
if (yych == '=') goto yy372;
@@ -2418,17 +2418,17 @@ yy279:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 247 "src/ast-lexer.cc"
+#line 247 "src/wast-lexer.cc"
{ RETURN(BLOCK); }
-#line 2424 "src/prebuilt/ast-lexer-gen.cc"
+#line 2424 "src/prebuilt/wast-lexer-gen.cc"
yy281:
++lexer->cursor;
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 254 "src/ast-lexer.cc"
+#line 254 "src/wast-lexer.cc"
{ RETURN(BR_IF); }
-#line 2432 "src/prebuilt/ast-lexer-gen.cc"
+#line 2432 "src/prebuilt/wast-lexer-gen.cc"
yy283:
yych = *++lexer->cursor;
if (yych == 'b') goto yy375;
@@ -2780,9 +2780,9 @@ yy348:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 451 "src/ast-lexer.cc"
+#line 451 "src/wast-lexer.cc"
{ RETURN(INPUT); }
-#line 2786 "src/prebuilt/ast-lexer-gen.cc"
+#line 2786 "src/prebuilt/wast-lexer-gen.cc"
yy350:
yych = *++lexer->cursor;
if (yych == 'e') goto yy499;
@@ -2792,9 +2792,9 @@ yy351:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 427 "src/ast-lexer.cc"
+#line 427 "src/wast-lexer.cc"
{ RETURN(LOCAL); }
-#line 2798 "src/prebuilt/ast-lexer-gen.cc"
+#line 2798 "src/prebuilt/wast-lexer-gen.cc"
yy353:
yych = *++lexer->cursor;
if (yych == 'y') goto yy501;
@@ -2820,9 +2820,9 @@ yy358:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 425 "src/ast-lexer.cc"
+#line 425 "src/wast-lexer.cc"
{ RETURN(PARAM); }
-#line 2826 "src/prebuilt/ast-lexer-gen.cc"
+#line 2826 "src/prebuilt/wast-lexer-gen.cc"
yy360:
yych = *++lexer->cursor;
if (yych == 't') goto yy510;
@@ -2852,17 +2852,17 @@ yy366:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 432 "src/ast-lexer.cc"
+#line 432 "src/wast-lexer.cc"
{ RETURN(START); }
-#line 2858 "src/prebuilt/ast-lexer-gen.cc"
+#line 2858 "src/prebuilt/wast-lexer-gen.cc"
yy368:
++lexer->cursor;
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 430 "src/ast-lexer.cc"
+#line 430 "src/wast-lexer.cc"
{ RETURN(TABLE); }
-#line 2866 "src/prebuilt/ast-lexer-gen.cc"
+#line 2866 "src/prebuilt/wast-lexer-gen.cc"
yy370:
yych = *++lexer->cursor;
if (yych == 'o') goto yy519;
@@ -2904,9 +2904,9 @@ yy378:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 437 "src/ast-lexer.cc"
+#line 437 "src/wast-lexer.cc"
{ RETURN(EXPORT); }
-#line 2910 "src/prebuilt/ast-lexer-gen.cc"
+#line 2910 "src/prebuilt/wast-lexer-gen.cc"
yy380:
yych = *++lexer->cursor;
if (yych == 's') goto yy532;
@@ -2937,9 +2937,9 @@ yy386:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 382 "src/ast-lexer.cc"
+#line 382 "src/wast-lexer.cc"
{ OPCODE(F32Eq); RETURN(COMPARE); }
-#line 2943 "src/prebuilt/ast-lexer-gen.cc"
+#line 2943 "src/prebuilt/wast-lexer-gen.cc"
yy388:
yych = *++lexer->cursor;
if (yych == 'o') goto yy542;
@@ -2949,25 +2949,25 @@ yy389:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 392 "src/ast-lexer.cc"
+#line 392 "src/wast-lexer.cc"
{ OPCODE(F32Ge); RETURN(COMPARE); }
-#line 2955 "src/prebuilt/ast-lexer-gen.cc"
+#line 2955 "src/prebuilt/wast-lexer-gen.cc"
yy391:
++lexer->cursor;
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 390 "src/ast-lexer.cc"
+#line 390 "src/wast-lexer.cc"
{ OPCODE(F32Gt); RETURN(COMPARE); }
-#line 2963 "src/prebuilt/ast-lexer-gen.cc"
+#line 2963 "src/prebuilt/wast-lexer-gen.cc"
yy393:
++lexer->cursor;
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 388 "src/ast-lexer.cc"
+#line 388 "src/wast-lexer.cc"
{ OPCODE(F32Le); RETURN(COMPARE); }
-#line 2971 "src/prebuilt/ast-lexer-gen.cc"
+#line 2971 "src/prebuilt/wast-lexer-gen.cc"
yy395:
yych = *++lexer->cursor;
if (yych == 'a') goto yy543;
@@ -2977,9 +2977,9 @@ yy396:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 386 "src/ast-lexer.cc"
+#line 386 "src/wast-lexer.cc"
{ OPCODE(F32Lt); RETURN(COMPARE); }
-#line 2983 "src/prebuilt/ast-lexer-gen.cc"
+#line 2983 "src/prebuilt/wast-lexer-gen.cc"
yy398:
yych = *++lexer->cursor;
if (yych == 'x') goto yy544;
@@ -3028,9 +3028,9 @@ yy401:
}
}
yy402:
-#line 384 "src/ast-lexer.cc"
+#line 384 "src/wast-lexer.cc"
{ OPCODE(F32Ne); RETURN(COMPARE); }
-#line 3034 "src/prebuilt/ast-lexer-gen.cc"
+#line 3034 "src/prebuilt/wast-lexer-gen.cc"
yy403:
yych = *++lexer->cursor;
if (yych == 'i') goto yy553;
@@ -3077,9 +3077,9 @@ yy413:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 383 "src/ast-lexer.cc"
+#line 383 "src/wast-lexer.cc"
{ OPCODE(F64Eq); RETURN(COMPARE); }
-#line 3083 "src/prebuilt/ast-lexer-gen.cc"
+#line 3083 "src/prebuilt/wast-lexer-gen.cc"
yy415:
yych = *++lexer->cursor;
if (yych == 'o') goto yy568;
@@ -3089,25 +3089,25 @@ yy416:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 393 "src/ast-lexer.cc"
+#line 393 "src/wast-lexer.cc"
{ OPCODE(F64Ge); RETURN(COMPARE); }
-#line 3095 "src/prebuilt/ast-lexer-gen.cc"
+#line 3095 "src/prebuilt/wast-lexer-gen.cc"
yy418:
++lexer->cursor;
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 391 "src/ast-lexer.cc"
+#line 391 "src/wast-lexer.cc"
{ OPCODE(F64Gt); RETURN(COMPARE); }
-#line 3103 "src/prebuilt/ast-lexer-gen.cc"
+#line 3103 "src/prebuilt/wast-lexer-gen.cc"
yy420:
++lexer->cursor;
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 389 "src/ast-lexer.cc"
+#line 389 "src/wast-lexer.cc"
{ OPCODE(F64Le); RETURN(COMPARE); }
-#line 3111 "src/prebuilt/ast-lexer-gen.cc"
+#line 3111 "src/prebuilt/wast-lexer-gen.cc"
yy422:
yych = *++lexer->cursor;
if (yych == 'a') goto yy569;
@@ -3117,9 +3117,9 @@ yy423:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 387 "src/ast-lexer.cc"
+#line 387 "src/wast-lexer.cc"
{ OPCODE(F64Lt); RETURN(COMPARE); }
-#line 3123 "src/prebuilt/ast-lexer-gen.cc"
+#line 3123 "src/prebuilt/wast-lexer-gen.cc"
yy425:
yych = *++lexer->cursor;
if (yych == 'x') goto yy570;
@@ -3168,9 +3168,9 @@ yy428:
}
}
yy429:
-#line 385 "src/ast-lexer.cc"
+#line 385 "src/wast-lexer.cc"
{ OPCODE(F64Ne); RETURN(COMPARE); }
-#line 3174 "src/prebuilt/ast-lexer-gen.cc"
+#line 3174 "src/prebuilt/wast-lexer-gen.cc"
yy430:
yych = *++lexer->cursor;
if (yych == 'o') goto yy579;
@@ -3208,9 +3208,9 @@ yy438:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 428 "src/ast-lexer.cc"
+#line 428 "src/wast-lexer.cc"
{ RETURN(GLOBAL); }
-#line 3214 "src/prebuilt/ast-lexer-gen.cc"
+#line 3214 "src/prebuilt/wast-lexer-gen.cc"
yy440:
yych = *++lexer->cursor;
if (yych == 'e') goto yy588;
@@ -3274,9 +3274,9 @@ yy447:
}
}
yy448:
-#line 362 "src/ast-lexer.cc"
+#line 362 "src/wast-lexer.cc"
{ OPCODE(I32Eq); RETURN(COMPARE); }
-#line 3280 "src/prebuilt/ast-lexer-gen.cc"
+#line 3280 "src/prebuilt/wast-lexer-gen.cc"
yy449:
yych = *++lexer->cursor;
if (yych == '_') goto yy601;
@@ -3306,17 +3306,17 @@ yy455:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 364 "src/ast-lexer.cc"
+#line 364 "src/wast-lexer.cc"
{ OPCODE(I32Ne); RETURN(COMPARE); }
-#line 3312 "src/prebuilt/ast-lexer-gen.cc"
+#line 3312 "src/prebuilt/wast-lexer-gen.cc"
yy457:
++lexer->cursor;
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 334 "src/ast-lexer.cc"
+#line 334 "src/wast-lexer.cc"
{ OPCODE(I32Or); RETURN(BINARY); }
-#line 3320 "src/prebuilt/ast-lexer-gen.cc"
+#line 3320 "src/prebuilt/wast-lexer-gen.cc"
yy459:
yych = *++lexer->cursor;
if (yych == 'p') goto yy608;
@@ -3414,9 +3414,9 @@ yy474:
}
}
yy475:
-#line 363 "src/ast-lexer.cc"
+#line 363 "src/wast-lexer.cc"
{ OPCODE(I64Eq); RETURN(COMPARE); }
-#line 3420 "src/prebuilt/ast-lexer-gen.cc"
+#line 3420 "src/prebuilt/wast-lexer-gen.cc"
yy476:
yych = *++lexer->cursor;
if (yych == 't') goto yy634;
@@ -3450,17 +3450,17 @@ yy483:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 365 "src/ast-lexer.cc"
+#line 365 "src/wast-lexer.cc"
{ OPCODE(I64Ne); RETURN(COMPARE); }
-#line 3456 "src/prebuilt/ast-lexer-gen.cc"
+#line 3456 "src/prebuilt/wast-lexer-gen.cc"
yy485:
++lexer->cursor;
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 335 "src/ast-lexer.cc"
+#line 335 "src/wast-lexer.cc"
{ OPCODE(I64Or); RETURN(BINARY); }
-#line 3464 "src/prebuilt/ast-lexer-gen.cc"
+#line 3464 "src/prebuilt/wast-lexer-gen.cc"
yy487:
yych = *++lexer->cursor;
if (yych == 'p') goto yy642;
@@ -3504,9 +3504,9 @@ yy496:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 436 "src/ast-lexer.cc"
+#line 436 "src/wast-lexer.cc"
{ RETURN(IMPORT); }
-#line 3510 "src/prebuilt/ast-lexer-gen.cc"
+#line 3510 "src/prebuilt/wast-lexer-gen.cc"
yy498:
yych = *++lexer->cursor;
if (yych == 't') goto yy657;
@@ -3516,25 +3516,25 @@ yy499:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 439 "src/ast-lexer.cc"
+#line 439 "src/wast-lexer.cc"
{ RETURN(INVOKE); }
-#line 3522 "src/prebuilt/ast-lexer-gen.cc"
+#line 3522 "src/prebuilt/wast-lexer-gen.cc"
yy501:
++lexer->cursor;
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 431 "src/ast-lexer.cc"
+#line 431 "src/wast-lexer.cc"
{ RETURN(MEMORY); }
-#line 3530 "src/prebuilt/ast-lexer-gen.cc"
+#line 3530 "src/prebuilt/wast-lexer-gen.cc"
yy503:
++lexer->cursor;
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 429 "src/ast-lexer.cc"
+#line 429 "src/wast-lexer.cc"
{ RETURN(MODULE); }
-#line 3538 "src/prebuilt/ast-lexer-gen.cc"
+#line 3538 "src/prebuilt/wast-lexer-gen.cc"
yy505:
yych = *++lexer->cursor;
if (yych <= '@') {
@@ -3581,17 +3581,17 @@ yy506:
}
}
yy507:
-#line 435 "src/ast-lexer.cc"
+#line 435 "src/wast-lexer.cc"
{ RETURN(OFFSET); }
-#line 3587 "src/prebuilt/ast-lexer-gen.cc"
+#line 3587 "src/prebuilt/wast-lexer-gen.cc"
yy508:
++lexer->cursor;
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 452 "src/ast-lexer.cc"
+#line 452 "src/wast-lexer.cc"
{ RETURN(OUTPUT); }
-#line 3595 "src/prebuilt/ast-lexer-gen.cc"
+#line 3595 "src/prebuilt/wast-lexer-gen.cc"
yy510:
yych = *++lexer->cursor;
if (yych == 'e') goto yy661;
@@ -3601,25 +3601,25 @@ yy511:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 426 "src/ast-lexer.cc"
+#line 426 "src/wast-lexer.cc"
{ RETURN(RESULT); }
-#line 3607 "src/prebuilt/ast-lexer-gen.cc"
+#line 3607 "src/prebuilt/wast-lexer-gen.cc"
yy513:
++lexer->cursor;
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 261 "src/ast-lexer.cc"
+#line 261 "src/wast-lexer.cc"
{ RETURN(RETURN); }
-#line 3615 "src/prebuilt/ast-lexer-gen.cc"
+#line 3615 "src/prebuilt/wast-lexer-gen.cc"
yy515:
++lexer->cursor;
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 419 "src/ast-lexer.cc"
+#line 419 "src/wast-lexer.cc"
{ RETURN(SELECT); }
-#line 3623 "src/prebuilt/ast-lexer-gen.cc"
+#line 3623 "src/prebuilt/wast-lexer-gen.cc"
yy517:
yych = *++lexer->cursor;
if (yych == 'o') goto yy662;
@@ -3672,9 +3672,9 @@ yy521:
}
}
yy522:
-#line 291 "src/ast-lexer.cc"
+#line 291 "src/wast-lexer.cc"
{ TEXT_AT(6); RETURN(ALIGN_EQ_NAT); }
-#line 3678 "src/prebuilt/ast-lexer-gen.cc"
+#line 3678 "src/prebuilt/wast-lexer-gen.cc"
yy523:
++lexer->cursor;
if (lexer->limit <= lexer->cursor) FILL(1);
@@ -3723,9 +3723,9 @@ yy525:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 244 "src/ast-lexer.cc"
+#line 244 "src/wast-lexer.cc"
{ RETURN(ANYFUNC); }
-#line 3729 "src/prebuilt/ast-lexer-gen.cc"
+#line 3729 "src/prebuilt/wast-lexer-gen.cc"
yy527:
yych = *++lexer->cursor;
switch (yych) {
@@ -3758,17 +3758,17 @@ yy532:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 306 "src/ast-lexer.cc"
+#line 306 "src/wast-lexer.cc"
{ OPCODE(F32Abs); RETURN(UNARY); }
-#line 3764 "src/prebuilt/ast-lexer-gen.cc"
+#line 3764 "src/prebuilt/wast-lexer-gen.cc"
yy534:
++lexer->cursor;
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 348 "src/ast-lexer.cc"
+#line 348 "src/wast-lexer.cc"
{ OPCODE(F32Add); RETURN(BINARY); }
-#line 3772 "src/prebuilt/ast-lexer-gen.cc"
+#line 3772 "src/prebuilt/wast-lexer-gen.cc"
yy536:
yych = *++lexer->cursor;
if (yych == 'l') goto yy678;
@@ -3791,9 +3791,9 @@ yy540:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 354 "src/ast-lexer.cc"
+#line 354 "src/wast-lexer.cc"
{ OPCODE(F32Div); RETURN(BINARY); }
-#line 3797 "src/prebuilt/ast-lexer-gen.cc"
+#line 3797 "src/prebuilt/wast-lexer-gen.cc"
yy542:
yych = *++lexer->cursor;
if (yych == 'o') goto yy684;
@@ -3807,25 +3807,25 @@ yy544:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 358 "src/ast-lexer.cc"
+#line 358 "src/wast-lexer.cc"
{ OPCODE(F32Max); RETURN(BINARY); }
-#line 3813 "src/prebuilt/ast-lexer-gen.cc"
+#line 3813 "src/prebuilt/wast-lexer-gen.cc"
yy546:
++lexer->cursor;
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 356 "src/ast-lexer.cc"
+#line 356 "src/wast-lexer.cc"
{ OPCODE(F32Min); RETURN(BINARY); }
-#line 3821 "src/prebuilt/ast-lexer-gen.cc"
+#line 3821 "src/prebuilt/wast-lexer-gen.cc"
yy548:
++lexer->cursor;
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 352 "src/ast-lexer.cc"
+#line 352 "src/wast-lexer.cc"
{ OPCODE(F32Mul); RETURN(BINARY); }
-#line 3829 "src/prebuilt/ast-lexer-gen.cc"
+#line 3829 "src/prebuilt/wast-lexer-gen.cc"
yy550:
yych = *++lexer->cursor;
if (yych == 'r') goto yy687;
@@ -3835,9 +3835,9 @@ yy551:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 304 "src/ast-lexer.cc"
+#line 304 "src/wast-lexer.cc"
{ OPCODE(F32Neg); RETURN(UNARY); }
-#line 3841 "src/prebuilt/ast-lexer-gen.cc"
+#line 3841 "src/prebuilt/wast-lexer-gen.cc"
yy553:
yych = *++lexer->cursor;
if (yych == 'n') goto yy688;
@@ -3855,9 +3855,9 @@ yy556:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 350 "src/ast-lexer.cc"
+#line 350 "src/wast-lexer.cc"
{ OPCODE(F32Sub); RETURN(BINARY); }
-#line 3861 "src/prebuilt/ast-lexer-gen.cc"
+#line 3861 "src/prebuilt/wast-lexer-gen.cc"
yy558:
yych = *++lexer->cursor;
if (yych == 'n') goto yy692;
@@ -3867,17 +3867,17 @@ yy559:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 307 "src/ast-lexer.cc"
+#line 307 "src/wast-lexer.cc"
{ OPCODE(F64Abs); RETURN(UNARY); }
-#line 3873 "src/prebuilt/ast-lexer-gen.cc"
+#line 3873 "src/prebuilt/wast-lexer-gen.cc"
yy561:
++lexer->cursor;
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 349 "src/ast-lexer.cc"
+#line 349 "src/wast-lexer.cc"
{ OPCODE(F64Add); RETURN(BINARY); }
-#line 3881 "src/prebuilt/ast-lexer-gen.cc"
+#line 3881 "src/prebuilt/wast-lexer-gen.cc"
yy563:
yych = *++lexer->cursor;
if (yych == 'l') goto yy693;
@@ -3896,9 +3896,9 @@ yy566:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 355 "src/ast-lexer.cc"
+#line 355 "src/wast-lexer.cc"
{ OPCODE(F64Div); RETURN(BINARY); }
-#line 3902 "src/prebuilt/ast-lexer-gen.cc"
+#line 3902 "src/prebuilt/wast-lexer-gen.cc"
yy568:
yych = *++lexer->cursor;
if (yych == 'o') goto yy698;
@@ -3912,25 +3912,25 @@ yy570:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 359 "src/ast-lexer.cc"
+#line 359 "src/wast-lexer.cc"
{ OPCODE(F64Max); RETURN(BINARY); }
-#line 3918 "src/prebuilt/ast-lexer-gen.cc"
+#line 3918 "src/prebuilt/wast-lexer-gen.cc"
yy572:
++lexer->cursor;
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 357 "src/ast-lexer.cc"
+#line 357 "src/wast-lexer.cc"
{ OPCODE(F64Min); RETURN(BINARY); }
-#line 3926 "src/prebuilt/ast-lexer-gen.cc"
+#line 3926 "src/prebuilt/wast-lexer-gen.cc"
yy574:
++lexer->cursor;
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 353 "src/ast-lexer.cc"
+#line 353 "src/wast-lexer.cc"
{ OPCODE(F64Mul); RETURN(BINARY); }
-#line 3934 "src/prebuilt/ast-lexer-gen.cc"
+#line 3934 "src/prebuilt/wast-lexer-gen.cc"
yy576:
yych = *++lexer->cursor;
if (yych == 'r') goto yy701;
@@ -3940,9 +3940,9 @@ yy577:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 305 "src/ast-lexer.cc"
+#line 305 "src/wast-lexer.cc"
{ OPCODE(F64Neg); RETURN(UNARY); }
-#line 3946 "src/prebuilt/ast-lexer-gen.cc"
+#line 3946 "src/prebuilt/wast-lexer-gen.cc"
yy579:
yych = *++lexer->cursor;
if (yych == 'm') goto yy702;
@@ -3964,9 +3964,9 @@ yy583:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 351 "src/ast-lexer.cc"
+#line 351 "src/wast-lexer.cc"
{ OPCODE(F64Sub); RETURN(BINARY); }
-#line 3970 "src/prebuilt/ast-lexer-gen.cc"
+#line 3970 "src/prebuilt/wast-lexer-gen.cc"
yy585:
yych = *++lexer->cursor;
if (yych == 'n') goto yy707;
@@ -3988,25 +3988,25 @@ yy589:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 318 "src/ast-lexer.cc"
+#line 318 "src/wast-lexer.cc"
{ OPCODE(I32Add); RETURN(BINARY); }
-#line 3994 "src/prebuilt/ast-lexer-gen.cc"
+#line 3994 "src/prebuilt/wast-lexer-gen.cc"
yy591:
++lexer->cursor;
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 332 "src/ast-lexer.cc"
+#line 332 "src/wast-lexer.cc"
{ OPCODE(I32And); RETURN(BINARY); }
-#line 4002 "src/prebuilt/ast-lexer-gen.cc"
+#line 4002 "src/prebuilt/wast-lexer-gen.cc"
yy593:
++lexer->cursor;
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 298 "src/ast-lexer.cc"
+#line 298 "src/wast-lexer.cc"
{ OPCODE(I32Clz); RETURN(UNARY); }
-#line 4010 "src/prebuilt/ast-lexer-gen.cc"
+#line 4010 "src/prebuilt/wast-lexer-gen.cc"
yy595:
yych = *++lexer->cursor;
if (yych == 's') goto yy711;
@@ -4016,9 +4016,9 @@ yy596:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 300 "src/ast-lexer.cc"
+#line 300 "src/wast-lexer.cc"
{ OPCODE(I32Ctz); RETURN(UNARY); }
-#line 4022 "src/prebuilt/ast-lexer-gen.cc"
+#line 4022 "src/prebuilt/wast-lexer-gen.cc"
yy598:
yych = *++lexer->cursor;
if (yych == '_') goto yy712;
@@ -4028,9 +4028,9 @@ yy599:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 296 "src/ast-lexer.cc"
+#line 296 "src/wast-lexer.cc"
{ OPCODE(I32Eqz); RETURN(CONVERT); }
-#line 4034 "src/prebuilt/ast-lexer-gen.cc"
+#line 4034 "src/prebuilt/wast-lexer-gen.cc"
yy601:
yych = *++lexer->cursor;
if (yych == 's') goto yy713;
@@ -4060,9 +4060,9 @@ yy606:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 322 "src/ast-lexer.cc"
+#line 322 "src/wast-lexer.cc"
{ OPCODE(I32Mul); RETURN(BINARY); }
-#line 4066 "src/prebuilt/ast-lexer-gen.cc"
+#line 4066 "src/prebuilt/wast-lexer-gen.cc"
yy608:
yych = *++lexer->cursor;
if (yych == 'c') goto yy731;
@@ -4085,9 +4085,9 @@ yy612:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 338 "src/ast-lexer.cc"
+#line 338 "src/wast-lexer.cc"
{ OPCODE(I32Shl); RETURN(BINARY); }
-#line 4091 "src/prebuilt/ast-lexer-gen.cc"
+#line 4091 "src/prebuilt/wast-lexer-gen.cc"
yy614:
yych = *++lexer->cursor;
if (yych == '_') goto yy738;
@@ -4101,9 +4101,9 @@ yy616:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 320 "src/ast-lexer.cc"
+#line 320 "src/wast-lexer.cc"
{ OPCODE(I32Sub); RETURN(BINARY); }
-#line 4107 "src/prebuilt/ast-lexer-gen.cc"
+#line 4107 "src/prebuilt/wast-lexer-gen.cc"
yy618:
yych = *++lexer->cursor;
if (yych == 'n') goto yy740;
@@ -4117,33 +4117,33 @@ yy620:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 336 "src/ast-lexer.cc"
+#line 336 "src/wast-lexer.cc"
{ OPCODE(I32Xor); RETURN(BINARY); }
-#line 4123 "src/prebuilt/ast-lexer-gen.cc"
+#line 4123 "src/prebuilt/wast-lexer-gen.cc"
yy622:
++lexer->cursor;
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 319 "src/ast-lexer.cc"
+#line 319 "src/wast-lexer.cc"
{ OPCODE(I64Add); RETURN(BINARY); }
-#line 4131 "src/prebuilt/ast-lexer-gen.cc"
+#line 4131 "src/prebuilt/wast-lexer-gen.cc"
yy624:
++lexer->cursor;
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 333 "src/ast-lexer.cc"
+#line 333 "src/wast-lexer.cc"
{ OPCODE(I64And); RETURN(BINARY); }
-#line 4139 "src/prebuilt/ast-lexer-gen.cc"
+#line 4139 "src/prebuilt/wast-lexer-gen.cc"
yy626:
++lexer->cursor;
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 299 "src/ast-lexer.cc"
+#line 299 "src/wast-lexer.cc"
{ OPCODE(I64Clz); RETURN(UNARY); }
-#line 4147 "src/prebuilt/ast-lexer-gen.cc"
+#line 4147 "src/prebuilt/wast-lexer-gen.cc"
yy628:
yych = *++lexer->cursor;
if (yych == 's') goto yy742;
@@ -4153,9 +4153,9 @@ yy629:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 301 "src/ast-lexer.cc"
+#line 301 "src/wast-lexer.cc"
{ OPCODE(I64Ctz); RETURN(UNARY); }
-#line 4159 "src/prebuilt/ast-lexer-gen.cc"
+#line 4159 "src/prebuilt/wast-lexer-gen.cc"
yy631:
yych = *++lexer->cursor;
if (yych == '_') goto yy743;
@@ -4165,9 +4165,9 @@ yy632:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 297 "src/ast-lexer.cc"
+#line 297 "src/wast-lexer.cc"
{ OPCODE(I64Eqz); RETURN(CONVERT); }
-#line 4171 "src/prebuilt/ast-lexer-gen.cc"
+#line 4171 "src/prebuilt/wast-lexer-gen.cc"
yy634:
yych = *++lexer->cursor;
if (yych == 'e') goto yy744;
@@ -4201,9 +4201,9 @@ yy640:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 323 "src/ast-lexer.cc"
+#line 323 "src/wast-lexer.cc"
{ OPCODE(I64Mul); RETURN(BINARY); }
-#line 4207 "src/prebuilt/ast-lexer-gen.cc"
+#line 4207 "src/prebuilt/wast-lexer-gen.cc"
yy642:
yych = *++lexer->cursor;
if (yych == 'c') goto yy763;
@@ -4226,9 +4226,9 @@ yy646:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 339 "src/ast-lexer.cc"
+#line 339 "src/wast-lexer.cc"
{ OPCODE(I64Shl); RETURN(BINARY); }
-#line 4232 "src/prebuilt/ast-lexer-gen.cc"
+#line 4232 "src/prebuilt/wast-lexer-gen.cc"
yy648:
yych = *++lexer->cursor;
if (yych == '_') goto yy770;
@@ -4242,9 +4242,9 @@ yy650:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 321 "src/ast-lexer.cc"
+#line 321 "src/wast-lexer.cc"
{ OPCODE(I64Sub); RETURN(BINARY); }
-#line 4248 "src/prebuilt/ast-lexer-gen.cc"
+#line 4248 "src/prebuilt/wast-lexer-gen.cc"
yy652:
yych = *++lexer->cursor;
if (yych == 'n') goto yy772;
@@ -4254,17 +4254,17 @@ yy653:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 337 "src/ast-lexer.cc"
+#line 337 "src/wast-lexer.cc"
{ OPCODE(I64Xor); RETURN(BINARY); }
-#line 4260 "src/prebuilt/ast-lexer-gen.cc"
+#line 4260 "src/prebuilt/wast-lexer-gen.cc"
yy655:
++lexer->cursor;
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 249 "src/ast-lexer.cc"
+#line 249 "src/wast-lexer.cc"
{ RETURN(IF); }
-#line 4268 "src/prebuilt/ast-lexer-gen.cc"
+#line 4268 "src/prebuilt/wast-lexer-gen.cc"
yy657:
yych = *++lexer->cursor;
if (yych == 'y') goto yy773;
@@ -4382,9 +4382,9 @@ yy673:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 255 "src/ast-lexer.cc"
+#line 255 "src/wast-lexer.cc"
{ RETURN(BR_TABLE); }
-#line 4388 "src/prebuilt/ast-lexer-gen.cc"
+#line 4388 "src/prebuilt/wast-lexer-gen.cc"
yy675:
yych = *++lexer->cursor;
if (yych == 'o') goto yy792;
@@ -4402,9 +4402,9 @@ yy678:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 310 "src/ast-lexer.cc"
+#line 310 "src/wast-lexer.cc"
{ OPCODE(F32Ceil); RETURN(UNARY); }
-#line 4408 "src/prebuilt/ast-lexer-gen.cc"
+#line 4408 "src/prebuilt/wast-lexer-gen.cc"
yy680:
yych = *++lexer->cursor;
if (yych == 't') goto yy795;
@@ -4430,9 +4430,9 @@ yy685:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 269 "src/ast-lexer.cc"
+#line 269 "src/wast-lexer.cc"
{ OPCODE(F32Load); RETURN(LOAD); }
-#line 4436 "src/prebuilt/ast-lexer-gen.cc"
+#line 4436 "src/prebuilt/wast-lexer-gen.cc"
yy687:
yych = *++lexer->cursor;
if (yych == 'e') goto yy802;
@@ -4446,9 +4446,9 @@ yy689:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 308 "src/ast-lexer.cc"
+#line 308 "src/wast-lexer.cc"
{ OPCODE(F32Sqrt); RETURN(UNARY); }
-#line 4452 "src/prebuilt/ast-lexer-gen.cc"
+#line 4452 "src/prebuilt/wast-lexer-gen.cc"
yy691:
yych = *++lexer->cursor;
if (yych == 'e') goto yy804;
@@ -4462,9 +4462,9 @@ yy693:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 311 "src/ast-lexer.cc"
+#line 311 "src/wast-lexer.cc"
{ OPCODE(F64Ceil); RETURN(UNARY); }
-#line 4468 "src/prebuilt/ast-lexer-gen.cc"
+#line 4468 "src/prebuilt/wast-lexer-gen.cc"
yy695:
yych = *++lexer->cursor;
if (yych == 't') goto yy808;
@@ -4486,9 +4486,9 @@ yy699:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 270 "src/ast-lexer.cc"
+#line 270 "src/wast-lexer.cc"
{ OPCODE(F64Load); RETURN(LOAD); }
-#line 4492 "src/prebuilt/ast-lexer-gen.cc"
+#line 4492 "src/prebuilt/wast-lexer-gen.cc"
yy701:
yych = *++lexer->cursor;
if (yych == 'e') goto yy814;
@@ -4506,9 +4506,9 @@ yy704:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 309 "src/ast-lexer.cc"
+#line 309 "src/wast-lexer.cc"
{ OPCODE(F64Sqrt); RETURN(UNARY); }
-#line 4512 "src/prebuilt/ast-lexer-gen.cc"
+#line 4512 "src/prebuilt/wast-lexer-gen.cc"
yy706:
yych = *++lexer->cursor;
if (yych == 'e') goto yy817;
@@ -4543,49 +4543,49 @@ yy713:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 378 "src/ast-lexer.cc"
+#line 378 "src/wast-lexer.cc"
{ OPCODE(I32GeS); RETURN(COMPARE); }
-#line 4549 "src/prebuilt/ast-lexer-gen.cc"
+#line 4549 "src/prebuilt/wast-lexer-gen.cc"
yy715:
++lexer->cursor;
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 380 "src/ast-lexer.cc"
+#line 380 "src/wast-lexer.cc"
{ OPCODE(I32GeU); RETURN(COMPARE); }
-#line 4557 "src/prebuilt/ast-lexer-gen.cc"
+#line 4557 "src/prebuilt/wast-lexer-gen.cc"
yy717:
++lexer->cursor;
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 374 "src/ast-lexer.cc"
+#line 374 "src/wast-lexer.cc"
{ OPCODE(I32GtS); RETURN(COMPARE); }
-#line 4565 "src/prebuilt/ast-lexer-gen.cc"
+#line 4565 "src/prebuilt/wast-lexer-gen.cc"
yy719:
++lexer->cursor;
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 376 "src/ast-lexer.cc"
+#line 376 "src/wast-lexer.cc"
{ OPCODE(I32GtU); RETURN(COMPARE); }
-#line 4573 "src/prebuilt/ast-lexer-gen.cc"
+#line 4573 "src/prebuilt/wast-lexer-gen.cc"
yy721:
++lexer->cursor;
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 370 "src/ast-lexer.cc"
+#line 370 "src/wast-lexer.cc"
{ OPCODE(I32LeS); RETURN(COMPARE); }
-#line 4581 "src/prebuilt/ast-lexer-gen.cc"
+#line 4581 "src/prebuilt/wast-lexer-gen.cc"
yy723:
++lexer->cursor;
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 372 "src/ast-lexer.cc"
+#line 372 "src/wast-lexer.cc"
{ OPCODE(I32LeU); RETURN(COMPARE); }
-#line 4589 "src/prebuilt/ast-lexer-gen.cc"
+#line 4589 "src/prebuilt/wast-lexer-gen.cc"
yy725:
++lexer->cursor;
if ((yych = *lexer->cursor) <= '8') {
@@ -4621,25 +4621,25 @@ yy725:
}
}
yy726:
-#line 267 "src/ast-lexer.cc"
+#line 267 "src/wast-lexer.cc"
{ OPCODE(I32Load); RETURN(LOAD); }
-#line 4627 "src/prebuilt/ast-lexer-gen.cc"
+#line 4627 "src/prebuilt/wast-lexer-gen.cc"
yy727:
++lexer->cursor;
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 366 "src/ast-lexer.cc"
+#line 366 "src/wast-lexer.cc"
{ OPCODE(I32LtS); RETURN(COMPARE); }
-#line 4635 "src/prebuilt/ast-lexer-gen.cc"
+#line 4635 "src/prebuilt/wast-lexer-gen.cc"
yy729:
++lexer->cursor;
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 368 "src/ast-lexer.cc"
+#line 368 "src/wast-lexer.cc"
{ OPCODE(I32LtU); RETURN(COMPARE); }
-#line 4643 "src/prebuilt/ast-lexer-gen.cc"
+#line 4643 "src/prebuilt/wast-lexer-gen.cc"
yy731:
yych = *++lexer->cursor;
if (yych == 'n') goto yy833;
@@ -4658,17 +4658,17 @@ yy734:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 344 "src/ast-lexer.cc"
+#line 344 "src/wast-lexer.cc"
{ OPCODE(I32Rotl); RETURN(BINARY); }
-#line 4664 "src/prebuilt/ast-lexer-gen.cc"
+#line 4664 "src/prebuilt/wast-lexer-gen.cc"
yy736:
++lexer->cursor;
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 346 "src/ast-lexer.cc"
+#line 346 "src/wast-lexer.cc"
{ OPCODE(I32Rotr); RETURN(BINARY); }
-#line 4672 "src/prebuilt/ast-lexer-gen.cc"
+#line 4672 "src/prebuilt/wast-lexer-gen.cc"
yy738:
yych = *++lexer->cursor;
if (yych == 's') goto yy839;
@@ -4704,49 +4704,49 @@ yy745:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 379 "src/ast-lexer.cc"
+#line 379 "src/wast-lexer.cc"
{ OPCODE(I64GeS); RETURN(COMPARE); }
-#line 4710 "src/prebuilt/ast-lexer-gen.cc"
+#line 4710 "src/prebuilt/wast-lexer-gen.cc"
yy747:
++lexer->cursor;
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 381 "src/ast-lexer.cc"
+#line 381 "src/wast-lexer.cc"
{ OPCODE(I64GeU); RETURN(COMPARE); }
-#line 4718 "src/prebuilt/ast-lexer-gen.cc"
+#line 4718 "src/prebuilt/wast-lexer-gen.cc"
yy749:
++lexer->cursor;
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 375 "src/ast-lexer.cc"
+#line 375 "src/wast-lexer.cc"
{ OPCODE(I64GtS); RETURN(COMPARE); }
-#line 4726 "src/prebuilt/ast-lexer-gen.cc"
+#line 4726 "src/prebuilt/wast-lexer-gen.cc"
yy751:
++lexer->cursor;
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 377 "src/ast-lexer.cc"
+#line 377 "src/wast-lexer.cc"
{ OPCODE(I64GtU); RETURN(COMPARE); }
-#line 4734 "src/prebuilt/ast-lexer-gen.cc"
+#line 4734 "src/prebuilt/wast-lexer-gen.cc"
yy753:
++lexer->cursor;
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 371 "src/ast-lexer.cc"
+#line 371 "src/wast-lexer.cc"
{ OPCODE(I64LeS); RETURN(COMPARE); }
-#line 4742 "src/prebuilt/ast-lexer-gen.cc"
+#line 4742 "src/prebuilt/wast-lexer-gen.cc"
yy755:
++lexer->cursor;
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 373 "src/ast-lexer.cc"
+#line 373 "src/wast-lexer.cc"
{ OPCODE(I64LeU); RETURN(COMPARE); }
-#line 4750 "src/prebuilt/ast-lexer-gen.cc"
+#line 4750 "src/prebuilt/wast-lexer-gen.cc"
yy757:
++lexer->cursor;
if ((yych = *lexer->cursor) <= '7') {
@@ -4786,25 +4786,25 @@ yy757:
}
}
yy758:
-#line 268 "src/ast-lexer.cc"
+#line 268 "src/wast-lexer.cc"
{ OPCODE(I64Load); RETURN(LOAD); }
-#line 4792 "src/prebuilt/ast-lexer-gen.cc"
+#line 4792 "src/prebuilt/wast-lexer-gen.cc"
yy759:
++lexer->cursor;
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 367 "src/ast-lexer.cc"
+#line 367 "src/wast-lexer.cc"
{ OPCODE(I64LtS); RETURN(COMPARE); }
-#line 4800 "src/prebuilt/ast-lexer-gen.cc"
+#line 4800 "src/prebuilt/wast-lexer-gen.cc"
yy761:
++lexer->cursor;
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 369 "src/ast-lexer.cc"
+#line 369 "src/wast-lexer.cc"
{ OPCODE(I64LtU); RETURN(COMPARE); }
-#line 4808 "src/prebuilt/ast-lexer-gen.cc"
+#line 4808 "src/prebuilt/wast-lexer-gen.cc"
yy763:
yych = *++lexer->cursor;
if (yych == 'n') goto yy857;
@@ -4823,17 +4823,17 @@ yy766:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 345 "src/ast-lexer.cc"
+#line 345 "src/wast-lexer.cc"
{ OPCODE(I64Rotl); RETURN(BINARY); }
-#line 4829 "src/prebuilt/ast-lexer-gen.cc"
+#line 4829 "src/prebuilt/wast-lexer-gen.cc"
yy768:
++lexer->cursor;
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 347 "src/ast-lexer.cc"
+#line 347 "src/wast-lexer.cc"
{ OPCODE(I64Rotr); RETURN(BINARY); }
-#line 4837 "src/prebuilt/ast-lexer-gen.cc"
+#line 4837 "src/prebuilt/wast-lexer-gen.cc"
yy770:
yych = *++lexer->cursor;
if (yych == 's') goto yy863;
@@ -4889,9 +4889,9 @@ yy774:
}
}
yy775:
-#line 290 "src/ast-lexer.cc"
+#line 290 "src/wast-lexer.cc"
{ TEXT_AT(7); RETURN(OFFSET_EQ_NAT); }
-#line 4895 "src/prebuilt/ast-lexer-gen.cc"
+#line 4895 "src/prebuilt/wast-lexer-gen.cc"
yy776:
++lexer->cursor;
if (lexer->limit <= lexer->cursor) FILL(1);
@@ -4940,9 +4940,9 @@ yy778:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 438 "src/ast-lexer.cc"
+#line 438 "src/wast-lexer.cc"
{ RETURN(REGISTER); }
-#line 4946 "src/prebuilt/ast-lexer-gen.cc"
+#line 4946 "src/prebuilt/wast-lexer-gen.cc"
yy780:
yych = *++lexer->cursor;
if (yych == 'a') goto yy871;
@@ -5046,9 +5046,9 @@ yy795:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 294 "src/ast-lexer.cc"
+#line 294 "src/wast-lexer.cc"
{ TYPE(F32); RETURN(CONST); }
-#line 5052 "src/prebuilt/ast-lexer-gen.cc"
+#line 5052 "src/prebuilt/wast-lexer-gen.cc"
yy797:
yych = *++lexer->cursor;
if (yych == 'r') goto yy886;
@@ -5066,9 +5066,9 @@ yy800:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 312 "src/ast-lexer.cc"
+#line 312 "src/wast-lexer.cc"
{ OPCODE(F32Floor); RETURN(UNARY); }
-#line 5072 "src/prebuilt/ast-lexer-gen.cc"
+#line 5072 "src/prebuilt/wast-lexer-gen.cc"
yy802:
yych = *++lexer->cursor;
if (yych == 's') goto yy889;
@@ -5082,25 +5082,25 @@ yy804:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 273 "src/ast-lexer.cc"
+#line 273 "src/wast-lexer.cc"
{ OPCODE(F32Store); RETURN(STORE); }
-#line 5088 "src/prebuilt/ast-lexer-gen.cc"
+#line 5088 "src/prebuilt/wast-lexer-gen.cc"
yy806:
++lexer->cursor;
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 314 "src/ast-lexer.cc"
+#line 314 "src/wast-lexer.cc"
{ OPCODE(F32Trunc); RETURN(UNARY); }
-#line 5096 "src/prebuilt/ast-lexer-gen.cc"
+#line 5096 "src/prebuilt/wast-lexer-gen.cc"
yy808:
++lexer->cursor;
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 295 "src/ast-lexer.cc"
+#line 295 "src/wast-lexer.cc"
{ TYPE(F64); RETURN(CONST); }
-#line 5104 "src/prebuilt/ast-lexer-gen.cc"
+#line 5104 "src/prebuilt/wast-lexer-gen.cc"
yy810:
yych = *++lexer->cursor;
if (yych == 'r') goto yy891;
@@ -5114,9 +5114,9 @@ yy812:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 313 "src/ast-lexer.cc"
+#line 313 "src/wast-lexer.cc"
{ OPCODE(F64Floor); RETURN(UNARY); }
-#line 5120 "src/prebuilt/ast-lexer-gen.cc"
+#line 5120 "src/prebuilt/wast-lexer-gen.cc"
yy814:
yych = *++lexer->cursor;
if (yych == 's') goto yy893;
@@ -5134,17 +5134,17 @@ yy817:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 274 "src/ast-lexer.cc"
+#line 274 "src/wast-lexer.cc"
{ OPCODE(F64Store); RETURN(STORE); }
-#line 5140 "src/prebuilt/ast-lexer-gen.cc"
+#line 5140 "src/prebuilt/wast-lexer-gen.cc"
yy819:
++lexer->cursor;
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 315 "src/ast-lexer.cc"
+#line 315 "src/wast-lexer.cc"
{ OPCODE(F64Trunc); RETURN(UNARY); }
-#line 5148 "src/prebuilt/ast-lexer-gen.cc"
+#line 5148 "src/prebuilt/wast-lexer-gen.cc"
yy821:
yych = *++lexer->cursor;
if (yych == 'l') goto yy896;
@@ -5154,9 +5154,9 @@ yy822:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 262 "src/ast-lexer.cc"
+#line 262 "src/wast-lexer.cc"
{ RETURN(GET_LOCAL); }
-#line 5160 "src/prebuilt/ast-lexer-gen.cc"
+#line 5160 "src/prebuilt/wast-lexer-gen.cc"
yy824:
yych = *++lexer->cursor;
if (yych == 'r') goto yy898;
@@ -5166,25 +5166,25 @@ yy825:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 292 "src/ast-lexer.cc"
+#line 292 "src/wast-lexer.cc"
{ TYPE(I32); RETURN(CONST); }
-#line 5172 "src/prebuilt/ast-lexer-gen.cc"
+#line 5172 "src/prebuilt/wast-lexer-gen.cc"
yy827:
++lexer->cursor;
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 324 "src/ast-lexer.cc"
+#line 324 "src/wast-lexer.cc"
{ OPCODE(I32DivS); RETURN(BINARY); }
-#line 5180 "src/prebuilt/ast-lexer-gen.cc"
+#line 5180 "src/prebuilt/wast-lexer-gen.cc"
yy829:
++lexer->cursor;
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 326 "src/ast-lexer.cc"
+#line 326 "src/wast-lexer.cc"
{ OPCODE(I32DivU); RETURN(BINARY); }
-#line 5188 "src/prebuilt/ast-lexer-gen.cc"
+#line 5188 "src/prebuilt/wast-lexer-gen.cc"
yy831:
yych = *++lexer->cursor;
if (yych == '6') goto yy899;
@@ -5206,33 +5206,33 @@ yy835:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 328 "src/ast-lexer.cc"
+#line 328 "src/wast-lexer.cc"
{ OPCODE(I32RemS); RETURN(BINARY); }
-#line 5212 "src/prebuilt/ast-lexer-gen.cc"
+#line 5212 "src/prebuilt/wast-lexer-gen.cc"
yy837:
++lexer->cursor;
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 330 "src/ast-lexer.cc"
+#line 330 "src/wast-lexer.cc"
{ OPCODE(I32RemU); RETURN(BINARY); }
-#line 5220 "src/prebuilt/ast-lexer-gen.cc"
+#line 5220 "src/prebuilt/wast-lexer-gen.cc"
yy839:
++lexer->cursor;
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 340 "src/ast-lexer.cc"
+#line 340 "src/wast-lexer.cc"
{ OPCODE(I32ShrS); RETURN(BINARY); }
-#line 5228 "src/prebuilt/ast-lexer-gen.cc"
+#line 5228 "src/prebuilt/wast-lexer-gen.cc"
yy841:
++lexer->cursor;
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 342 "src/ast-lexer.cc"
+#line 342 "src/wast-lexer.cc"
{ OPCODE(I32ShrU); RETURN(BINARY); }
-#line 5236 "src/prebuilt/ast-lexer-gen.cc"
+#line 5236 "src/prebuilt/wast-lexer-gen.cc"
yy843:
++lexer->cursor;
if ((yych = *lexer->cursor) <= '8') {
@@ -5268,9 +5268,9 @@ yy843:
}
}
yy844:
-#line 271 "src/ast-lexer.cc"
+#line 271 "src/wast-lexer.cc"
{ OPCODE(I32Store); RETURN(STORE); }
-#line 5274 "src/prebuilt/ast-lexer-gen.cc"
+#line 5274 "src/prebuilt/wast-lexer-gen.cc"
yy845:
yych = *++lexer->cursor;
if (yych == '_') goto yy907;
@@ -5284,25 +5284,25 @@ yy847:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 293 "src/ast-lexer.cc"
+#line 293 "src/wast-lexer.cc"
{ TYPE(I64); RETURN(CONST); }
-#line 5290 "src/prebuilt/ast-lexer-gen.cc"
+#line 5290 "src/prebuilt/wast-lexer-gen.cc"
yy849:
++lexer->cursor;
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 325 "src/ast-lexer.cc"
+#line 325 "src/wast-lexer.cc"
{ OPCODE(I64DivS); RETURN(BINARY); }
-#line 5298 "src/prebuilt/ast-lexer-gen.cc"
+#line 5298 "src/prebuilt/wast-lexer-gen.cc"
yy851:
++lexer->cursor;
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 327 "src/ast-lexer.cc"
+#line 327 "src/wast-lexer.cc"
{ OPCODE(I64DivU); RETURN(BINARY); }
-#line 5306 "src/prebuilt/ast-lexer-gen.cc"
+#line 5306 "src/prebuilt/wast-lexer-gen.cc"
yy853:
yych = *++lexer->cursor;
if (yych == 'd') goto yy909;
@@ -5332,33 +5332,33 @@ yy859:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 329 "src/ast-lexer.cc"
+#line 329 "src/wast-lexer.cc"
{ OPCODE(I64RemS); RETURN(BINARY); }
-#line 5338 "src/prebuilt/ast-lexer-gen.cc"
+#line 5338 "src/prebuilt/wast-lexer-gen.cc"
yy861:
++lexer->cursor;
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 331 "src/ast-lexer.cc"
+#line 331 "src/wast-lexer.cc"
{ OPCODE(I64RemU); RETURN(BINARY); }
-#line 5346 "src/prebuilt/ast-lexer-gen.cc"
+#line 5346 "src/prebuilt/wast-lexer-gen.cc"
yy863:
++lexer->cursor;
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 341 "src/ast-lexer.cc"
+#line 341 "src/wast-lexer.cc"
{ OPCODE(I64ShrS); RETURN(BINARY); }
-#line 5354 "src/prebuilt/ast-lexer-gen.cc"
+#line 5354 "src/prebuilt/wast-lexer-gen.cc"
yy865:
++lexer->cursor;
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 343 "src/ast-lexer.cc"
+#line 343 "src/wast-lexer.cc"
{ OPCODE(I64ShrU); RETURN(BINARY); }
-#line 5362 "src/prebuilt/ast-lexer-gen.cc"
+#line 5362 "src/prebuilt/wast-lexer-gen.cc"
yy867:
++lexer->cursor;
if ((yych = *lexer->cursor) <= '7') {
@@ -5398,9 +5398,9 @@ yy867:
}
}
yy868:
-#line 272 "src/ast-lexer.cc"
+#line 272 "src/wast-lexer.cc"
{ OPCODE(I64Store); RETURN(STORE); }
-#line 5404 "src/prebuilt/ast-lexer-gen.cc"
+#line 5404 "src/prebuilt/wast-lexer-gen.cc"
yy869:
yych = *++lexer->cursor;
if (yych == '_') goto yy920;
@@ -5426,17 +5426,17 @@ yy872:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 263 "src/ast-lexer.cc"
+#line 263 "src/wast-lexer.cc"
{ RETURN(SET_LOCAL); }
-#line 5432 "src/prebuilt/ast-lexer-gen.cc"
+#line 5432 "src/prebuilt/wast-lexer-gen.cc"
yy874:
++lexer->cursor;
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 264 "src/ast-lexer.cc"
+#line 264 "src/wast-lexer.cc"
{ RETURN(TEE_LOCAL); }
-#line 5440 "src/prebuilt/ast-lexer-gen.cc"
+#line 5440 "src/prebuilt/wast-lexer-gen.cc"
yy876:
yych = *++lexer->cursor;
if (yych == 'l') goto yy925;
@@ -5522,9 +5522,9 @@ yy896:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 265 "src/ast-lexer.cc"
+#line 265 "src/wast-lexer.cc"
{ RETURN(GET_GLOBAL); }
-#line 5528 "src/prebuilt/ast-lexer-gen.cc"
+#line 5528 "src/prebuilt/wast-lexer-gen.cc"
yy898:
yych = *++lexer->cursor;
if (yych == 'y') goto yy949;
@@ -5543,9 +5543,9 @@ yy901:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 302 "src/ast-lexer.cc"
+#line 302 "src/wast-lexer.cc"
{ OPCODE(I32Popcnt); RETURN(UNARY); }
-#line 5549 "src/prebuilt/ast-lexer-gen.cc"
+#line 5549 "src/prebuilt/wast-lexer-gen.cc"
yy903:
yych = *++lexer->cursor;
if (yych == 'r') goto yy956;
@@ -5559,9 +5559,9 @@ yy905:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 285 "src/ast-lexer.cc"
+#line 285 "src/wast-lexer.cc"
{ OPCODE(I32Store8); RETURN(STORE); }
-#line 5565 "src/prebuilt/ast-lexer-gen.cc"
+#line 5565 "src/prebuilt/wast-lexer-gen.cc"
yy907:
yych = *++lexer->cursor;
if (yych == 's') goto yy959;
@@ -5593,9 +5593,9 @@ yy913:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 303 "src/ast-lexer.cc"
+#line 303 "src/wast-lexer.cc"
{ OPCODE(I64Popcnt); RETURN(UNARY); }
-#line 5599 "src/prebuilt/ast-lexer-gen.cc"
+#line 5599 "src/prebuilt/wast-lexer-gen.cc"
yy915:
yych = *++lexer->cursor;
if (yych == 'r') goto yy969;
@@ -5613,9 +5613,9 @@ yy918:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 286 "src/ast-lexer.cc"
+#line 286 "src/wast-lexer.cc"
{ OPCODE(I64Store8); RETURN(STORE); }
-#line 5619 "src/prebuilt/ast-lexer-gen.cc"
+#line 5619 "src/prebuilt/wast-lexer-gen.cc"
yy920:
yych = *++lexer->cursor;
if (yych == 's') goto yy974;
@@ -5672,9 +5672,9 @@ yy923:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 266 "src/ast-lexer.cc"
+#line 266 "src/wast-lexer.cc"
{ RETURN(SET_GLOBAL); }
-#line 5678 "src/prebuilt/ast-lexer-gen.cc"
+#line 5678 "src/prebuilt/wast-lexer-gen.cc"
yy925:
yych = *++lexer->cursor;
if (yych == 'e') goto yy976;
@@ -5700,9 +5700,9 @@ yy930:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 449 "src/ast-lexer.cc"
+#line 449 "src/wast-lexer.cc"
{ RETURN(ASSERT_TRAP); }
-#line 5706 "src/prebuilt/ast-lexer-gen.cc"
+#line 5706 "src/prebuilt/wast-lexer-gen.cc"
yy932:
yych = *++lexer->cursor;
if (yych == 'n') goto yy982;
@@ -5712,9 +5712,9 @@ yy933:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 257 "src/ast-lexer.cc"
+#line 257 "src/wast-lexer.cc"
{ RETURN(CALL_IMPORT); }
-#line 5718 "src/prebuilt/ast-lexer-gen.cc"
+#line 5718 "src/prebuilt/wast-lexer-gen.cc"
yy935:
yych = *++lexer->cursor;
if (yych == 'c') goto yy983;
@@ -5740,9 +5740,9 @@ yy940:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 316 "src/ast-lexer.cc"
+#line 316 "src/wast-lexer.cc"
{ OPCODE(F32Nearest); RETURN(UNARY); }
-#line 5746 "src/prebuilt/ast-lexer-gen.cc"
+#line 5746 "src/prebuilt/wast-lexer-gen.cc"
yy942:
yych = *++lexer->cursor;
if (yych == 'p') goto yy989;
@@ -5760,9 +5760,9 @@ yy945:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 317 "src/ast-lexer.cc"
+#line 317 "src/wast-lexer.cc"
{ OPCODE(F64Nearest); RETURN(UNARY); }
-#line 5766 "src/prebuilt/ast-lexer-gen.cc"
+#line 5766 "src/prebuilt/wast-lexer-gen.cc"
yy947:
yych = *++lexer->cursor;
if (yych == '/') goto yy993;
@@ -5776,9 +5776,9 @@ yy949:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 422 "src/ast-lexer.cc"
+#line 422 "src/wast-lexer.cc"
{ RETURN(GROW_MEMORY); }
-#line 5782 "src/prebuilt/ast-lexer-gen.cc"
+#line 5782 "src/prebuilt/wast-lexer-gen.cc"
yy951:
yych = *++lexer->cursor;
if (yych == 's') goto yy995;
@@ -5789,17 +5789,17 @@ yy952:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 275 "src/ast-lexer.cc"
+#line 275 "src/wast-lexer.cc"
{ OPCODE(I32Load8S); RETURN(LOAD); }
-#line 5795 "src/prebuilt/ast-lexer-gen.cc"
+#line 5795 "src/prebuilt/wast-lexer-gen.cc"
yy954:
++lexer->cursor;
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 277 "src/ast-lexer.cc"
+#line 277 "src/wast-lexer.cc"
{ OPCODE(I32Load8U); RETURN(LOAD); }
-#line 5803 "src/prebuilt/ast-lexer-gen.cc"
+#line 5803 "src/prebuilt/wast-lexer-gen.cc"
yy956:
yych = *++lexer->cursor;
if (yych == 'p') goto yy999;
@@ -5809,9 +5809,9 @@ yy957:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 287 "src/ast-lexer.cc"
+#line 287 "src/wast-lexer.cc"
{ OPCODE(I32Store16); RETURN(STORE); }
-#line 5815 "src/prebuilt/ast-lexer-gen.cc"
+#line 5815 "src/prebuilt/wast-lexer-gen.cc"
yy959:
yych = *++lexer->cursor;
if (yych == '/') goto yy1000;
@@ -5844,17 +5844,17 @@ yy965:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 276 "src/ast-lexer.cc"
+#line 276 "src/wast-lexer.cc"
{ OPCODE(I64Load8S); RETURN(LOAD); }
-#line 5850 "src/prebuilt/ast-lexer-gen.cc"
+#line 5850 "src/prebuilt/wast-lexer-gen.cc"
yy967:
++lexer->cursor;
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 278 "src/ast-lexer.cc"
+#line 278 "src/wast-lexer.cc"
{ OPCODE(I64Load8U); RETURN(LOAD); }
-#line 5858 "src/prebuilt/ast-lexer-gen.cc"
+#line 5858 "src/prebuilt/wast-lexer-gen.cc"
yy969:
yych = *++lexer->cursor;
if (yych == 'p') goto yy1014;
@@ -5864,17 +5864,17 @@ yy970:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 288 "src/ast-lexer.cc"
+#line 288 "src/wast-lexer.cc"
{ OPCODE(I64Store16); RETURN(STORE); }
-#line 5870 "src/prebuilt/ast-lexer-gen.cc"
+#line 5870 "src/prebuilt/wast-lexer-gen.cc"
yy972:
++lexer->cursor;
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 289 "src/ast-lexer.cc"
+#line 289 "src/wast-lexer.cc"
{ OPCODE(I64Store32); RETURN(STORE); }
-#line 5878 "src/prebuilt/ast-lexer-gen.cc"
+#line 5878 "src/prebuilt/wast-lexer-gen.cc"
yy974:
yych = *++lexer->cursor;
if (yych == '/') goto yy1015;
@@ -5888,9 +5888,9 @@ yy976:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 420 "src/ast-lexer.cc"
+#line 420 "src/wast-lexer.cc"
{ RETURN(UNREACHABLE); }
-#line 5894 "src/prebuilt/ast-lexer-gen.cc"
+#line 5894 "src/prebuilt/wast-lexer-gen.cc"
yy978:
yych = *++lexer->cursor;
if (yych == 's') goto yy1017;
@@ -5929,9 +5929,9 @@ yy986:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 360 "src/ast-lexer.cc"
+#line 360 "src/wast-lexer.cc"
{ OPCODE(F32Copysign); RETURN(BINARY); }
-#line 5935 "src/prebuilt/ast-lexer-gen.cc"
+#line 5935 "src/prebuilt/wast-lexer-gen.cc"
yy988:
yych = *++lexer->cursor;
if (yych == '6') goto yy1028;
@@ -5950,9 +5950,9 @@ yy991:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 361 "src/ast-lexer.cc"
+#line 361 "src/wast-lexer.cc"
{ OPCODE(F64Copysign); RETURN(BINARY); }
-#line 5956 "src/prebuilt/ast-lexer-gen.cc"
+#line 5956 "src/prebuilt/wast-lexer-gen.cc"
yy993:
yych = *++lexer->cursor;
if (yych == 'f') goto yy1032;
@@ -5966,17 +5966,17 @@ yy995:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 279 "src/ast-lexer.cc"
+#line 279 "src/wast-lexer.cc"
{ OPCODE(I32Load16S); RETURN(LOAD); }
-#line 5972 "src/prebuilt/ast-lexer-gen.cc"
+#line 5972 "src/prebuilt/wast-lexer-gen.cc"
yy997:
++lexer->cursor;
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 281 "src/ast-lexer.cc"
+#line 281 "src/wast-lexer.cc"
{ OPCODE(I32Load16U); RETURN(LOAD); }
-#line 5980 "src/prebuilt/ast-lexer-gen.cc"
+#line 5980 "src/prebuilt/wast-lexer-gen.cc"
yy999:
yych = *++lexer->cursor;
if (yych == 'r') goto yy1034;
@@ -5994,9 +5994,9 @@ yy1002:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 396 "src/ast-lexer.cc"
+#line 396 "src/wast-lexer.cc"
{ OPCODE(I32WrapI64); RETURN(CONVERT); }
-#line 6000 "src/prebuilt/ast-lexer-gen.cc"
+#line 6000 "src/prebuilt/wast-lexer-gen.cc"
yy1004:
yych = *++lexer->cursor;
if (yych == '/') goto yy1037;
@@ -6010,33 +6010,33 @@ yy1006:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 280 "src/ast-lexer.cc"
+#line 280 "src/wast-lexer.cc"
{ OPCODE(I64Load16S); RETURN(LOAD); }
-#line 6016 "src/prebuilt/ast-lexer-gen.cc"
+#line 6016 "src/prebuilt/wast-lexer-gen.cc"
yy1008:
++lexer->cursor;
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 282 "src/ast-lexer.cc"
+#line 282 "src/wast-lexer.cc"
{ OPCODE(I64Load16U); RETURN(LOAD); }
-#line 6024 "src/prebuilt/ast-lexer-gen.cc"
+#line 6024 "src/prebuilt/wast-lexer-gen.cc"
yy1010:
++lexer->cursor;
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 283 "src/ast-lexer.cc"
+#line 283 "src/wast-lexer.cc"
{ OPCODE(I64Load32S); RETURN(LOAD); }
-#line 6032 "src/prebuilt/ast-lexer-gen.cc"
+#line 6032 "src/prebuilt/wast-lexer-gen.cc"
yy1012:
++lexer->cursor;
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 284 "src/ast-lexer.cc"
+#line 284 "src/wast-lexer.cc"
{ OPCODE(I64Load32U); RETURN(LOAD); }
-#line 6040 "src/prebuilt/ast-lexer-gen.cc"
+#line 6040 "src/prebuilt/wast-lexer-gen.cc"
yy1014:
yych = *++lexer->cursor;
if (yych == 'r') goto yy1039;
@@ -6096,9 +6096,9 @@ yy1020:
}
}
yy1021:
-#line 444 "src/ast-lexer.cc"
+#line 444 "src/wast-lexer.cc"
{ RETURN(ASSERT_RETURN); }
-#line 6102 "src/prebuilt/ast-lexer-gen.cc"
+#line 6102 "src/prebuilt/wast-lexer-gen.cc"
yy1022:
yych = *++lexer->cursor;
if (yych == 'a') goto yy1047;
@@ -6108,9 +6108,9 @@ yy1023:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 258 "src/ast-lexer.cc"
+#line 258 "src/wast-lexer.cc"
{ RETURN(CALL_INDIRECT); }
-#line 6114 "src/prebuilt/ast-lexer-gen.cc"
+#line 6114 "src/prebuilt/wast-lexer-gen.cc"
yy1025:
yych = *++lexer->cursor;
if (yych == 'y') goto yy1048;
@@ -6192,9 +6192,9 @@ yy1043:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 442 "src/ast-lexer.cc"
+#line 442 "src/wast-lexer.cc"
{ RETURN(ASSERT_INVALID); }
-#line 6198 "src/prebuilt/ast-lexer-gen.cc"
+#line 6198 "src/prebuilt/wast-lexer-gen.cc"
yy1045:
yych = *++lexer->cursor;
if (yych == 'e') goto yy1072;
@@ -6213,9 +6213,9 @@ yy1048:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 421 "src/ast-lexer.cc"
+#line 421 "src/wast-lexer.cc"
{ RETURN(CURRENT_MEMORY); }
-#line 6219 "src/prebuilt/ast-lexer-gen.cc"
+#line 6219 "src/prebuilt/wast-lexer-gen.cc"
yy1050:
yych = *++lexer->cursor;
if (yych == 'i') goto yy1076;
@@ -6229,9 +6229,9 @@ yy1052:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 414 "src/ast-lexer.cc"
+#line 414 "src/wast-lexer.cc"
{ OPCODE(F32DemoteF64); RETURN(CONVERT); }
-#line 6235 "src/prebuilt/ast-lexer-gen.cc"
+#line 6235 "src/prebuilt/wast-lexer-gen.cc"
yy1054:
yych = *++lexer->cursor;
if (yych == 't') goto yy1078;
@@ -6349,9 +6349,9 @@ yy1081:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 413 "src/ast-lexer.cc"
+#line 413 "src/wast-lexer.cc"
{ OPCODE(F64PromoteF32); RETURN(CONVERT); }
-#line 6355 "src/prebuilt/ast-lexer-gen.cc"
+#line 6355 "src/prebuilt/wast-lexer-gen.cc"
yy1083:
yych = *++lexer->cursor;
if (yych == '/') goto yy1119;
@@ -6365,33 +6365,33 @@ yy1085:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 397 "src/ast-lexer.cc"
+#line 397 "src/wast-lexer.cc"
{ OPCODE(I32TruncSF32); RETURN(CONVERT); }
-#line 6371 "src/prebuilt/ast-lexer-gen.cc"
+#line 6371 "src/prebuilt/wast-lexer-gen.cc"
yy1087:
++lexer->cursor;
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 399 "src/ast-lexer.cc"
+#line 399 "src/wast-lexer.cc"
{ OPCODE(I32TruncSF64); RETURN(CONVERT); }
-#line 6379 "src/prebuilt/ast-lexer-gen.cc"
+#line 6379 "src/prebuilt/wast-lexer-gen.cc"
yy1089:
++lexer->cursor;
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 401 "src/ast-lexer.cc"
+#line 401 "src/wast-lexer.cc"
{ OPCODE(I32TruncUF32); RETURN(CONVERT); }
-#line 6387 "src/prebuilt/ast-lexer-gen.cc"
+#line 6387 "src/prebuilt/wast-lexer-gen.cc"
yy1091:
++lexer->cursor;
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 403 "src/ast-lexer.cc"
+#line 403 "src/wast-lexer.cc"
{ OPCODE(I32TruncUF64); RETURN(CONVERT); }
-#line 6395 "src/prebuilt/ast-lexer-gen.cc"
+#line 6395 "src/prebuilt/wast-lexer-gen.cc"
yy1093:
yych = *++lexer->cursor;
if (yych == '2') goto yy1121;
@@ -6409,33 +6409,33 @@ yy1096:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 398 "src/ast-lexer.cc"
+#line 398 "src/wast-lexer.cc"
{ OPCODE(I64TruncSF32); RETURN(CONVERT); }
-#line 6415 "src/prebuilt/ast-lexer-gen.cc"
+#line 6415 "src/prebuilt/wast-lexer-gen.cc"
yy1098:
++lexer->cursor;
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 400 "src/ast-lexer.cc"
+#line 400 "src/wast-lexer.cc"
{ OPCODE(I64TruncSF64); RETURN(CONVERT); }
-#line 6423 "src/prebuilt/ast-lexer-gen.cc"
+#line 6423 "src/prebuilt/wast-lexer-gen.cc"
yy1100:
++lexer->cursor;
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 402 "src/ast-lexer.cc"
+#line 402 "src/wast-lexer.cc"
{ OPCODE(I64TruncUF32); RETURN(CONVERT); }
-#line 6431 "src/prebuilt/ast-lexer-gen.cc"
+#line 6431 "src/prebuilt/wast-lexer-gen.cc"
yy1102:
++lexer->cursor;
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 404 "src/ast-lexer.cc"
+#line 404 "src/wast-lexer.cc"
{ OPCODE(I64TruncUF64); RETURN(CONVERT); }
-#line 6439 "src/prebuilt/ast-lexer-gen.cc"
+#line 6439 "src/prebuilt/wast-lexer-gen.cc"
yy1104:
yych = *++lexer->cursor;
if (yych == 'n') goto yy1126;
@@ -6445,9 +6445,9 @@ yy1105:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 441 "src/ast-lexer.cc"
+#line 441 "src/wast-lexer.cc"
{ RETURN(ASSERT_MALFORMED); }
-#line 6451 "src/prebuilt/ast-lexer-gen.cc"
+#line 6451 "src/prebuilt/wast-lexer-gen.cc"
yy1107:
yych = *++lexer->cursor;
if (yych == 'i') goto yy1128;
@@ -6509,17 +6509,17 @@ yy1121:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 394 "src/ast-lexer.cc"
+#line 394 "src/wast-lexer.cc"
{ OPCODE(I64ExtendSI32); RETURN(CONVERT); }
-#line 6515 "src/prebuilt/ast-lexer-gen.cc"
+#line 6515 "src/prebuilt/wast-lexer-gen.cc"
yy1123:
++lexer->cursor;
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 395 "src/ast-lexer.cc"
+#line 395 "src/wast-lexer.cc"
{ OPCODE(I64ExtendUI32); RETURN(CONVERT); }
-#line 6523 "src/prebuilt/ast-lexer-gen.cc"
+#line 6523 "src/prebuilt/wast-lexer-gen.cc"
yy1125:
yych = *++lexer->cursor;
if (yych == 'f') goto yy1151;
@@ -6529,9 +6529,9 @@ yy1126:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 450 "src/ast-lexer.cc"
+#line 450 "src/wast-lexer.cc"
{ RETURN(ASSERT_EXHAUSTION); }
-#line 6535 "src/prebuilt/ast-lexer-gen.cc"
+#line 6535 "src/prebuilt/wast-lexer-gen.cc"
yy1128:
yych = *++lexer->cursor;
if (yych == 't') goto yy1152;
@@ -6545,41 +6545,41 @@ yy1130:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 443 "src/ast-lexer.cc"
+#line 443 "src/wast-lexer.cc"
{ RETURN(ASSERT_UNLINKABLE); }
-#line 6551 "src/prebuilt/ast-lexer-gen.cc"
+#line 6551 "src/prebuilt/wast-lexer-gen.cc"
yy1132:
++lexer->cursor;
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 405 "src/ast-lexer.cc"
+#line 405 "src/wast-lexer.cc"
{ OPCODE(F32ConvertSI32); RETURN(CONVERT); }
-#line 6559 "src/prebuilt/ast-lexer-gen.cc"
+#line 6559 "src/prebuilt/wast-lexer-gen.cc"
yy1134:
++lexer->cursor;
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 407 "src/ast-lexer.cc"
+#line 407 "src/wast-lexer.cc"
{ OPCODE(F32ConvertSI64); RETURN(CONVERT); }
-#line 6567 "src/prebuilt/ast-lexer-gen.cc"
+#line 6567 "src/prebuilt/wast-lexer-gen.cc"
yy1136:
++lexer->cursor;
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 409 "src/ast-lexer.cc"
+#line 409 "src/wast-lexer.cc"
{ OPCODE(F32ConvertUI32); RETURN(CONVERT); }
-#line 6575 "src/prebuilt/ast-lexer-gen.cc"
+#line 6575 "src/prebuilt/wast-lexer-gen.cc"
yy1138:
++lexer->cursor;
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 411 "src/ast-lexer.cc"
+#line 411 "src/wast-lexer.cc"
{ OPCODE(F32ConvertUI64); RETURN(CONVERT); }
-#line 6583 "src/prebuilt/ast-lexer-gen.cc"
+#line 6583 "src/prebuilt/wast-lexer-gen.cc"
yy1140:
yych = *++lexer->cursor;
if (yych == '3') goto yy1154;
@@ -6589,33 +6589,33 @@ yy1141:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 406 "src/ast-lexer.cc"
+#line 406 "src/wast-lexer.cc"
{ OPCODE(F64ConvertSI32); RETURN(CONVERT); }
-#line 6595 "src/prebuilt/ast-lexer-gen.cc"
+#line 6595 "src/prebuilt/wast-lexer-gen.cc"
yy1143:
++lexer->cursor;
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 408 "src/ast-lexer.cc"
+#line 408 "src/wast-lexer.cc"
{ OPCODE(F64ConvertSI64); RETURN(CONVERT); }
-#line 6603 "src/prebuilt/ast-lexer-gen.cc"
+#line 6603 "src/prebuilt/wast-lexer-gen.cc"
yy1145:
++lexer->cursor;
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 410 "src/ast-lexer.cc"
+#line 410 "src/wast-lexer.cc"
{ OPCODE(F64ConvertUI32); RETURN(CONVERT); }
-#line 6611 "src/prebuilt/ast-lexer-gen.cc"
+#line 6611 "src/prebuilt/wast-lexer-gen.cc"
yy1147:
++lexer->cursor;
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 412 "src/ast-lexer.cc"
+#line 412 "src/wast-lexer.cc"
{ OPCODE(F64ConvertUI64); RETURN(CONVERT); }
-#line 6619 "src/prebuilt/ast-lexer-gen.cc"
+#line 6619 "src/prebuilt/wast-lexer-gen.cc"
yy1149:
yych = *++lexer->cursor;
if (yych == '6') goto yy1155;
@@ -6665,33 +6665,33 @@ yy1160:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 415 "src/ast-lexer.cc"
+#line 415 "src/wast-lexer.cc"
{ OPCODE(F32ReinterpretI32); RETURN(CONVERT); }
-#line 6671 "src/prebuilt/ast-lexer-gen.cc"
+#line 6671 "src/prebuilt/wast-lexer-gen.cc"
yy1162:
++lexer->cursor;
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 417 "src/ast-lexer.cc"
+#line 417 "src/wast-lexer.cc"
{ OPCODE(F64ReinterpretI64); RETURN(CONVERT); }
-#line 6679 "src/prebuilt/ast-lexer-gen.cc"
+#line 6679 "src/prebuilt/wast-lexer-gen.cc"
yy1164:
++lexer->cursor;
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 416 "src/ast-lexer.cc"
+#line 416 "src/wast-lexer.cc"
{ OPCODE(I32ReinterpretF32); RETURN(CONVERT); }
-#line 6687 "src/prebuilt/ast-lexer-gen.cc"
+#line 6687 "src/prebuilt/wast-lexer-gen.cc"
yy1166:
++lexer->cursor;
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 418 "src/ast-lexer.cc"
+#line 418 "src/wast-lexer.cc"
{ OPCODE(I64ReinterpretF64); RETURN(CONVERT); }
-#line 6695 "src/prebuilt/ast-lexer-gen.cc"
+#line 6695 "src/prebuilt/wast-lexer-gen.cc"
yy1168:
yych = *++lexer->cursor;
if (yych == 'e') goto yy1170;
@@ -6757,60 +6757,58 @@ yy1183:
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 445 "src/ast-lexer.cc"
+#line 445 "src/wast-lexer.cc"
{
RETURN(ASSERT_RETURN_CANONICAL_NAN); }
-#line 6764 "src/prebuilt/ast-lexer-gen.cc"
+#line 6764 "src/prebuilt/wast-lexer-gen.cc"
yy1185:
++lexer->cursor;
if (yybm[0+(yych = *lexer->cursor)] & 16) {
goto yy49;
}
-#line 447 "src/ast-lexer.cc"
+#line 447 "src/wast-lexer.cc"
{
RETURN(ASSERT_RETURN_ARITHMETIC_NAN); }
-#line 6773 "src/prebuilt/ast-lexer-gen.cc"
+#line 6773 "src/prebuilt/wast-lexer-gen.cc"
}
}
-#line 473 "src/ast-lexer.cc"
+#line 473 "src/wast-lexer.cc"
}
}
-static AstLexer* new_lexer(AstLexerSourceType type,
- const char* filename) {
- AstLexer* lexer = new AstLexer();
+static WastLexer* new_lexer(WastLexerSourceType type, const char* filename) {
+ WastLexer* lexer = new WastLexer();
lexer->line = 1;
lexer->filename = filename;
lexer->source.type = type;
return lexer;
}
-AstLexer* new_ast_file_lexer(const char* filename) {
- AstLexer* lexer = new_lexer(AstLexerSourceType::File, filename);
+WastLexer* new_wast_file_lexer(const char* filename) {
+ WastLexer* lexer = new_lexer(WastLexerSourceType::File, filename);
lexer->source.file = fopen(filename, "rb");
if (!lexer->source.file) {
- destroy_ast_lexer(lexer);
+ destroy_wast_lexer(lexer);
return nullptr;
}
return lexer;
}
-AstLexer* new_ast_buffer_lexer(const char* filename,
- const void* data,
- size_t size) {
- AstLexer* lexer =
- new_lexer(AstLexerSourceType::Buffer, filename);
+WastLexer* new_wast_buffer_lexer(const char* filename,
+ const void* data,
+ size_t size) {
+ WastLexer* lexer = new_lexer(WastLexerSourceType::Buffer, filename);
lexer->source.buffer.data = data;
lexer->source.buffer.size = size;
lexer->source.buffer.read_offset = 0;
return lexer;
}
-void destroy_ast_lexer(AstLexer* lexer) {
- if (lexer->source.type == AstLexerSourceType::File && lexer->source.file)
+void destroy_wast_lexer(WastLexer* lexer) {
+ if (lexer->source.type == WastLexerSourceType::File && lexer->source.file)
fclose(lexer->source.file);
- delete [] lexer->buffer;
+ delete[] lexer->buffer;
delete lexer;
}
@@ -6866,7 +6864,7 @@ static Result scan_forward_for_line_offset_in_buffer(
}
static Result scan_forward_for_line_offset_in_file(
- AstLexer* lexer,
+ WastLexer* lexer,
int line,
size_t line_start_offset,
LineOffsetPosition find_position,
@@ -6913,15 +6911,14 @@ cleanup:
return result;
}
-static Result scan_forward_for_line_offset(
- AstLexer* lexer,
- int line,
- size_t line_start_offset,
- LineOffsetPosition find_position,
- int find_line,
- size_t* out_line_offset) {
+static Result scan_forward_for_line_offset(WastLexer* lexer,
+ int line,
+ size_t line_start_offset,
+ LineOffsetPosition find_position,
+ int find_line,
+ size_t* out_line_offset) {
assert(line <= find_line);
- if (lexer->source.type == AstLexerSourceType::Buffer) {
+ if (lexer->source.type == WastLexerSourceType::Buffer) {
const char* source_buffer =
static_cast<const char*>(lexer->source.buffer.data);
const char* buffer_start = source_buffer + line_start_offset;
@@ -6930,16 +6927,16 @@ static Result scan_forward_for_line_offset(
buffer_start, buffer_end, line, line_start_offset, find_position,
find_line, &line, out_line_offset);
} else {
- assert(lexer->source.type == AstLexerSourceType::File);
+ assert(lexer->source.type == WastLexerSourceType::File);
return scan_forward_for_line_offset_in_file(lexer, line, line_start_offset,
find_position, find_line,
out_line_offset);
}
}
-static Result get_line_start_offset(AstLexer* lexer,
- int line,
- size_t* out_offset) {
+static Result get_line_start_offset(WastLexer* lexer,
+ int line,
+ size_t* out_offset) {
int first_line = 1;
size_t first_offset = 0;
int current_line = lexer->line;
@@ -6963,18 +6960,17 @@ static Result get_line_start_offset(AstLexer* lexer,
}
}
-static Result get_offsets_from_line(AstLexer* lexer,
- int line,
- size_t* out_line_start,
- size_t* out_line_end) {
+static Result get_offsets_from_line(WastLexer* lexer,
+ int line,
+ size_t* out_line_start,
+ size_t* out_line_end) {
size_t line_start;
if (WABT_FAILED(get_line_start_offset(lexer, line, &line_start)))
return Result::Error;
size_t line_end;
- if (WABT_FAILED(scan_forward_for_line_offset(lexer, line, line_start,
- LineOffsetPosition::End,
- line, &line_end)))
+ if (WABT_FAILED(scan_forward_for_line_offset(
+ lexer, line, line_start, LineOffsetPosition::End, line, &line_end)))
return Result::Error;
*out_line_start = line_start;
*out_line_end = line_end;
@@ -7010,12 +7006,12 @@ static void clamp_source_line_offsets_to_location(size_t line_start,
*out_new_line_end = line_end;
}
-Result ast_lexer_get_source_line(AstLexer* lexer,
- const Location* loc,
- size_t line_max_length,
- char* line,
- size_t* out_line_length,
- int* out_column_offset) {
+Result wast_lexer_get_source_line(WastLexer* lexer,
+ const Location* loc,
+ size_t line_max_length,
+ char* line,
+ size_t* out_line_length,
+ int* out_column_offset) {
Result result;
size_t line_start; /* inclusive */
size_t line_end; /* exclusive */
@@ -7046,12 +7042,12 @@ Result ast_lexer_get_source_line(AstLexer* lexer,
read_length -= 3;
}
- if (lexer->source.type == AstLexerSourceType::Buffer) {
+ if (lexer->source.type == WastLexerSourceType::Buffer) {
const char* buffer_read_start =
static_cast<const char*>(lexer->source.buffer.data) + read_start;
memcpy(write_start, buffer_read_start, read_length);
} else {
- assert(lexer->source.type == AstLexerSourceType::File);
+ assert(lexer->source.type == WastLexerSourceType::File);
FILE* lexer_file = lexer->source.file;
long old_offset = ftell(lexer_file);
if (old_offset == -1)
diff --git a/src/prebuilt/ast-parser-gen.cc b/src/prebuilt/wast-parser-gen.cc
index a756c8d2..9c140316 100644
--- a/src/prebuilt/ast-parser-gen.cc
+++ b/src/prebuilt/wast-parser-gen.cc
@@ -59,18 +59,18 @@
#define YYPULL 1
/* Substitute the type names. */
-#define YYSTYPE WABT_AST_PARSER_STYPE
-#define YYLTYPE WABT_AST_PARSER_LTYPE
+#define YYSTYPE WABT_WAST_PARSER_STYPE
+#define YYLTYPE WABT_WAST_PARSER_LTYPE
/* Substitute the variable and function names. */
-#define yyparse wabt_ast_parser_parse
-#define yylex wabt_ast_parser_lex
-#define yyerror wabt_ast_parser_error
-#define yydebug wabt_ast_parser_debug
-#define yynerrs wabt_ast_parser_nerrs
+#define yyparse wabt_wast_parser_parse
+#define yylex wabt_wast_parser_lex
+#define yyerror wabt_wast_parser_error
+#define yydebug wabt_wast_parser_debug
+#define yynerrs wabt_wast_parser_nerrs
/* Copy the first part of user declarations. */
-#line 17 "src/ast-parser.y" /* yacc.c:339 */
+#line 17 "src/wast-parser.y" /* yacc.c:339 */
#include <assert.h>
#include <stdarg.h>
@@ -80,12 +80,12 @@
#include <algorithm>
#include <utility>
-#include "ast-parser.h"
-#include "ast-parser-lexer-shared.h"
#include "binary-error-handler.h"
-#include "binary-reader-ast.h"
#include "binary-reader.h"
+#include "binary-reader-ir.h"
#include "literal.h"
+#include "wast-parser.h"
+#include "wast-parser-lexer-shared.h"
#define INVALID_VAR_INDEX (-1)
@@ -170,7 +170,7 @@
#define CHECK_IMPORT_ORDERING(module, kind, kinds, loc_) \
do { \
if ((module)->kinds.size() != (module)->num_##kind##_imports) { \
- ast_parser_error( \
+ wast_parser_error( \
&loc_, lexer, parser, \
"imports must occur before all non-import definitions"); \
} \
@@ -180,15 +180,15 @@
do { \
if (!string_slice_is_empty(&(end_label))) { \
if (string_slice_is_empty(&(begin_label))) { \
- ast_parser_error(&loc, lexer, parser, \
- "unexpected label \"" PRIstringslice "\"", \
- WABT_PRINTF_STRING_SLICE_ARG(end_label)); \
+ wast_parser_error(&loc, lexer, parser, \
+ "unexpected label \"" PRIstringslice "\"", \
+ WABT_PRINTF_STRING_SLICE_ARG(end_label)); \
} else if (!string_slices_are_equal(&(begin_label), &(end_label))) { \
- ast_parser_error(&loc, lexer, parser, \
- "mismatching label \"" PRIstringslice \
- "\" != \"" PRIstringslice "\"", \
- WABT_PRINTF_STRING_SLICE_ARG(begin_label), \
- WABT_PRINTF_STRING_SLICE_ARG(end_label)); \
+ wast_parser_error(&loc, lexer, parser, \
+ "mismatching label \"" PRIstringslice \
+ "\" != \"" PRIstringslice "\"", \
+ WABT_PRINTF_STRING_SLICE_ARG(begin_label), \
+ WABT_PRINTF_STRING_SLICE_ARG(end_label)); \
} \
destroy_string_slice(&(end_label)); \
} \
@@ -221,20 +221,20 @@ void append_implicit_func_declaration(Location*,
class BinaryErrorHandlerModule : public BinaryErrorHandler {
public:
- BinaryErrorHandlerModule(Location* loc, AstLexer* lexer, AstParser* parser);
+ BinaryErrorHandlerModule(Location* loc, WastLexer* lexer, WastParser* parser);
bool OnError(uint32_t offset, const std::string& error) override;
private:
Location* loc_;
- AstLexer* lexer_;
- AstParser* parser_;
+ WastLexer* lexer_;
+ WastParser* parser_;
};
-#define wabt_ast_parser_lex ast_lexer_lex
-#define wabt_ast_parser_error ast_parser_error
+#define wabt_wast_parser_lex wast_lexer_lex
+#define wabt_wast_parser_error wast_parser_error
-#line 238 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:339 */
+#line 238 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:339 */
# ifndef YY_NULLPTR
# if defined __cplusplus && 201103L <= __cplusplus
@@ -253,29 +253,29 @@ class BinaryErrorHandlerModule : public BinaryErrorHandler {
#endif
/* In a future release of Bison, this section will be replaced
- by #include "ast-parser-gen.hh". */
-#ifndef YY_WABT_AST_PARSER_SRC_PREBUILT_AST_PARSER_GEN_HH_INCLUDED
-# define YY_WABT_AST_PARSER_SRC_PREBUILT_AST_PARSER_GEN_HH_INCLUDED
+ by #include "wast-parser-gen.hh". */
+#ifndef YY_WABT_WAST_PARSER_SRC_PREBUILT_WAST_PARSER_GEN_HH_INCLUDED
+# define YY_WABT_WAST_PARSER_SRC_PREBUILT_WAST_PARSER_GEN_HH_INCLUDED
/* Debug traces. */
-#ifndef WABT_AST_PARSER_DEBUG
+#ifndef WABT_WAST_PARSER_DEBUG
# if defined YYDEBUG
#if YYDEBUG
-# define WABT_AST_PARSER_DEBUG 1
+# define WABT_WAST_PARSER_DEBUG 1
# else
-# define WABT_AST_PARSER_DEBUG 0
+# define WABT_WAST_PARSER_DEBUG 0
# endif
# else /* ! defined YYDEBUG */
-# define WABT_AST_PARSER_DEBUG 0
+# define WABT_WAST_PARSER_DEBUG 0
# endif /* ! defined YYDEBUG */
-#endif /* ! defined WABT_AST_PARSER_DEBUG */
-#if WABT_AST_PARSER_DEBUG
-extern int wabt_ast_parser_debug;
+#endif /* ! defined WABT_WAST_PARSER_DEBUG */
+#if WABT_WAST_PARSER_DEBUG
+extern int wabt_wast_parser_debug;
#endif
/* Token type. */
-#ifndef WABT_AST_PARSER_TOKENTYPE
-# define WABT_AST_PARSER_TOKENTYPE
- enum wabt_ast_parser_tokentype
+#ifndef WABT_WAST_PARSER_TOKENTYPE
+# define WABT_WAST_PARSER_TOKENTYPE
+ enum wabt_wast_parser_tokentype
{
WABT_TOKEN_TYPE_EOF = 0,
WABT_TOKEN_TYPE_LPAR = 258,
@@ -354,35 +354,35 @@ extern int wabt_ast_parser_debug;
#endif
/* Value type. */
-#if ! defined WABT_AST_PARSER_STYPE && ! defined WABT_AST_PARSER_STYPE_IS_DECLARED
-typedef ::wabt::Token WABT_AST_PARSER_STYPE;
-# define WABT_AST_PARSER_STYPE_IS_TRIVIAL 1
-# define WABT_AST_PARSER_STYPE_IS_DECLARED 1
+#if ! defined WABT_WAST_PARSER_STYPE && ! defined WABT_WAST_PARSER_STYPE_IS_DECLARED
+typedef ::wabt::Token WABT_WAST_PARSER_STYPE;
+# define WABT_WAST_PARSER_STYPE_IS_TRIVIAL 1
+# define WABT_WAST_PARSER_STYPE_IS_DECLARED 1
#endif
/* Location type. */
-#if ! defined WABT_AST_PARSER_LTYPE && ! defined WABT_AST_PARSER_LTYPE_IS_DECLARED
-typedef struct WABT_AST_PARSER_LTYPE WABT_AST_PARSER_LTYPE;
-struct WABT_AST_PARSER_LTYPE
+#if ! defined WABT_WAST_PARSER_LTYPE && ! defined WABT_WAST_PARSER_LTYPE_IS_DECLARED
+typedef struct WABT_WAST_PARSER_LTYPE WABT_WAST_PARSER_LTYPE;
+struct WABT_WAST_PARSER_LTYPE
{
int first_line;
int first_column;
int last_line;
int last_column;
};
-# define WABT_AST_PARSER_LTYPE_IS_DECLARED 1
-# define WABT_AST_PARSER_LTYPE_IS_TRIVIAL 1
+# define WABT_WAST_PARSER_LTYPE_IS_DECLARED 1
+# define WABT_WAST_PARSER_LTYPE_IS_TRIVIAL 1
#endif
-int wabt_ast_parser_parse (::wabt::AstLexer* lexer, ::wabt::AstParser* parser);
+int wabt_wast_parser_parse (::wabt::WastLexer* lexer, ::wabt::WastParser* parser);
-#endif /* !YY_WABT_AST_PARSER_SRC_PREBUILT_AST_PARSER_GEN_HH_INCLUDED */
+#endif /* !YY_WABT_WAST_PARSER_SRC_PREBUILT_WAST_PARSER_GEN_HH_INCLUDED */
/* Copy the second part of user declarations. */
-#line 386 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:358 */
+#line 386 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:358 */
#ifdef short
# undef short
@@ -563,8 +563,8 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */
#if (! defined yyoverflow \
&& (! defined __cplusplus \
- || (defined WABT_AST_PARSER_LTYPE_IS_TRIVIAL && WABT_AST_PARSER_LTYPE_IS_TRIVIAL \
- && defined WABT_AST_PARSER_STYPE_IS_TRIVIAL && WABT_AST_PARSER_STYPE_IS_TRIVIAL)))
+ || (defined WABT_WAST_PARSER_LTYPE_IS_TRIVIAL && WABT_WAST_PARSER_LTYPE_IS_TRIVIAL \
+ && defined WABT_WAST_PARSER_STYPE_IS_TRIVIAL && WABT_WAST_PARSER_STYPE_IS_TRIVIAL)))
/* A type that is properly aligned for any stack member. */
union yyalloc
@@ -684,7 +684,7 @@ static const yytype_uint8 yytranslate[] =
65, 66, 67, 68, 69, 70, 71, 72, 73, 74
};
-#if WABT_AST_PARSER_DEBUG
+#if WABT_WAST_PARSER_DEBUG
/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
static const yytype_uint16 yyrline[] =
{
@@ -709,7 +709,7 @@ static const yytype_uint16 yyrline[] =
};
#endif
-#if WABT_AST_PARSER_DEBUG || YYERROR_VERBOSE || 1
+#if WABT_WAST_PARSER_DEBUG || YYERROR_VERBOSE || 1
/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
First, the terminals, then, starting at YYNTOKENS, nonterminals. */
static const char *const yytname[] =
@@ -1214,7 +1214,7 @@ while (0)
/* Enable debugging if requested. */
-#if WABT_AST_PARSER_DEBUG
+#if WABT_WAST_PARSER_DEBUG
# ifndef YYFPRINTF
# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
@@ -1233,7 +1233,7 @@ do { \
we won't break user code: when these are the locations we know. */
#ifndef YY_LOCATION_PRINT
-# if defined WABT_AST_PARSER_LTYPE_IS_TRIVIAL && WABT_AST_PARSER_LTYPE_IS_TRIVIAL
+# if defined WABT_WAST_PARSER_LTYPE_IS_TRIVIAL && WABT_WAST_PARSER_LTYPE_IS_TRIVIAL
/* Print *YYLOCP on YYO. Private, do not rely on its existence. */
@@ -1289,7 +1289,7 @@ do { \
`----------------------------------------*/
static void
-yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, ::wabt::AstLexer* lexer, ::wabt::AstParser* parser)
+yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, ::wabt::WastLexer* lexer, ::wabt::WastParser* parser)
{
FILE *yyo = yyoutput;
YYUSE (yyo);
@@ -1311,7 +1311,7 @@ yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvalue
`--------------------------------*/
static void
-yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, ::wabt::AstLexer* lexer, ::wabt::AstParser* parser)
+yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, ::wabt::WastLexer* lexer, ::wabt::WastParser* parser)
{
YYFPRINTF (yyoutput, "%s %s (",
yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
@@ -1351,7 +1351,7 @@ do { \
`------------------------------------------------*/
static void
-yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule, ::wabt::AstLexer* lexer, ::wabt::AstParser* parser)
+yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule, ::wabt::WastLexer* lexer, ::wabt::WastParser* parser)
{
unsigned long int yylno = yyrline[yyrule];
int yynrhs = yyr2[yyrule];
@@ -1379,12 +1379,12 @@ do { \
/* Nonzero means print parse trace. It is left uninitialized so that
multiple parsers can coexist. */
int yydebug;
-#else /* !WABT_AST_PARSER_DEBUG */
+#else /* !WABT_WAST_PARSER_DEBUG */
# define YYDPRINTF(Args)
# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
# define YY_STACK_PRINT(Bottom, Top)
# define YY_REDUCE_PRINT(Rule)
-#endif /* !WABT_AST_PARSER_DEBUG */
+#endif /* !WABT_WAST_PARSER_DEBUG */
/* YYINITDEPTH -- initial size of the parser's stacks. */
@@ -1631,7 +1631,7 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
`-----------------------------------------------*/
static void
-yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp, ::wabt::AstLexer* lexer, ::wabt::AstParser* parser)
+yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp, ::wabt::WastLexer* lexer, ::wabt::WastParser* parser)
{
YYUSE (yyvaluep);
YYUSE (yylocationp);
@@ -1645,363 +1645,363 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocatio
switch (yytype)
{
case 5: /* NAT */
-#line 253 "src/ast-parser.y" /* yacc.c:1257 */
+#line 253 "src/wast-parser.y" /* yacc.c:1257 */
{}
-#line 1651 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1257 */
+#line 1651 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1257 */
break;
case 6: /* INT */
-#line 253 "src/ast-parser.y" /* yacc.c:1257 */
+#line 253 "src/wast-parser.y" /* yacc.c:1257 */
{}
-#line 1657 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1257 */
+#line 1657 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1257 */
break;
case 7: /* FLOAT */
-#line 253 "src/ast-parser.y" /* yacc.c:1257 */
+#line 253 "src/wast-parser.y" /* yacc.c:1257 */
{}
-#line 1663 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1257 */
+#line 1663 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1257 */
break;
case 8: /* TEXT */
-#line 253 "src/ast-parser.y" /* yacc.c:1257 */
+#line 253 "src/wast-parser.y" /* yacc.c:1257 */
{}
-#line 1669 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1257 */
+#line 1669 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1257 */
break;
case 9: /* VAR */
-#line 253 "src/ast-parser.y" /* yacc.c:1257 */
+#line 253 "src/wast-parser.y" /* yacc.c:1257 */
{}
-#line 1675 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1257 */
+#line 1675 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1257 */
break;
case 35: /* OFFSET_EQ_NAT */
-#line 253 "src/ast-parser.y" /* yacc.c:1257 */
+#line 253 "src/wast-parser.y" /* yacc.c:1257 */
{}
-#line 1681 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1257 */
+#line 1681 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1257 */
break;
case 36: /* ALIGN_EQ_NAT */
-#line 253 "src/ast-parser.y" /* yacc.c:1257 */
+#line 253 "src/wast-parser.y" /* yacc.c:1257 */
{}
-#line 1687 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1257 */
+#line 1687 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1257 */
break;
case 76: /* non_empty_text_list */
-#line 280 "src/ast-parser.y" /* yacc.c:1257 */
+#line 280 "src/wast-parser.y" /* yacc.c:1257 */
{ destroy_text_list(&((*yyvaluep).text_list)); }
-#line 1693 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1257 */
+#line 1693 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1257 */
break;
case 77: /* text_list */
-#line 280 "src/ast-parser.y" /* yacc.c:1257 */
+#line 280 "src/wast-parser.y" /* yacc.c:1257 */
{ destroy_text_list(&((*yyvaluep).text_list)); }
-#line 1699 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1257 */
+#line 1699 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1257 */
break;
case 78: /* quoted_text */
-#line 254 "src/ast-parser.y" /* yacc.c:1257 */
+#line 254 "src/wast-parser.y" /* yacc.c:1257 */
{ destroy_string_slice(&((*yyvaluep).text)); }
-#line 1705 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1257 */
+#line 1705 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1257 */
break;
case 79: /* value_type_list */
-#line 281 "src/ast-parser.y" /* yacc.c:1257 */
+#line 281 "src/wast-parser.y" /* yacc.c:1257 */
{ delete ((*yyvaluep).types); }
-#line 1711 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1257 */
+#line 1711 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1257 */
break;
case 81: /* global_type */
-#line 273 "src/ast-parser.y" /* yacc.c:1257 */
+#line 273 "src/wast-parser.y" /* yacc.c:1257 */
{ delete ((*yyvaluep).global); }
-#line 1717 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1257 */
+#line 1717 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1257 */
break;
case 82: /* func_type */
-#line 271 "src/ast-parser.y" /* yacc.c:1257 */
+#line 271 "src/wast-parser.y" /* yacc.c:1257 */
{ delete ((*yyvaluep).func_sig); }
-#line 1723 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1257 */
+#line 1723 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1257 */
break;
case 83: /* func_sig */
-#line 271 "src/ast-parser.y" /* yacc.c:1257 */
+#line 271 "src/wast-parser.y" /* yacc.c:1257 */
{ delete ((*yyvaluep).func_sig); }
-#line 1729 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1257 */
+#line 1729 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1257 */
break;
case 85: /* memory_sig */
-#line 276 "src/ast-parser.y" /* yacc.c:1257 */
+#line 276 "src/wast-parser.y" /* yacc.c:1257 */
{ delete ((*yyvaluep).memory); }
-#line 1735 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1257 */
+#line 1735 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1257 */
break;
case 87: /* type_use */
-#line 282 "src/ast-parser.y" /* yacc.c:1257 */
+#line 282 "src/wast-parser.y" /* yacc.c:1257 */
{ destroy_var(&((*yyvaluep).var)); }
-#line 1741 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1257 */
+#line 1741 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1257 */
break;
case 89: /* literal */
-#line 255 "src/ast-parser.y" /* yacc.c:1257 */
+#line 255 "src/wast-parser.y" /* yacc.c:1257 */
{ destroy_string_slice(&((*yyvaluep).literal).text); }
-#line 1747 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1257 */
+#line 1747 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1257 */
break;
case 90: /* var */
-#line 282 "src/ast-parser.y" /* yacc.c:1257 */
+#line 282 "src/wast-parser.y" /* yacc.c:1257 */
{ destroy_var(&((*yyvaluep).var)); }
-#line 1753 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1257 */
+#line 1753 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1257 */
break;
case 91: /* var_list */
-#line 283 "src/ast-parser.y" /* yacc.c:1257 */
+#line 283 "src/wast-parser.y" /* yacc.c:1257 */
{ delete ((*yyvaluep).vars); }
-#line 1759 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1257 */
+#line 1759 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1257 */
break;
case 92: /* bind_var_opt */
-#line 254 "src/ast-parser.y" /* yacc.c:1257 */
+#line 254 "src/wast-parser.y" /* yacc.c:1257 */
{ destroy_string_slice(&((*yyvaluep).text)); }
-#line 1765 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1257 */
+#line 1765 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1257 */
break;
case 93: /* bind_var */
-#line 254 "src/ast-parser.y" /* yacc.c:1257 */
+#line 254 "src/wast-parser.y" /* yacc.c:1257 */
{ destroy_string_slice(&((*yyvaluep).text)); }
-#line 1771 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1257 */
+#line 1771 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1257 */
break;
case 94: /* labeling_opt */
-#line 254 "src/ast-parser.y" /* yacc.c:1257 */
+#line 254 "src/wast-parser.y" /* yacc.c:1257 */
{ destroy_string_slice(&((*yyvaluep).text)); }
-#line 1777 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1257 */
+#line 1777 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1257 */
break;
case 97: /* instr */
-#line 268 "src/ast-parser.y" /* yacc.c:1257 */
+#line 268 "src/wast-parser.y" /* yacc.c:1257 */
{ destroy_expr_list(((*yyvaluep).expr_list).first); }
-#line 1783 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1257 */
+#line 1783 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1257 */
break;
case 98: /* plain_instr */
-#line 267 "src/ast-parser.y" /* yacc.c:1257 */
+#line 267 "src/wast-parser.y" /* yacc.c:1257 */
{ delete ((*yyvaluep).expr); }
-#line 1789 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1257 */
+#line 1789 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1257 */
break;
case 99: /* block_instr */
-#line 267 "src/ast-parser.y" /* yacc.c:1257 */
+#line 267 "src/wast-parser.y" /* yacc.c:1257 */
{ delete ((*yyvaluep).expr); }
-#line 1795 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1257 */
+#line 1795 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1257 */
break;
case 100: /* block */
-#line 257 "src/ast-parser.y" /* yacc.c:1257 */
+#line 257 "src/wast-parser.y" /* yacc.c:1257 */
{ delete ((*yyvaluep).block); }
-#line 1801 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1257 */
+#line 1801 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1257 */
break;
case 101: /* expr */
-#line 268 "src/ast-parser.y" /* yacc.c:1257 */
+#line 268 "src/wast-parser.y" /* yacc.c:1257 */
{ destroy_expr_list(((*yyvaluep).expr_list).first); }
-#line 1807 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1257 */
+#line 1807 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1257 */
break;
case 102: /* expr1 */
-#line 268 "src/ast-parser.y" /* yacc.c:1257 */
+#line 268 "src/wast-parser.y" /* yacc.c:1257 */
{ destroy_expr_list(((*yyvaluep).expr_list).first); }
-#line 1813 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1257 */
+#line 1813 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1257 */
break;
case 103: /* if_ */
-#line 268 "src/ast-parser.y" /* yacc.c:1257 */
+#line 268 "src/wast-parser.y" /* yacc.c:1257 */
{ destroy_expr_list(((*yyvaluep).expr_list).first); }
-#line 1819 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1257 */
+#line 1819 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1257 */
break;
case 104: /* instr_list */
-#line 268 "src/ast-parser.y" /* yacc.c:1257 */
+#line 268 "src/wast-parser.y" /* yacc.c:1257 */
{ destroy_expr_list(((*yyvaluep).expr_list).first); }
-#line 1825 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1257 */
+#line 1825 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1257 */
break;
case 105: /* expr_list */
-#line 268 "src/ast-parser.y" /* yacc.c:1257 */
+#line 268 "src/wast-parser.y" /* yacc.c:1257 */
{ destroy_expr_list(((*yyvaluep).expr_list).first); }
-#line 1831 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1257 */
+#line 1831 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1257 */
break;
case 106: /* const_expr */
-#line 268 "src/ast-parser.y" /* yacc.c:1257 */
+#line 268 "src/wast-parser.y" /* yacc.c:1257 */
{ destroy_expr_list(((*yyvaluep).expr_list).first); }
-#line 1837 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1257 */
+#line 1837 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1257 */
break;
case 107: /* func_fields */
-#line 269 "src/ast-parser.y" /* yacc.c:1257 */
+#line 269 "src/wast-parser.y" /* yacc.c:1257 */
{ destroy_func_fields(((*yyvaluep).func_fields)); }
-#line 1843 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1257 */
+#line 1843 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1257 */
break;
case 108: /* func_body */
-#line 269 "src/ast-parser.y" /* yacc.c:1257 */
+#line 269 "src/wast-parser.y" /* yacc.c:1257 */
{ destroy_func_fields(((*yyvaluep).func_fields)); }
-#line 1849 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1257 */
+#line 1849 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1257 */
break;
case 109: /* func_info */
-#line 270 "src/ast-parser.y" /* yacc.c:1257 */
+#line 270 "src/wast-parser.y" /* yacc.c:1257 */
{ delete ((*yyvaluep).func); }
-#line 1855 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1257 */
+#line 1855 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1257 */
break;
case 110: /* func */
-#line 264 "src/ast-parser.y" /* yacc.c:1257 */
+#line 264 "src/wast-parser.y" /* yacc.c:1257 */
{ delete ((*yyvaluep).exported_func); }
-#line 1861 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1257 */
+#line 1861 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1257 */
break;
case 111: /* offset */
-#line 268 "src/ast-parser.y" /* yacc.c:1257 */
+#line 268 "src/wast-parser.y" /* yacc.c:1257 */
{ destroy_expr_list(((*yyvaluep).expr_list).first); }
-#line 1867 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1257 */
+#line 1867 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1257 */
break;
case 112: /* elem */
-#line 262 "src/ast-parser.y" /* yacc.c:1257 */
+#line 262 "src/wast-parser.y" /* yacc.c:1257 */
{ delete ((*yyvaluep).elem_segment); }
-#line 1873 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1257 */
+#line 1873 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1257 */
break;
case 113: /* table */
-#line 266 "src/ast-parser.y" /* yacc.c:1257 */
+#line 266 "src/wast-parser.y" /* yacc.c:1257 */
{ delete ((*yyvaluep).exported_table); }
-#line 1879 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1257 */
+#line 1879 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1257 */
break;
case 114: /* data */
-#line 261 "src/ast-parser.y" /* yacc.c:1257 */
+#line 261 "src/wast-parser.y" /* yacc.c:1257 */
{ delete ((*yyvaluep).data_segment); }
-#line 1885 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1257 */
+#line 1885 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1257 */
break;
case 115: /* memory */
-#line 265 "src/ast-parser.y" /* yacc.c:1257 */
+#line 265 "src/wast-parser.y" /* yacc.c:1257 */
{ delete ((*yyvaluep).exported_memory); }
-#line 1891 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1257 */
+#line 1891 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1257 */
break;
case 117: /* import_kind */
-#line 274 "src/ast-parser.y" /* yacc.c:1257 */
+#line 274 "src/wast-parser.y" /* yacc.c:1257 */
{ delete ((*yyvaluep).import); }
-#line 1897 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1257 */
+#line 1897 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1257 */
break;
case 118: /* import */
-#line 274 "src/ast-parser.y" /* yacc.c:1257 */
+#line 274 "src/wast-parser.y" /* yacc.c:1257 */
{ delete ((*yyvaluep).import); }
-#line 1903 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1257 */
+#line 1903 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1257 */
break;
case 119: /* inline_import */
-#line 274 "src/ast-parser.y" /* yacc.c:1257 */
+#line 274 "src/wast-parser.y" /* yacc.c:1257 */
{ delete ((*yyvaluep).import); }
-#line 1909 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1257 */
+#line 1909 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1257 */
break;
case 120: /* export_kind */
-#line 263 "src/ast-parser.y" /* yacc.c:1257 */
+#line 263 "src/wast-parser.y" /* yacc.c:1257 */
{ delete ((*yyvaluep).export_); }
-#line 1915 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1257 */
+#line 1915 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1257 */
break;
case 121: /* export */
-#line 263 "src/ast-parser.y" /* yacc.c:1257 */
+#line 263 "src/wast-parser.y" /* yacc.c:1257 */
{ delete ((*yyvaluep).export_); }
-#line 1921 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1257 */
+#line 1921 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1257 */
break;
case 122: /* inline_export_opt */
-#line 275 "src/ast-parser.y" /* yacc.c:1257 */
+#line 275 "src/wast-parser.y" /* yacc.c:1257 */
{ delete ((*yyvaluep).optional_export); }
-#line 1927 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1257 */
+#line 1927 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1257 */
break;
case 123: /* inline_export */
-#line 275 "src/ast-parser.y" /* yacc.c:1257 */
+#line 275 "src/wast-parser.y" /* yacc.c:1257 */
{ delete ((*yyvaluep).optional_export); }
-#line 1933 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1257 */
+#line 1933 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1257 */
break;
case 124: /* type_def */
-#line 272 "src/ast-parser.y" /* yacc.c:1257 */
+#line 272 "src/wast-parser.y" /* yacc.c:1257 */
{ delete ((*yyvaluep).func_type); }
-#line 1939 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1257 */
+#line 1939 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1257 */
break;
case 125: /* start */
-#line 282 "src/ast-parser.y" /* yacc.c:1257 */
+#line 282 "src/wast-parser.y" /* yacc.c:1257 */
{ destroy_var(&((*yyvaluep).var)); }
-#line 1945 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1257 */
+#line 1945 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1257 */
break;
case 126: /* module_fields */
-#line 277 "src/ast-parser.y" /* yacc.c:1257 */
+#line 277 "src/wast-parser.y" /* yacc.c:1257 */
{ delete ((*yyvaluep).module); }
-#line 1951 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1257 */
+#line 1951 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1257 */
break;
case 127: /* raw_module */
-#line 278 "src/ast-parser.y" /* yacc.c:1257 */
+#line 278 "src/wast-parser.y" /* yacc.c:1257 */
{ delete ((*yyvaluep).raw_module); }
-#line 1957 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1257 */
+#line 1957 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1257 */
break;
case 128: /* module */
-#line 277 "src/ast-parser.y" /* yacc.c:1257 */
+#line 277 "src/wast-parser.y" /* yacc.c:1257 */
{ delete ((*yyvaluep).module); }
-#line 1963 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1257 */
+#line 1963 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1257 */
break;
case 129: /* script_var_opt */
-#line 282 "src/ast-parser.y" /* yacc.c:1257 */
+#line 282 "src/wast-parser.y" /* yacc.c:1257 */
{ destroy_var(&((*yyvaluep).var)); }
-#line 1969 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1257 */
+#line 1969 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1257 */
break;
case 130: /* action */
-#line 256 "src/ast-parser.y" /* yacc.c:1257 */
+#line 256 "src/wast-parser.y" /* yacc.c:1257 */
{ delete ((*yyvaluep).action); }
-#line 1975 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1257 */
+#line 1975 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1257 */
break;
case 131: /* assertion */
-#line 258 "src/ast-parser.y" /* yacc.c:1257 */
+#line 258 "src/wast-parser.y" /* yacc.c:1257 */
{ delete ((*yyvaluep).command); }
-#line 1981 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1257 */
+#line 1981 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1257 */
break;
case 132: /* cmd */
-#line 258 "src/ast-parser.y" /* yacc.c:1257 */
+#line 258 "src/wast-parser.y" /* yacc.c:1257 */
{ delete ((*yyvaluep).command); }
-#line 1987 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1257 */
+#line 1987 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1257 */
break;
case 133: /* cmd_list */
-#line 259 "src/ast-parser.y" /* yacc.c:1257 */
+#line 259 "src/wast-parser.y" /* yacc.c:1257 */
{ delete ((*yyvaluep).commands); }
-#line 1993 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1257 */
+#line 1993 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1257 */
break;
case 135: /* const_list */
-#line 260 "src/ast-parser.y" /* yacc.c:1257 */
+#line 260 "src/wast-parser.y" /* yacc.c:1257 */
{ delete ((*yyvaluep).consts); }
-#line 1999 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1257 */
+#line 1999 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1257 */
break;
case 136: /* script */
-#line 279 "src/ast-parser.y" /* yacc.c:1257 */
+#line 279 "src/wast-parser.y" /* yacc.c:1257 */
{ delete ((*yyvaluep).script); }
-#line 2005 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1257 */
+#line 2005 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1257 */
break;
@@ -2019,7 +2019,7 @@ yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocatio
`----------*/
int
-yyparse (::wabt::AstLexer* lexer, ::wabt::AstParser* parser)
+yyparse (::wabt::WastLexer* lexer, ::wabt::WastParser* parser)
{
/* The lookahead symbol. */
int yychar;
@@ -2033,7 +2033,7 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);
/* Location data for the lookahead symbol. */
static YYLTYPE yyloc_default
-# if defined WABT_AST_PARSER_LTYPE_IS_TRIVIAL && WABT_AST_PARSER_LTYPE_IS_TRIVIAL
+# if defined WABT_WAST_PARSER_LTYPE_IS_TRIVIAL && WABT_WAST_PARSER_LTYPE_IS_TRIVIAL
= { 1, 1, 1, 1 }
# endif
;
@@ -2293,18 +2293,18 @@ yyreduce:
switch (yyn)
{
case 2:
-#line 296 "src/ast-parser.y" /* yacc.c:1646 */
+#line 296 "src/wast-parser.y" /* yacc.c:1646 */
{
TextListNode* node = new TextListNode();
DUPTEXT(node->text, (yyvsp[0].text));
node->next = nullptr;
(yyval.text_list).first = (yyval.text_list).last = node;
}
-#line 2304 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 2304 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 3:
-#line 302 "src/ast-parser.y" /* yacc.c:1646 */
+#line 302 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.text_list) = (yyvsp[-1].text_list);
TextListNode* node = new TextListNode();
@@ -2313,17 +2313,17 @@ yyreduce:
(yyval.text_list).last->next = node;
(yyval.text_list).last = node;
}
-#line 2317 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 2317 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 4:
-#line 312 "src/ast-parser.y" /* yacc.c:1646 */
+#line 312 "src/wast-parser.y" /* yacc.c:1646 */
{ (yyval.text_list).first = (yyval.text_list).last = nullptr; }
-#line 2323 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 2323 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 6:
-#line 317 "src/ast-parser.y" /* yacc.c:1646 */
+#line 317 "src/wast-parser.y" /* yacc.c:1646 */
{
TextListNode node;
node.text = (yyvsp[0].text);
@@ -2337,74 +2337,74 @@ yyreduce:
(yyval.text).start = data;
(yyval.text).length = size;
}
-#line 2341 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 2341 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 7:
-#line 335 "src/ast-parser.y" /* yacc.c:1646 */
+#line 335 "src/wast-parser.y" /* yacc.c:1646 */
{ (yyval.types) = new TypeVector(); }
-#line 2347 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 2347 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 8:
-#line 336 "src/ast-parser.y" /* yacc.c:1646 */
+#line 336 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.types) = (yyvsp[-1].types);
(yyval.types)->push_back((yyvsp[0].type));
}
-#line 2356 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 2356 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 9:
-#line 342 "src/ast-parser.y" /* yacc.c:1646 */
+#line 342 "src/wast-parser.y" /* yacc.c:1646 */
{}
-#line 2362 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 2362 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 10:
-#line 345 "src/ast-parser.y" /* yacc.c:1646 */
+#line 345 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.global) = new Global();
(yyval.global)->type = (yyvsp[0].type);
(yyval.global)->mutable_ = false;
}
-#line 2372 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 2372 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 11:
-#line 350 "src/ast-parser.y" /* yacc.c:1646 */
+#line 350 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.global) = new Global();
(yyval.global)->type = (yyvsp[-1].type);
(yyval.global)->mutable_ = true;
}
-#line 2382 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 2382 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 12:
-#line 357 "src/ast-parser.y" /* yacc.c:1646 */
+#line 357 "src/wast-parser.y" /* yacc.c:1646 */
{ (yyval.func_sig) = (yyvsp[-1].func_sig); }
-#line 2388 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 2388 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 13:
-#line 360 "src/ast-parser.y" /* yacc.c:1646 */
+#line 360 "src/wast-parser.y" /* yacc.c:1646 */
{ (yyval.func_sig) = new FuncSignature(); }
-#line 2394 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 2394 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 14:
-#line 361 "src/ast-parser.y" /* yacc.c:1646 */
+#line 361 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.func_sig) = new FuncSignature();
(yyval.func_sig)->param_types = std::move(*(yyvsp[-1].types));
delete (yyvsp[-1].types);
}
-#line 2404 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 2404 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 15:
-#line 366 "src/ast-parser.y" /* yacc.c:1646 */
+#line 366 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.func_sig) = new FuncSignature();
(yyval.func_sig)->param_types = std::move(*(yyvsp[-5].types));
@@ -2412,502 +2412,502 @@ yyreduce:
(yyval.func_sig)->result_types = std::move(*(yyvsp[-1].types));
delete (yyvsp[-1].types);
}
-#line 2416 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 2416 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 16:
-#line 373 "src/ast-parser.y" /* yacc.c:1646 */
+#line 373 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.func_sig) = new FuncSignature();
(yyval.func_sig)->result_types = std::move(*(yyvsp[-1].types));
delete (yyvsp[-1].types);
}
-#line 2426 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 2426 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 17:
-#line 381 "src/ast-parser.y" /* yacc.c:1646 */
+#line 381 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.table) = new Table();
(yyval.table)->elem_limits = (yyvsp[-1].limits);
}
-#line 2435 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 2435 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 18:
-#line 387 "src/ast-parser.y" /* yacc.c:1646 */
+#line 387 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.memory) = new Memory();
(yyval.memory)->page_limits = (yyvsp[0].limits);
}
-#line 2444 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 2444 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 19:
-#line 393 "src/ast-parser.y" /* yacc.c:1646 */
+#line 393 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.limits).has_max = false;
(yyval.limits).initial = (yyvsp[0].u64);
(yyval.limits).max = 0;
}
-#line 2454 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 2454 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 20:
-#line 398 "src/ast-parser.y" /* yacc.c:1646 */
+#line 398 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.limits).has_max = true;
(yyval.limits).initial = (yyvsp[-1].u64);
(yyval.limits).max = (yyvsp[0].u64);
}
-#line 2464 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 2464 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 21:
-#line 405 "src/ast-parser.y" /* yacc.c:1646 */
+#line 405 "src/wast-parser.y" /* yacc.c:1646 */
{ (yyval.var) = (yyvsp[-1].var); }
-#line 2470 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 2470 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 22:
-#line 411 "src/ast-parser.y" /* yacc.c:1646 */
+#line 411 "src/wast-parser.y" /* yacc.c:1646 */
{
if (WABT_FAILED(parse_uint64((yyvsp[0].literal).text.start,
(yyvsp[0].literal).text.start + (yyvsp[0].literal).text.length, &(yyval.u64)))) {
- ast_parser_error(&(yylsp[0]), lexer, parser,
- "invalid int " PRIstringslice "\"",
- WABT_PRINTF_STRING_SLICE_ARG((yyvsp[0].literal).text));
+ wast_parser_error(&(yylsp[0]), lexer, parser,
+ "invalid int " PRIstringslice "\"",
+ WABT_PRINTF_STRING_SLICE_ARG((yyvsp[0].literal).text));
}
}
-#line 2483 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 2483 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 23:
-#line 422 "src/ast-parser.y" /* yacc.c:1646 */
+#line 422 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.literal).type = (yyvsp[0].literal).type;
DUPTEXT((yyval.literal).text, (yyvsp[0].literal).text);
}
-#line 2492 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 2492 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 24:
-#line 426 "src/ast-parser.y" /* yacc.c:1646 */
+#line 426 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.literal).type = (yyvsp[0].literal).type;
DUPTEXT((yyval.literal).text, (yyvsp[0].literal).text);
}
-#line 2501 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 2501 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 25:
-#line 430 "src/ast-parser.y" /* yacc.c:1646 */
+#line 430 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.literal).type = (yyvsp[0].literal).type;
DUPTEXT((yyval.literal).text, (yyvsp[0].literal).text);
}
-#line 2510 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 2510 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 26:
-#line 437 "src/ast-parser.y" /* yacc.c:1646 */
+#line 437 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.var).loc = (yylsp[0]);
(yyval.var).type = VarType::Index;
(yyval.var).index = (yyvsp[0].u64);
}
-#line 2520 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 2520 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 27:
-#line 442 "src/ast-parser.y" /* yacc.c:1646 */
+#line 442 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.var).loc = (yylsp[0]);
(yyval.var).type = VarType::Name;
DUPTEXT((yyval.var).name, (yyvsp[0].text));
}
-#line 2530 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 2530 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 28:
-#line 449 "src/ast-parser.y" /* yacc.c:1646 */
+#line 449 "src/wast-parser.y" /* yacc.c:1646 */
{ (yyval.vars) = new VarVector(); }
-#line 2536 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 2536 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 29:
-#line 450 "src/ast-parser.y" /* yacc.c:1646 */
+#line 450 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.vars) = (yyvsp[-1].vars);
(yyval.vars)->push_back((yyvsp[0].var));
}
-#line 2545 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 2545 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 30:
-#line 456 "src/ast-parser.y" /* yacc.c:1646 */
+#line 456 "src/wast-parser.y" /* yacc.c:1646 */
{ WABT_ZERO_MEMORY((yyval.text)); }
-#line 2551 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 2551 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 32:
-#line 460 "src/ast-parser.y" /* yacc.c:1646 */
+#line 460 "src/wast-parser.y" /* yacc.c:1646 */
{ DUPTEXT((yyval.text), (yyvsp[0].text)); }
-#line 2557 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 2557 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 33:
-#line 464 "src/ast-parser.y" /* yacc.c:1646 */
+#line 464 "src/wast-parser.y" /* yacc.c:1646 */
{ WABT_ZERO_MEMORY((yyval.text)); }
-#line 2563 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 2563 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 35:
-#line 469 "src/ast-parser.y" /* yacc.c:1646 */
+#line 469 "src/wast-parser.y" /* yacc.c:1646 */
{ (yyval.u64) = 0; }
-#line 2569 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 2569 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 36:
-#line 470 "src/ast-parser.y" /* yacc.c:1646 */
+#line 470 "src/wast-parser.y" /* yacc.c:1646 */
{
if (WABT_FAILED(parse_int64((yyvsp[0].text).start, (yyvsp[0].text).start + (yyvsp[0].text).length, &(yyval.u64),
ParseIntType::SignedAndUnsigned))) {
- ast_parser_error(&(yylsp[0]), lexer, parser,
- "invalid offset \"" PRIstringslice "\"",
- WABT_PRINTF_STRING_SLICE_ARG((yyvsp[0].text)));
+ wast_parser_error(&(yylsp[0]), lexer, parser,
+ "invalid offset \"" PRIstringslice "\"",
+ WABT_PRINTF_STRING_SLICE_ARG((yyvsp[0].text)));
}
}
-#line 2582 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 2582 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 37:
-#line 480 "src/ast-parser.y" /* yacc.c:1646 */
+#line 480 "src/wast-parser.y" /* yacc.c:1646 */
{ (yyval.u32) = USE_NATURAL_ALIGNMENT; }
-#line 2588 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 2588 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 38:
-#line 481 "src/ast-parser.y" /* yacc.c:1646 */
+#line 481 "src/wast-parser.y" /* yacc.c:1646 */
{
if (WABT_FAILED(parse_int32((yyvsp[0].text).start, (yyvsp[0].text).start + (yyvsp[0].text).length, &(yyval.u32),
ParseIntType::UnsignedOnly))) {
- ast_parser_error(&(yylsp[0]), lexer, parser,
- "invalid alignment \"" PRIstringslice "\"",
- WABT_PRINTF_STRING_SLICE_ARG((yyvsp[0].text)));
+ wast_parser_error(&(yylsp[0]), lexer, parser,
+ "invalid alignment \"" PRIstringslice "\"",
+ WABT_PRINTF_STRING_SLICE_ARG((yyvsp[0].text)));
}
}
-#line 2601 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 2601 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 39:
-#line 492 "src/ast-parser.y" /* yacc.c:1646 */
+#line 492 "src/wast-parser.y" /* yacc.c:1646 */
{ (yyval.expr_list) = join_exprs1(&(yylsp[0]), (yyvsp[0].expr)); }
-#line 2607 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 2607 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 40:
-#line 493 "src/ast-parser.y" /* yacc.c:1646 */
+#line 493 "src/wast-parser.y" /* yacc.c:1646 */
{ (yyval.expr_list) = join_exprs1(&(yylsp[0]), (yyvsp[0].expr)); }
-#line 2613 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 2613 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 41:
-#line 494 "src/ast-parser.y" /* yacc.c:1646 */
+#line 494 "src/wast-parser.y" /* yacc.c:1646 */
{ (yyval.expr_list) = (yyvsp[0].expr_list); }
-#line 2619 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 2619 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 42:
-#line 497 "src/ast-parser.y" /* yacc.c:1646 */
+#line 497 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.expr) = Expr::CreateUnreachable();
}
-#line 2627 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 2627 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 43:
-#line 500 "src/ast-parser.y" /* yacc.c:1646 */
+#line 500 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.expr) = Expr::CreateNop();
}
-#line 2635 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 2635 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 44:
-#line 503 "src/ast-parser.y" /* yacc.c:1646 */
+#line 503 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.expr) = Expr::CreateDrop();
}
-#line 2643 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 2643 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 45:
-#line 506 "src/ast-parser.y" /* yacc.c:1646 */
+#line 506 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.expr) = Expr::CreateSelect();
}
-#line 2651 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 2651 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 46:
-#line 509 "src/ast-parser.y" /* yacc.c:1646 */
+#line 509 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.expr) = Expr::CreateBr((yyvsp[0].var));
}
-#line 2659 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 2659 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 47:
-#line 512 "src/ast-parser.y" /* yacc.c:1646 */
+#line 512 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.expr) = Expr::CreateBrIf((yyvsp[0].var));
}
-#line 2667 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 2667 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 48:
-#line 515 "src/ast-parser.y" /* yacc.c:1646 */
+#line 515 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.expr) = Expr::CreateBrTable((yyvsp[-1].vars), (yyvsp[0].var));
}
-#line 2675 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 2675 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 49:
-#line 518 "src/ast-parser.y" /* yacc.c:1646 */
+#line 518 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.expr) = Expr::CreateReturn();
}
-#line 2683 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 2683 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 50:
-#line 521 "src/ast-parser.y" /* yacc.c:1646 */
+#line 521 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.expr) = Expr::CreateCall((yyvsp[0].var));
}
-#line 2691 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 2691 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 51:
-#line 524 "src/ast-parser.y" /* yacc.c:1646 */
+#line 524 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.expr) = Expr::CreateCallIndirect((yyvsp[0].var));
}
-#line 2699 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 2699 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 52:
-#line 527 "src/ast-parser.y" /* yacc.c:1646 */
+#line 527 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.expr) = Expr::CreateGetLocal((yyvsp[0].var));
}
-#line 2707 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 2707 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 53:
-#line 530 "src/ast-parser.y" /* yacc.c:1646 */
+#line 530 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.expr) = Expr::CreateSetLocal((yyvsp[0].var));
}
-#line 2715 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 2715 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 54:
-#line 533 "src/ast-parser.y" /* yacc.c:1646 */
+#line 533 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.expr) = Expr::CreateTeeLocal((yyvsp[0].var));
}
-#line 2723 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 2723 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 55:
-#line 536 "src/ast-parser.y" /* yacc.c:1646 */
+#line 536 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.expr) = Expr::CreateGetGlobal((yyvsp[0].var));
}
-#line 2731 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 2731 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 56:
-#line 539 "src/ast-parser.y" /* yacc.c:1646 */
+#line 539 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.expr) = Expr::CreateSetGlobal((yyvsp[0].var));
}
-#line 2739 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 2739 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 57:
-#line 542 "src/ast-parser.y" /* yacc.c:1646 */
+#line 542 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.expr) = Expr::CreateLoad((yyvsp[-2].opcode), (yyvsp[0].u32), (yyvsp[-1].u64));
}
-#line 2747 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 2747 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 58:
-#line 545 "src/ast-parser.y" /* yacc.c:1646 */
+#line 545 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.expr) = Expr::CreateStore((yyvsp[-2].opcode), (yyvsp[0].u32), (yyvsp[-1].u64));
}
-#line 2755 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 2755 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 59:
-#line 548 "src/ast-parser.y" /* yacc.c:1646 */
+#line 548 "src/wast-parser.y" /* yacc.c:1646 */
{
Const const_;
WABT_ZERO_MEMORY(const_);
const_.loc = (yylsp[-1]);
if (WABT_FAILED(parse_const((yyvsp[-1].type), (yyvsp[0].literal).type, (yyvsp[0].literal).text.start,
(yyvsp[0].literal).text.start + (yyvsp[0].literal).text.length, &const_))) {
- ast_parser_error(&(yylsp[0]), lexer, parser,
- "invalid literal \"" PRIstringslice "\"",
- WABT_PRINTF_STRING_SLICE_ARG((yyvsp[0].literal).text));
+ wast_parser_error(&(yylsp[0]), lexer, parser,
+ "invalid literal \"" PRIstringslice "\"",
+ WABT_PRINTF_STRING_SLICE_ARG((yyvsp[0].literal).text));
}
delete [] (yyvsp[0].literal).text.start;
(yyval.expr) = Expr::CreateConst(const_);
}
-#line 2773 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 2773 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 60:
-#line 561 "src/ast-parser.y" /* yacc.c:1646 */
+#line 561 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.expr) = Expr::CreateUnary((yyvsp[0].opcode));
}
-#line 2781 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 2781 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 61:
-#line 564 "src/ast-parser.y" /* yacc.c:1646 */
+#line 564 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.expr) = Expr::CreateBinary((yyvsp[0].opcode));
}
-#line 2789 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 2789 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 62:
-#line 567 "src/ast-parser.y" /* yacc.c:1646 */
+#line 567 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.expr) = Expr::CreateCompare((yyvsp[0].opcode));
}
-#line 2797 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 2797 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 63:
-#line 570 "src/ast-parser.y" /* yacc.c:1646 */
+#line 570 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.expr) = Expr::CreateConvert((yyvsp[0].opcode));
}
-#line 2805 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 2805 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 64:
-#line 573 "src/ast-parser.y" /* yacc.c:1646 */
+#line 573 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.expr) = Expr::CreateCurrentMemory();
}
-#line 2813 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 2813 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 65:
-#line 576 "src/ast-parser.y" /* yacc.c:1646 */
+#line 576 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.expr) = Expr::CreateGrowMemory();
}
-#line 2821 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 2821 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 66:
-#line 581 "src/ast-parser.y" /* yacc.c:1646 */
+#line 581 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.expr) = Expr::CreateBlock((yyvsp[-2].block));
(yyval.expr)->block->label = (yyvsp[-3].text);
CHECK_END_LABEL((yylsp[0]), (yyval.expr)->block->label, (yyvsp[0].text));
}
-#line 2831 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 2831 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 67:
-#line 586 "src/ast-parser.y" /* yacc.c:1646 */
+#line 586 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.expr) = Expr::CreateLoop((yyvsp[-2].block));
(yyval.expr)->loop->label = (yyvsp[-3].text);
CHECK_END_LABEL((yylsp[0]), (yyval.expr)->loop->label, (yyvsp[0].text));
}
-#line 2841 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 2841 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 68:
-#line 591 "src/ast-parser.y" /* yacc.c:1646 */
+#line 591 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.expr) = Expr::CreateIf((yyvsp[-2].block), nullptr);
(yyval.expr)->if_.true_->label = (yyvsp[-3].text);
CHECK_END_LABEL((yylsp[0]), (yyval.expr)->if_.true_->label, (yyvsp[0].text));
}
-#line 2851 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 2851 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 69:
-#line 596 "src/ast-parser.y" /* yacc.c:1646 */
+#line 596 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.expr) = Expr::CreateIf((yyvsp[-5].block), (yyvsp[-2].expr_list).first);
(yyval.expr)->if_.true_->label = (yyvsp[-6].text);
CHECK_END_LABEL((yylsp[-3]), (yyval.expr)->if_.true_->label, (yyvsp[-3].text));
CHECK_END_LABEL((yylsp[0]), (yyval.expr)->if_.true_->label, (yyvsp[0].text));
}
-#line 2862 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 2862 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 70:
-#line 604 "src/ast-parser.y" /* yacc.c:1646 */
+#line 604 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.block) = new Block();
(yyval.block)->sig = std::move(*(yyvsp[-1].types));
delete (yyvsp[-1].types);
(yyval.block)->first = (yyvsp[0].expr_list).first;
}
-#line 2873 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 2873 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 71:
-#line 613 "src/ast-parser.y" /* yacc.c:1646 */
+#line 613 "src/wast-parser.y" /* yacc.c:1646 */
{ (yyval.expr_list) = (yyvsp[-1].expr_list); }
-#line 2879 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 2879 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 72:
-#line 617 "src/ast-parser.y" /* yacc.c:1646 */
+#line 617 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.expr_list) = join_exprs2(&(yylsp[-1]), &(yyvsp[0].expr_list), (yyvsp[-1].expr));
}
-#line 2887 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 2887 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 73:
-#line 620 "src/ast-parser.y" /* yacc.c:1646 */
+#line 620 "src/wast-parser.y" /* yacc.c:1646 */
{
Expr* expr = Expr::CreateBlock((yyvsp[0].block));
expr->block->label = (yyvsp[-1].text);
(yyval.expr_list) = join_exprs1(&(yylsp[-2]), expr);
}
-#line 2897 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 2897 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 74:
-#line 625 "src/ast-parser.y" /* yacc.c:1646 */
+#line 625 "src/wast-parser.y" /* yacc.c:1646 */
{
Expr* expr = Expr::CreateLoop((yyvsp[0].block));
expr->loop->label = (yyvsp[-1].text);
(yyval.expr_list) = join_exprs1(&(yylsp[-2]), expr);
}
-#line 2907 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 2907 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 75:
-#line 630 "src/ast-parser.y" /* yacc.c:1646 */
+#line 630 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.expr_list) = (yyvsp[0].expr_list);
Expr* if_ = (yyvsp[0].expr_list).last;
@@ -2916,121 +2916,121 @@ yyreduce:
if_->if_.true_->sig = std::move(*(yyvsp[-1].types));
delete (yyvsp[-1].types);
}
-#line 2920 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 2920 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 76:
-#line 640 "src/ast-parser.y" /* yacc.c:1646 */
+#line 640 "src/wast-parser.y" /* yacc.c:1646 */
{
Expr* expr = Expr::CreateIf(new Block((yyvsp[-5].expr_list).first), (yyvsp[-1].expr_list).first);
(yyval.expr_list) = join_exprs1(&(yylsp[-7]), expr);
}
-#line 2929 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 2929 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 77:
-#line 644 "src/ast-parser.y" /* yacc.c:1646 */
+#line 644 "src/wast-parser.y" /* yacc.c:1646 */
{
Expr* expr = Expr::CreateIf(new Block((yyvsp[-1].expr_list).first), nullptr);
(yyval.expr_list) = join_exprs1(&(yylsp[-3]), expr);
}
-#line 2938 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 2938 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 78:
-#line 648 "src/ast-parser.y" /* yacc.c:1646 */
+#line 648 "src/wast-parser.y" /* yacc.c:1646 */
{
Expr* expr = Expr::CreateIf(new Block((yyvsp[-5].expr_list).first), (yyvsp[-1].expr_list).first);
(yyval.expr_list) = join_exprs2(&(yylsp[-8]), &(yyvsp[-8].expr_list), expr);
}
-#line 2947 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 2947 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 79:
-#line 652 "src/ast-parser.y" /* yacc.c:1646 */
+#line 652 "src/wast-parser.y" /* yacc.c:1646 */
{
Expr* expr = Expr::CreateIf(new Block((yyvsp[-1].expr_list).first), nullptr);
(yyval.expr_list) = join_exprs2(&(yylsp[-4]), &(yyvsp[-4].expr_list), expr);
}
-#line 2956 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 2956 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 80:
-#line 656 "src/ast-parser.y" /* yacc.c:1646 */
+#line 656 "src/wast-parser.y" /* yacc.c:1646 */
{
Expr* expr = Expr::CreateIf(new Block((yyvsp[-1].expr_list).first), (yyvsp[0].expr_list).first);
(yyval.expr_list) = join_exprs2(&(yylsp[-2]), &(yyvsp[-2].expr_list), expr);
}
-#line 2965 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 2965 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 81:
-#line 660 "src/ast-parser.y" /* yacc.c:1646 */
+#line 660 "src/wast-parser.y" /* yacc.c:1646 */
{
Expr* expr = Expr::CreateIf(new Block((yyvsp[0].expr_list).first), nullptr);
(yyval.expr_list) = join_exprs2(&(yylsp[-1]), &(yyvsp[-1].expr_list), expr);
}
-#line 2974 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 2974 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 82:
-#line 667 "src/ast-parser.y" /* yacc.c:1646 */
+#line 667 "src/wast-parser.y" /* yacc.c:1646 */
{ WABT_ZERO_MEMORY((yyval.expr_list)); }
-#line 2980 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 2980 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 83:
-#line 668 "src/ast-parser.y" /* yacc.c:1646 */
+#line 668 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.expr_list).first = (yyvsp[-1].expr_list).first;
(yyvsp[-1].expr_list).last->next = (yyvsp[0].expr_list).first;
(yyval.expr_list).last = (yyvsp[0].expr_list).last ? (yyvsp[0].expr_list).last : (yyvsp[-1].expr_list).last;
(yyval.expr_list).size = (yyvsp[-1].expr_list).size + (yyvsp[0].expr_list).size;
}
-#line 2991 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 2991 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 84:
-#line 676 "src/ast-parser.y" /* yacc.c:1646 */
+#line 676 "src/wast-parser.y" /* yacc.c:1646 */
{ WABT_ZERO_MEMORY((yyval.expr_list)); }
-#line 2997 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 2997 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 85:
-#line 677 "src/ast-parser.y" /* yacc.c:1646 */
+#line 677 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.expr_list).first = (yyvsp[-1].expr_list).first;
(yyvsp[-1].expr_list).last->next = (yyvsp[0].expr_list).first;
(yyval.expr_list).last = (yyvsp[0].expr_list).last ? (yyvsp[0].expr_list).last : (yyvsp[-1].expr_list).last;
(yyval.expr_list).size = (yyvsp[-1].expr_list).size + (yyvsp[0].expr_list).size;
}
-#line 3008 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 3008 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 88:
-#line 691 "src/ast-parser.y" /* yacc.c:1646 */
+#line 691 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.func_fields) = new FuncField();
(yyval.func_fields)->type = FuncFieldType::ResultTypes;
(yyval.func_fields)->types = (yyvsp[-2].types);
(yyval.func_fields)->next = (yyvsp[0].func_fields);
}
-#line 3019 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 3019 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 89:
-#line 697 "src/ast-parser.y" /* yacc.c:1646 */
+#line 697 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.func_fields) = new FuncField();
(yyval.func_fields)->type = FuncFieldType::ParamTypes;
(yyval.func_fields)->types = (yyvsp[-2].types);
(yyval.func_fields)->next = (yyvsp[0].func_fields);
}
-#line 3030 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 3030 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 90:
-#line 703 "src/ast-parser.y" /* yacc.c:1646 */
+#line 703 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.func_fields) = new FuncField();
(yyval.func_fields)->type = FuncFieldType::BoundParam;
@@ -3039,33 +3039,33 @@ yyreduce:
(yyval.func_fields)->bound_type.type = (yyvsp[-2].type);
(yyval.func_fields)->next = (yyvsp[0].func_fields);
}
-#line 3043 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 3043 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 91:
-#line 713 "src/ast-parser.y" /* yacc.c:1646 */
+#line 713 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.func_fields) = new FuncField();
(yyval.func_fields)->type = FuncFieldType::Exprs;
(yyval.func_fields)->first_expr = (yyvsp[0].expr_list).first;
(yyval.func_fields)->next = nullptr;
}
-#line 3054 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 3054 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 92:
-#line 719 "src/ast-parser.y" /* yacc.c:1646 */
+#line 719 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.func_fields) = new FuncField();
(yyval.func_fields)->type = FuncFieldType::LocalTypes;
(yyval.func_fields)->types = (yyvsp[-2].types);
(yyval.func_fields)->next = (yyvsp[0].func_fields);
}
-#line 3065 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 3065 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 93:
-#line 725 "src/ast-parser.y" /* yacc.c:1646 */
+#line 725 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.func_fields) = new FuncField();
(yyval.func_fields)->type = FuncFieldType::BoundLocal;
@@ -3074,11 +3074,11 @@ yyreduce:
(yyval.func_fields)->bound_type.type = (yyvsp[-2].type);
(yyval.func_fields)->next = (yyvsp[0].func_fields);
}
-#line 3078 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 3078 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 94:
-#line 735 "src/ast-parser.y" /* yacc.c:1646 */
+#line 735 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.func) = new Func();
FuncField* field = (yyvsp[0].func_fields);
@@ -3129,11 +3129,11 @@ yyreduce:
field = next;
}
}
-#line 3133 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 3133 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 95:
-#line 787 "src/ast-parser.y" /* yacc.c:1646 */
+#line 787 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.exported_func) = new ExportedFunc();
(yyval.exported_func)->func.reset((yyvsp[-1].func));
@@ -3143,11 +3143,11 @@ yyreduce:
(yyval.exported_func)->export_ = std::move(*(yyvsp[-3].optional_export));
delete (yyvsp[-3].optional_export);
}
-#line 3147 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 3147 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 96:
-#line 797 "src/ast-parser.y" /* yacc.c:1646 */
+#line 797 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.exported_func) = new ExportedFunc();
(yyval.exported_func)->func.reset((yyvsp[-1].func));
@@ -3155,11 +3155,11 @@ yyreduce:
(yyval.exported_func)->func->decl.type_var = (yyvsp[-2].var);
(yyval.exported_func)->func->name = (yyvsp[-3].text);
}
-#line 3159 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 3159 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 97:
-#line 804 "src/ast-parser.y" /* yacc.c:1646 */
+#line 804 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.exported_func) = new ExportedFunc();
(yyval.exported_func)->func.reset((yyvsp[-1].func));
@@ -3167,29 +3167,29 @@ yyreduce:
(yyval.exported_func)->export_ = std::move(*(yyvsp[-2].optional_export));
delete (yyvsp[-2].optional_export);
}
-#line 3171 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 3171 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 98:
-#line 812 "src/ast-parser.y" /* yacc.c:1646 */
+#line 812 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.exported_func) = new ExportedFunc();
(yyval.exported_func)->func.reset((yyvsp[-1].func));
(yyval.exported_func)->func->name = (yyvsp[-2].text);
}
-#line 3181 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 3181 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 99:
-#line 822 "src/ast-parser.y" /* yacc.c:1646 */
+#line 822 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.expr_list) = (yyvsp[-1].expr_list);
}
-#line 3189 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 3189 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 101:
-#line 829 "src/ast-parser.y" /* yacc.c:1646 */
+#line 829 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.elem_segment) = new ElemSegment();
(yyval.elem_segment)->table_var = (yyvsp[-3].var);
@@ -3197,11 +3197,11 @@ yyreduce:
(yyval.elem_segment)->vars = std::move(*(yyvsp[-1].vars));
delete (yyvsp[-1].vars);
}
-#line 3201 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 3201 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 102:
-#line 836 "src/ast-parser.y" /* yacc.c:1646 */
+#line 836 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.elem_segment) = new ElemSegment();
(yyval.elem_segment)->table_var.loc = (yylsp[-3]);
@@ -3211,11 +3211,11 @@ yyreduce:
(yyval.elem_segment)->vars = std::move(*(yyvsp[-1].vars));
delete (yyvsp[-1].vars);
}
-#line 3215 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 3215 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 103:
-#line 848 "src/ast-parser.y" /* yacc.c:1646 */
+#line 848 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.exported_table) = new ExportedTable();
(yyval.exported_table)->table.reset((yyvsp[-1].table));
@@ -3224,11 +3224,11 @@ yyreduce:
(yyval.exported_table)->export_ = std::move(*(yyvsp[-2].optional_export));
delete (yyvsp[-2].optional_export);
}
-#line 3228 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 3228 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 104:
-#line 857 "src/ast-parser.y" /* yacc.c:1646 */
+#line 857 "src/wast-parser.y" /* yacc.c:1646 */
{
Expr* expr = Expr::CreateConst(Const(Const::I32(), 0));
expr->loc = (yylsp[-8]);
@@ -3247,11 +3247,11 @@ yyreduce:
(yyval.exported_table)->export_ = std::move(*(yyvsp[-6].optional_export));
delete (yyvsp[-6].optional_export);
}
-#line 3251 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 3251 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 105:
-#line 878 "src/ast-parser.y" /* yacc.c:1646 */
+#line 878 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.data_segment) = new DataSegment();
(yyval.data_segment)->memory_var = (yyvsp[-3].var);
@@ -3259,11 +3259,11 @@ yyreduce:
dup_text_list(&(yyvsp[-1].text_list), &(yyval.data_segment)->data, &(yyval.data_segment)->size);
destroy_text_list(&(yyvsp[-1].text_list));
}
-#line 3263 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 3263 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 106:
-#line 885 "src/ast-parser.y" /* yacc.c:1646 */
+#line 885 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.data_segment) = new DataSegment();
(yyval.data_segment)->memory_var.loc = (yylsp[-3]);
@@ -3273,11 +3273,11 @@ yyreduce:
dup_text_list(&(yyvsp[-1].text_list), &(yyval.data_segment)->data, &(yyval.data_segment)->size);
destroy_text_list(&(yyvsp[-1].text_list));
}
-#line 3277 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 3277 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 107:
-#line 897 "src/ast-parser.y" /* yacc.c:1646 */
+#line 897 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.exported_memory) = new ExportedMemory();
(yyval.exported_memory)->memory.reset((yyvsp[-1].memory));
@@ -3286,11 +3286,11 @@ yyreduce:
(yyval.exported_memory)->export_ = std::move(*(yyvsp[-2].optional_export));
delete (yyvsp[-2].optional_export);
}
-#line 3290 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 3290 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 108:
-#line 905 "src/ast-parser.y" /* yacc.c:1646 */
+#line 905 "src/wast-parser.y" /* yacc.c:1646 */
{
Expr* expr = Expr::CreateConst(Const(Const::I32(), 0));
expr->loc = (yylsp[-7]);
@@ -3311,11 +3311,11 @@ yyreduce:
(yyval.exported_memory)->export_ = std::move(*(yyvsp[-5].optional_export));
delete (yyvsp[-5].optional_export);
}
-#line 3315 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 3315 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 109:
-#line 926 "src/ast-parser.y" /* yacc.c:1646 */
+#line 926 "src/wast-parser.y" /* yacc.c:1646 */
{
Expr* expr = Expr::CreateConst(Const(Const::I32(), 0));
expr->loc = (yylsp[-6]);
@@ -3335,11 +3335,11 @@ yyreduce:
(yyval.exported_memory)->memory->page_limits.has_max = true;
(yyval.exported_memory)->export_.has_export = false;
}
-#line 3339 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 3339 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 110:
-#line 948 "src/ast-parser.y" /* yacc.c:1646 */
+#line 948 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.exported_global) = new ExportedGlobal();
(yyval.exported_global)->global.reset((yyvsp[-2].global));
@@ -3348,11 +3348,11 @@ yyreduce:
(yyval.exported_global)->export_ = std::move(*(yyvsp[-3].optional_export));
delete (yyvsp[-3].optional_export);
}
-#line 3352 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 3352 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 111:
-#line 956 "src/ast-parser.y" /* yacc.c:1646 */
+#line 956 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.exported_global) = new ExportedGlobal();
(yyval.exported_global)->global.reset((yyvsp[-2].global));
@@ -3360,11 +3360,11 @@ yyreduce:
(yyval.exported_global)->global->init_expr = (yyvsp[-1].expr_list).first;
(yyval.exported_global)->export_.has_export = false;
}
-#line 3364 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 3364 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 112:
-#line 969 "src/ast-parser.y" /* yacc.c:1646 */
+#line 969 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.import) = new Import();
(yyval.import)->kind = ExternalKind::Func;
@@ -3373,11 +3373,11 @@ yyreduce:
(yyval.import)->func->decl.has_func_type = true;
(yyval.import)->func->decl.type_var = (yyvsp[-1].var);
}
-#line 3377 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 3377 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 113:
-#line 977 "src/ast-parser.y" /* yacc.c:1646 */
+#line 977 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.import) = new Import();
(yyval.import)->kind = ExternalKind::Func;
@@ -3386,54 +3386,54 @@ yyreduce:
(yyval.import)->func->decl.sig = std::move(*(yyvsp[-1].func_sig));
delete (yyvsp[-1].func_sig);
}
-#line 3390 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 3390 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 114:
-#line 985 "src/ast-parser.y" /* yacc.c:1646 */
+#line 985 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.import) = new Import();
(yyval.import)->kind = ExternalKind::Table;
(yyval.import)->table = (yyvsp[-1].table);
(yyval.import)->table->name = (yyvsp[-2].text);
}
-#line 3401 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 3401 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 115:
-#line 991 "src/ast-parser.y" /* yacc.c:1646 */
+#line 991 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.import) = new Import();
(yyval.import)->kind = ExternalKind::Memory;
(yyval.import)->memory = (yyvsp[-1].memory);
(yyval.import)->memory->name = (yyvsp[-2].text);
}
-#line 3412 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 3412 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 116:
-#line 997 "src/ast-parser.y" /* yacc.c:1646 */
+#line 997 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.import) = new Import();
(yyval.import)->kind = ExternalKind::Global;
(yyval.import)->global = (yyvsp[-1].global);
(yyval.import)->global->name = (yyvsp[-2].text);
}
-#line 3423 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 3423 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 117:
-#line 1005 "src/ast-parser.y" /* yacc.c:1646 */
+#line 1005 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.import) = (yyvsp[-1].import);
(yyval.import)->module_name = (yyvsp[-3].text);
(yyval.import)->field_name = (yyvsp[-2].text);
}
-#line 3433 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 3433 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 118:
-#line 1010 "src/ast-parser.y" /* yacc.c:1646 */
+#line 1010 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.import) = (yyvsp[-2].import);
(yyval.import)->kind = ExternalKind::Func;
@@ -3442,11 +3442,11 @@ yyreduce:
(yyval.import)->func->decl.has_func_type = true;
(yyval.import)->func->decl.type_var = (yyvsp[-1].var);
}
-#line 3446 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 3446 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 119:
-#line 1018 "src/ast-parser.y" /* yacc.c:1646 */
+#line 1018 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.import) = (yyvsp[-2].import);
(yyval.import)->kind = ExternalKind::Func;
@@ -3455,158 +3455,158 @@ yyreduce:
(yyval.import)->func->decl.sig = std::move(*(yyvsp[-1].func_sig));
delete (yyvsp[-1].func_sig);
}
-#line 3459 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 3459 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 120:
-#line 1026 "src/ast-parser.y" /* yacc.c:1646 */
+#line 1026 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.import) = (yyvsp[-2].import);
(yyval.import)->kind = ExternalKind::Table;
(yyval.import)->table = (yyvsp[-1].table);
(yyval.import)->table->name = (yyvsp[-3].text);
}
-#line 3470 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 3470 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 121:
-#line 1032 "src/ast-parser.y" /* yacc.c:1646 */
+#line 1032 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.import) = (yyvsp[-2].import);
(yyval.import)->kind = ExternalKind::Memory;
(yyval.import)->memory = (yyvsp[-1].memory);
(yyval.import)->memory->name = (yyvsp[-3].text);
}
-#line 3481 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 3481 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 122:
-#line 1038 "src/ast-parser.y" /* yacc.c:1646 */
+#line 1038 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.import) = (yyvsp[-2].import);
(yyval.import)->kind = ExternalKind::Global;
(yyval.import)->global = (yyvsp[-1].global);
(yyval.import)->global->name = (yyvsp[-3].text);
}
-#line 3492 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 3492 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 123:
-#line 1047 "src/ast-parser.y" /* yacc.c:1646 */
+#line 1047 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.import) = new Import();
(yyval.import)->module_name = (yyvsp[-2].text);
(yyval.import)->field_name = (yyvsp[-1].text);
}
-#line 3502 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 3502 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 124:
-#line 1055 "src/ast-parser.y" /* yacc.c:1646 */
+#line 1055 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.export_) = new Export();
(yyval.export_)->kind = ExternalKind::Func;
(yyval.export_)->var = (yyvsp[-1].var);
}
-#line 3512 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 3512 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 125:
-#line 1060 "src/ast-parser.y" /* yacc.c:1646 */
+#line 1060 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.export_) = new Export();
(yyval.export_)->kind = ExternalKind::Table;
(yyval.export_)->var = (yyvsp[-1].var);
}
-#line 3522 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 3522 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 126:
-#line 1065 "src/ast-parser.y" /* yacc.c:1646 */
+#line 1065 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.export_) = new Export();
(yyval.export_)->kind = ExternalKind::Memory;
(yyval.export_)->var = (yyvsp[-1].var);
}
-#line 3532 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 3532 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 127:
-#line 1070 "src/ast-parser.y" /* yacc.c:1646 */
+#line 1070 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.export_) = new Export();
(yyval.export_)->kind = ExternalKind::Global;
(yyval.export_)->var = (yyvsp[-1].var);
}
-#line 3542 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 3542 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 128:
-#line 1077 "src/ast-parser.y" /* yacc.c:1646 */
+#line 1077 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.export_) = (yyvsp[-1].export_);
(yyval.export_)->name = (yyvsp[-2].text);
}
-#line 3551 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 3551 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 129:
-#line 1084 "src/ast-parser.y" /* yacc.c:1646 */
+#line 1084 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.optional_export) = new OptionalExport();
(yyval.optional_export)->has_export = false;
}
-#line 3560 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 3560 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 131:
-#line 1091 "src/ast-parser.y" /* yacc.c:1646 */
+#line 1091 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.optional_export) = new OptionalExport();
(yyval.optional_export)->has_export = true;
(yyval.optional_export)->export_.reset(new Export());
(yyval.optional_export)->export_->name = (yyvsp[-1].text);
}
-#line 3571 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 3571 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 132:
-#line 1103 "src/ast-parser.y" /* yacc.c:1646 */
+#line 1103 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.func_type) = new FuncType();
(yyval.func_type)->sig = std::move(*(yyvsp[-1].func_sig));
delete (yyvsp[-1].func_sig);
}
-#line 3581 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 3581 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 133:
-#line 1108 "src/ast-parser.y" /* yacc.c:1646 */
+#line 1108 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.func_type) = new FuncType();
(yyval.func_type)->name = (yyvsp[-2].text);
(yyval.func_type)->sig = std::move(*(yyvsp[-1].func_sig));
delete (yyvsp[-1].func_sig);
}
-#line 3592 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 3592 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 134:
-#line 1117 "src/ast-parser.y" /* yacc.c:1646 */
+#line 1117 "src/wast-parser.y" /* yacc.c:1646 */
{ (yyval.var) = (yyvsp[-1].var); }
-#line 3598 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 3598 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 135:
-#line 1121 "src/ast-parser.y" /* yacc.c:1646 */
+#line 1121 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.module) = new Module();
}
-#line 3606 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 3606 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 136:
-#line 1124 "src/ast-parser.y" /* yacc.c:1646 */
+#line 1124 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.module) = (yyvsp[-1].module);
ModuleField* field;
@@ -3614,11 +3614,11 @@ yyreduce:
APPEND_ITEM_TO_VECTOR((yyval.module), func_types, field->func_type);
INSERT_BINDING((yyval.module), func_type, func_types, (yylsp[0]), (yyvsp[0].func_type)->name);
}
-#line 3618 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 3618 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 137:
-#line 1131 "src/ast-parser.y" /* yacc.c:1646 */
+#line 1131 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.module) = (yyvsp[-1].module);
ModuleField* field;
@@ -3628,11 +3628,11 @@ yyreduce:
APPEND_INLINE_EXPORT((yyval.module), Global, (yylsp[0]), (yyvsp[0].exported_global), (yyval.module)->globals.size() - 1);
delete (yyvsp[0].exported_global);
}
-#line 3632 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 3632 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 138:
-#line 1140 "src/ast-parser.y" /* yacc.c:1646 */
+#line 1140 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.module) = (yyvsp[-1].module);
ModuleField* field;
@@ -3650,11 +3650,11 @@ yyreduce:
}
delete (yyvsp[0].exported_table);
}
-#line 3654 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 3654 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 139:
-#line 1157 "src/ast-parser.y" /* yacc.c:1646 */
+#line 1157 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.module) = (yyvsp[-1].module);
ModuleField* field;
@@ -3672,11 +3672,11 @@ yyreduce:
}
delete (yyvsp[0].exported_memory);
}
-#line 3676 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 3676 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 140:
-#line 1174 "src/ast-parser.y" /* yacc.c:1646 */
+#line 1174 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.module) = (yyvsp[-1].module);
ModuleField* field;
@@ -3689,44 +3689,44 @@ yyreduce:
APPEND_INLINE_EXPORT((yyval.module), Func, (yylsp[0]), (yyvsp[0].exported_func), (yyval.module)->funcs.size() - 1);
delete (yyvsp[0].exported_func);
}
-#line 3693 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 3693 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 141:
-#line 1186 "src/ast-parser.y" /* yacc.c:1646 */
+#line 1186 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.module) = (yyvsp[-1].module);
ModuleField* field;
APPEND_FIELD_TO_LIST((yyval.module), field, ElemSegment, elem_segment, (yylsp[0]), (yyvsp[0].elem_segment));
APPEND_ITEM_TO_VECTOR((yyval.module), elem_segments, field->elem_segment);
}
-#line 3704 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 3704 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 142:
-#line 1192 "src/ast-parser.y" /* yacc.c:1646 */
+#line 1192 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.module) = (yyvsp[-1].module);
ModuleField* field;
APPEND_FIELD_TO_LIST((yyval.module), field, DataSegment, data_segment, (yylsp[0]), (yyvsp[0].data_segment));
APPEND_ITEM_TO_VECTOR((yyval.module), data_segments, field->data_segment);
}
-#line 3715 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 3715 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 143:
-#line 1198 "src/ast-parser.y" /* yacc.c:1646 */
+#line 1198 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.module) = (yyvsp[-1].module);
ModuleField* field;
APPEND_FIELD_TO_LIST((yyval.module), field, Start, start, (yylsp[0]), (yyvsp[0].var));
(yyval.module)->start = &field->start;
}
-#line 3726 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 3726 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 144:
-#line 1204 "src/ast-parser.y" /* yacc.c:1646 */
+#line 1204 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.module) = (yyvsp[-1].module);
ModuleField* field;
@@ -3760,11 +3760,11 @@ yyreduce:
}
APPEND_ITEM_TO_VECTOR((yyval.module), imports, field->import);
}
-#line 3764 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 3764 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 145:
-#line 1237 "src/ast-parser.y" /* yacc.c:1646 */
+#line 1237 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.module) = (yyvsp[-1].module);
ModuleField* field;
@@ -3772,11 +3772,11 @@ yyreduce:
APPEND_ITEM_TO_VECTOR((yyval.module), exports, field->export_);
INSERT_BINDING((yyval.module), export, exports, (yylsp[0]), field->export_->name);
}
-#line 3776 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 3776 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 146:
-#line 1247 "src/ast-parser.y" /* yacc.c:1646 */
+#line 1247 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.raw_module) = new RawModule();
(yyval.raw_module)->type = RawModuleType::Text;
@@ -3797,11 +3797,11 @@ yyreduce:
}
}
}
-#line 3801 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 3801 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 147:
-#line 1267 "src/ast-parser.y" /* yacc.c:1646 */
+#line 1267 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.raw_module) = new RawModule();
(yyval.raw_module)->type = RawModuleType::Binary;
@@ -3810,11 +3810,11 @@ yyreduce:
dup_text_list(&(yyvsp[-1].text_list), &(yyval.raw_module)->binary.data, &(yyval.raw_module)->binary.size);
destroy_text_list(&(yyvsp[-1].text_list));
}
-#line 3814 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 3814 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 148:
-#line 1278 "src/ast-parser.y" /* yacc.c:1646 */
+#line 1278 "src/wast-parser.y" /* yacc.c:1646 */
{
if ((yyvsp[0].raw_module)->type == RawModuleType::Text) {
(yyval.module) = (yyvsp[0].raw_module)->text;
@@ -3824,39 +3824,39 @@ yyreduce:
(yyval.module) = new Module();
ReadBinaryOptions options = WABT_READ_BINARY_OPTIONS_DEFAULT;
BinaryErrorHandlerModule error_handler(&(yyvsp[0].raw_module)->binary.loc, lexer, parser);
- read_binary_ast((yyvsp[0].raw_module)->binary.data, (yyvsp[0].raw_module)->binary.size, &options,
- &error_handler, (yyval.module));
+ read_binary_ir((yyvsp[0].raw_module)->binary.data, (yyvsp[0].raw_module)->binary.size, &options,
+ &error_handler, (yyval.module));
(yyval.module)->name = (yyvsp[0].raw_module)->binary.name;
(yyval.module)->loc = (yyvsp[0].raw_module)->binary.loc;
WABT_ZERO_MEMORY((yyvsp[0].raw_module)->binary.name);
}
delete (yyvsp[0].raw_module);
}
-#line 3836 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 3836 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 149:
-#line 1300 "src/ast-parser.y" /* yacc.c:1646 */
+#line 1300 "src/wast-parser.y" /* yacc.c:1646 */
{
WABT_ZERO_MEMORY((yyval.var));
(yyval.var).type = VarType::Index;
(yyval.var).index = INVALID_VAR_INDEX;
}
-#line 3846 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 3846 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 150:
-#line 1305 "src/ast-parser.y" /* yacc.c:1646 */
+#line 1305 "src/wast-parser.y" /* yacc.c:1646 */
{
WABT_ZERO_MEMORY((yyval.var));
(yyval.var).type = VarType::Name;
DUPTEXT((yyval.var).name, (yyvsp[0].text));
}
-#line 3856 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 3856 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 151:
-#line 1313 "src/ast-parser.y" /* yacc.c:1646 */
+#line 1313 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.action) = new Action();
(yyval.action)->loc = (yylsp[-4]);
@@ -3867,11 +3867,11 @@ yyreduce:
(yyval.action)->invoke->args = std::move(*(yyvsp[-1].consts));
delete (yyvsp[-1].consts);
}
-#line 3871 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 3871 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 152:
-#line 1323 "src/ast-parser.y" /* yacc.c:1646 */
+#line 1323 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.action) = new Action();
(yyval.action)->loc = (yylsp[-3]);
@@ -3879,128 +3879,128 @@ yyreduce:
(yyval.action)->type = ActionType::Get;
(yyval.action)->name = (yyvsp[-1].text);
}
-#line 3883 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 3883 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 153:
-#line 1333 "src/ast-parser.y" /* yacc.c:1646 */
+#line 1333 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.command) = new Command();
(yyval.command)->type = CommandType::AssertMalformed;
(yyval.command)->assert_malformed.module = (yyvsp[-2].raw_module);
(yyval.command)->assert_malformed.text = (yyvsp[-1].text);
}
-#line 3894 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 3894 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 154:
-#line 1339 "src/ast-parser.y" /* yacc.c:1646 */
+#line 1339 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.command) = new Command();
(yyval.command)->type = CommandType::AssertInvalid;
(yyval.command)->assert_invalid.module = (yyvsp[-2].raw_module);
(yyval.command)->assert_invalid.text = (yyvsp[-1].text);
}
-#line 3905 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 3905 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 155:
-#line 1345 "src/ast-parser.y" /* yacc.c:1646 */
+#line 1345 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.command) = new Command();
(yyval.command)->type = CommandType::AssertUnlinkable;
(yyval.command)->assert_unlinkable.module = (yyvsp[-2].raw_module);
(yyval.command)->assert_unlinkable.text = (yyvsp[-1].text);
}
-#line 3916 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 3916 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 156:
-#line 1351 "src/ast-parser.y" /* yacc.c:1646 */
+#line 1351 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.command) = new Command();
(yyval.command)->type = CommandType::AssertUninstantiable;
(yyval.command)->assert_uninstantiable.module = (yyvsp[-2].raw_module);
(yyval.command)->assert_uninstantiable.text = (yyvsp[-1].text);
}
-#line 3927 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 3927 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 157:
-#line 1357 "src/ast-parser.y" /* yacc.c:1646 */
+#line 1357 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.command) = new Command();
(yyval.command)->type = CommandType::AssertReturn;
(yyval.command)->assert_return.action = (yyvsp[-2].action);
(yyval.command)->assert_return.expected = (yyvsp[-1].consts);
}
-#line 3938 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 3938 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 158:
-#line 1363 "src/ast-parser.y" /* yacc.c:1646 */
+#line 1363 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.command) = new Command();
(yyval.command)->type = CommandType::AssertReturnCanonicalNan;
(yyval.command)->assert_return_canonical_nan.action = (yyvsp[-1].action);
}
-#line 3948 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 3948 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 159:
-#line 1368 "src/ast-parser.y" /* yacc.c:1646 */
+#line 1368 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.command) = new Command();
(yyval.command)->type = CommandType::AssertReturnArithmeticNan;
(yyval.command)->assert_return_arithmetic_nan.action = (yyvsp[-1].action);
}
-#line 3958 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 3958 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 160:
-#line 1373 "src/ast-parser.y" /* yacc.c:1646 */
+#line 1373 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.command) = new Command();
(yyval.command)->type = CommandType::AssertTrap;
(yyval.command)->assert_trap.action = (yyvsp[-2].action);
(yyval.command)->assert_trap.text = (yyvsp[-1].text);
}
-#line 3969 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 3969 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 161:
-#line 1379 "src/ast-parser.y" /* yacc.c:1646 */
+#line 1379 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.command) = new Command();
(yyval.command)->type = CommandType::AssertExhaustion;
(yyval.command)->assert_trap.action = (yyvsp[-2].action);
(yyval.command)->assert_trap.text = (yyvsp[-1].text);
}
-#line 3980 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 3980 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 162:
-#line 1388 "src/ast-parser.y" /* yacc.c:1646 */
+#line 1388 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.command) = new Command();
(yyval.command)->type = CommandType::Action;
(yyval.command)->action = (yyvsp[0].action);
}
-#line 3990 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 3990 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 164:
-#line 1394 "src/ast-parser.y" /* yacc.c:1646 */
+#line 1394 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.command) = new Command();
(yyval.command)->type = CommandType::Module;
(yyval.command)->module = (yyvsp[0].module);
}
-#line 4000 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 4000 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 165:
-#line 1399 "src/ast-parser.y" /* yacc.c:1646 */
+#line 1399 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.command) = new Command();
(yyval.command)->type = CommandType::Register;
@@ -4008,56 +4008,56 @@ yyreduce:
(yyval.command)->register_.var = (yyvsp[-1].var);
(yyval.command)->register_.var.loc = (yylsp[-1]);
}
-#line 4012 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 4012 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 166:
-#line 1408 "src/ast-parser.y" /* yacc.c:1646 */
+#line 1408 "src/wast-parser.y" /* yacc.c:1646 */
{ (yyval.commands) = new CommandPtrVector(); }
-#line 4018 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 4018 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 167:
-#line 1409 "src/ast-parser.y" /* yacc.c:1646 */
+#line 1409 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.commands) = (yyvsp[-1].commands);
(yyval.commands)->emplace_back((yyvsp[0].command));
}
-#line 4027 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 4027 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 168:
-#line 1416 "src/ast-parser.y" /* yacc.c:1646 */
+#line 1416 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.const_).loc = (yylsp[-2]);
if (WABT_FAILED(parse_const((yyvsp[-2].type), (yyvsp[-1].literal).type, (yyvsp[-1].literal).text.start,
(yyvsp[-1].literal).text.start + (yyvsp[-1].literal).text.length, &(yyval.const_)))) {
- ast_parser_error(&(yylsp[-1]), lexer, parser,
- "invalid literal \"" PRIstringslice "\"",
- WABT_PRINTF_STRING_SLICE_ARG((yyvsp[-1].literal).text));
+ wast_parser_error(&(yylsp[-1]), lexer, parser,
+ "invalid literal \"" PRIstringslice "\"",
+ WABT_PRINTF_STRING_SLICE_ARG((yyvsp[-1].literal).text));
}
delete [] (yyvsp[-1].literal).text.start;
}
-#line 4042 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 4042 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 169:
-#line 1428 "src/ast-parser.y" /* yacc.c:1646 */
+#line 1428 "src/wast-parser.y" /* yacc.c:1646 */
{ (yyval.consts) = new ConstVector(); }
-#line 4048 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 4048 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 170:
-#line 1429 "src/ast-parser.y" /* yacc.c:1646 */
+#line 1429 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.consts) = (yyvsp[-1].consts);
(yyval.consts)->push_back((yyvsp[0].const_));
}
-#line 4057 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 4057 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
case 171:
-#line 1436 "src/ast-parser.y" /* yacc.c:1646 */
+#line 1436 "src/wast-parser.y" /* yacc.c:1646 */
{
(yyval.script) = new Script();
(yyval.script)->commands = std::move(*(yyvsp[0].commands));
@@ -4119,11 +4119,11 @@ yyreduce:
}
parser->script = (yyval.script);
}
-#line 4123 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 4123 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
break;
-#line 4127 "src/prebuilt/ast-parser-gen.cc" /* yacc.c:1646 */
+#line 4127 "src/prebuilt/wast-parser-gen.cc" /* yacc.c:1646 */
default: break;
}
/* User semantic actions sometimes alter yychar, and that requires
@@ -4358,7 +4358,7 @@ yyreturn:
#endif
return yyresult;
}
-#line 1505 "src/ast-parser.y" /* yacc.c:1906 */
+#line 1505 "src/wast-parser.y" /* yacc.c:1906 */
void append_expr_list(ExprList* expr_list, ExprList* expr) {
@@ -4509,12 +4509,12 @@ void append_implicit_func_declaration(Location* loc,
}
}
-Result parse_ast(AstLexer* lexer, Script** out_script,
+Result parse_wast(WastLexer* lexer, Script** out_script,
SourceErrorHandler* error_handler) {
- AstParser parser;
+ WastParser parser;
WABT_ZERO_MEMORY(parser);
parser.error_handler = error_handler;
- int result = wabt_ast_parser_parse(lexer, &parser);
+ int result = wabt_wast_parser_parse(lexer, &parser);
delete [] parser.yyssa;
delete [] parser.yyvsa;
delete [] parser.yylsa;
@@ -4523,18 +4523,18 @@ Result parse_ast(AstLexer* lexer, Script** out_script,
}
BinaryErrorHandlerModule::BinaryErrorHandlerModule(
- Location* loc, AstLexer* lexer, AstParser* parser)
+ Location* loc, WastLexer* lexer, WastParser* parser)
: loc_(loc), lexer_(lexer), parser_(parser) {}
bool BinaryErrorHandlerModule::OnError(uint32_t offset,
const std::string& error) {
if (offset == WABT_UNKNOWN_OFFSET) {
- ast_parser_error(loc_, lexer_, parser_, "error in binary module: %s",
- error.c_str());
+ wast_parser_error(loc_, lexer_, parser_, "error in binary module: %s",
+ error.c_str());
} else {
- ast_parser_error(loc_, lexer_, parser_,
- "error in binary module: @0x%08x: %s", offset,
- error.c_str());
+ wast_parser_error(loc_, lexer_, parser_,
+ "error in binary module: @0x%08x: %s", offset,
+ error.c_str());
}
return true;
}
diff --git a/src/prebuilt/ast-parser-gen.hh b/src/prebuilt/wast-parser-gen.hh
index 53b5e4e3..20acb2b7 100644
--- a/src/prebuilt/ast-parser-gen.hh
+++ b/src/prebuilt/wast-parser-gen.hh
@@ -30,28 +30,28 @@
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */
-#ifndef YY_WABT_AST_PARSER_SRC_PREBUILT_AST_PARSER_GEN_HH_INCLUDED
-# define YY_WABT_AST_PARSER_SRC_PREBUILT_AST_PARSER_GEN_HH_INCLUDED
+#ifndef YY_WABT_WAST_PARSER_SRC_PREBUILT_WAST_PARSER_GEN_HH_INCLUDED
+# define YY_WABT_WAST_PARSER_SRC_PREBUILT_WAST_PARSER_GEN_HH_INCLUDED
/* Debug traces. */
-#ifndef WABT_AST_PARSER_DEBUG
+#ifndef WABT_WAST_PARSER_DEBUG
# if defined YYDEBUG
#if YYDEBUG
-# define WABT_AST_PARSER_DEBUG 1
+# define WABT_WAST_PARSER_DEBUG 1
# else
-# define WABT_AST_PARSER_DEBUG 0
+# define WABT_WAST_PARSER_DEBUG 0
# endif
# else /* ! defined YYDEBUG */
-# define WABT_AST_PARSER_DEBUG 0
+# define WABT_WAST_PARSER_DEBUG 0
# endif /* ! defined YYDEBUG */
-#endif /* ! defined WABT_AST_PARSER_DEBUG */
-#if WABT_AST_PARSER_DEBUG
-extern int wabt_ast_parser_debug;
+#endif /* ! defined WABT_WAST_PARSER_DEBUG */
+#if WABT_WAST_PARSER_DEBUG
+extern int wabt_wast_parser_debug;
#endif
/* Token type. */
-#ifndef WABT_AST_PARSER_TOKENTYPE
-# define WABT_AST_PARSER_TOKENTYPE
- enum wabt_ast_parser_tokentype
+#ifndef WABT_WAST_PARSER_TOKENTYPE
+# define WABT_WAST_PARSER_TOKENTYPE
+ enum wabt_wast_parser_tokentype
{
WABT_TOKEN_TYPE_EOF = 0,
WABT_TOKEN_TYPE_LPAR = 258,
@@ -130,28 +130,28 @@ extern int wabt_ast_parser_debug;
#endif
/* Value type. */
-#if ! defined WABT_AST_PARSER_STYPE && ! defined WABT_AST_PARSER_STYPE_IS_DECLARED
-typedef ::wabt::Token WABT_AST_PARSER_STYPE;
-# define WABT_AST_PARSER_STYPE_IS_TRIVIAL 1
-# define WABT_AST_PARSER_STYPE_IS_DECLARED 1
+#if ! defined WABT_WAST_PARSER_STYPE && ! defined WABT_WAST_PARSER_STYPE_IS_DECLARED
+typedef ::wabt::Token WABT_WAST_PARSER_STYPE;
+# define WABT_WAST_PARSER_STYPE_IS_TRIVIAL 1
+# define WABT_WAST_PARSER_STYPE_IS_DECLARED 1
#endif
/* Location type. */
-#if ! defined WABT_AST_PARSER_LTYPE && ! defined WABT_AST_PARSER_LTYPE_IS_DECLARED
-typedef struct WABT_AST_PARSER_LTYPE WABT_AST_PARSER_LTYPE;
-struct WABT_AST_PARSER_LTYPE
+#if ! defined WABT_WAST_PARSER_LTYPE && ! defined WABT_WAST_PARSER_LTYPE_IS_DECLARED
+typedef struct WABT_WAST_PARSER_LTYPE WABT_WAST_PARSER_LTYPE;
+struct WABT_WAST_PARSER_LTYPE
{
int first_line;
int first_column;
int last_line;
int last_column;
};
-# define WABT_AST_PARSER_LTYPE_IS_DECLARED 1
-# define WABT_AST_PARSER_LTYPE_IS_TRIVIAL 1
+# define WABT_WAST_PARSER_LTYPE_IS_DECLARED 1
+# define WABT_WAST_PARSER_LTYPE_IS_TRIVIAL 1
#endif
-int wabt_ast_parser_parse (::wabt::AstLexer* lexer, ::wabt::AstParser* parser);
+int wabt_wast_parser_parse (::wabt::WastLexer* lexer, ::wabt::WastParser* parser);
-#endif /* !YY_WABT_AST_PARSER_SRC_PREBUILT_AST_PARSER_GEN_HH_INCLUDED */
+#endif /* !YY_WABT_WAST_PARSER_SRC_PREBUILT_WAST_PARSER_GEN_HH_INCLUDED */
diff --git a/src/prebuilt/ast-parser-gen.output b/src/prebuilt/wast-parser-gen.output
index 371633b3..371633b3 100644
--- a/src/prebuilt/ast-parser-gen.output
+++ b/src/prebuilt/wast-parser-gen.output
diff --git a/src/resolve-names.cc b/src/resolve-names.cc
index c759b718..dd85f437 100644
--- a/src/resolve-names.cc
+++ b/src/resolve-names.cc
@@ -19,8 +19,8 @@
#include <assert.h>
#include <stdio.h>
-#include "ast.h"
-#include "ast-parser-lexer-shared.h"
+#include "ir.h"
+#include "wast-parser-lexer-shared.h"
namespace wabt {
@@ -32,7 +32,7 @@ struct Context {
Context();
SourceErrorHandler* error_handler = nullptr;
- AstLexer* lexer = nullptr;
+ WastLexer* lexer = nullptr;
Script* script = nullptr;
Module* current_module = nullptr;
Func* current_func = nullptr;
@@ -52,7 +52,7 @@ static void WABT_PRINTF_FORMAT(3, 4)
ctx->result = Result::Error;
va_list args;
va_start(args, fmt);
- ast_format_error(ctx->error_handler, loc, ctx->lexer, fmt, args);
+ wast_format_error(ctx->error_handler, loc, ctx->lexer, fmt, args);
va_end(args);
}
@@ -402,7 +402,7 @@ static void visit_script(Context* ctx, Script* script) {
}
static void init_context(Context* ctx,
- AstLexer* lexer,
+ WastLexer* lexer,
Script* script,
SourceErrorHandler* error_handler) {
ctx->lexer = lexer;
@@ -428,7 +428,7 @@ static void init_context(Context* ctx,
ctx->visitor.on_tee_local_expr = on_tee_local_expr;
}
-Result resolve_names_module(AstLexer* lexer,
+Result resolve_names_module(WastLexer* lexer,
Module* module,
SourceErrorHandler* error_handler) {
Context ctx;
@@ -437,7 +437,7 @@ Result resolve_names_module(AstLexer* lexer,
return ctx.result;
}
-Result resolve_names_script(AstLexer* lexer,
+Result resolve_names_script(WastLexer* lexer,
Script* script,
SourceErrorHandler* error_handler) {
Context ctx;
diff --git a/src/resolve-names.h b/src/resolve-names.h
index f6cded1d..059c8edc 100644
--- a/src/resolve-names.h
+++ b/src/resolve-names.h
@@ -21,13 +21,13 @@
namespace wabt {
-struct AstLexer;
+struct WastLexer;
struct Module;
struct Script;
class SourceErrorHandler;
-Result resolve_names_module(AstLexer*, Module*, SourceErrorHandler*);
-Result resolve_names_script(AstLexer*, Script*, SourceErrorHandler*);
+Result resolve_names_module(WastLexer*, Module*, SourceErrorHandler*);
+Result resolve_names_script(WastLexer*, Script*, SourceErrorHandler*);
} // namespace wabt
diff --git a/src/tools/wasm2wast.cc b/src/tools/wasm2wast.cc
index e8c4408e..def48f71 100644
--- a/src/tools/wasm2wast.cc
+++ b/src/tools/wasm2wast.cc
@@ -20,14 +20,14 @@
#include <stdlib.h>
#include "apply-names.h"
-#include "ast.h"
-#include "ast-writer.h"
#include "binary-error-handler.h"
#include "binary-reader.h"
-#include "binary-reader-ast.h"
+#include "binary-reader-ir.h"
#include "generate-names.h"
+#include "ir.h"
#include "option-parser.h"
#include "stream.h"
+#include "wat-writer.h"
#include "writer.h"
#define PROGRAM_NAME "wasm2wast"
@@ -143,8 +143,8 @@ int main(int argc, char** argv) {
if (WABT_SUCCEEDED(result)) {
BinaryErrorHandlerFile error_handler;
Module module;
- result = read_binary_ast(data, size, &s_read_binary_options, &error_handler,
- &module);
+ result = read_binary_ir(data, size, &s_read_binary_options, &error_handler,
+ &module);
if (WABT_SUCCEEDED(result)) {
if (s_generate_names)
result = generate_names(&module);
@@ -159,7 +159,7 @@ int main(int argc, char** argv) {
if (WABT_SUCCEEDED(result)) {
FileWriter writer(s_outfile ? FileWriter(s_outfile)
: FileWriter(stdout));
- result = write_ast(&writer, &module);
+ result = write_wat(&writer, &module);
}
}
delete[] data;
diff --git a/src/tools/wast-desugar.cc b/src/tools/wast-desugar.cc
index 237539bc..03b8891a 100644
--- a/src/tools/wast-desugar.cc
+++ b/src/tools/wast-desugar.cc
@@ -21,15 +21,15 @@
#include <stdlib.h>
#include "apply-names.h"
-#include "ast.h"
-#include "ast-parser.h"
-#include "ast-writer.h"
#include "common.h"
#include "config.h"
#include "generate-names.h"
+#include "ir.h"
#include "option-parser.h"
#include "source-error-handler.h"
#include "stream.h"
+#include "wast-parser.h"
+#include "wat-writer.h"
#include "writer.h"
#define PROGRAM_NAME "wast-desugar"
@@ -128,13 +128,13 @@ int main(int argc, char** argv) {
init_stdio();
parse_options(argc, argv);
- AstLexer* lexer = new_ast_file_lexer(s_infile);
+ WastLexer* lexer = new_wast_file_lexer(s_infile);
if (!lexer)
WABT_FATAL("unable to read %s\n", s_infile);
SourceErrorHandlerFile error_handler;
Script* script;
- Result result = parse_ast(lexer, &script, &error_handler);
+ Result result = parse_wast(lexer, &script, &error_handler);
if (WABT_SUCCEEDED(result)) {
Module* module = get_first_module(script);
@@ -149,11 +149,11 @@ int main(int argc, char** argv) {
if (WABT_SUCCEEDED(result)) {
FileWriter writer(s_outfile ? FileWriter(s_outfile) : FileWriter(stdout));
- result = write_ast(&writer, module);
+ result = write_wat(&writer, module);
}
}
- destroy_ast_lexer(lexer);
+ destroy_wast_lexer(lexer);
delete script;
return result != Result::Ok;
}
diff --git a/src/tools/wast2wasm.cc b/src/tools/wast2wasm.cc
index baa6f989..0cacf566 100644
--- a/src/tools/wast2wasm.cc
+++ b/src/tools/wast2wasm.cc
@@ -21,16 +21,16 @@
#include <stdlib.h>
#include "config.h"
-#include "ast.h"
-#include "ast-parser.h"
#include "binary-writer.h"
#include "binary-writer-spec.h"
#include "common.h"
+#include "ir.h"
#include "option-parser.h"
#include "resolve-names.h"
#include "source-error-handler.h"
#include "stream.h"
#include "validator.h"
+#include "wast-parser.h"
#include "writer.h"
#define PROGRAM_NAME "wast2wasm"
@@ -197,13 +197,13 @@ int main(int argc, char** argv) {
parse_options(argc, argv);
- AstLexer* lexer = new_ast_file_lexer(s_infile);
+ WastLexer* lexer = new_wast_file_lexer(s_infile);
if (!lexer)
WABT_FATAL("unable to read file: %s\n", s_infile);
SourceErrorHandlerFile error_handler;
Script* script;
- Result result = parse_ast(lexer, &script, &error_handler);
+ Result result = parse_wast(lexer, &script, &error_handler);
if (WABT_SUCCEEDED(result)) {
result = resolve_names_script(lexer, script, &error_handler);
@@ -234,7 +234,7 @@ int main(int argc, char** argv) {
}
}
- destroy_ast_lexer(lexer);
+ destroy_wast_lexer(lexer);
delete script;
return result != Result::Ok;
}
diff --git a/src/validator.cc b/src/validator.cc
index dc1f12b1..609367e3 100644
--- a/src/validator.cc
+++ b/src/validator.cc
@@ -23,10 +23,9 @@
#include <stdarg.h>
#include <stdio.h>
-#include "ast-parser-lexer-shared.h"
-#include "binary-reader-ast.h"
#include "binary-reader.h"
#include "type-checker.h"
+#include "wast-parser-lexer-shared.h"
namespace wabt {
@@ -48,10 +47,10 @@ struct ActionResult {
struct Context {
WABT_DISALLOW_COPY_AND_ASSIGN(Context);
- Context(SourceErrorHandler*, AstLexer*, const Script*);
+ Context(SourceErrorHandler*, WastLexer*, const Script*);
SourceErrorHandler* error_handler = nullptr;
- AstLexer* lexer = nullptr;
+ WastLexer* lexer = nullptr;
const Script* script = nullptr;
const Module* current_module = nullptr;
const Func* current_func = nullptr;
@@ -66,7 +65,7 @@ struct Context {
};
Context::Context(SourceErrorHandler* error_handler,
- AstLexer* lexer,
+ WastLexer* lexer,
const Script* script)
: error_handler(error_handler), lexer(lexer), script(script) {}
@@ -77,7 +76,7 @@ static void WABT_PRINTF_FORMAT(3, 4)
ctx->result = Result::Error;
va_list args;
va_start(args, fmt);
- ast_format_error(ctx->error_handler, loc, ctx->lexer, fmt, args);
+ wast_format_error(ctx->error_handler, loc, ctx->lexer, fmt, args);
va_end(args);
}
@@ -1003,7 +1002,7 @@ static void check_command(Context* ctx, const Command* command) {
}
}
-Result validate_script(AstLexer* lexer,
+Result validate_script(WastLexer* lexer,
const struct Script* script,
SourceErrorHandler* error_handler) {
Context ctx(error_handler, lexer, script);
diff --git a/src/validator.h b/src/validator.h
index c117e241..93cb1ae5 100644
--- a/src/validator.h
+++ b/src/validator.h
@@ -17,7 +17,7 @@
#ifndef WABT_VALIDATOR_H_
#define WABT_VALIDATOR_H_
-#include "ast-lexer.h"
+#include "wast-lexer.h"
namespace wabt {
@@ -25,9 +25,9 @@ struct Module;
struct Script;
class SourceErrorHandler;
-/* perform all checks on the AST; the module is valid if and only if this
+/* perform all checks on the script; the module is valid if and only if this
* function succeeds. */
-Result validate_script(AstLexer*, const struct Script*, SourceErrorHandler*);
+Result validate_script(WastLexer*, const struct Script*, SourceErrorHandler*);
} // namespace wabt
diff --git a/src/wabt.js b/src/wabt.js
index 7bbb00c7..f8818315 100644
--- a/src/wabt.js
+++ b/src/wabt.js
@@ -68,13 +68,13 @@ function allocateCString(s) {
function Lexer(filename, buffer) {
this.filenameObj = allocateCString(filename);
this.bufferObj = allocateBuffer(buffer);
- this.addr = Module._wabt_new_ast_buffer_lexer(
+ this.addr = Module._wabt_new_wast_buffer_lexer(
this.filenameObj.addr, this.bufferObj.addr, this.bufferObj.size);
}
Lexer.prototype = Object.create(Object.prototype);
Lexer.prototype.destroy = function() {
- Module._wabt_destroy_ast_lexer(this.addr);
+ Module._wabt_destroy_wast_lexer(this.addr);
Module._free(this.bufferObj.addr);
Module._free(this.filenameObj.addr);
};
@@ -130,28 +130,28 @@ ErrorHandler.prototype.destroy = function() {
};
-/// parseAst
-function parseAst(filename, buffer) {
+/// parseWast
+function parseWast(filename, buffer) {
var lexer = new Lexer(filename, buffer);
var errorHandler = new ErrorHandler();
try {
var parseResult_addr =
- Module._wabt_parse_ast(lexer.addr, errorHandler.addr);
+ Module._wabt_parse_wast(lexer.addr, errorHandler.addr);
- var result = Module._wabt_parse_ast_result_get_result(parseResult_addr);
+ var result = Module._wabt_parse_wast_result_get_result(parseResult_addr);
if (result !== WABT_OK) {
- throw new Error('parseAst failed:\n' + errorHandler.getMessage());
+ throw new Error('parseWast failed:\n' + errorHandler.getMessage());
}
var script_addr =
- Module._wabt_parse_ast_result_release_script(parseResult_addr);
+ Module._wabt_parse_wast_result_release_script(parseResult_addr);
var result = new Script(lexer, script_addr);
// Clear lexer so it isn't destroyed below.
lexer = null;
return result;
} finally {
- Module._wabt_destroy_parse_ast_result(parseResult_addr);
+ Module._wabt_destroy_parse_wast_result(parseResult_addr);
errorHandler.destroy();
if (lexer) {
lexer.destroy();
@@ -239,6 +239,6 @@ Script.prototype.destroy = function() {
};
wabt.ready = Promise.resolve();
-wabt.parseAst = parseAst;
+wabt.parseWast = parseWast;
})(wabt);
diff --git a/src/ast-lexer.cc b/src/wast-lexer.cc
index cff05083..adab9964 100644
--- a/src/ast-lexer.cc
+++ b/src/wast-lexer.cc
@@ -14,18 +14,18 @@
* limitations under the License.
*/
-#include "ast-lexer.h"
+#include "wast-lexer.h"
#include <assert.h>
#include <stdio.h>
#include "config.h"
-#include "ast-parser.h"
-#include "ast-parser-lexer-shared.h"
+#include "wast-parser.h"
+#include "wast-parser-lexer-shared.h"
/* must be included after so some typedefs will be defined */
-#include "ast-parser-gen.hh"
+#include "wast-parser-gen.hh"
/*!max:re2c */
@@ -45,7 +45,7 @@
#define ERROR(...) \
YY_USER_ACTION; \
- ast_parser_error(loc, lexer, parser, __VA_ARGS__)
+ wast_parser_error(loc, lexer, parser, __VA_ARGS__)
#define BEGIN(c) \
do { \
@@ -93,8 +93,8 @@
namespace wabt {
static Result fill(Location* loc,
- AstLexer* lexer,
- AstParser* parser,
+ WastLexer* lexer,
+ WastParser* parser,
size_t need) {
if (lexer->eof)
return Result::Error;
@@ -114,8 +114,8 @@ static Result fill(Location* loc,
char* new_buffer = new char[new_buffer_size];
if (!new_buffer) {
- ast_parser_error(loc, lexer, parser,
- "unable to reallocate lexer buffer.");
+ wast_parser_error(loc, lexer, parser,
+ "unable to reallocate lexer buffer.");
return Result::Error;
}
memmove(new_buffer, lexer->token, lexer->limit - lexer->token);
@@ -127,7 +127,7 @@ static Result fill(Location* loc,
lexer->limit = new_buffer + (lexer->limit - old_buffer) - free;
lexer->buffer_file_offset += free;
free += new_buffer_size - old_buffer_size;
- delete [] old_buffer;
+ delete[] old_buffer;
} else {
/* shift everything down to make more room in the buffer */
memmove(lexer->buffer, lexer->token, lexer->limit - lexer->token);
@@ -138,11 +138,11 @@ static Result fill(Location* loc,
lexer->buffer_file_offset += free;
}
/* read the new data into the buffer */
- if (lexer->source.type == AstLexerSourceType::File) {
+ if (lexer->source.type == WastLexerSourceType::File) {
lexer->limit += fread(lexer->limit, 1, free, lexer->source.file);
} else {
/* TODO(binji): could lex directly from buffer */
- assert(lexer->source.type == AstLexerSourceType::Buffer);
+ assert(lexer->source.type == WastLexerSourceType::Buffer);
size_t read_size = free;
size_t offset = lexer->source.buffer.read_offset;
size_t bytes_left = lexer->source.buffer.size - offset;
@@ -165,10 +165,10 @@ static Result fill(Location* loc,
return Result::Ok;
}
-int ast_lexer_lex(WABT_AST_PARSER_STYPE* lval,
- WABT_AST_PARSER_LTYPE* loc,
- AstLexer* lexer,
- AstParser* parser) {
+int wast_lexer_lex(WABT_WAST_PARSER_STYPE* lval,
+ WABT_WAST_PARSER_LTYPE* loc,
+ WastLexer* lexer,
+ WastParser* parser) {
enum {
YYCOND_INIT,
YYCOND_BAD_TEXT,
@@ -474,40 +474,38 @@ int ast_lexer_lex(WABT_AST_PARSER_STYPE* lval,
}
}
-static AstLexer* new_lexer(AstLexerSourceType type,
- const char* filename) {
- AstLexer* lexer = new AstLexer();
+static WastLexer* new_lexer(WastLexerSourceType type, const char* filename) {
+ WastLexer* lexer = new WastLexer();
lexer->line = 1;
lexer->filename = filename;
lexer->source.type = type;
return lexer;
}
-AstLexer* new_ast_file_lexer(const char* filename) {
- AstLexer* lexer = new_lexer(AstLexerSourceType::File, filename);
+WastLexer* new_wast_file_lexer(const char* filename) {
+ WastLexer* lexer = new_lexer(WastLexerSourceType::File, filename);
lexer->source.file = fopen(filename, "rb");
if (!lexer->source.file) {
- destroy_ast_lexer(lexer);
+ destroy_wast_lexer(lexer);
return nullptr;
}
return lexer;
}
-AstLexer* new_ast_buffer_lexer(const char* filename,
- const void* data,
- size_t size) {
- AstLexer* lexer =
- new_lexer(AstLexerSourceType::Buffer, filename);
+WastLexer* new_wast_buffer_lexer(const char* filename,
+ const void* data,
+ size_t size) {
+ WastLexer* lexer = new_lexer(WastLexerSourceType::Buffer, filename);
lexer->source.buffer.data = data;
lexer->source.buffer.size = size;
lexer->source.buffer.read_offset = 0;
return lexer;
}
-void destroy_ast_lexer(AstLexer* lexer) {
- if (lexer->source.type == AstLexerSourceType::File && lexer->source.file)
+void destroy_wast_lexer(WastLexer* lexer) {
+ if (lexer->source.type == WastLexerSourceType::File && lexer->source.file)
fclose(lexer->source.file);
- delete [] lexer->buffer;
+ delete[] lexer->buffer;
delete lexer;
}
@@ -563,7 +561,7 @@ static Result scan_forward_for_line_offset_in_buffer(
}
static Result scan_forward_for_line_offset_in_file(
- AstLexer* lexer,
+ WastLexer* lexer,
int line,
size_t line_start_offset,
LineOffsetPosition find_position,
@@ -610,15 +608,14 @@ cleanup:
return result;
}
-static Result scan_forward_for_line_offset(
- AstLexer* lexer,
- int line,
- size_t line_start_offset,
- LineOffsetPosition find_position,
- int find_line,
- size_t* out_line_offset) {
+static Result scan_forward_for_line_offset(WastLexer* lexer,
+ int line,
+ size_t line_start_offset,
+ LineOffsetPosition find_position,
+ int find_line,
+ size_t* out_line_offset) {
assert(line <= find_line);
- if (lexer->source.type == AstLexerSourceType::Buffer) {
+ if (lexer->source.type == WastLexerSourceType::Buffer) {
const char* source_buffer =
static_cast<const char*>(lexer->source.buffer.data);
const char* buffer_start = source_buffer + line_start_offset;
@@ -627,16 +624,16 @@ static Result scan_forward_for_line_offset(
buffer_start, buffer_end, line, line_start_offset, find_position,
find_line, &line, out_line_offset);
} else {
- assert(lexer->source.type == AstLexerSourceType::File);
+ assert(lexer->source.type == WastLexerSourceType::File);
return scan_forward_for_line_offset_in_file(lexer, line, line_start_offset,
find_position, find_line,
out_line_offset);
}
}
-static Result get_line_start_offset(AstLexer* lexer,
- int line,
- size_t* out_offset) {
+static Result get_line_start_offset(WastLexer* lexer,
+ int line,
+ size_t* out_offset) {
int first_line = 1;
size_t first_offset = 0;
int current_line = lexer->line;
@@ -660,18 +657,17 @@ static Result get_line_start_offset(AstLexer* lexer,
}
}
-static Result get_offsets_from_line(AstLexer* lexer,
- int line,
- size_t* out_line_start,
- size_t* out_line_end) {
+static Result get_offsets_from_line(WastLexer* lexer,
+ int line,
+ size_t* out_line_start,
+ size_t* out_line_end) {
size_t line_start;
if (WABT_FAILED(get_line_start_offset(lexer, line, &line_start)))
return Result::Error;
size_t line_end;
- if (WABT_FAILED(scan_forward_for_line_offset(lexer, line, line_start,
- LineOffsetPosition::End,
- line, &line_end)))
+ if (WABT_FAILED(scan_forward_for_line_offset(
+ lexer, line, line_start, LineOffsetPosition::End, line, &line_end)))
return Result::Error;
*out_line_start = line_start;
*out_line_end = line_end;
@@ -707,12 +703,12 @@ static void clamp_source_line_offsets_to_location(size_t line_start,
*out_new_line_end = line_end;
}
-Result ast_lexer_get_source_line(AstLexer* lexer,
- const Location* loc,
- size_t line_max_length,
- char* line,
- size_t* out_line_length,
- int* out_column_offset) {
+Result wast_lexer_get_source_line(WastLexer* lexer,
+ const Location* loc,
+ size_t line_max_length,
+ char* line,
+ size_t* out_line_length,
+ int* out_column_offset) {
Result result;
size_t line_start; /* inclusive */
size_t line_end; /* exclusive */
@@ -743,12 +739,12 @@ Result ast_lexer_get_source_line(AstLexer* lexer,
read_length -= 3;
}
- if (lexer->source.type == AstLexerSourceType::Buffer) {
+ if (lexer->source.type == WastLexerSourceType::Buffer) {
const char* buffer_read_start =
static_cast<const char*>(lexer->source.buffer.data) + read_start;
memcpy(write_start, buffer_read_start, read_length);
} else {
- assert(lexer->source.type == AstLexerSourceType::File);
+ assert(lexer->source.type == WastLexerSourceType::File);
FILE* lexer_file = lexer->source.file;
long old_offset = ftell(lexer_file);
if (old_offset == -1)
diff --git a/src/ast-lexer.h b/src/wast-lexer.h
index f2325a30..00cfacfb 100644
--- a/src/ast-lexer.h
+++ b/src/wast-lexer.h
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-#ifndef WABT_AST_LEXER_H_
-#define WABT_AST_LEXER_H_
+#ifndef WABT_WAST_LEXER_H_
+#define WABT_WAST_LEXER_H_
#include <stddef.h>
#include <stdio.h>
@@ -24,13 +24,13 @@
namespace wabt {
-enum class AstLexerSourceType {
+enum class WastLexerSourceType {
File,
Buffer,
};
-struct AstLexerSource {
- AstLexerSourceType type;
+struct WastLexerSource {
+ WastLexerSourceType type;
union {
FILE* file;
struct {
@@ -41,8 +41,8 @@ struct AstLexerSource {
};
};
-struct AstLexer {
- AstLexerSource source;
+struct WastLexer {
+ WastLexerSource source;
const char* filename;
int line;
int comment_nesting;
@@ -59,12 +59,12 @@ struct AstLexer {
char* limit;
};
-AstLexer* new_ast_file_lexer(const char* filename);
-AstLexer* new_ast_buffer_lexer(const char* filename,
- const void* data,
- size_t size);
-void destroy_ast_lexer(AstLexer*);
+WastLexer* new_wast_file_lexer(const char* filename);
+WastLexer* new_wast_buffer_lexer(const char* filename,
+ const void* data,
+ size_t size);
+void destroy_wast_lexer(WastLexer*);
} // namespace wabt
-#endif /* WABT_AST_LEXER_H_ */
+#endif /* WABT_WAST_LEXER_H_ */
diff --git a/src/ast-parser-lexer-shared.cc b/src/wast-parser-lexer-shared.cc
index a6f8ba96..d5211704 100644
--- a/src/ast-parser-lexer-shared.cc
+++ b/src/wast-parser-lexer-shared.cc
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "ast-parser-lexer-shared.h"
+#include "wast-parser-lexer-shared.h"
#include <stdarg.h>
#include <stdio.h>
@@ -24,23 +24,23 @@
namespace wabt {
-void ast_parser_error(Location* loc,
- AstLexer* lexer,
- AstParser* parser,
- const char* format,
- ...) {
+void wast_parser_error(Location* loc,
+ WastLexer* lexer,
+ WastParser* parser,
+ const char* format,
+ ...) {
parser->errors++;
va_list args;
va_start(args, format);
- ast_format_error(parser->error_handler, loc, lexer, format, args);
+ wast_format_error(parser->error_handler, loc, lexer, format, args);
va_end(args);
}
-void ast_format_error(SourceErrorHandler* error_handler,
- const struct Location* loc,
- AstLexer* lexer,
- const char* format,
- va_list args) {
+void wast_format_error(SourceErrorHandler* error_handler,
+ const struct Location* loc,
+ WastLexer* lexer,
+ const char* format,
+ va_list args) {
va_list args_copy;
va_copy(args_copy, args);
char fixed_buf[WABT_DEFAULT_SNPRINTF_ALLOCA_BUFSIZE];
@@ -57,7 +57,7 @@ void ast_format_error(SourceErrorHandler* error_handler,
size_t source_line_max_length = error_handler->source_line_max_length();
if (loc && lexer) {
source_line = static_cast<char*>(alloca(source_line_max_length + 1));
- Result result = ast_lexer_get_source_line(
+ Result result = wast_lexer_get_source_line(
lexer, loc, source_line_max_length, source_line, &source_line_length,
&source_line_column_offset);
if (WABT_FAILED(result)) {
diff --git a/src/ast-parser-lexer-shared.h b/src/wast-parser-lexer-shared.h
index 894db7b1..421d9fa7 100644
--- a/src/ast-parser-lexer-shared.h
+++ b/src/wast-parser-lexer-shared.h
@@ -14,22 +14,22 @@
* limitations under the License.
*/
-#ifndef WABT_AST_PARSER_LEXER_SHARED_H_
-#define WABT_AST_PARSER_LEXER_SHARED_H_
+#ifndef WABT_WAST_PARSER_LEXER_SHARED_H_
+#define WABT_WAST_PARSER_LEXER_SHARED_H_
#include <stdarg.h>
#include <memory>
-#include "ast.h"
-#include "ast-lexer.h"
#include "common.h"
+#include "ir.h"
#include "source-error-handler.h"
+#include "wast-lexer.h"
-#define WABT_AST_PARSER_STYPE Token
-#define WABT_AST_PARSER_LTYPE Location
-#define YYSTYPE WABT_AST_PARSER_STYPE
-#define YYLTYPE WABT_AST_PARSER_LTYPE
+#define WABT_WAST_PARSER_STYPE Token
+#define WABT_WAST_PARSER_LTYPE Location
+#define YYSTYPE WABT_WAST_PARSER_STYPE
+#define YYLTYPE WABT_WAST_PARSER_LTYPE
#define WABT_INVALID_LINE_OFFSET (static_cast<size_t>(~0))
@@ -159,7 +159,7 @@ union Token {
VarVector* vars;
};
-struct AstParser {
+struct WastParser {
Script* script;
SourceErrorHandler* error_handler;
int errors;
@@ -169,26 +169,29 @@ struct AstParser {
YYLTYPE* yylsa;
};
-int ast_lexer_lex(union Token*, struct Location*, AstLexer*, struct AstParser*);
-Result ast_lexer_get_source_line(AstLexer*,
- const struct Location*,
- size_t line_max_length,
- char* line,
- size_t* out_line_length,
- int* out_column_offset);
-void WABT_PRINTF_FORMAT(4, 5) ast_parser_error(struct Location*,
- AstLexer*,
- struct AstParser*,
- const char*,
- ...);
-void ast_format_error(SourceErrorHandler*,
- const struct Location*,
- AstLexer*,
- const char* format,
- va_list);
+int wast_lexer_lex(union Token*,
+ struct Location*,
+ WastLexer*,
+ struct WastParser*);
+Result wast_lexer_get_source_line(WastLexer*,
+ const struct Location*,
+ size_t line_max_length,
+ char* line,
+ size_t* out_line_length,
+ int* out_column_offset);
+void WABT_PRINTF_FORMAT(4, 5) wast_parser_error(struct Location*,
+ WastLexer*,
+ struct WastParser*,
+ const char*,
+ ...);
+void wast_format_error(SourceErrorHandler*,
+ const struct Location*,
+ WastLexer*,
+ const char* format,
+ va_list);
void destroy_func_fields(FuncField*);
void destroy_text_list(TextList*);
} // namespace wabt
-#endif /* WABT_AST_PARSER_LEXER_SHARED_H_ */
+#endif /* WABT_WAST_PARSER_LEXER_SHARED_H_ */
diff --git a/src/ast-parser.h b/src/wast-parser.h
index 4cd90f31..f195d7ee 100644
--- a/src/ast-parser.h
+++ b/src/wast-parser.h
@@ -14,18 +14,18 @@
* limitations under the License.
*/
-#ifndef WABT_AST_PARSER_H_
-#define WABT_AST_PARSER_H_
+#ifndef WABT_WAST_PARSER_H_
+#define WABT_WAST_PARSER_H_
-#include "ast-lexer.h"
+#include "wast-lexer.h"
namespace wabt {
struct Script;
class SourceErrorHandler;
-Result parse_ast(AstLexer* lexer, Script** out_script, SourceErrorHandler*);
+Result parse_wast(WastLexer* lexer, Script** out_script, SourceErrorHandler*);
} // namespace wabt
-#endif /* WABT_AST_PARSER_H_ */
+#endif /* WABT_WAST_PARSER_H_ */
diff --git a/src/ast-parser.y b/src/wast-parser.y
index 081bedcb..5dc7d2b3 100644
--- a/src/ast-parser.y
+++ b/src/wast-parser.y
@@ -23,12 +23,12 @@
#include <algorithm>
#include <utility>
-#include "ast-parser.h"
-#include "ast-parser-lexer-shared.h"
#include "binary-error-handler.h"
-#include "binary-reader-ast.h"
#include "binary-reader.h"
+#include "binary-reader-ir.h"
#include "literal.h"
+#include "wast-parser.h"
+#include "wast-parser-lexer-shared.h"
#define INVALID_VAR_INDEX (-1)
@@ -113,7 +113,7 @@
#define CHECK_IMPORT_ORDERING(module, kind, kinds, loc_) \
do { \
if ((module)->kinds.size() != (module)->num_##kind##_imports) { \
- ast_parser_error( \
+ wast_parser_error( \
&loc_, lexer, parser, \
"imports must occur before all non-import definitions"); \
} \
@@ -123,15 +123,15 @@
do { \
if (!string_slice_is_empty(&(end_label))) { \
if (string_slice_is_empty(&(begin_label))) { \
- ast_parser_error(&loc, lexer, parser, \
- "unexpected label \"" PRIstringslice "\"", \
- WABT_PRINTF_STRING_SLICE_ARG(end_label)); \
+ wast_parser_error(&loc, lexer, parser, \
+ "unexpected label \"" PRIstringslice "\"", \
+ WABT_PRINTF_STRING_SLICE_ARG(end_label)); \
} else if (!string_slices_are_equal(&(begin_label), &(end_label))) { \
- ast_parser_error(&loc, lexer, parser, \
- "mismatching label \"" PRIstringslice \
- "\" != \"" PRIstringslice "\"", \
- WABT_PRINTF_STRING_SLICE_ARG(begin_label), \
- WABT_PRINTF_STRING_SLICE_ARG(end_label)); \
+ wast_parser_error(&loc, lexer, parser, \
+ "mismatching label \"" PRIstringslice \
+ "\" != \"" PRIstringslice "\"", \
+ WABT_PRINTF_STRING_SLICE_ARG(begin_label), \
+ WABT_PRINTF_STRING_SLICE_ARG(end_label)); \
} \
destroy_string_slice(&(end_label)); \
} \
@@ -164,27 +164,27 @@ void append_implicit_func_declaration(Location*,
class BinaryErrorHandlerModule : public BinaryErrorHandler {
public:
- BinaryErrorHandlerModule(Location* loc, AstLexer* lexer, AstParser* parser);
+ BinaryErrorHandlerModule(Location* loc, WastLexer* lexer, WastParser* parser);
bool OnError(uint32_t offset, const std::string& error) override;
private:
Location* loc_;
- AstLexer* lexer_;
- AstParser* parser_;
+ WastLexer* lexer_;
+ WastParser* parser_;
};
-#define wabt_ast_parser_lex ast_lexer_lex
-#define wabt_ast_parser_error ast_parser_error
+#define wabt_wast_parser_lex wast_lexer_lex
+#define wabt_wast_parser_error wast_parser_error
%}
-%define api.prefix {wabt_ast_parser_}
+%define api.prefix {wabt_wast_parser_}
%define api.pure true
%define api.value.type {::wabt::Token}
%define api.token.prefix {WABT_TOKEN_TYPE_}
%define parse.error verbose
-%lex-param {::wabt::AstLexer* lexer} {::wabt::AstParser* parser}
-%parse-param {::wabt::AstLexer* lexer} {::wabt::AstParser* parser}
+%lex-param {::wabt::WastLexer* lexer} {::wabt::WastParser* parser}
+%parse-param {::wabt::WastLexer* lexer} {::wabt::WastParser* parser}
%locations
%token LPAR "("
@@ -411,9 +411,9 @@ nat :
NAT {
if (WABT_FAILED(parse_uint64($1.text.start,
$1.text.start + $1.text.length, &$$))) {
- ast_parser_error(&@1, lexer, parser,
- "invalid int " PRIstringslice "\"",
- WABT_PRINTF_STRING_SLICE_ARG($1.text));
+ wast_parser_error(&@1, lexer, parser,
+ "invalid int " PRIstringslice "\"",
+ WABT_PRINTF_STRING_SLICE_ARG($1.text));
}
}
;
@@ -470,9 +470,9 @@ offset_opt :
| OFFSET_EQ_NAT {
if (WABT_FAILED(parse_int64($1.start, $1.start + $1.length, &$$,
ParseIntType::SignedAndUnsigned))) {
- ast_parser_error(&@1, lexer, parser,
- "invalid offset \"" PRIstringslice "\"",
- WABT_PRINTF_STRING_SLICE_ARG($1));
+ wast_parser_error(&@1, lexer, parser,
+ "invalid offset \"" PRIstringslice "\"",
+ WABT_PRINTF_STRING_SLICE_ARG($1));
}
}
;
@@ -481,9 +481,9 @@ align_opt :
| ALIGN_EQ_NAT {
if (WABT_FAILED(parse_int32($1.start, $1.start + $1.length, &$$,
ParseIntType::UnsignedOnly))) {
- ast_parser_error(&@1, lexer, parser,
- "invalid alignment \"" PRIstringslice "\"",
- WABT_PRINTF_STRING_SLICE_ARG($1));
+ wast_parser_error(&@1, lexer, parser,
+ "invalid alignment \"" PRIstringslice "\"",
+ WABT_PRINTF_STRING_SLICE_ARG($1));
}
}
;
@@ -551,9 +551,9 @@ plain_instr :
const_.loc = @1;
if (WABT_FAILED(parse_const($1, $2.type, $2.text.start,
$2.text.start + $2.text.length, &const_))) {
- ast_parser_error(&@2, lexer, parser,
- "invalid literal \"" PRIstringslice "\"",
- WABT_PRINTF_STRING_SLICE_ARG($2.text));
+ wast_parser_error(&@2, lexer, parser,
+ "invalid literal \"" PRIstringslice "\"",
+ WABT_PRINTF_STRING_SLICE_ARG($2.text));
}
delete [] $2.text.start;
$$ = Expr::CreateConst(const_);
@@ -1284,8 +1284,8 @@ module :
$$ = new Module();
ReadBinaryOptions options = WABT_READ_BINARY_OPTIONS_DEFAULT;
BinaryErrorHandlerModule error_handler(&$1->binary.loc, lexer, parser);
- read_binary_ast($1->binary.data, $1->binary.size, &options,
- &error_handler, $$);
+ read_binary_ir($1->binary.data, $1->binary.size, &options,
+ &error_handler, $$);
$$->name = $1->binary.name;
$$->loc = $1->binary.loc;
WABT_ZERO_MEMORY($1->binary.name);
@@ -1417,9 +1417,9 @@ const :
$$.loc = @2;
if (WABT_FAILED(parse_const($2, $3.type, $3.text.start,
$3.text.start + $3.text.length, &$$))) {
- ast_parser_error(&@3, lexer, parser,
- "invalid literal \"" PRIstringslice "\"",
- WABT_PRINTF_STRING_SLICE_ARG($3.text));
+ wast_parser_error(&@3, lexer, parser,
+ "invalid literal \"" PRIstringslice "\"",
+ WABT_PRINTF_STRING_SLICE_ARG($3.text));
}
delete [] $3.text.start;
}
@@ -1652,12 +1652,12 @@ void append_implicit_func_declaration(Location* loc,
}
}
-Result parse_ast(AstLexer* lexer, Script** out_script,
+Result parse_wast(WastLexer* lexer, Script** out_script,
SourceErrorHandler* error_handler) {
- AstParser parser;
+ WastParser parser;
WABT_ZERO_MEMORY(parser);
parser.error_handler = error_handler;
- int result = wabt_ast_parser_parse(lexer, &parser);
+ int result = wabt_wast_parser_parse(lexer, &parser);
delete [] parser.yyssa;
delete [] parser.yyvsa;
delete [] parser.yylsa;
@@ -1666,18 +1666,18 @@ Result parse_ast(AstLexer* lexer, Script** out_script,
}
BinaryErrorHandlerModule::BinaryErrorHandlerModule(
- Location* loc, AstLexer* lexer, AstParser* parser)
+ Location* loc, WastLexer* lexer, WastParser* parser)
: loc_(loc), lexer_(lexer), parser_(parser) {}
bool BinaryErrorHandlerModule::OnError(uint32_t offset,
const std::string& error) {
if (offset == WABT_UNKNOWN_OFFSET) {
- ast_parser_error(loc_, lexer_, parser_, "error in binary module: %s",
- error.c_str());
+ wast_parser_error(loc_, lexer_, parser_, "error in binary module: %s",
+ error.c_str());
} else {
- ast_parser_error(loc_, lexer_, parser_,
- "error in binary module: @0x%08x: %s", offset,
- error.c_str());
+ wast_parser_error(loc_, lexer_, parser_,
+ "error in binary module: @0x%08x: %s", offset,
+ error.c_str());
}
return true;
}
diff --git a/src/ast-writer.cc b/src/wat-writer.cc
index 306da811..1af22944 100644
--- a/src/ast-writer.cc
+++ b/src/wat-writer.cc
@@ -14,7 +14,7 @@
* limitations under the License.
*/
-#include "ast-writer.h"
+#include "wat-writer.h"
#include <assert.h>
#include <inttypes.h>
@@ -24,8 +24,8 @@
#include <string>
#include <vector>
-#include "ast.h"
#include "common.h"
+#include "ir.h"
#include "literal.h"
#include "stream.h"
#include "writer.h"
@@ -58,9 +58,9 @@ enum class NextChar {
ForceNewline,
};
-class ASTWriter {
+class WatWriter {
public:
- ASTWriter(Writer* writer) : stream_(writer) {}
+ WatWriter(Writer* writer) : stream_(writer) {}
Result WriteModule(const Module* module);
@@ -135,16 +135,16 @@ class ASTWriter {
} // namespace
-void ASTWriter::Indent() {
+void WatWriter::Indent() {
indent_ += INDENT_SIZE;
}
-void ASTWriter::Dedent() {
+void WatWriter::Dedent() {
indent_ -= INDENT_SIZE;
assert(indent_ >= 0);
}
-void ASTWriter::WriteIndent() {
+void WatWriter::WriteIndent() {
static char s_indent[] =
" "
" ";
@@ -159,7 +159,7 @@ void ASTWriter::WriteIndent() {
}
}
-void ASTWriter::WriteNextChar() {
+void WatWriter::WriteNextChar() {
switch (next_char_) {
case NextChar::Space:
stream_.WriteChar(' ');
@@ -177,88 +177,88 @@ void ASTWriter::WriteNextChar() {
next_char_ = NextChar::None;
}
-void ASTWriter::WriteDataWithNextChar(const void* src, size_t size) {
+void WatWriter::WriteDataWithNextChar(const void* src, size_t size) {
WriteNextChar();
stream_.WriteData(src, size);
}
-void WABT_PRINTF_FORMAT(2, 3) ASTWriter::Writef(const char* format, ...) {
+void WABT_PRINTF_FORMAT(2, 3) WatWriter::Writef(const char* format, ...) {
WABT_SNPRINTF_ALLOCA(buffer, length, format);
/* default to following space */
WriteDataWithNextChar(buffer, length);
next_char_ = NextChar::Space;
}
-void ASTWriter::WritePutc(char c) {
+void WatWriter::WritePutc(char c) {
stream_.WriteChar(c);
}
-void ASTWriter::WritePuts(const char* s, NextChar next_char) {
+void WatWriter::WritePuts(const char* s, NextChar next_char) {
size_t len = strlen(s);
WriteDataWithNextChar(s, len);
next_char_ = next_char;
}
-void ASTWriter::WritePutsSpace(const char* s) {
+void WatWriter::WritePutsSpace(const char* s) {
WritePuts(s, NextChar::Space);
}
-void ASTWriter::WritePutsNewline(const char* s) {
+void WatWriter::WritePutsNewline(const char* s) {
WritePuts(s, NextChar::Newline);
}
-void ASTWriter::WriteNewline(bool force) {
+void WatWriter::WriteNewline(bool force) {
if (next_char_ == NextChar::ForceNewline)
WriteNextChar();
next_char_ = force ? NextChar::ForceNewline : NextChar::Newline;
}
-void ASTWriter::WriteOpen(const char* name, NextChar next_char) {
+void WatWriter::WriteOpen(const char* name, NextChar next_char) {
WritePuts("(", NextChar::None);
WritePuts(name, next_char);
Indent();
}
-void ASTWriter::WriteOpenNewline(const char* name) {
+void WatWriter::WriteOpenNewline(const char* name) {
WriteOpen(name, NextChar::Newline);
}
-void ASTWriter::WriteOpenSpace(const char* name) {
+void WatWriter::WriteOpenSpace(const char* name) {
WriteOpen(name, NextChar::Space);
}
-void ASTWriter::WriteClose(NextChar next_char) {
+void WatWriter::WriteClose(NextChar next_char) {
if (next_char_ != NextChar::ForceNewline)
next_char_ = NextChar::None;
Dedent();
WritePuts(")", next_char);
}
-void ASTWriter::WriteCloseNewline() {
+void WatWriter::WriteCloseNewline() {
WriteClose(NextChar::Newline);
}
-void ASTWriter::WriteCloseSpace() {
+void WatWriter::WriteCloseSpace() {
WriteClose(NextChar::Space);
}
-void ASTWriter::WriteString(const std::string& str, NextChar next_char) {
+void WatWriter::WriteString(const std::string& str, NextChar next_char) {
WritePuts(str.c_str(), next_char);
}
-void ASTWriter::WriteStringSlice(const StringSlice* str, NextChar next_char) {
+void WatWriter::WriteStringSlice(const StringSlice* str, NextChar next_char) {
Writef(PRIstringslice, WABT_PRINTF_STRING_SLICE_ARG(*str));
next_char_ = next_char;
}
-bool ASTWriter::WriteStringSliceOpt(const StringSlice* str,
+bool WatWriter::WriteStringSliceOpt(const StringSlice* str,
NextChar next_char) {
if (str->start)
WriteStringSlice(str, next_char);
return !!str->start;
}
-void ASTWriter::WriteStringSliceOrIndex(const StringSlice* str,
+void WatWriter::WriteStringSliceOrIndex(const StringSlice* str,
uint32_t index,
NextChar next_char) {
if (str->start)
@@ -267,7 +267,7 @@ void ASTWriter::WriteStringSliceOrIndex(const StringSlice* str,
Writef("(;%u;)", index);
}
-void ASTWriter::WriteQuotedData(const void* data, size_t length) {
+void WatWriter::WriteQuotedData(const void* data, size_t length) {
const uint8_t* u8_data = static_cast<const uint8_t*>(data);
static const char s_hexdigits[] = "0123456789abcdef";
WriteNextChar();
@@ -286,13 +286,13 @@ void ASTWriter::WriteQuotedData(const void* data, size_t length) {
next_char_ = NextChar::Space;
}
-void ASTWriter::WriteQuotedStringSlice(const StringSlice* str,
+void WatWriter::WriteQuotedStringSlice(const StringSlice* str,
NextChar next_char) {
WriteQuotedData(str->start, str->length);
next_char_ = next_char;
}
-void ASTWriter::WriteVar(const Var* var, NextChar next_char) {
+void WatWriter::WriteVar(const Var* var, NextChar next_char) {
if (var->type == VarType::Index) {
Writef("%" PRId64, var->index);
next_char_ = next_char;
@@ -301,7 +301,7 @@ void ASTWriter::WriteVar(const Var* var, NextChar next_char) {
}
}
-void ASTWriter::WriteBrVar(const Var* var, NextChar next_char) {
+void WatWriter::WriteBrVar(const Var* var, NextChar next_char) {
if (var->type == VarType::Index) {
Writef("%" PRId64 " (;@%" PRId64 ";)", var->index,
depth_ - var->index - 1);
@@ -311,13 +311,13 @@ void ASTWriter::WriteBrVar(const Var* var, NextChar next_char) {
}
}
-void ASTWriter::WriteType(Type type, NextChar next_char) {
+void WatWriter::WriteType(Type type, NextChar next_char) {
const char* type_name = get_type_name(type);
assert(type_name);
WritePuts(type_name, next_char);
}
-void ASTWriter::WriteTypes(const TypeVector& types, const char* name) {
+void WatWriter::WriteTypes(const TypeVector& types, const char* name) {
if (types.size()) {
if (name)
WriteOpenSpace(name);
@@ -328,12 +328,12 @@ void ASTWriter::WriteTypes(const TypeVector& types, const char* name) {
}
}
-void ASTWriter::WriteFuncSigSpace(const FuncSignature* func_sig) {
+void WatWriter::WriteFuncSigSpace(const FuncSignature* func_sig) {
WriteTypes(func_sig->param_types, "param");
WriteTypes(func_sig->result_types, "result");
}
-void ASTWriter::WriteBeginBlock(const Block* block, const char* text) {
+void WatWriter::WriteBeginBlock(const Block* block, const char* text) {
WritePutsSpace(text);
bool has_label = WriteStringSliceOpt(&block->label, NextChar::Space);
WriteTypes(block->sig, nullptr);
@@ -344,19 +344,19 @@ void ASTWriter::WriteBeginBlock(const Block* block, const char* text) {
Indent();
}
-void ASTWriter::WriteEndBlock() {
+void WatWriter::WriteEndBlock() {
Dedent();
depth_--;
WritePutsNewline(get_opcode_name(Opcode::End));
}
-void ASTWriter::WriteBlock(const Block* block, const char* start_text) {
+void WatWriter::WriteBlock(const Block* block, const char* start_text) {
WriteBeginBlock(block, start_text);
WriteExprList(block->first);
WriteEndBlock();
}
-void ASTWriter::WriteConst(const Const* const_) {
+void WatWriter::WriteConst(const Const* const_) {
switch (const_->type) {
case Type::I32:
WritePutsSpace(get_opcode_name(Opcode::I32Const));
@@ -400,7 +400,7 @@ void ASTWriter::WriteConst(const Const* const_) {
}
}
-void ASTWriter::WriteExpr(const Expr* expr) {
+void WatWriter::WriteExpr(const Expr* expr) {
switch (expr->type) {
case ExprType::Binary:
WritePutsNewline(get_opcode_name(expr->binary.opcode));
@@ -549,12 +549,12 @@ void ASTWriter::WriteExpr(const Expr* expr) {
}
}
-void ASTWriter::WriteExprList(const Expr* first) {
+void WatWriter::WriteExprList(const Expr* first) {
for (const Expr* expr = first; expr; expr = expr->next)
WriteExpr(expr);
}
-void ASTWriter::WriteInitExpr(const Expr* expr) {
+void WatWriter::WriteInitExpr(const Expr* expr) {
if (expr) {
WritePuts("(", NextChar::None);
WriteExpr(expr);
@@ -564,7 +564,7 @@ void ASTWriter::WriteInitExpr(const Expr* expr) {
}
}
-void ASTWriter::WriteTypeBindings(const char* prefix,
+void WatWriter::WriteTypeBindings(const char* prefix,
const Func* func,
const TypeVector& types,
const BindingHash& bindings) {
@@ -595,7 +595,7 @@ void ASTWriter::WriteTypeBindings(const char* prefix,
WriteCloseSpace();
}
-void ASTWriter::WriteFunc(const Module* module, const Func* func) {
+void WatWriter::WriteFunc(const Module* module, const Func* func) {
WriteOpenSpace("func");
WriteStringSliceOrIndex(&func->name, func_index_++, NextChar::Space);
if (decl_has_func_type(&func->decl)) {
@@ -616,7 +616,7 @@ void ASTWriter::WriteFunc(const Module* module, const Func* func) {
WriteCloseNewline();
}
-void ASTWriter::WriteBeginGlobal(const Global* global) {
+void WatWriter::WriteBeginGlobal(const Global* global) {
WriteOpenSpace("global");
WriteStringSliceOrIndex(&global->name, global_index_++,
NextChar::Space);
@@ -629,19 +629,19 @@ void ASTWriter::WriteBeginGlobal(const Global* global) {
}
}
-void ASTWriter::WriteGlobal(const Global* global) {
+void WatWriter::WriteGlobal(const Global* global) {
WriteBeginGlobal(global);
WriteInitExpr(global->init_expr);
WriteCloseNewline();
}
-void ASTWriter::WriteLimits(const Limits* limits) {
+void WatWriter::WriteLimits(const Limits* limits) {
Writef("%" PRIu64, limits->initial);
if (limits->has_max)
Writef("%" PRIu64, limits->max);
}
-void ASTWriter::WriteTable(const Table* table) {
+void WatWriter::WriteTable(const Table* table) {
WriteOpenSpace("table");
WriteStringSliceOrIndex(&table->name, table_index_++,
NextChar::Space);
@@ -650,7 +650,7 @@ void ASTWriter::WriteTable(const Table* table) {
WriteCloseNewline();
}
-void ASTWriter::WriteElemSegment(const ElemSegment* segment) {
+void WatWriter::WriteElemSegment(const ElemSegment* segment) {
WriteOpenSpace("elem");
WriteInitExpr(segment->offset);
for (const Var& var : segment->vars)
@@ -658,7 +658,7 @@ void ASTWriter::WriteElemSegment(const ElemSegment* segment) {
WriteCloseNewline();
}
-void ASTWriter::WriteMemory(const Memory* memory) {
+void WatWriter::WriteMemory(const Memory* memory) {
WriteOpenSpace("memory");
WriteStringSliceOrIndex(&memory->name, memory_index_++,
NextChar::Space);
@@ -666,14 +666,14 @@ void ASTWriter::WriteMemory(const Memory* memory) {
WriteCloseNewline();
}
-void ASTWriter::WriteDataSegment(const DataSegment* segment) {
+void WatWriter::WriteDataSegment(const DataSegment* segment) {
WriteOpenSpace("data");
WriteInitExpr(segment->offset);
WriteQuotedData(segment->data, segment->size);
WriteCloseNewline();
}
-void ASTWriter::WriteImport(const Import* import) {
+void WatWriter::WriteImport(const Import* import) {
WriteOpenSpace("import");
WriteQuotedStringSlice(&import->module_name, NextChar::Space);
WriteQuotedStringSlice(&import->field_name, NextChar::Space);
@@ -708,7 +708,7 @@ void ASTWriter::WriteImport(const Import* import) {
WriteCloseNewline();
}
-void ASTWriter::WriteExport(const Export* export_) {
+void WatWriter::WriteExport(const Export* export_) {
static const char* s_kind_names[] = {"func", "table", "memory", "global"};
WABT_STATIC_ASSERT(WABT_ARRAY_SIZE(s_kind_names) == kExternalKindCount);
WriteOpenSpace("export");
@@ -720,7 +720,7 @@ void ASTWriter::WriteExport(const Export* export_) {
WriteCloseNewline();
}
-void ASTWriter::WriteFuncType(const FuncType* func_type) {
+void WatWriter::WriteFuncType(const FuncType* func_type) {
WriteOpenSpace("type");
WriteStringSliceOrIndex(&func_type->name, func_type_index_++,
NextChar::Space);
@@ -730,13 +730,13 @@ void ASTWriter::WriteFuncType(const FuncType* func_type) {
WriteCloseNewline();
}
-void ASTWriter::WriteStartFunction(const Var* start) {
+void WatWriter::WriteStartFunction(const Var* start) {
WriteOpenSpace("start");
WriteVar(start, NextChar::None);
WriteCloseNewline();
}
-Result ASTWriter::WriteModule(const Module* module) {
+Result WatWriter::WriteModule(const Module* module) {
WriteOpenNewline("module");
for (const ModuleField* field = module->first_field; field;
field = field->next) {
@@ -779,9 +779,9 @@ Result ASTWriter::WriteModule(const Module* module) {
return result_;
}
-Result write_ast(Writer* writer, const Module* module) {
- ASTWriter ast_writer(writer);
- return ast_writer.WriteModule(module);
+Result write_wat(Writer* writer, const Module* module) {
+ WatWriter wat_writer(writer);
+ return wat_writer.WriteModule(module);
}
} // namespace wabt
diff --git a/src/ast-writer.h b/src/wat-writer.h
index 79bf2c76..840b77e7 100644
--- a/src/ast-writer.h
+++ b/src/wat-writer.h
@@ -14,8 +14,8 @@
* limitations under the License.
*/
-#ifndef WABT_AST_WRITER_H_
-#define WABT_AST_WRITER_H_
+#ifndef WABT_WAT_WRITER_H_
+#define WABT_WAT_WRITER_H_
#include "common.h"
@@ -24,8 +24,8 @@ namespace wabt {
struct Module;
class Writer;
-Result write_ast(Writer*, const Module*);
+Result write_wat(Writer*, const Module*);
} // namespace wabt
-#endif /* WABT_AST_WRITER_H_ */
+#endif /* WABT_WAT_WRITER_H_ */