diff --git a/.clang-format b/.clang-format old mode 100644 new mode 100755 diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 diff --git a/README.md b/README.md old mode 100644 new mode 100755 diff --git a/include/cminusfc/cminusf_builder.hpp b/include/cminusfc/cminusf_builder.hpp old mode 100644 new mode 100755 index 30c724b852c44aad3f684f1c74c5322105604529..30a3127a0c52b5234cf2e7df7ea1fdf637a9661f --- a/include/cminusfc/cminusf_builder.hpp +++ b/include/cminusfc/cminusf_builder.hpp @@ -24,12 +24,12 @@ class Scope { // push a name to scope // return true if successful // return false if this name already exits - bool push(const std::string& name, Value *val) { + bool push(const std::string &name, Value *val) { auto result = inner[inner.size() - 1].insert({name, val}); return result.second; } - Value *find(const std::string& name) { + Value *find(const std::string &name) { for (auto s = inner.rbegin(); s != inner.rend(); s++) { auto iter = s->find(name); if (iter != s->end()) { @@ -62,11 +62,13 @@ class CminusfBuilder : public ASTVisitor { std::vector output_params; output_params.push_back(TyInt32); auto *output_type = FunctionType::get(TyVoid, output_params); - auto *output_fun = Function::create(output_type, "output", module.get()); + auto *output_fun = + Function::create(output_type, "output", module.get()); std::vector output_float_params; output_float_params.push_back(TyFloat); - auto *output_float_type = FunctionType::get(TyVoid, output_float_params); + auto *output_float_type = + FunctionType::get(TyVoid, output_float_params); auto *output_float_fun = Function::create(output_float_type, "outputFloat", module.get()); @@ -106,8 +108,11 @@ class CminusfBuilder : public ASTVisitor { std::unique_ptr module; struct { + // whether require lvalue + bool require_lvalue = false; // function that is being built Function *func = nullptr; - // TODO: you should add more fields to store state + // detect scope pre-enter (for elegance only) + bool pre_enter_scope = false; } context; }; diff --git a/include/common/ast.hpp b/include/common/ast.hpp old mode 100644 new mode 100755 diff --git a/include/common/logging.hpp b/include/common/logging.hpp old mode 100644 new mode 100755 diff --git a/include/common/syntax_tree.h b/include/common/syntax_tree.h old mode 100644 new mode 100755 diff --git a/include/lightir/BasicBlock.hpp b/include/lightir/BasicBlock.hpp old mode 100644 new mode 100755 diff --git a/include/lightir/Constant.hpp b/include/lightir/Constant.hpp old mode 100644 new mode 100755 diff --git a/include/lightir/Function.hpp b/include/lightir/Function.hpp old mode 100644 new mode 100755 diff --git a/include/lightir/GlobalVariable.hpp b/include/lightir/GlobalVariable.hpp old mode 100644 new mode 100755 diff --git a/include/lightir/IRBuilder.hpp b/include/lightir/IRBuilder.hpp old mode 100644 new mode 100755 diff --git a/include/lightir/IRprinter.hpp b/include/lightir/IRprinter.hpp old mode 100644 new mode 100755 diff --git a/include/lightir/Instruction.hpp b/include/lightir/Instruction.hpp old mode 100644 new mode 100755 diff --git a/include/lightir/Module.hpp b/include/lightir/Module.hpp old mode 100644 new mode 100755 diff --git a/include/lightir/Type.hpp b/include/lightir/Type.hpp old mode 100644 new mode 100755 diff --git a/include/lightir/User.hpp b/include/lightir/User.hpp old mode 100644 new mode 100755 diff --git a/include/lightir/Value.hpp b/include/lightir/Value.hpp old mode 100644 new mode 100755 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt old mode 100644 new mode 100755 diff --git a/src/cminusfc/CMakeLists.txt b/src/cminusfc/CMakeLists.txt old mode 100644 new mode 100755 diff --git a/src/cminusfc/cminusf_builder.cpp b/src/cminusfc/cminusf_builder.cpp old mode 100644 new mode 100755 index 03604446758b46c3ef4e80bd10dfefcaf24734f1..e3159ef59ba247e57b8f30527fc49cda3ff23e60 --- a/src/cminusfc/cminusf_builder.cpp +++ b/src/cminusfc/cminusf_builder.cpp @@ -1,3 +1,8 @@ +/* + * 声明:本代码为 2023 秋 中国科大编译原理(李诚)课程实验参考实现。 + * 请不要以任何方式,将本代码上传到可以公开访问的站点或仓库 + */ + #include "cminusf_builder.hpp" #define CONST_FP(num) ConstantFP::get((float)num, module.get()) @@ -11,6 +16,22 @@ Type *INT32PTR_T; Type *FLOAT_T; Type *FLOATPTR_T; +bool promote(IRBuilder *builder, Value **l_val_p, Value **r_val_p) { + bool is_int = false; + auto &l_val = *l_val_p; + auto &r_val = *r_val_p; + if (l_val->get_type() == r_val->get_type()) { + is_int = l_val->get_type()->is_integer_type(); + } else { + if (l_val->get_type()->is_integer_type()) { + l_val = builder->create_sitofp(l_val, FLOAT_T); + } else { + r_val = builder->create_sitofp(r_val, FLOAT_T); + } + } + return is_int; +} + /* * use CMinusfBuilder::Scope to construct scopes * scope.enter: enter a new scope @@ -19,7 +40,7 @@ Type *FLOATPTR_T; * scope.find: find and return the value bound to the name */ -Value* CminusfBuilder::visit(ASTProgram &node) { +Value *CminusfBuilder::visit(ASTProgram &node) { VOID_T = module->get_void_type(); INT1_T = module->get_int1_type(); INT32_T = module->get_int32_type(); @@ -34,145 +55,457 @@ Value* CminusfBuilder::visit(ASTProgram &node) { return ret_val; } -Value* CminusfBuilder::visit(ASTNum &node) { - // TODO: This function is empty now. - // Add some code here. - return nullptr; +Value *CminusfBuilder::visit(ASTNum &node) { + if (node.type == TYPE_INT) { + return CONST_INT(node.i_val); + } + return CONST_FP(node.f_val); } -Value* CminusfBuilder::visit(ASTVarDeclaration &node) { - // TODO: This function is empty now. - // Add some code here. +Value *CminusfBuilder::visit(ASTVarDeclaration &node) { + Type *var_type = nullptr; + if (node.type == TYPE_INT) { + var_type = module->get_int32_type(); + } else { + var_type = module->get_float_type(); + } + + if (node.num == nullptr) { + if (scope.in_global()) { + auto *initializer = ConstantZero::get(var_type, module.get()); + auto *var = GlobalVariable::create(node.id, module.get(), var_type, + false, initializer); + scope.push(node.id, var); + } else { + auto *var = builder->create_alloca(var_type); + scope.push(node.id, var); + } + } else { + auto *array_type = ArrayType::get(var_type, node.num->i_val); + if (scope.in_global()) { + auto *initializer = ConstantZero::get(array_type, module.get()); + auto *var = GlobalVariable::create(node.id, module.get(), + array_type, false, initializer); + scope.push(node.id, var); + } else { + auto *var = builder->create_alloca(array_type); + scope.push(node.id, var); + } + } return nullptr; } -Value* CminusfBuilder::visit(ASTFunDeclaration &node) { - FunctionType *fun_type; - Type *ret_type; +Value *CminusfBuilder::visit(ASTFunDeclaration &node) { + FunctionType *fun_type = nullptr; + Type *ret_type = nullptr; std::vector param_types; - if (node.type == TYPE_INT) + if (node.type == TYPE_INT) { ret_type = INT32_T; - else if (node.type == TYPE_FLOAT) + } else if (node.type == TYPE_FLOAT) { ret_type = FLOAT_T; - else + } else { ret_type = VOID_T; + } for (auto ¶m : node.params) { - // TODO: Please accomplish param_types. + if (param->type == TYPE_INT) { + if (param->isarray) { + param_types.push_back(INT32PTR_T); + } else { + param_types.push_back(INT32_T); + } + } else { + if (param->isarray) { + param_types.push_back(FLOATPTR_T); + } else { + param_types.push_back(FLOAT_T); + } + } } fun_type = FunctionType::get(ret_type, param_types); - auto func = Function::create(fun_type, node.id, module.get()); + auto *func = Function::create(fun_type, node.id, module.get()); scope.push(node.id, func); context.func = func; - auto funBB = BasicBlock::create(module.get(), "entry", func); + auto *funBB = BasicBlock::create(module.get(), "entry", func); builder->set_insert_point(funBB); scope.enter(); + context.pre_enter_scope = true; std::vector args; for (auto &arg : func->get_args()) { args.push_back(&arg); } - for (unsigned int i = 0; i < node.params.size(); ++i) { - // TODO: You need to deal with params and store them in the scope. + for (unsigned i = 0; i < node.params.size(); ++i) { + if (node.params[i]->isarray) { + Value *array_alloc = nullptr; + if (node.params[i]->type == TYPE_INT) { + array_alloc = builder->create_alloca(INT32PTR_T); + } else { + array_alloc = builder->create_alloca(FLOATPTR_T); + } + builder->create_store(args[i], array_alloc); + scope.push(node.params[i]->id, array_alloc); + } else { + Value *alloc = nullptr; + if (node.params[i]->type == TYPE_INT) { + alloc = builder->create_alloca(INT32_T); + } else { + alloc = builder->create_alloca(FLOAT_T); + } + builder->create_store(args[i], alloc); + scope.push(node.params[i]->id, alloc); + } } node.compound_stmt->accept(*this); - if (not builder->get_insert_block()->is_terminated()) - { - if (context.func->get_return_type()->is_void_type()) + // can't deal with return in both blocks + if (not builder->get_insert_block()->is_terminated()) { + if (context.func->get_return_type()->is_void_type()) { builder->create_void_ret(); - else if (context.func->get_return_type()->is_float_type()) + } else if (context.func->get_return_type()->is_float_type()) { builder->create_ret(CONST_FP(0.)); - else + } else { builder->create_ret(CONST_INT(0)); + } } scope.exit(); return nullptr; } -Value* CminusfBuilder::visit(ASTParam &node) { - // TODO: This function is empty now. - // Add some code here. - return nullptr; -} +Value *CminusfBuilder::visit(ASTParam &node) { return nullptr; } + +Value *CminusfBuilder::visit(ASTCompoundStmt &node) { + bool need_exit_scope = !context.pre_enter_scope; + if (context.pre_enter_scope) { + context.pre_enter_scope = false; + } else { + scope.enter(); + } -Value* CminusfBuilder::visit(ASTCompoundStmt &node) { - // TODO: This function is not complete. - // You may need to add some code here - // to deal with complex statements. - for (auto &decl : node.local_declarations) { decl->accept(*this); } for (auto &stmt : node.statement_list) { stmt->accept(*this); - if (builder->get_insert_block()->is_terminated()) + if (builder->get_insert_block()->is_terminated()) { break; + } + } + + if (need_exit_scope) { + scope.exit(); } return nullptr; } -Value* CminusfBuilder::visit(ASTExpressionStmt &node) { - // TODO: This function is empty now. - // Add some code here. +Value *CminusfBuilder::visit(ASTExpressionStmt &node) { + if (node.expression != nullptr) { + return node.expression->accept(*this); + } return nullptr; } -Value* CminusfBuilder::visit(ASTSelectionStmt &node) { - // TODO: This function is empty now. - // Add some code here. +Value *CminusfBuilder::visit(ASTSelectionStmt &node) { + auto *ret_val = node.expression->accept(*this); + auto *trueBB = BasicBlock::create(module.get(), "", context.func); + BasicBlock *falseBB{}; + auto *contBB = BasicBlock::create(module.get(), "", context.func); + Value *cond_val = nullptr; + if (ret_val->get_type()->is_integer_type()) { + cond_val = builder->create_icmp_ne(ret_val, CONST_INT(0)); + } else { + cond_val = builder->create_fcmp_ne(ret_val, CONST_FP(0.)); + } + + if (node.else_statement == nullptr) { + builder->create_cond_br(cond_val, trueBB, contBB); + } else { + falseBB = BasicBlock::create(module.get(), "", context.func); + builder->create_cond_br(cond_val, trueBB, falseBB); + } + builder->set_insert_point(trueBB); + node.if_statement->accept(*this); + + if (not builder->get_insert_block()->is_terminated()) { + builder->create_br(contBB); + } + + if (node.else_statement == nullptr) { + // falseBB->erase_from_parent(); // did not clean up memory + } else { + builder->set_insert_point(falseBB); + node.else_statement->accept(*this); + if (not builder->get_insert_block()->is_terminated()) { + builder->create_br(contBB); + } + } + + builder->set_insert_point(contBB); return nullptr; } -Value* CminusfBuilder::visit(ASTIterationStmt &node) { - // TODO: This function is empty now. - // Add some code here. +Value *CminusfBuilder::visit(ASTIterationStmt &node) { + auto *exprBB = BasicBlock::create(module.get(), "", context.func); + if (not builder->get_insert_block()->is_terminated()) { + builder->create_br(exprBB); + } + builder->set_insert_point(exprBB); + + auto *ret_val = node.expression->accept(*this); + auto *trueBB = BasicBlock::create(module.get(), "", context.func); + auto *contBB = BasicBlock::create(module.get(), "", context.func); + Value *cond_val = nullptr; + if (ret_val->get_type()->is_integer_type()) { + cond_val = builder->create_icmp_ne(ret_val, CONST_INT(0)); + } else { + cond_val = builder->create_fcmp_ne(ret_val, CONST_FP(0.)); + } + + builder->create_cond_br(cond_val, trueBB, contBB); + builder->set_insert_point(trueBB); + node.statement->accept(*this); + if (not builder->get_insert_block()->is_terminated()) { + builder->create_br(exprBB); + } + builder->set_insert_point(contBB); + return nullptr; } -Value* CminusfBuilder::visit(ASTReturnStmt &node) { +Value *CminusfBuilder::visit(ASTReturnStmt &node) { if (node.expression == nullptr) { builder->create_void_ret(); - return nullptr; } else { - // TODO: The given code is incomplete. - // You need to solve other return cases (e.g. return an integer). + auto *fun_ret_type = + context.func->get_function_type()->get_return_type(); + auto *ret_val = node.expression->accept(*this); + if (fun_ret_type != ret_val->get_type()) { + if (fun_ret_type->is_integer_type()) { + ret_val = builder->create_fptosi(ret_val, INT32_T); + } else { + ret_val = builder->create_sitofp(ret_val, FLOAT_T); + } + } + + builder->create_ret(ret_val); } + return nullptr; } -Value* CminusfBuilder::visit(ASTVar &node) { - // TODO: This function is empty now. - // Add some code here. - return nullptr; +Value *CminusfBuilder::visit(ASTVar &node) { + auto *var = scope.find(node.id); + auto is_int = + var->get_type()->get_pointer_element_type()->is_integer_type(); + auto is_float = + var->get_type()->get_pointer_element_type()->is_float_type(); + auto is_ptr = + var->get_type()->get_pointer_element_type()->is_pointer_type(); + bool should_return_lvalue = context.require_lvalue; + context.require_lvalue = false; + Value *ret_val = nullptr; + if (node.expression == nullptr) { + if (should_return_lvalue) { + ret_val = var; + context.require_lvalue = false; + } else { + if (is_int || is_float || is_ptr) { + ret_val = builder->create_load(var); + } else { + ret_val = + builder->create_gep(var, {CONST_INT(0), CONST_INT(0)}); + } + } + } else { + auto *val = node.expression->accept(*this); + Value *is_neg = nullptr; + auto *exceptBB = BasicBlock::create(module.get(), "", context.func); + auto *contBB = BasicBlock::create(module.get(), "", context.func); + if (val->get_type()->is_float_type()) { + val = builder->create_fptosi(val, INT32_T); + } + + is_neg = builder->create_icmp_lt(val, CONST_INT(0)); + + builder->create_cond_br(is_neg, exceptBB, contBB); + builder->set_insert_point(exceptBB); + auto *neg_idx_except_fun = scope.find("neg_idx_except"); + builder->create_call(dynamic_cast(neg_idx_except_fun), {}); + if (context.func->get_return_type()->is_void_type()) { + builder->create_void_ret(); + } else if (context.func->get_return_type()->is_float_type()) { + builder->create_ret(CONST_FP(0.)); + } else { + builder->create_ret(CONST_INT(0)); + } + + builder->set_insert_point(contBB); + Value *tmp_ptr = nullptr; + if (is_int || is_float) { + tmp_ptr = builder->create_gep(var, {val}); + } else if (is_ptr) { + auto *array_load = builder->create_load(var); + tmp_ptr = builder->create_gep(array_load, {val}); + } else { + tmp_ptr = builder->create_gep(var, {CONST_INT(0), val}); + } + if (should_return_lvalue) { + ret_val = tmp_ptr; + context.require_lvalue = false; + } else { + ret_val = builder->create_load(tmp_ptr); + } + } + return ret_val; } -Value* CminusfBuilder::visit(ASTAssignExpression &node) { - // TODO: This function is empty now. - // Add some code here. - return nullptr; +Value *CminusfBuilder::visit(ASTAssignExpression &node) { + auto *expr_result = node.expression->accept(*this); + context.require_lvalue = true; + auto *var_addr = node.var->accept(*this); + if (var_addr->get_type()->get_pointer_element_type() != + expr_result->get_type()) { + if (expr_result->get_type() == INT32_T) { + expr_result = builder->create_sitofp(expr_result, FLOAT_T); + } else { + expr_result = builder->create_fptosi(expr_result, INT32_T); + } + } + builder->create_store(expr_result, var_addr); + return expr_result; } -Value* CminusfBuilder::visit(ASTSimpleExpression &node) { - // TODO: This function is empty now. - // Add some code here. - return nullptr; +Value *CminusfBuilder::visit(ASTSimpleExpression &node) { + if (node.additive_expression_r == nullptr) { + return node.additive_expression_l->accept(*this); + } + + auto *l_val = node.additive_expression_l->accept(*this); + auto *r_val = node.additive_expression_r->accept(*this); + bool is_int = promote(&*builder, &l_val, &r_val); + Value *cmp = nullptr; + switch (node.op) { + case OP_LT: + if (is_int) { + cmp = builder->create_icmp_lt(l_val, r_val); + } else { + cmp = builder->create_fcmp_lt(l_val, r_val); + } + break; + case OP_LE: + if (is_int) { + cmp = builder->create_icmp_le(l_val, r_val); + } else { + cmp = builder->create_fcmp_le(l_val, r_val); + } + break; + case OP_GE: + if (is_int) { + cmp = builder->create_icmp_ge(l_val, r_val); + } else { + cmp = builder->create_fcmp_ge(l_val, r_val); + } + break; + case OP_GT: + if (is_int) { + cmp = builder->create_icmp_gt(l_val, r_val); + } else { + cmp = builder->create_fcmp_gt(l_val, r_val); + } + break; + case OP_EQ: + if (is_int) { + cmp = builder->create_icmp_eq(l_val, r_val); + } else { + cmp = builder->create_fcmp_eq(l_val, r_val); + } + break; + case OP_NEQ: + if (is_int) { + cmp = builder->create_icmp_ne(l_val, r_val); + } else { + cmp = builder->create_fcmp_ne(l_val, r_val); + } + break; + } + + return builder->create_zext(cmp, INT32_T); } -Value* CminusfBuilder::visit(ASTAdditiveExpression &node) { - // TODO: This function is empty now. - // Add some code here. - return nullptr; +Value *CminusfBuilder::visit(ASTAdditiveExpression &node) { + if (node.additive_expression == nullptr) { + return node.term->accept(*this); + } + + auto *l_val = node.additive_expression->accept(*this); + auto *r_val = node.term->accept(*this); + bool is_int = promote(&*builder, &l_val, &r_val); + Value *ret_val = nullptr; + switch (node.op) { + case OP_PLUS: + if (is_int) { + ret_val = builder->create_iadd(l_val, r_val); + } else { + ret_val = builder->create_fadd(l_val, r_val); + } + break; + case OP_MINUS: + if (is_int) { + ret_val = builder->create_isub(l_val, r_val); + } else { + ret_val = builder->create_fsub(l_val, r_val); + } + break; + } + return ret_val; } -Value* CminusfBuilder::visit(ASTTerm &node) { - // TODO: This function is empty now. - // Add some code here. - return nullptr; +Value *CminusfBuilder::visit(ASTTerm &node) { + if (node.term == nullptr) { + return node.factor->accept(*this); + } + + auto *l_val = node.term->accept(*this); + auto *r_val = node.factor->accept(*this); + bool is_int = promote(&*builder, &l_val, &r_val); + + Value *ret_val = nullptr; + switch (node.op) { + case OP_MUL: + if (is_int) { + ret_val = builder->create_imul(l_val, r_val); + } else { + ret_val = builder->create_fmul(l_val, r_val); + } + break; + case OP_DIV: + if (is_int) { + ret_val = builder->create_isdiv(l_val, r_val); + } else { + ret_val = builder->create_fdiv(l_val, r_val); + } + break; + } + return ret_val; } -Value* CminusfBuilder::visit(ASTCall &node) { - // TODO: This function is empty now. - // Add some code here. - return nullptr; +Value *CminusfBuilder::visit(ASTCall &node) { + auto *func = dynamic_cast(scope.find(node.id)); + std::vector args; + auto param_type = func->get_function_type()->param_begin(); + for (auto &arg : node.args) { + auto *arg_val = arg->accept(*this); + if (!arg_val->get_type()->is_pointer_type() && + *param_type != arg_val->get_type()) { + if (arg_val->get_type()->is_integer_type()) { + arg_val = builder->create_sitofp(arg_val, FLOAT_T); + } else { + arg_val = builder->create_fptosi(arg_val, INT32_T); + } + } + args.push_back(arg_val); + param_type++; + } + + return builder->create_call(static_cast(func), args); } diff --git a/src/cminusfc/main.cpp b/src/cminusfc/main.cpp old mode 100644 new mode 100755 diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt old mode 100644 new mode 100755 diff --git a/src/common/ast.cpp b/src/common/ast.cpp old mode 100644 new mode 100755 index da76f874b9f33b1c5e50db32858e1be71e9b409a..dabb6c9efd73c2d3493504c279b9c541cc784559 --- a/src/common/ast.cpp +++ b/src/common/ast.cpp @@ -34,6 +34,7 @@ ASTNode *AST::transform_node_iter(syntax_tree_node *n) { */ if (_STR_EQ(n->name, "program")) { auto node = new ASTProgram(); + // flatten declaration list std::stack s; // 为什么这里要用stack呢?如果用其他数据结构应该如何实现 @@ -96,23 +97,34 @@ ASTNode *AST::transform_node_iter(syntax_tree_node *n) { // id 字段填充 node->id = n->children[1]->name; - /* - params 字段填充 - 注意这里的params是一个列表,每个元素都是一个ASTParam,需要flatten - params -> param-list | void - param-list -> param-list , param | param - */ - // TODO: 1.fill in the fields of ASTFunDeclaration - // 1.1 flatten params + // flatten params + std::stack s; + auto list_ptr = n->children[3]->children[0]; + if (list_ptr->children_num != 0) { + if (list_ptr->children_num == 3) { + while (list_ptr->children_num == 3) { + s.push(list_ptr->children[2]); + list_ptr = list_ptr->children[0]; + } + } + s.push(list_ptr->children[0]); - // 1.2 compound_stmt 字段填充 + while (!s.empty()) { + auto child_node = static_cast(transform_node_iter(s.top())); + auto child_node_shared = std::shared_ptr(child_node); + node->params.push_back(child_node_shared); + s.pop(); + } + } + auto stmt_node = + static_cast(transform_node_iter(n->children[5])); + node->compound_stmt = std::shared_ptr(stmt_node); return node; } else if (_STR_EQ(n->name, "param")) { // param -> type-specifier ID | type-specifier ID [ ] // ASTParam的结构 主要需要填充的属性有 type, id, isarray auto node = new ASTParam(); - // type, id, isarray if (_STR_EQ(n->children[0]->children[0]->name, "int")) node->type = TYPE_INT; else @@ -123,19 +135,41 @@ ASTNode *AST::transform_node_iter(syntax_tree_node *n) { return node; } else if (_STR_EQ(n->name, "compound-stmt")) { auto node = new ASTCompoundStmt(); - // TODO: 2.fill in the fields of ASTCompoundStmt - /* - 文法表达式如下 - compound-stmt -> { local-declarations statement-list } - local-declarations -> local-declarations var-declaration | empty - statement-list -> statement-list statement | empty - */ - // local declarations - // 2.1 flatten local declarations - - // statement list - // 2.2 flatten statement-list + if (n->children[1]->children_num == 2) { + // flatten local declarations + auto list_ptr = n->children[1]; + std::stack s; + while (list_ptr->children_num == 2) { + s.push(list_ptr->children[1]); + list_ptr = list_ptr->children[0]; + } + + while (!s.empty()) { + auto decl_node = + static_cast(transform_node_iter(s.top())); + auto decl_node_ptr = std::shared_ptr(decl_node); + node->local_declarations.push_back(decl_node_ptr); + s.pop(); + } + } + + if (n->children[2]->children_num == 2) { + // flatten statement-list + auto list_ptr = n->children[2]; + std::stack s; + while (list_ptr->children_num == 2) { + s.push(list_ptr->children[1]); + list_ptr = list_ptr->children[0]; + } + while (!s.empty()) { + auto stmt_node = + static_cast(transform_node_iter(s.top())); + auto stmt_node_ptr = std::shared_ptr(stmt_node); + node->statement_list.push_back(stmt_node_ptr); + s.pop(); + } + } return node; } else if (_STR_EQ(n->name, "statement")) { return transform_node_iter(n->children[0]); @@ -151,18 +185,25 @@ ASTNode *AST::transform_node_iter(syntax_tree_node *n) { return node; } else if (_STR_EQ(n->name, "selection-stmt")) { auto node = new ASTSelectionStmt(); - // TODO: 5.fill in the fields of ASTSelectionStmt - /* - selection-stmt -> if ( expression ) statement | if ( expression ) - statement else statement ASTSelectionStmt的结构,需要填充的字段有 - expression, if_statement, else_statement - */ - // 5.1 expresstion - // 5.2 if statement + auto expr_node = + static_cast(transform_node_iter(n->children[2])); + auto expr_node_ptr = std::shared_ptr(expr_node); + node->expression = expr_node_ptr; + + auto if_stmt_node = + static_cast(transform_node_iter(n->children[4])); + auto if_stmt_node_ptr = std::shared_ptr(if_stmt_node); + node->if_statement = if_stmt_node_ptr; // check whether this selection statement contains - // 5.3 else structure + // else structure + if (n->children_num == 7) { + auto else_stmt_node = + static_cast(transform_node_iter(n->children[6])); + auto else_stmt_node_ptr = std::shared_ptr(else_stmt_node); + node->else_statement = else_stmt_node_ptr; + } return node; } else if (_STR_EQ(n->name, "iteration-stmt")) { @@ -242,13 +283,20 @@ ASTNode *AST::transform_node_iter(syntax_tree_node *n) { } else if (_STR_EQ(n->name, "additive-expression")) { auto node = new ASTAdditiveExpression(); if (n->children_num == 3) { - // TODO: 4.fill in the fields of ASTAdditiveExpression - /* - 文法表达式如下 - additive-expression -> additive-expression addop term | term - */ - // additive_expression, term, op + auto add_expr_node = static_cast( + transform_node_iter(n->children[0])); + node->additive_expression = + std::shared_ptr(add_expr_node); + + auto op_name = n->children[1]->children[0]->name; + if (_STR_EQ(op_name, "+")) + node->op = OP_PLUS; + else if (_STR_EQ(op_name, "-")) + node->op = OP_MINUS; + auto term_node = + static_cast(transform_node_iter(n->children[2])); + node->term = std::shared_ptr(term_node); } else { auto term_node = static_cast(transform_node_iter(n->children[0])); @@ -287,19 +335,12 @@ ASTNode *AST::transform_node_iter(syntax_tree_node *n) { return transform_node_iter(n->children[i]); else { auto num_node = new ASTNum(); - // TODO: 3.fill in the fields of ASTNum - /* - 文法表达式如下 - factor -> ( expression ) | var | call | integer | float - float -> FLOATPOINT - integer -> INTEGER - */ if (_STR_EQ(name, "integer")) { - // 3.1 - + num_node->type = TYPE_INT; + num_node->i_val = std::stoi(n->children[i]->children[0]->name); } else if (_STR_EQ(name, "float")) { - // 3.2 - + num_node->type = TYPE_FLOAT; + num_node->f_val = std::stof(n->children[i]->children[0]->name); } else { _AST_NODE_ERROR_ } diff --git a/src/common/logging.cpp b/src/common/logging.cpp old mode 100644 new mode 100755 diff --git a/src/common/syntax_tree.c b/src/common/syntax_tree.c old mode 100644 new mode 100755 diff --git a/src/io/CMakeLists.txt b/src/io/CMakeLists.txt old mode 100644 new mode 100755 diff --git a/src/io/io.c b/src/io/io.c old mode 100644 new mode 100755 diff --git a/src/io/io.h b/src/io/io.h old mode 100644 new mode 100755 diff --git a/src/lightir/BasicBlock.cpp b/src/lightir/BasicBlock.cpp old mode 100644 new mode 100755 diff --git a/src/lightir/CMakeLists.txt b/src/lightir/CMakeLists.txt old mode 100644 new mode 100755 diff --git a/src/lightir/Constant.cpp b/src/lightir/Constant.cpp old mode 100644 new mode 100755 diff --git a/src/lightir/Function.cpp b/src/lightir/Function.cpp old mode 100644 new mode 100755 diff --git a/src/lightir/GlobalVariable.cpp b/src/lightir/GlobalVariable.cpp old mode 100644 new mode 100755 diff --git a/src/lightir/IRprinter.cpp b/src/lightir/IRprinter.cpp old mode 100644 new mode 100755 diff --git a/src/lightir/Instruction.cpp b/src/lightir/Instruction.cpp old mode 100644 new mode 100755 diff --git a/src/lightir/Module.cpp b/src/lightir/Module.cpp old mode 100644 new mode 100755 diff --git a/src/lightir/Type.cpp b/src/lightir/Type.cpp old mode 100644 new mode 100755 diff --git a/src/lightir/User.cpp b/src/lightir/User.cpp old mode 100644 new mode 100755 diff --git a/src/lightir/Value.cpp b/src/lightir/Value.cpp old mode 100644 new mode 100755 diff --git a/src/logging/CMakeLists.txt b/src/logging/CMakeLists.txt old mode 100644 new mode 100755 diff --git a/src/logging/test_ast.cpp b/src/logging/test_ast.cpp old mode 100644 new mode 100755 diff --git a/src/logging/test_logging.cpp b/src/logging/test_logging.cpp old mode 100644 new mode 100755 diff --git a/src/parser/CMakeLists.txt b/src/parser/CMakeLists.txt old mode 100644 new mode 100755 diff --git a/src/parser/lexical_analyzer.l b/src/parser/lexical_analyzer.l old mode 100644 new mode 100755 index e3d89c994763b296090d993da3847e014f0fc211..6a93dc21d4cadb0fe3055749676b0b529bf7ec0a --- a/src/parser/lexical_analyzer.l +++ b/src/parser/lexical_analyzer.l @@ -25,6 +25,9 @@ void pass_node(char *text){ /* to do for students */ /* two cases for you, pass_node will send flex's token to bison */ \+ {pos_start = pos_end; pos_end += 1; pass_node(yytext); return ADD;} + + /****请在此补全所有flex的模式与动作 end******/ + \- {pos_start = pos_end; pos_end += 1; pass_node(yytext); return SUB;} \* {pos_start = pos_end; pos_end += 1; pass_node(yytext); return MUL;} \/ {pos_start = pos_end; pos_end += 1; pass_node(yytext); return DIV;} @@ -34,13 +37,34 @@ void pass_node(char *text){ \>= {pos_start = pos_end; pos_end += 2; pass_node(yytext); return GTE;} == {pos_start = pos_end; pos_end += 2; pass_node(yytext); return EQ;} != {pos_start = pos_end; pos_end += 2; pass_node(yytext); return NEQ;} -= {pos_start = pos_end; pos_end += 1; pass_node(yytext); return ASSIGN;} += {pos_start = pos_end; pos_end += 1; pass_node(yytext); return ASSIN;} ; {pos_start = pos_end; pos_end += 1; pass_node(yytext); return SEMICOLON;} , {pos_start = pos_end; pos_end += 1; pass_node(yytext); return COMMA;} - /* TODO: phase1. 请在这里补充其他的词法规则 */ +\( {pos_start = pos_end; pos_end += 1; pass_node(yytext); return LPARENTHESE;} +\) {pos_start = pos_end; pos_end += 1; pass_node(yytext); return RPARENTHESE;} +\[ {pos_start = pos_end; pos_end += 1; pass_node(yytext); return LBRACKET;} +\] {pos_start = pos_end; pos_end += 1; pass_node(yytext); return RBRACKET;} +\{ {pos_start = pos_end; pos_end += 1; pass_node(yytext); return LBRACE;} +\} {pos_start = pos_end; pos_end += 1; pass_node(yytext); return RBRACE;} +else {pos_start = pos_end; pos_end += 4; pass_node(yytext); return ELSE;} +if {pos_start = pos_end; pos_end += 2; pass_node(yytext); return IF;} +int {pos_start = pos_end; pos_end += 3; pass_node(yytext); return INT;} +float {pos_start = pos_end; pos_end += 5; pass_node(yytext); return FLOAT;} +return {pos_start = pos_end; pos_end += 6; pass_node(yytext); return RETURN;} +void {pos_start = pos_end; pos_end += 4; pass_node(yytext); return VOID;} +while {pos_start = pos_end; pos_end += 5; pass_node(yytext); return WHILE;} +[a-zA-Z]+ {pos_start = pos_end; pos_end += strlen(yytext); pass_node(yytext); return IDENTIFIER;} +[0-9]+ {pos_start = pos_end; pos_end += strlen(yytext); pass_node(yytext); return INTEGER;} +[0-9]+\.[0-9]*|[0-9]*\.[0-9]+ { pos_start = pos_end; pos_end += strlen(yytext); pass_node(yytext); return FLOATPOINT;} +\n {lines++; pos_start = 1; pos_end = 1;} +[ \t] {pos_start = pos_end; pos_end += 1;} + +"/*" { pos_start = pos_end; pos_end += 2; BEGIN(COMMENT); } +"*/" { pos_start = pos_end; pos_end += 2; BEGIN(INITIAL); } +. { pos_start = pos_end; pos_start += 1; } +\n { pos_start = 1; pos_end = 1; lines++; } . { pos_start = pos_end; pos_end++; return ERROR; } - /****请在此补全所有flex的模式与动作 end******/ %% diff --git a/src/parser/parser.c b/src/parser/parser.c old mode 100644 new mode 100755 diff --git a/src/parser/syntax_analyzer.y b/src/parser/syntax_analyzer.y old mode 100644 new mode 100755 index 71a07eca0ed5be9593308ab6022ebbc747472810..703e1c6a79a33b631ae437090c5b2a3ea0c1b515 --- a/src/parser/syntax_analyzer.y +++ b/src/parser/syntax_analyzer.y @@ -28,15 +28,13 @@ void yyerror(const char *s); syntax_tree_node *node(const char *node_name, int children_num, ...); %} -/* Complete this definition. - Hint: See pass_node(), node(), and syntax_tree.h. - Use forward declaring. */ +/* TODO: Complete this definition. */ %union { struct _syntax_tree_node * node; char * name; } -/* Your tokens here. */ +/* TODO: Your tokens here. */ %token ERROR %token ADD %token SUB @@ -48,7 +46,7 @@ syntax_tree_node *node(const char *node_name, int children_num, ...); %token GTE %token EQ %token NEQ -%token ASSIGN +%token ASSIN %token SEMICOLON %token COMMA %token LPARENTHESE @@ -65,8 +63,8 @@ syntax_tree_node *node(const char *node_name, int children_num, ...); %token WHILE %token IDENTIFIER %token INTEGER -%token FLOAT // 这个token 对应float 关键字 -%token FLOATPOINT // 这个token 对应 浮点数值, 如果分不清的同学可以参考type-specifier的文法和对应产生式规则 +%token FLOAT +%token FLOATPOINT // 这个是 float 类型的 token //%token EOL //%token BLANK //%token COMMENT @@ -76,7 +74,7 @@ syntax_tree_node *node(const char *node_name, int children_num, ...); %start program %% -/* Your rules here. TA has completed many */ +/* TODO: Your rules here. */ program : declaration-list {$$ = node( "program", 1, $1); gt->root = $$;} ; @@ -122,8 +120,91 @@ local-declarations : local-declarations var-declaration {$$ = node( "local-dec statement-list : statement-list statement {$$ = node( "statement-list", 2, $1, $2);} | {$$ = node( "statement-list",0);} - ; -// TODO: phase1. 补充其他的文法产生式逻辑 + ; + +statement : expression-stmt {$$ = node( "statement", 1, $1);} + | compound-stmt {$$ = node( "statement", 1, $1);} + | selection-stmt {$$ = node( "statement", 1, $1);} + | iteration-stmt {$$ = node( "statement", 1, $1);} + | return-stmt {$$ = node( "statement", 1, $1);} + ; + +expression-stmt : expression SEMICOLON {$$ = node( "expression-stmt", 2, $1, $2);} + | SEMICOLON {$$ = node( "expression-stmt", 1, $1);} + ; + +selection-stmt : IF LPARENTHESE expression RPARENTHESE statement {$$ = node( "selection-stmt", 5, $1, $2, $3, $4, $5);} + | IF LPARENTHESE expression RPARENTHESE statement ELSE statement {$$ = node( "selection-stmt", 7, $1, $2, $3, $4, $5, $6, $7);} + ; + +iteration-stmt : WHILE LPARENTHESE expression RPARENTHESE statement {$$ = node( "iteration-stmt", 5, $1, $2, $3, $4, $5);} + ; + +return-stmt : RETURN SEMICOLON {$$ = node( "return-stmt", 2, $1, $2);} + | RETURN expression SEMICOLON {$$ = node( "return-stmt", 3, $1, $2, $3);} + ; + +expression : var ASSIN expression {$$ = node( "expression", 3, $1, $2, $3);} + | simple-expression {$$ = node( "expression", 1, $1);} + ; + +var : IDENTIFIER {$$ = node( "var", 1, $1);} + | IDENTIFIER LBRACKET expression RBRACKET {$$ = node( "var", 4, $1, $2, $3, $4);} + ; + +simple-expression : additive-expression relop additive-expression {$$ = node( "simple-expression", 3, $1, $2, $3);} + | additive-expression {$$ = node( "simple-expression", 1, $1);} + ; + +relop : LT {$$ = node( "relop", 1, $1);} + | LTE {$$ = node( "relop", 1, $1);} + | GT {$$ = node( "relop", 1, $1);} + | GTE {$$ = node( "relop", 1, $1);} + | EQ {$$ = node( "relop", 1, $1);} + | NEQ {$$ = node( "relop", 1, $1);} + ; + +additive-expression : additive-expression addop term {$$ = node( "additive-expression", 3, $1, $2, $3);} + | term {$$ = node( "additive-expression", 1, $1);} + ; + +addop : ADD {$$ = node( "addop", 1, $1);} + | SUB {$$ = node( "addop", 1, $1);} + ; + +term : term mulop factor {$$ = node( "term", 3, $1, $2, $3);} + | factor {$$ = node( "term", 1, $1);} + ; + +mulop : MUL {$$ = node( "mulop", 1, $1);} + | DIV {$$ = node( "mulop", 1, $1);} + ; + +factor : LPARENTHESE expression RPARENTHESE {$$ = node( "factor", 3, $1, $2, $3);} + | var {$$ = node( "factor", 1, $1);} + | call {$$ = node( "factor", 1, $1);} + | integer {$$ = node( "factor", 1, $1);} + | float {$$ = node( "factor", 1, $1);} + ; + +integer : INTEGER {$$ = node( "integer", 1, $1);} + ; + +float : FLOATPOINT {$$ = node( "float", 1, $1);} + ; + +call : IDENTIFIER LPARENTHESE args RPARENTHESE {$$ = node( "call", 4, $1, $2, $3, $4);} + ; + +args : arg-list {$$ = node( "args", 1, $1);} +| {$$ = node( "args", 0);} + ; + +arg-list : arg-list COMMA expression {$$ = node( "arg-list", 3, $1, $2, $3);} + | expression {$$ = node( "arg-list", 1, $1);} + ; + + %% @@ -164,7 +245,7 @@ syntax_tree_node *node(const char *name, int children_num, ...) { syntax_tree_node *p = new_syntax_tree_node(name); syntax_tree_node *child; - // 这里表示 epsilon结点是通过 children_num == 0 来判断的 + // 这里表示 epsilon结点是通过 children_num == 0 来判断的 if (children_num == 0) { child = new_syntax_tree_node("epsilon"); syntax_tree_add_child(p, child); diff --git a/tests/1-parser/input/easy/FAIL_comment.cminus b/tests/1-parser/input/easy/FAIL_comment.cminus old mode 100644 new mode 100755 diff --git a/tests/1-parser/input/easy/FAIL_comment2.cminus b/tests/1-parser/input/easy/FAIL_comment2.cminus old mode 100644 new mode 100755 diff --git a/tests/1-parser/input/easy/FAIL_function.cminus b/tests/1-parser/input/easy/FAIL_function.cminus old mode 100644 new mode 100755 diff --git a/tests/1-parser/input/easy/FAIL_id.cminus b/tests/1-parser/input/easy/FAIL_id.cminus old mode 100644 new mode 100755 diff --git a/tests/1-parser/input/easy/expr.cminus b/tests/1-parser/input/easy/expr.cminus old mode 100644 new mode 100755 diff --git a/tests/1-parser/input/easy/id.cminus b/tests/1-parser/input/easy/id.cminus old mode 100644 new mode 100755 diff --git a/tests/1-parser/input/hard/You_Should_Pass.cminus b/tests/1-parser/input/hard/You_Should_Pass.cminus old mode 100644 new mode 100755 diff --git a/tests/1-parser/input/hard/assoc.cminus b/tests/1-parser/input/hard/assoc.cminus old mode 100644 new mode 100755 diff --git a/tests/1-parser/input/hard/gcd.cminus b/tests/1-parser/input/hard/gcd.cminus old mode 100644 new mode 100755 diff --git a/tests/1-parser/input/hard/hanoi.cminus b/tests/1-parser/input/hard/hanoi.cminus old mode 100644 new mode 100755 diff --git a/tests/1-parser/input/hard/if.cminus b/tests/1-parser/input/hard/if.cminus old mode 100644 new mode 100755 diff --git a/tests/1-parser/input/hard/selectionsort.cminus b/tests/1-parser/input/hard/selectionsort.cminus old mode 100644 new mode 100755 diff --git a/tests/1-parser/input/normal/FAIL_assign.cminus b/tests/1-parser/input/normal/FAIL_assign.cminus old mode 100644 new mode 100755 diff --git a/tests/1-parser/input/normal/FAIL_local-decl.cminus b/tests/1-parser/input/normal/FAIL_local-decl.cminus old mode 100644 new mode 100755 diff --git a/tests/1-parser/input/normal/array.cminus b/tests/1-parser/input/normal/array.cminus old mode 100644 new mode 100755 diff --git a/tests/1-parser/input/normal/func.cminus b/tests/1-parser/input/normal/func.cminus old mode 100644 new mode 100755 diff --git a/tests/1-parser/input/normal/if.cminus b/tests/1-parser/input/normal/if.cminus old mode 100644 new mode 100755 diff --git a/tests/1-parser/input/normal/local-decl.cminus b/tests/1-parser/input/normal/local-decl.cminus old mode 100644 new mode 100755 diff --git a/tests/1-parser/input/normal/skip_spaces.cminus b/tests/1-parser/input/normal/skip_spaces.cminus old mode 100644 new mode 100755 diff --git a/tests/1-parser/output_standard/easy/FAIL_comment.syntax_tree b/tests/1-parser/output_standard/easy/FAIL_comment.syntax_tree old mode 100644 new mode 100755 diff --git a/tests/1-parser/output_standard/easy/FAIL_comment2.syntax_tree b/tests/1-parser/output_standard/easy/FAIL_comment2.syntax_tree old mode 100644 new mode 100755 diff --git a/tests/1-parser/output_standard/easy/FAIL_function.syntax_tree b/tests/1-parser/output_standard/easy/FAIL_function.syntax_tree old mode 100644 new mode 100755 diff --git a/tests/1-parser/output_standard/easy/FAIL_id.syntax_tree b/tests/1-parser/output_standard/easy/FAIL_id.syntax_tree old mode 100644 new mode 100755 diff --git a/tests/1-parser/output_standard/easy/expr.syntax_tree b/tests/1-parser/output_standard/easy/expr.syntax_tree old mode 100644 new mode 100755 diff --git a/tests/1-parser/output_standard/easy/id.syntax_tree b/tests/1-parser/output_standard/easy/id.syntax_tree old mode 100644 new mode 100755 diff --git a/tests/1-parser/output_standard/hard/You_Should_Pass.syntax_tree b/tests/1-parser/output_standard/hard/You_Should_Pass.syntax_tree old mode 100644 new mode 100755 diff --git a/tests/1-parser/output_standard/hard/assoc.syntax_tree b/tests/1-parser/output_standard/hard/assoc.syntax_tree old mode 100644 new mode 100755 diff --git a/tests/1-parser/output_standard/hard/gcd.syntax_tree b/tests/1-parser/output_standard/hard/gcd.syntax_tree old mode 100644 new mode 100755 diff --git a/tests/1-parser/output_standard/hard/hanoi.syntax_tree b/tests/1-parser/output_standard/hard/hanoi.syntax_tree old mode 100644 new mode 100755 diff --git a/tests/1-parser/output_standard/hard/if.syntax_tree b/tests/1-parser/output_standard/hard/if.syntax_tree old mode 100644 new mode 100755 diff --git a/tests/1-parser/output_standard/hard/selectionsort.syntax_tree b/tests/1-parser/output_standard/hard/selectionsort.syntax_tree old mode 100644 new mode 100755 diff --git a/tests/1-parser/output_standard/normal/FAIL_assign.syntax_tree b/tests/1-parser/output_standard/normal/FAIL_assign.syntax_tree old mode 100644 new mode 100755 diff --git a/tests/1-parser/output_standard/normal/FAIL_local-decl.syntax_tree b/tests/1-parser/output_standard/normal/FAIL_local-decl.syntax_tree old mode 100644 new mode 100755 diff --git a/tests/1-parser/output_standard/normal/array.syntax_tree b/tests/1-parser/output_standard/normal/array.syntax_tree old mode 100644 new mode 100755 diff --git a/tests/1-parser/output_standard/normal/func.syntax_tree b/tests/1-parser/output_standard/normal/func.syntax_tree old mode 100644 new mode 100755 diff --git a/tests/1-parser/output_standard/normal/if.syntax_tree b/tests/1-parser/output_standard/normal/if.syntax_tree old mode 100644 new mode 100755 diff --git a/tests/1-parser/output_standard/normal/local-decl.syntax_tree b/tests/1-parser/output_standard/normal/local-decl.syntax_tree old mode 100644 new mode 100755 diff --git a/tests/1-parser/output_standard/normal/skip_spaces.syntax_tree b/tests/1-parser/output_standard/normal/skip_spaces.syntax_tree old mode 100644 new mode 100755 diff --git a/tests/1-parser/output_standard/testcases_general/1-return.syntax_tree b/tests/1-parser/output_standard/testcases_general/1-return.syntax_tree old mode 100644 new mode 100755 diff --git a/tests/1-parser/output_standard/testcases_general/10-funcall.syntax_tree b/tests/1-parser/output_standard/testcases_general/10-funcall.syntax_tree old mode 100644 new mode 100755 diff --git a/tests/1-parser/output_standard/testcases_general/11-funcall_chain.syntax_tree b/tests/1-parser/output_standard/testcases_general/11-funcall_chain.syntax_tree old mode 100644 new mode 100755 diff --git a/tests/1-parser/output_standard/testcases_general/12-funcall_recursion.syntax_tree b/tests/1-parser/output_standard/testcases_general/12-funcall_recursion.syntax_tree old mode 100644 new mode 100755 diff --git a/tests/1-parser/output_standard/testcases_general/13-if_stmt.syntax_tree b/tests/1-parser/output_standard/testcases_general/13-if_stmt.syntax_tree old mode 100644 new mode 100755 diff --git a/tests/1-parser/output_standard/testcases_general/14-while_stmt.syntax_tree b/tests/1-parser/output_standard/testcases_general/14-while_stmt.syntax_tree old mode 100644 new mode 100755 diff --git a/tests/1-parser/output_standard/testcases_general/15-if_while.syntax_tree b/tests/1-parser/output_standard/testcases_general/15-if_while.syntax_tree old mode 100644 new mode 100755 diff --git a/tests/1-parser/output_standard/testcases_general/16-if_chain.syntax_tree b/tests/1-parser/output_standard/testcases_general/16-if_chain.syntax_tree old mode 100644 new mode 100755 diff --git a/tests/1-parser/output_standard/testcases_general/17-while_chain.syntax_tree b/tests/1-parser/output_standard/testcases_general/17-while_chain.syntax_tree old mode 100644 new mode 100755 diff --git a/tests/1-parser/output_standard/testcases_general/18-global_var.syntax_tree b/tests/1-parser/output_standard/testcases_general/18-global_var.syntax_tree old mode 100644 new mode 100755 diff --git a/tests/1-parser/output_standard/testcases_general/19-global_local_var.syntax_tree b/tests/1-parser/output_standard/testcases_general/19-global_local_var.syntax_tree old mode 100644 new mode 100755 diff --git a/tests/1-parser/output_standard/testcases_general/2-decl_int.syntax_tree b/tests/1-parser/output_standard/testcases_general/2-decl_int.syntax_tree old mode 100644 new mode 100755 diff --git a/tests/1-parser/output_standard/testcases_general/20-gcd_array.syntax_tree b/tests/1-parser/output_standard/testcases_general/20-gcd_array.syntax_tree old mode 100644 new mode 100755 diff --git a/tests/1-parser/output_standard/testcases_general/21-comment.syntax_tree b/tests/1-parser/output_standard/testcases_general/21-comment.syntax_tree old mode 100644 new mode 100755 diff --git a/tests/1-parser/output_standard/testcases_general/3-decl_float.syntax_tree b/tests/1-parser/output_standard/testcases_general/3-decl_float.syntax_tree old mode 100644 new mode 100755 diff --git a/tests/1-parser/output_standard/testcases_general/4-decl_int_array.syntax_tree b/tests/1-parser/output_standard/testcases_general/4-decl_int_array.syntax_tree old mode 100644 new mode 100755 diff --git a/tests/1-parser/output_standard/testcases_general/5-decl_float_array.syntax_tree b/tests/1-parser/output_standard/testcases_general/5-decl_float_array.syntax_tree old mode 100644 new mode 100755 diff --git a/tests/1-parser/output_standard/testcases_general/6-num_add_int.syntax_tree b/tests/1-parser/output_standard/testcases_general/6-num_add_int.syntax_tree old mode 100644 new mode 100755 diff --git a/tests/1-parser/output_standard/testcases_general/7-assign_int_var_local.syntax_tree b/tests/1-parser/output_standard/testcases_general/7-assign_int_var_local.syntax_tree old mode 100644 new mode 100755 diff --git a/tests/1-parser/output_standard/testcases_general/8-assign_int_array_local.syntax_tree b/tests/1-parser/output_standard/testcases_general/8-assign_int_array_local.syntax_tree old mode 100644 new mode 100755 diff --git a/tests/1-parser/output_standard/testcases_general/9-assign_cast.syntax_tree b/tests/1-parser/output_standard/testcases_general/9-assign_cast.syntax_tree old mode 100644 new mode 100755 diff --git a/tests/1-parser/output_standard_ast/easy/FAIL_comment.ast b/tests/1-parser/output_standard_ast/easy/FAIL_comment.ast old mode 100644 new mode 100755 diff --git a/tests/1-parser/output_standard_ast/easy/FAIL_comment2.ast b/tests/1-parser/output_standard_ast/easy/FAIL_comment2.ast old mode 100644 new mode 100755 diff --git a/tests/1-parser/output_standard_ast/easy/FAIL_function.ast b/tests/1-parser/output_standard_ast/easy/FAIL_function.ast old mode 100644 new mode 100755 diff --git a/tests/1-parser/output_standard_ast/easy/FAIL_id.ast b/tests/1-parser/output_standard_ast/easy/FAIL_id.ast old mode 100644 new mode 100755 diff --git a/tests/1-parser/output_standard_ast/easy/expr.ast b/tests/1-parser/output_standard_ast/easy/expr.ast old mode 100644 new mode 100755 diff --git a/tests/1-parser/output_standard_ast/easy/id.ast b/tests/1-parser/output_standard_ast/easy/id.ast old mode 100644 new mode 100755 diff --git a/tests/1-parser/output_standard_ast/hard/You_Should_Pass.ast b/tests/1-parser/output_standard_ast/hard/You_Should_Pass.ast old mode 100644 new mode 100755 diff --git a/tests/1-parser/output_standard_ast/hard/assoc.ast b/tests/1-parser/output_standard_ast/hard/assoc.ast old mode 100644 new mode 100755 diff --git a/tests/1-parser/output_standard_ast/hard/gcd.ast b/tests/1-parser/output_standard_ast/hard/gcd.ast old mode 100644 new mode 100755 diff --git a/tests/1-parser/output_standard_ast/hard/hanoi.ast b/tests/1-parser/output_standard_ast/hard/hanoi.ast old mode 100644 new mode 100755 diff --git a/tests/1-parser/output_standard_ast/hard/if.ast b/tests/1-parser/output_standard_ast/hard/if.ast old mode 100644 new mode 100755 diff --git a/tests/1-parser/output_standard_ast/hard/selectionsort.ast b/tests/1-parser/output_standard_ast/hard/selectionsort.ast old mode 100644 new mode 100755 diff --git a/tests/1-parser/output_standard_ast/normal/FAIL_assign.ast b/tests/1-parser/output_standard_ast/normal/FAIL_assign.ast old mode 100644 new mode 100755 diff --git a/tests/1-parser/output_standard_ast/normal/FAIL_local-decl.ast b/tests/1-parser/output_standard_ast/normal/FAIL_local-decl.ast old mode 100644 new mode 100755 diff --git a/tests/1-parser/output_standard_ast/normal/array.ast b/tests/1-parser/output_standard_ast/normal/array.ast old mode 100644 new mode 100755 diff --git a/tests/1-parser/output_standard_ast/normal/func.ast b/tests/1-parser/output_standard_ast/normal/func.ast old mode 100644 new mode 100755 diff --git a/tests/1-parser/output_standard_ast/normal/if.ast b/tests/1-parser/output_standard_ast/normal/if.ast old mode 100644 new mode 100755 diff --git a/tests/1-parser/output_standard_ast/normal/local-decl.ast b/tests/1-parser/output_standard_ast/normal/local-decl.ast old mode 100644 new mode 100755 diff --git a/tests/1-parser/output_standard_ast/normal/skip_spaces.ast b/tests/1-parser/output_standard_ast/normal/skip_spaces.ast old mode 100644 new mode 100755 diff --git a/tests/1-parser/output_standard_ast/testcases_general/1-return.ast b/tests/1-parser/output_standard_ast/testcases_general/1-return.ast old mode 100644 new mode 100755 diff --git a/tests/1-parser/output_standard_ast/testcases_general/10-funcall.ast b/tests/1-parser/output_standard_ast/testcases_general/10-funcall.ast old mode 100644 new mode 100755 diff --git a/tests/1-parser/output_standard_ast/testcases_general/11-funcall_chain.ast b/tests/1-parser/output_standard_ast/testcases_general/11-funcall_chain.ast old mode 100644 new mode 100755 diff --git a/tests/1-parser/output_standard_ast/testcases_general/12-funcall_recursion.ast b/tests/1-parser/output_standard_ast/testcases_general/12-funcall_recursion.ast old mode 100644 new mode 100755 diff --git a/tests/1-parser/output_standard_ast/testcases_general/13-if_stmt.ast b/tests/1-parser/output_standard_ast/testcases_general/13-if_stmt.ast old mode 100644 new mode 100755 diff --git a/tests/1-parser/output_standard_ast/testcases_general/14-while_stmt.ast b/tests/1-parser/output_standard_ast/testcases_general/14-while_stmt.ast old mode 100644 new mode 100755 diff --git a/tests/1-parser/output_standard_ast/testcases_general/15-if_while.ast b/tests/1-parser/output_standard_ast/testcases_general/15-if_while.ast old mode 100644 new mode 100755 diff --git a/tests/1-parser/output_standard_ast/testcases_general/16-if_chain.ast b/tests/1-parser/output_standard_ast/testcases_general/16-if_chain.ast old mode 100644 new mode 100755 diff --git a/tests/1-parser/output_standard_ast/testcases_general/17-while_chain.ast b/tests/1-parser/output_standard_ast/testcases_general/17-while_chain.ast old mode 100644 new mode 100755 diff --git a/tests/1-parser/output_standard_ast/testcases_general/18-global_var.ast b/tests/1-parser/output_standard_ast/testcases_general/18-global_var.ast old mode 100644 new mode 100755 diff --git a/tests/1-parser/output_standard_ast/testcases_general/19-global_local_var.ast b/tests/1-parser/output_standard_ast/testcases_general/19-global_local_var.ast old mode 100644 new mode 100755 diff --git a/tests/1-parser/output_standard_ast/testcases_general/2-decl_int.ast b/tests/1-parser/output_standard_ast/testcases_general/2-decl_int.ast old mode 100644 new mode 100755 diff --git a/tests/1-parser/output_standard_ast/testcases_general/20-gcd_array.ast b/tests/1-parser/output_standard_ast/testcases_general/20-gcd_array.ast old mode 100644 new mode 100755 diff --git a/tests/1-parser/output_standard_ast/testcases_general/21-comment.ast b/tests/1-parser/output_standard_ast/testcases_general/21-comment.ast old mode 100644 new mode 100755 diff --git a/tests/1-parser/output_standard_ast/testcases_general/3-decl_float.ast b/tests/1-parser/output_standard_ast/testcases_general/3-decl_float.ast old mode 100644 new mode 100755 diff --git a/tests/1-parser/output_standard_ast/testcases_general/4-decl_int_array.ast b/tests/1-parser/output_standard_ast/testcases_general/4-decl_int_array.ast old mode 100644 new mode 100755 diff --git a/tests/1-parser/output_standard_ast/testcases_general/5-decl_float_array.ast b/tests/1-parser/output_standard_ast/testcases_general/5-decl_float_array.ast old mode 100644 new mode 100755 diff --git a/tests/1-parser/output_standard_ast/testcases_general/6-num_add_int.ast b/tests/1-parser/output_standard_ast/testcases_general/6-num_add_int.ast old mode 100644 new mode 100755 diff --git a/tests/1-parser/output_standard_ast/testcases_general/7-assign_int_var_local.ast b/tests/1-parser/output_standard_ast/testcases_general/7-assign_int_var_local.ast old mode 100644 new mode 100755 diff --git a/tests/1-parser/output_standard_ast/testcases_general/8-assign_int_array_local.ast b/tests/1-parser/output_standard_ast/testcases_general/8-assign_int_array_local.ast old mode 100644 new mode 100755 diff --git a/tests/1-parser/output_standard_ast/testcases_general/9-assign_cast.ast b/tests/1-parser/output_standard_ast/testcases_general/9-assign_cast.ast old mode 100644 new mode 100755 diff --git a/tests/1-parser/output_student/easy/FAIL_comment.syntax_tree b/tests/1-parser/output_student/easy/FAIL_comment.syntax_tree new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tests/1-parser/output_student/easy/FAIL_comment2.syntax_tree b/tests/1-parser/output_student/easy/FAIL_comment2.syntax_tree new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tests/1-parser/output_student/easy/FAIL_function.syntax_tree b/tests/1-parser/output_student/easy/FAIL_function.syntax_tree new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tests/1-parser/output_student/easy/FAIL_id.syntax_tree b/tests/1-parser/output_student/easy/FAIL_id.syntax_tree new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tests/1-parser/output_student/easy/expr.syntax_tree b/tests/1-parser/output_student/easy/expr.syntax_tree new file mode 100644 index 0000000000000000000000000000000000000000..9ebc41726ea78bfe8d3b74f24864d0d45aa61af3 --- /dev/null +++ b/tests/1-parser/output_student/easy/expr.syntax_tree @@ -0,0 +1,176 @@ +>--+ program +| >--+ declaration-list +| | >--+ declaration +| | | >--+ fun-declaration +| | | | >--+ type-specifier +| | | | | >--* int +| | | | >--* main +| | | | >--* ( +| | | | >--+ params +| | | | | >--* void +| | | | >--* ) +| | | | >--+ compound-stmt +| | | | | >--* { +| | | | | >--+ local-declarations +| | | | | | >--* epsilon +| | | | | >--+ statement-list +| | | | | | >--+ statement-list +| | | | | | | >--+ statement-list +| | | | | | | | >--+ statement-list +| | | | | | | | | >--+ statement-list +| | | | | | | | | | >--+ statement-list +| | | | | | | | | | | >--+ statement-list +| | | | | | | | | | | | >--+ statement-list +| | | | | | | | | | | | | >--+ statement-list +| | | | | | | | | | | | | | >--+ statement-list +| | | | | | | | | | | | | | | >--* epsilon +| | | | | | | | | | | | | | >--+ statement +| | | | | | | | | | | | | | | >--+ expression-stmt +| | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | >--* a +| | | | | | | | | | | | | | | | | >--* = +| | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | | | | | | | | >--* 0 +| | | | | | | | | | | | | | | | >--* ; +| | | | | | | | | | | | | >--+ statement +| | | | | | | | | | | | | | >--+ expression-stmt +| | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | >--* x +| | | | | | | | | | | | | | | | >--* = +| | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | >--+ float +| | | | | | | | | | | | | | | | | | | | | | >--* 0.0 +| | | | | | | | | | | | | | | >--* ; +| | | | | | | | | | | | >--+ statement +| | | | | | | | | | | | | >--+ expression-stmt +| | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | >--* x +| | | | | | | | | | | | | | | >--* = +| | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | >--+ float +| | | | | | | | | | | | | | | | | | | | | >--* 1. +| | | | | | | | | | | | | | >--* ; +| | | | | | | | | | | >--+ statement +| | | | | | | | | | | | >--+ expression-stmt +| | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | >--* x +| | | | | | | | | | | | | | >--* = +| | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | >--+ float +| | | | | | | | | | | | | | | | | | | | >--* .1 +| | | | | | | | | | | | | >--* ; +| | | | | | | | | | >--+ statement +| | | | | | | | | | | >--+ expression-stmt +| | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | >--* a +| | | | | | | | | | | | | >--* = +| | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | | | | | >--* 1 +| | | | | | | | | | | | | | | | >--+ addop +| | | | | | | | | | | | | | | | | >--* + +| | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | | | | >--* 1 +| | | | | | | | | | | | >--* ; +| | | | | | | | | >--+ statement +| | | | | | | | | | >--+ expression-stmt +| | | | | | | | | | | >--+ expression +| | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | >--* a +| | | | | | | | | | | | >--* = +| | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | >--* a +| | | | | | | | | | | | | | | >--+ addop +| | | | | | | | | | | | | | | | >--* - +| | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | | | >--* 1 +| | | | | | | | | | | >--* ; +| | | | | | | | >--+ statement +| | | | | | | | | >--+ expression-stmt +| | | | | | | | | | >--+ expression +| | | | | | | | | | | >--+ var +| | | | | | | | | | | | >--* x +| | | | | | | | | | | >--* = +| | | | | | | | | | | >--+ expression +| | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | >--* x +| | | | | | | | | | | | | | | >--+ mulop +| | | | | | | | | | | | | | | | >--* * +| | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | | >--* 1 +| | | | | | | | | | >--* ; +| | | | | | | >--+ statement +| | | | | | | | >--+ expression-stmt +| | | | | | | | | >--+ expression +| | | | | | | | | | >--+ var +| | | | | | | | | | | >--* x +| | | | | | | | | | >--* = +| | | | | | | | | | >--+ expression +| | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | >--* a +| | | | | | | | | | | | | | >--+ mulop +| | | | | | | | | | | | | | | >--* / +| | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | >--* x +| | | | | | | | | >--* ; +| | | | | | >--+ statement +| | | | | | | >--+ return-stmt +| | | | | | | | >--* return +| | | | | | | | >--+ expression +| | | | | | | | | >--+ simple-expression +| | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | >--+ term +| | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | >--* 0 +| | | | | | | | >--* ; +| | | | | >--* } diff --git a/tests/1-parser/output_student/easy/id.syntax_tree b/tests/1-parser/output_student/easy/id.syntax_tree new file mode 100644 index 0000000000000000000000000000000000000000..7ca2718ca2fc741099e448f23a42569bb0fdc396 --- /dev/null +++ b/tests/1-parser/output_student/easy/id.syntax_tree @@ -0,0 +1,42 @@ +>--+ program +| >--+ declaration-list +| | >--+ declaration-list +| | | >--+ declaration-list +| | | | >--+ declaration +| | | | | >--+ var-declaration +| | | | | | >--+ type-specifier +| | | | | | | >--* int +| | | | | | >--* a +| | | | | | >--* ; +| | | >--+ declaration +| | | | >--+ fun-declaration +| | | | | >--+ type-specifier +| | | | | | >--* int +| | | | | >--* f +| | | | | >--* ( +| | | | | >--+ params +| | | | | | >--* void +| | | | | >--* ) +| | | | | >--+ compound-stmt +| | | | | | >--* { +| | | | | | >--+ local-declarations +| | | | | | | >--* epsilon +| | | | | | >--+ statement-list +| | | | | | | >--* epsilon +| | | | | | >--* } +| | >--+ declaration +| | | >--+ fun-declaration +| | | | >--+ type-specifier +| | | | | >--* int +| | | | >--* g +| | | | >--* ( +| | | | >--+ params +| | | | | >--* void +| | | | >--* ) +| | | | >--+ compound-stmt +| | | | | >--* { +| | | | | >--+ local-declarations +| | | | | | >--* epsilon +| | | | | >--+ statement-list +| | | | | | >--* epsilon +| | | | | >--* } diff --git a/tests/1-parser/output_student/hard/You_Should_Pass.syntax_tree b/tests/1-parser/output_student/hard/You_Should_Pass.syntax_tree new file mode 100644 index 0000000000000000000000000000000000000000..d3cc5dc34c61a6df3888b0765f9defef0e1e8bd0 --- /dev/null +++ b/tests/1-parser/output_student/hard/You_Should_Pass.syntax_tree @@ -0,0 +1,369 @@ +>--+ program +| >--+ declaration-list +| | >--+ declaration-list +| | | >--+ declaration-list +| | | | >--+ declaration-list +| | | | | >--+ declaration-list +| | | | | | >--+ declaration-list +| | | | | | | >--+ declaration +| | | | | | | | >--+ var-declaration +| | | | | | | | | >--+ type-specifier +| | | | | | | | | | >--* float +| | | | | | | | | >--* GVAR +| | | | | | | | | >--* ; +| | | | | | >--+ declaration +| | | | | | | >--+ var-declaration +| | | | | | | | >--+ type-specifier +| | | | | | | | | >--* void +| | | | | | | | >--* NeverEverDeclareLikeThis +| | | | | | | | >--* ; +| | | | | >--+ declaration +| | | | | | >--+ var-declaration +| | | | | | | >--+ type-specifier +| | | | | | | | >--* int +| | | | | | | >--* GARRAY +| | | | | | | >--* [ +| | | | | | | >--* 2333 +| | | | | | | >--* ] +| | | | | | | >--* ; +| | | | >--+ declaration +| | | | | >--+ fun-declaration +| | | | | | >--+ type-specifier +| | | | | | | >--* void +| | | | | | >--* MyFuncA +| | | | | | >--* ( +| | | | | | >--+ params +| | | | | | | >--+ param-list +| | | | | | | | >--+ param-list +| | | | | | | | | >--+ param-list +| | | | | | | | | | >--+ param +| | | | | | | | | | | >--+ type-specifier +| | | | | | | | | | | | >--* int +| | | | | | | | | | | >--* floatNum +| | | | | | | | | >--* , +| | | | | | | | | >--+ param +| | | | | | | | | | >--+ type-specifier +| | | | | | | | | | | >--* float +| | | | | | | | | | >--* intNum +| | | | | | | | >--* , +| | | | | | | | >--+ param +| | | | | | | | | >--+ type-specifier +| | | | | | | | | | >--* void +| | | | | | | | | >--* voidNums +| | | | | | | | | >--* [ +| | | | | | | | | >--* ] +| | | | | | >--* ) +| | | | | | >--+ compound-stmt +| | | | | | | >--* { +| | | | | | | >--+ local-declarations +| | | | | | | | >--+ local-declarations +| | | | | | | | | >--* epsilon +| | | | | | | | >--+ var-declaration +| | | | | | | | | >--+ type-specifier +| | | | | | | | | | >--* int +| | | | | | | | | >--* IKnowYouAreVoid +| | | | | | | | | >--* ; +| | | | | | | >--+ statement-list +| | | | | | | | >--+ statement-list +| | | | | | | | | >--* epsilon +| | | | | | | | >--+ statement +| | | | | | | | | >--+ return-stmt +| | | | | | | | | | >--* return +| | | | | | | | | | >--+ expression +| | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | >--+ call +| | | | | | | | | | | | | | | | >--* MyFuncB +| | | | | | | | | | | | | | | | >--* ( +| | | | | | | | | | | | | | | | >--+ args +| | | | | | | | | | | | | | | | | >--+ arg-list +| | | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | | | | >--* IKnowYouAreVoid +| | | | | | | | | | | | | | | | >--* ) +| | | | | | | | | | >--* ; +| | | | | | | >--* } +| | | >--+ declaration +| | | | >--+ fun-declaration +| | | | | >--+ type-specifier +| | | | | | >--* float +| | | | | >--* MyFuncB +| | | | | >--* ( +| | | | | >--+ params +| | | | | | >--* void +| | | | | >--* ) +| | | | | >--+ compound-stmt +| | | | | | >--* { +| | | | | | >--+ local-declarations +| | | | | | | >--+ local-declarations +| | | | | | | | >--* epsilon +| | | | | | | >--+ var-declaration +| | | | | | | | >--+ type-specifier +| | | | | | | | | >--* int +| | | | | | | | >--* IAmVoid +| | | | | | | | >--* [ +| | | | | | | | >--* 0 +| | | | | | | | >--* ] +| | | | | | | | >--* ; +| | | | | | >--+ statement-list +| | | | | | | >--+ statement-list +| | | | | | | | >--* epsilon +| | | | | | | >--+ statement +| | | | | | | | >--+ return-stmt +| | | | | | | | | >--* return +| | | | | | | | | >--+ expression +| | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | >--+ call +| | | | | | | | | | | | | | | >--* MyFuncA +| | | | | | | | | | | | | | | >--* ( +| | | | | | | | | | | | | | | >--+ args +| | | | | | | | | | | | | | | | >--+ arg-list +| | | | | | | | | | | | | | | | | >--+ arg-list +| | | | | | | | | | | | | | | | | | >--+ arg-list +| | | | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | | >--+ float +| | | | | | | | | | | | | | | | | | | | | | | | | >--* .0 +| | | | | | | | | | | | | | | | | | >--* , +| | | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | | | | | | | | | >--* 0 +| | | | | | | | | | | | | | | | | >--* , +| | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | | | >--* IAmVoid +| | | | | | | | | | | | | | | >--* ) +| | | | | | | | | >--* ; +| | | | | | >--* } +| | >--+ declaration +| | | >--+ fun-declaration +| | | | >--+ type-specifier +| | | | | >--* int +| | | | >--* main +| | | | >--* ( +| | | | >--+ params +| | | | | >--* void +| | | | >--* ) +| | | | >--+ compound-stmt +| | | | | >--* { +| | | | | >--+ local-declarations +| | | | | | >--+ local-declarations +| | | | | | | >--+ local-declarations +| | | | | | | | >--+ local-declarations +| | | | | | | | | >--* epsilon +| | | | | | | | >--+ var-declaration +| | | | | | | | | >--+ type-specifier +| | | | | | | | | | >--* int +| | | | | | | | | >--* a +| | | | | | | | | >--* ; +| | | | | | | >--+ var-declaration +| | | | | | | | >--+ type-specifier +| | | | | | | | | >--* int +| | | | | | | | >--* b +| | | | | | | | >--* ; +| | | | | | >--+ var-declaration +| | | | | | | >--+ type-specifier +| | | | | | | | >--* int +| | | | | | | >--* c +| | | | | | | >--* ; +| | | | | >--+ statement-list +| | | | | | >--+ statement-list +| | | | | | | >--+ statement-list +| | | | | | | | >--+ statement-list +| | | | | | | | | >--* epsilon +| | | | | | | | >--+ statement +| | | | | | | | | >--+ expression-stmt +| | | | | | | | | | >--+ expression +| | | | | | | | | | | >--+ var +| | | | | | | | | | | | >--* a +| | | | | | | | | | | >--* = +| | | | | | | | | | | >--+ expression +| | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | >--* b +| | | | | | | | | | | | >--* = +| | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | >--* c +| | | | | | | | | | | | | >--* = +| | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | >--* ( +| | | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | | | | | | | | | >--* 85 +| | | | | | | | | | | | | | | | | | | | >--+ relop +| | | | | | | | | | | | | | | | | | | | | >--* == +| | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | | | | | | | | | | >--* 84 +| | | | | | | | | | | | | | | | | | | | | >--+ addop +| | | | | | | | | | | | | | | | | | | | | | >--* + +| | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | >--+ float +| | | | | | | | | | | | | | | | | | | | | | | | >--* 0.4 +| | | | | | | | | | | | | | | | | | >--* ) +| | | | | | | | | | >--* ; +| | | | | | | >--+ statement +| | | | | | | | >--+ selection-stmt +| | | | | | | | | >--* if +| | | | | | | | | >--* ( +| | | | | | | | | >--+ expression +| | | | | | | | | | >--+ var +| | | | | | | | | | | >--* a +| | | | | | | | | | >--* = +| | | | | | | | | | >--+ expression +| | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | >--* b +| | | | | | | | | >--* ) +| | | | | | | | | >--+ statement +| | | | | | | | | | >--+ compound-stmt +| | | | | | | | | | | >--* { +| | | | | | | | | | | >--+ local-declarations +| | | | | | | | | | | | >--* epsilon +| | | | | | | | | | | >--+ statement-list +| | | | | | | | | | | | >--+ statement-list +| | | | | | | | | | | | | >--* epsilon +| | | | | | | | | | | | >--+ statement +| | | | | | | | | | | | | >--+ expression-stmt +| | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | >--* GARRAY +| | | | | | | | | | | | | | | | >--* [ +| | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | >--* ( +| | | | | | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | | | | >--+ call +| | | | | | | | | | | | | | | | | | | | | | | | | | | >--* MyFuncB +| | | | | | | | | | | | | | | | | | | | | | | | | | | >--* ( +| | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ args +| | | | | | | | | | | | | | | | | | | | | | | | | | | | >--* epsilon +| | | | | | | | | | | | | | | | | | | | | | | | | | | >--* ) +| | | | | | | | | | | | | | | | | | | | | >--* ) +| | | | | | | | | | | | | | | | >--* ] +| | | | | | | | | | | | | | | >--* = +| | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | >--* GARRAY +| | | | | | | | | | | | | | | | | | | | | >--* [ +| | | | | | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | | | >--* c +| | | | | | | | | | | | | | | | | | | | | | >--* = +| | | | | | | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ float +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--* 1. +| | | | | | | | | | | | | | | | | | | | | | | | | | >--+ mulop +| | | | | | | | | | | | | | | | | | | | | | | | | | | >--* * +| | | | | | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ float +| | | | | | | | | | | | | | | | | | | | | | | | | | | | >--* .1 +| | | | | | | | | | | | | | | | | | | | | | | | >--+ relop +| | | | | | | | | | | | | | | | | | | | | | | | | >--* == +| | | | | | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ float +| | | | | | | | | | | | | | | | | | | | | | | | | | | | >--* 1.1 +| | | | | | | | | | | | | | | | | | | | | >--* ] +| | | | | | | | | | | | | | >--* ; +| | | | | | | | | | | >--* } +| | | | | | | | | >--* else +| | | | | | | | | >--+ statement +| | | | | | | | | | >--+ selection-stmt +| | | | | | | | | | | >--* if +| | | | | | | | | | | >--* ( +| | | | | | | | | | | >--+ expression +| | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | >--+ call +| | | | | | | | | | | | | | | | | >--* MyFuncC +| | | | | | | | | | | | | | | | | >--* ( +| | | | | | | | | | | | | | | | | >--+ args +| | | | | | | | | | | | | | | | | | >--+ arg-list +| | | | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | | | | | >--* NotDeclared +| | | | | | | | | | | | | | | | | >--* ) +| | | | | | | | | | | >--* ) +| | | | | | | | | | | >--+ statement +| | | | | | | | | | | | >--+ compound-stmt +| | | | | | | | | | | | | >--* { +| | | | | | | | | | | | | >--+ local-declarations +| | | | | | | | | | | | | | >--* epsilon +| | | | | | | | | | | | | >--+ statement-list +| | | | | | | | | | | | | | >--* epsilon +| | | | | | | | | | | | | >--* } +| | | | | | | | | | | >--* else +| | | | | | | | | | | >--+ statement +| | | | | | | | | | | | >--+ expression-stmt +| | | | | | | | | | | | | >--* ; +| | | | | | >--+ statement +| | | | | | | >--+ return-stmt +| | | | | | | | >--* return +| | | | | | | | >--+ expression +| | | | | | | | | >--+ simple-expression +| | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | >--+ term +| | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | >--+ float +| | | | | | | | | | | | | | >--* 0. +| | | | | | | | >--* ; +| | | | | >--* } diff --git a/tests/1-parser/output_student/hard/assoc.syntax_tree b/tests/1-parser/output_student/hard/assoc.syntax_tree new file mode 100644 index 0000000000000000000000000000000000000000..8420eb9dd0b0e9bfdc88568607ce4ff07fcf0f16 --- /dev/null +++ b/tests/1-parser/output_student/hard/assoc.syntax_tree @@ -0,0 +1,120 @@ +>--+ program +| >--+ declaration-list +| | >--+ declaration +| | | >--+ fun-declaration +| | | | >--+ type-specifier +| | | | | >--* int +| | | | >--* main +| | | | >--* ( +| | | | >--+ params +| | | | | >--* void +| | | | >--* ) +| | | | >--+ compound-stmt +| | | | | >--* { +| | | | | >--+ local-declarations +| | | | | | >--* epsilon +| | | | | >--+ statement-list +| | | | | | >--+ statement-list +| | | | | | | >--* epsilon +| | | | | | >--+ statement +| | | | | | | >--+ expression-stmt +| | | | | | | | >--+ expression +| | | | | | | | | >--+ var +| | | | | | | | | | >--* a +| | | | | | | | | >--* = +| | | | | | | | | >--+ expression +| | | | | | | | | | >--+ var +| | | | | | | | | | | >--* b +| | | | | | | | | | >--* = +| | | | | | | | | | >--+ expression +| | | | | | | | | | | >--+ var +| | | | | | | | | | | | >--* c +| | | | | | | | | | | >--* = +| | | | | | | | | | | >--+ expression +| | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | | | | | >--* 1 +| | | | | | | | | | | | | | | | >--+ addop +| | | | | | | | | | | | | | | | | >--* + +| | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | | | | | | | >--* 1 +| | | | | | | | | | | | | | | | | | | >--+ mulop +| | | | | | | | | | | | | | | | | | | | >--* / +| | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | | | | | | >--* 2 +| | | | | | | | | | | | | | | | | | >--+ mulop +| | | | | | | | | | | | | | | | | | | >--* * +| | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | | | | | >--* 1 +| | | | | | | | | | | | | | | | | >--+ mulop +| | | | | | | | | | | | | | | | | | >--* * +| | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | >--* ( +| | | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | | | | | | | | | | | | >--* 1 +| | | | | | | | | | | | | | | | | | | | | | | >--+ addop +| | | | | | | | | | | | | | | | | | | | | | | | >--* + +| | | | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | | | | | | | | | | | >--* 1 +| | | | | | | | | | | | | | | | | | | | | | >--+ addop +| | | | | | | | | | | | | | | | | | | | | | | >--* + +| | | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | | | | | | | | | | >--* 1 +| | | | | | | | | | | | | | | | | | | | | >--+ addop +| | | | | | | | | | | | | | | | | | | | | | >--* - +| | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | | | | | | | | | | >--* 1 +| | | | | | | | | | | | | | | | | | | | | | >--+ mulop +| | | | | | | | | | | | | | | | | | | | | | | >--* / +| | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | | | | | | | | | >--* 1 +| | | | | | | | | | | | | | | | | | >--* ) +| | | | | | | | | | | | | | | >--+ addop +| | | | | | | | | | | | | | | | >--* + +| | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | | | >--* 3 +| | | | | | | | | | | | | | >--+ addop +| | | | | | | | | | | | | | | >--* + +| | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | | | >--* 4 +| | | | | | | | | | | | | | | >--+ mulop +| | | | | | | | | | | | | | | | >--* * +| | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | | >--* 3 +| | | | | | | | >--* ; +| | | | | >--* } diff --git a/tests/1-parser/output_student/hard/gcd.syntax_tree b/tests/1-parser/output_student/hard/gcd.syntax_tree new file mode 100644 index 0000000000000000000000000000000000000000..a2b03f931c5fae67ed03421920aedb9caafaf843 --- /dev/null +++ b/tests/1-parser/output_student/hard/gcd.syntax_tree @@ -0,0 +1,291 @@ +>--+ program +| >--+ declaration-list +| | >--+ declaration-list +| | | >--+ declaration +| | | | >--+ fun-declaration +| | | | | >--+ type-specifier +| | | | | | >--* int +| | | | | >--* gcd +| | | | | >--* ( +| | | | | >--+ params +| | | | | | >--+ param-list +| | | | | | | >--+ param-list +| | | | | | | | >--+ param +| | | | | | | | | >--+ type-specifier +| | | | | | | | | | >--* int +| | | | | | | | | >--* u +| | | | | | | >--* , +| | | | | | | >--+ param +| | | | | | | | >--+ type-specifier +| | | | | | | | | >--* int +| | | | | | | | >--* v +| | | | | >--* ) +| | | | | >--+ compound-stmt +| | | | | | >--* { +| | | | | | >--+ local-declarations +| | | | | | | >--* epsilon +| | | | | | >--+ statement-list +| | | | | | | >--+ statement-list +| | | | | | | | >--* epsilon +| | | | | | | >--+ statement +| | | | | | | | >--+ selection-stmt +| | | | | | | | | >--* if +| | | | | | | | | >--* ( +| | | | | | | | | >--+ expression +| | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | >--* v +| | | | | | | | | | | >--+ relop +| | | | | | | | | | | | >--* == +| | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | >--* 0 +| | | | | | | | | >--* ) +| | | | | | | | | >--+ statement +| | | | | | | | | | >--+ return-stmt +| | | | | | | | | | | >--* return +| | | | | | | | | | | >--+ expression +| | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | >--* u +| | | | | | | | | | | >--* ; +| | | | | | | | | >--* else +| | | | | | | | | >--+ statement +| | | | | | | | | | >--+ return-stmt +| | | | | | | | | | | >--* return +| | | | | | | | | | | >--+ expression +| | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | >--+ call +| | | | | | | | | | | | | | | | | >--* gcd +| | | | | | | | | | | | | | | | | >--* ( +| | | | | | | | | | | | | | | | | >--+ args +| | | | | | | | | | | | | | | | | | >--+ arg-list +| | | | | | | | | | | | | | | | | | | >--+ arg-list +| | | | | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | | | | | | >--* v +| | | | | | | | | | | | | | | | | | | >--* , +| | | | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | | | | | | >--* u +| | | | | | | | | | | | | | | | | | | | | | >--+ addop +| | | | | | | | | | | | | | | | | | | | | | | >--* - +| | | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | | | | | | | >--* u +| | | | | | | | | | | | | | | | | | | | | | | | >--+ mulop +| | | | | | | | | | | | | | | | | | | | | | | | | >--* / +| | | | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | | | | | | >--* v +| | | | | | | | | | | | | | | | | | | | | | | >--+ mulop +| | | | | | | | | | | | | | | | | | | | | | | | >--* * +| | | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | | | | | >--* v +| | | | | | | | | | | | | | | | | >--* ) +| | | | | | | | | | | >--* ; +| | | | | | >--* } +| | >--+ declaration +| | | >--+ fun-declaration +| | | | >--+ type-specifier +| | | | | >--* int +| | | | >--* main +| | | | >--* ( +| | | | >--+ params +| | | | | >--* void +| | | | >--* ) +| | | | >--+ compound-stmt +| | | | | >--* { +| | | | | >--+ local-declarations +| | | | | | >--+ local-declarations +| | | | | | | >--+ local-declarations +| | | | | | | | >--+ local-declarations +| | | | | | | | | >--* epsilon +| | | | | | | | >--+ var-declaration +| | | | | | | | | >--+ type-specifier +| | | | | | | | | | >--* int +| | | | | | | | | >--* x +| | | | | | | | | >--* ; +| | | | | | | >--+ var-declaration +| | | | | | | | >--+ type-specifier +| | | | | | | | | >--* int +| | | | | | | | >--* y +| | | | | | | | >--* ; +| | | | | | >--+ var-declaration +| | | | | | | >--+ type-specifier +| | | | | | | | >--* int +| | | | | | | >--* temp +| | | | | | | >--* ; +| | | | | >--+ statement-list +| | | | | | >--+ statement-list +| | | | | | | >--+ statement-list +| | | | | | | | >--+ statement-list +| | | | | | | | | >--+ statement-list +| | | | | | | | | | >--+ statement-list +| | | | | | | | | | | >--* epsilon +| | | | | | | | | | >--+ statement +| | | | | | | | | | | >--+ expression-stmt +| | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | >--* x +| | | | | | | | | | | | | >--* = +| | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | | | | >--* 72 +| | | | | | | | | | | | >--* ; +| | | | | | | | | >--+ statement +| | | | | | | | | | >--+ expression-stmt +| | | | | | | | | | | >--+ expression +| | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | >--* y +| | | | | | | | | | | | >--* = +| | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | | | >--* 18 +| | | | | | | | | | | >--* ; +| | | | | | | | >--+ statement +| | | | | | | | | >--+ selection-stmt +| | | | | | | | | | >--* if +| | | | | | | | | | >--* ( +| | | | | | | | | | >--+ expression +| | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | >--* x +| | | | | | | | | | | | >--+ relop +| | | | | | | | | | | | | >--* < +| | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | >--* y +| | | | | | | | | | >--* ) +| | | | | | | | | | >--+ statement +| | | | | | | | | | | >--+ compound-stmt +| | | | | | | | | | | | >--* { +| | | | | | | | | | | | >--+ local-declarations +| | | | | | | | | | | | | >--* epsilon +| | | | | | | | | | | | >--+ statement-list +| | | | | | | | | | | | | >--+ statement-list +| | | | | | | | | | | | | | >--+ statement-list +| | | | | | | | | | | | | | | >--+ statement-list +| | | | | | | | | | | | | | | | >--* epsilon +| | | | | | | | | | | | | | | >--+ statement +| | | | | | | | | | | | | | | | >--+ expression-stmt +| | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | >--* temp +| | | | | | | | | | | | | | | | | | >--* = +| | | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | | | | >--* x +| | | | | | | | | | | | | | | | | >--* ; +| | | | | | | | | | | | | | >--+ statement +| | | | | | | | | | | | | | | >--+ expression-stmt +| | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | >--* x +| | | | | | | | | | | | | | | | | >--* = +| | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | | | >--* y +| | | | | | | | | | | | | | | | >--* ; +| | | | | | | | | | | | | >--+ statement +| | | | | | | | | | | | | | >--+ expression-stmt +| | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | >--* y +| | | | | | | | | | | | | | | | >--* = +| | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | | >--* temp +| | | | | | | | | | | | | | | >--* ; +| | | | | | | | | | | | >--* } +| | | | | | | >--+ statement +| | | | | | | | >--+ expression-stmt +| | | | | | | | | >--+ expression +| | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | >--+ call +| | | | | | | | | | | | | | | >--* gcd +| | | | | | | | | | | | | | | >--* ( +| | | | | | | | | | | | | | | >--+ args +| | | | | | | | | | | | | | | | >--+ arg-list +| | | | | | | | | | | | | | | | | >--+ arg-list +| | | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | | | | >--* x +| | | | | | | | | | | | | | | | | >--* , +| | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | | | >--* y +| | | | | | | | | | | | | | | >--* ) +| | | | | | | | | >--* ; +| | | | | | >--+ statement +| | | | | | | >--+ return-stmt +| | | | | | | | >--* return +| | | | | | | | >--+ expression +| | | | | | | | | >--+ simple-expression +| | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | >--+ term +| | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | >--* 0 +| | | | | | | | >--* ; +| | | | | >--* } diff --git a/tests/1-parser/output_student/hard/hanoi.syntax_tree b/tests/1-parser/output_student/hard/hanoi.syntax_tree new file mode 100644 index 0000000000000000000000000000000000000000..f91ceec470e0de068e96579c0753dd4eba8a267c --- /dev/null +++ b/tests/1-parser/output_student/hard/hanoi.syntax_tree @@ -0,0 +1,558 @@ +>--+ program +| >--+ declaration-list +| | >--+ declaration-list +| | | >--+ declaration-list +| | | | >--+ declaration +| | | | | >--+ fun-declaration +| | | | | | >--+ type-specifier +| | | | | | | >--* void +| | | | | | >--* move +| | | | | | >--* ( +| | | | | | >--+ params +| | | | | | | >--+ param-list +| | | | | | | | >--+ param-list +| | | | | | | | | >--+ param +| | | | | | | | | | >--+ type-specifier +| | | | | | | | | | | >--* int +| | | | | | | | | | >--* x +| | | | | | | | >--* , +| | | | | | | | >--+ param +| | | | | | | | | >--+ type-specifier +| | | | | | | | | | >--* int +| | | | | | | | | >--* y +| | | | | | >--* ) +| | | | | | >--+ compound-stmt +| | | | | | | >--* { +| | | | | | | >--+ local-declarations +| | | | | | | | >--* epsilon +| | | | | | | >--+ statement-list +| | | | | | | | >--+ statement-list +| | | | | | | | | >--+ statement-list +| | | | | | | | | | >--+ statement-list +| | | | | | | | | | | >--+ statement-list +| | | | | | | | | | | | >--+ statement-list +| | | | | | | | | | | | | >--* epsilon +| | | | | | | | | | | | >--+ statement +| | | | | | | | | | | | | >--+ expression-stmt +| | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | >--+ call +| | | | | | | | | | | | | | | | | | | | >--* putint +| | | | | | | | | | | | | | | | | | | | >--* ( +| | | | | | | | | | | | | | | | | | | | >--+ args +| | | | | | | | | | | | | | | | | | | | | >--+ arg-list +| | | | | | | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | | | | | | | | >--* x +| | | | | | | | | | | | | | | | | | | | >--* ) +| | | | | | | | | | | | | | >--* ; +| | | | | | | | | | | >--+ statement +| | | | | | | | | | | | >--+ expression-stmt +| | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | >--+ call +| | | | | | | | | | | | | | | | | | | >--* putch +| | | | | | | | | | | | | | | | | | | >--* ( +| | | | | | | | | | | | | | | | | | | >--+ args +| | | | | | | | | | | | | | | | | | | | >--+ arg-list +| | | | | | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | | | | | | | | | | | | >--* 32 +| | | | | | | | | | | | | | | | | | | >--* ) +| | | | | | | | | | | | | >--* ; +| | | | | | | | | | >--+ statement +| | | | | | | | | | | >--+ expression-stmt +| | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | >--+ call +| | | | | | | | | | | | | | | | | | >--* putint +| | | | | | | | | | | | | | | | | | >--* ( +| | | | | | | | | | | | | | | | | | >--+ args +| | | | | | | | | | | | | | | | | | | >--+ arg-list +| | | | | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | | | | | | >--* y +| | | | | | | | | | | | | | | | | | >--* ) +| | | | | | | | | | | | >--* ; +| | | | | | | | | >--+ statement +| | | | | | | | | | >--+ expression-stmt +| | | | | | | | | | | >--+ expression +| | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | >--+ call +| | | | | | | | | | | | | | | | | >--* putch +| | | | | | | | | | | | | | | | | >--* ( +| | | | | | | | | | | | | | | | | >--+ args +| | | | | | | | | | | | | | | | | | >--+ arg-list +| | | | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | | | | | | | | | | >--* 44 +| | | | | | | | | | | | | | | | | >--* ) +| | | | | | | | | | | >--* ; +| | | | | | | | >--+ statement +| | | | | | | | | >--+ expression-stmt +| | | | | | | | | | >--+ expression +| | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | >--+ call +| | | | | | | | | | | | | | | | >--* putch +| | | | | | | | | | | | | | | | >--* ( +| | | | | | | | | | | | | | | | >--+ args +| | | | | | | | | | | | | | | | | >--+ arg-list +| | | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | | | | | | | | | >--* 32 +| | | | | | | | | | | | | | | | >--* ) +| | | | | | | | | | >--* ; +| | | | | | | >--* } +| | | >--+ declaration +| | | | >--+ fun-declaration +| | | | | >--+ type-specifier +| | | | | | >--* void +| | | | | >--* hanoi +| | | | | >--* ( +| | | | | >--+ params +| | | | | | >--+ param-list +| | | | | | | >--+ param-list +| | | | | | | | >--+ param-list +| | | | | | | | | >--+ param-list +| | | | | | | | | | >--+ param +| | | | | | | | | | | >--+ type-specifier +| | | | | | | | | | | | >--* int +| | | | | | | | | | | >--* n +| | | | | | | | | >--* , +| | | | | | | | | >--+ param +| | | | | | | | | | >--+ type-specifier +| | | | | | | | | | | >--* int +| | | | | | | | | | >--* one +| | | | | | | | >--* , +| | | | | | | | >--+ param +| | | | | | | | | >--+ type-specifier +| | | | | | | | | | >--* int +| | | | | | | | | >--* two +| | | | | | | >--* , +| | | | | | | >--+ param +| | | | | | | | >--+ type-specifier +| | | | | | | | | >--* int +| | | | | | | | >--* three +| | | | | >--* ) +| | | | | >--+ compound-stmt +| | | | | | >--* { +| | | | | | >--+ local-declarations +| | | | | | | >--* epsilon +| | | | | | >--+ statement-list +| | | | | | | >--+ statement-list +| | | | | | | | >--* epsilon +| | | | | | | >--+ statement +| | | | | | | | >--+ selection-stmt +| | | | | | | | | >--* if +| | | | | | | | | >--* ( +| | | | | | | | | >--+ expression +| | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | >--* n +| | | | | | | | | | | >--+ relop +| | | | | | | | | | | | >--* == +| | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | >--* 1 +| | | | | | | | | >--* ) +| | | | | | | | | >--+ statement +| | | | | | | | | | >--+ expression-stmt +| | | | | | | | | | | >--+ expression +| | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | >--+ call +| | | | | | | | | | | | | | | | | >--* move +| | | | | | | | | | | | | | | | | >--* ( +| | | | | | | | | | | | | | | | | >--+ args +| | | | | | | | | | | | | | | | | | >--+ arg-list +| | | | | | | | | | | | | | | | | | | >--+ arg-list +| | | | | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | | | | | | >--* one +| | | | | | | | | | | | | | | | | | | >--* , +| | | | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | | | | | >--* three +| | | | | | | | | | | | | | | | | >--* ) +| | | | | | | | | | | >--* ; +| | | | | | | | | >--* else +| | | | | | | | | >--+ statement +| | | | | | | | | | >--+ compound-stmt +| | | | | | | | | | | >--* { +| | | | | | | | | | | >--+ local-declarations +| | | | | | | | | | | | >--* epsilon +| | | | | | | | | | | >--+ statement-list +| | | | | | | | | | | | >--+ statement-list +| | | | | | | | | | | | | >--+ statement-list +| | | | | | | | | | | | | | >--+ statement-list +| | | | | | | | | | | | | | | >--* epsilon +| | | | | | | | | | | | | | >--+ statement +| | | | | | | | | | | | | | | >--+ expression-stmt +| | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | >--+ call +| | | | | | | | | | | | | | | | | | | | | | >--* hanoi +| | | | | | | | | | | | | | | | | | | | | | >--* ( +| | | | | | | | | | | | | | | | | | | | | | >--+ args +| | | | | | | | | | | | | | | | | | | | | | | >--+ arg-list +| | | | | | | | | | | | | | | | | | | | | | | | >--+ arg-list +| | | | | | | | | | | | | | | | | | | | | | | | | >--+ arg-list +| | | | | | | | | | | | | | | | | | | | | | | | | | >--+ arg-list +| | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--* n +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ addop +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--* - +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--* 1 +| | | | | | | | | | | | | | | | | | | | | | | | | | >--* , +| | | | | | | | | | | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--* one +| | | | | | | | | | | | | | | | | | | | | | | | | >--* , +| | | | | | | | | | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--* three +| | | | | | | | | | | | | | | | | | | | | | | | >--* , +| | | | | | | | | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--* two +| | | | | | | | | | | | | | | | | | | | | | >--* ) +| | | | | | | | | | | | | | | | >--* ; +| | | | | | | | | | | | | >--+ statement +| | | | | | | | | | | | | | >--+ expression-stmt +| | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | >--+ call +| | | | | | | | | | | | | | | | | | | | | >--* move +| | | | | | | | | | | | | | | | | | | | | >--* ( +| | | | | | | | | | | | | | | | | | | | | >--+ args +| | | | | | | | | | | | | | | | | | | | | | >--+ arg-list +| | | | | | | | | | | | | | | | | | | | | | | >--+ arg-list +| | | | | | | | | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--* one +| | | | | | | | | | | | | | | | | | | | | | | >--* , +| | | | | | | | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--* three +| | | | | | | | | | | | | | | | | | | | | >--* ) +| | | | | | | | | | | | | | | >--* ; +| | | | | | | | | | | | >--+ statement +| | | | | | | | | | | | | >--+ expression-stmt +| | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | >--+ call +| | | | | | | | | | | | | | | | | | | | >--* hanoi +| | | | | | | | | | | | | | | | | | | | >--* ( +| | | | | | | | | | | | | | | | | | | | >--+ args +| | | | | | | | | | | | | | | | | | | | | >--+ arg-list +| | | | | | | | | | | | | | | | | | | | | | >--+ arg-list +| | | | | | | | | | | | | | | | | | | | | | | >--+ arg-list +| | | | | | | | | | | | | | | | | | | | | | | | >--+ arg-list +| | | | | | | | | | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--* n +| | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ addop +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--* - +| | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--* 1 +| | | | | | | | | | | | | | | | | | | | | | | | >--* , +| | | | | | | | | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--* two +| | | | | | | | | | | | | | | | | | | | | | | >--* , +| | | | | | | | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--* one +| | | | | | | | | | | | | | | | | | | | | | >--* , +| | | | | | | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | | | | | | | | >--* three +| | | | | | | | | | | | | | | | | | | | >--* ) +| | | | | | | | | | | | | | >--* ; +| | | | | | | | | | | >--* } +| | | | | | >--* } +| | >--+ declaration +| | | >--+ fun-declaration +| | | | >--+ type-specifier +| | | | | >--* int +| | | | >--* main +| | | | >--* ( +| | | | >--+ params +| | | | | >--* void +| | | | >--* ) +| | | | >--+ compound-stmt +| | | | | >--* { +| | | | | >--+ local-declarations +| | | | | | >--+ local-declarations +| | | | | | | >--* epsilon +| | | | | | >--+ var-declaration +| | | | | | | >--+ type-specifier +| | | | | | | | >--* int +| | | | | | | >--* n +| | | | | | | >--* ; +| | | | | >--+ statement-list +| | | | | | >--+ statement-list +| | | | | | | >--+ statement-list +| | | | | | | | >--+ statement-list +| | | | | | | | | >--* epsilon +| | | | | | | | >--+ statement +| | | | | | | | | >--+ expression-stmt +| | | | | | | | | | >--+ expression +| | | | | | | | | | | >--+ var +| | | | | | | | | | | | >--* n +| | | | | | | | | | | >--* = +| | | | | | | | | | | >--+ expression +| | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | >--+ call +| | | | | | | | | | | | | | | | | >--* getint +| | | | | | | | | | | | | | | | | >--* ( +| | | | | | | | | | | | | | | | | >--+ args +| | | | | | | | | | | | | | | | | | >--* epsilon +| | | | | | | | | | | | | | | | | >--* ) +| | | | | | | | | | >--* ; +| | | | | | | >--+ statement +| | | | | | | | >--+ iteration-stmt +| | | | | | | | | >--* while +| | | | | | | | | >--* ( +| | | | | | | | | >--+ expression +| | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | >--* n +| | | | | | | | | | | >--+ relop +| | | | | | | | | | | | >--* > +| | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | >--* 0 +| | | | | | | | | >--* ) +| | | | | | | | | >--+ statement +| | | | | | | | | | >--+ compound-stmt +| | | | | | | | | | | >--* { +| | | | | | | | | | | >--+ local-declarations +| | | | | | | | | | | | >--* epsilon +| | | | | | | | | | | >--+ statement-list +| | | | | | | | | | | | >--+ statement-list +| | | | | | | | | | | | | >--+ statement-list +| | | | | | | | | | | | | | >--+ statement-list +| | | | | | | | | | | | | | | >--* epsilon +| | | | | | | | | | | | | | >--+ statement +| | | | | | | | | | | | | | | >--+ expression-stmt +| | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | >--+ call +| | | | | | | | | | | | | | | | | | | | | | >--* hanoi +| | | | | | | | | | | | | | | | | | | | | | >--* ( +| | | | | | | | | | | | | | | | | | | | | | >--+ args +| | | | | | | | | | | | | | | | | | | | | | | >--+ arg-list +| | | | | | | | | | | | | | | | | | | | | | | | >--+ arg-list +| | | | | | | | | | | | | | | | | | | | | | | | | >--+ arg-list +| | | | | | | | | | | | | | | | | | | | | | | | | | >--+ arg-list +| | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ call +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--* getint +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--* ( +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ args +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--* epsilon +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--* ) +| | | | | | | | | | | | | | | | | | | | | | | | | | >--* , +| | | | | | | | | | | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--* 1 +| | | | | | | | | | | | | | | | | | | | | | | | | >--* , +| | | | | | | | | | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--* 2 +| | | | | | | | | | | | | | | | | | | | | | | | >--* , +| | | | | | | | | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--* 3 +| | | | | | | | | | | | | | | | | | | | | | >--* ) +| | | | | | | | | | | | | | | | >--* ; +| | | | | | | | | | | | | >--+ statement +| | | | | | | | | | | | | | >--+ expression-stmt +| | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | >--+ call +| | | | | | | | | | | | | | | | | | | | | >--* putch +| | | | | | | | | | | | | | | | | | | | | >--* ( +| | | | | | | | | | | | | | | | | | | | | >--+ args +| | | | | | | | | | | | | | | | | | | | | | >--+ arg-list +| | | | | | | | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--* 10 +| | | | | | | | | | | | | | | | | | | | | >--* ) +| | | | | | | | | | | | | | | >--* ; +| | | | | | | | | | | | >--+ statement +| | | | | | | | | | | | | >--+ expression-stmt +| | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | >--* n +| | | | | | | | | | | | | | | >--* = +| | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | | >--* n +| | | | | | | | | | | | | | | | | | >--+ addop +| | | | | | | | | | | | | | | | | | | >--* - +| | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | | | | | | >--* 1 +| | | | | | | | | | | | | | >--* ; +| | | | | | | | | | | >--* } +| | | | | | >--+ statement +| | | | | | | >--+ return-stmt +| | | | | | | | >--* return +| | | | | | | | >--+ expression +| | | | | | | | | >--+ simple-expression +| | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | >--+ term +| | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | >--* 0 +| | | | | | | | >--* ; +| | | | | >--* } diff --git a/tests/1-parser/output_student/hard/if.syntax_tree b/tests/1-parser/output_student/hard/if.syntax_tree new file mode 100644 index 0000000000000000000000000000000000000000..78b818cbba1feca022de2ee601bd6ff83beb63c1 --- /dev/null +++ b/tests/1-parser/output_student/hard/if.syntax_tree @@ -0,0 +1,81 @@ +>--+ program +| >--+ declaration-list +| | >--+ declaration +| | | >--+ fun-declaration +| | | | >--+ type-specifier +| | | | | >--* int +| | | | >--* main +| | | | >--* ( +| | | | >--+ params +| | | | | >--* void +| | | | >--* ) +| | | | >--+ compound-stmt +| | | | | >--* { +| | | | | >--+ local-declarations +| | | | | | >--* epsilon +| | | | | >--+ statement-list +| | | | | | >--+ statement-list +| | | | | | | >--+ statement-list +| | | | | | | | >--* epsilon +| | | | | | | >--+ statement +| | | | | | | | >--+ selection-stmt +| | | | | | | | | >--* if +| | | | | | | | | >--* ( +| | | | | | | | | >--+ expression +| | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | >--* 1 +| | | | | | | | | >--* ) +| | | | | | | | | >--+ statement +| | | | | | | | | | >--+ compound-stmt +| | | | | | | | | | | >--* { +| | | | | | | | | | | >--+ local-declarations +| | | | | | | | | | | | >--* epsilon +| | | | | | | | | | | >--+ statement-list +| | | | | | | | | | | | >--* epsilon +| | | | | | | | | | | >--* } +| | | | | | | | | >--* else +| | | | | | | | | >--+ statement +| | | | | | | | | | >--+ selection-stmt +| | | | | | | | | | | >--* if +| | | | | | | | | | | >--* ( +| | | | | | | | | | | >--+ expression +| | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | | >--* 2 +| | | | | | | | | | | >--* ) +| | | | | | | | | | | >--+ statement +| | | | | | | | | | | | >--+ compound-stmt +| | | | | | | | | | | | | >--* { +| | | | | | | | | | | | | >--+ local-declarations +| | | | | | | | | | | | | | >--* epsilon +| | | | | | | | | | | | | >--+ statement-list +| | | | | | | | | | | | | | >--* epsilon +| | | | | | | | | | | | | >--* } +| | | | | | | | | | | >--* else +| | | | | | | | | | | >--+ statement +| | | | | | | | | | | | >--+ compound-stmt +| | | | | | | | | | | | | >--* { +| | | | | | | | | | | | | >--+ local-declarations +| | | | | | | | | | | | | | >--* epsilon +| | | | | | | | | | | | | >--+ statement-list +| | | | | | | | | | | | | | >--* epsilon +| | | | | | | | | | | | | >--* } +| | | | | | >--+ statement +| | | | | | | >--+ return-stmt +| | | | | | | | >--* return +| | | | | | | | >--+ expression +| | | | | | | | | >--+ simple-expression +| | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | >--+ term +| | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | >--* 0 +| | | | | | | | >--* ; +| | | | | >--* } diff --git a/tests/1-parser/output_student/hard/selectionsort.syntax_tree b/tests/1-parser/output_student/hard/selectionsort.syntax_tree new file mode 100644 index 0000000000000000000000000000000000000000..6eb1dcc64c61cc6ffa45903005fb4e80246a3f26 --- /dev/null +++ b/tests/1-parser/output_student/hard/selectionsort.syntax_tree @@ -0,0 +1,765 @@ +>--+ program +| >--+ declaration-list +| | >--+ declaration-list +| | | >--+ declaration-list +| | | | >--+ declaration-list +| | | | | >--+ declaration +| | | | | | >--+ var-declaration +| | | | | | | >--+ type-specifier +| | | | | | | | >--* int +| | | | | | | >--* x +| | | | | | | >--* [ +| | | | | | | >--* 10 +| | | | | | | >--* ] +| | | | | | | >--* ; +| | | | >--+ declaration +| | | | | >--+ fun-declaration +| | | | | | >--+ type-specifier +| | | | | | | >--* int +| | | | | | >--* minloc +| | | | | | >--* ( +| | | | | | >--+ params +| | | | | | | >--+ param-list +| | | | | | | | >--+ param-list +| | | | | | | | | >--+ param-list +| | | | | | | | | | >--+ param +| | | | | | | | | | | >--+ type-specifier +| | | | | | | | | | | | >--* int +| | | | | | | | | | | >--* a +| | | | | | | | | | | >--* [ +| | | | | | | | | | | >--* ] +| | | | | | | | | >--* , +| | | | | | | | | >--+ param +| | | | | | | | | | >--+ type-specifier +| | | | | | | | | | | >--* int +| | | | | | | | | | >--* low +| | | | | | | | >--* , +| | | | | | | | >--+ param +| | | | | | | | | >--+ type-specifier +| | | | | | | | | | >--* int +| | | | | | | | | >--* high +| | | | | | >--* ) +| | | | | | >--+ compound-stmt +| | | | | | | >--* { +| | | | | | | >--+ local-declarations +| | | | | | | | >--+ local-declarations +| | | | | | | | | >--+ local-declarations +| | | | | | | | | | >--+ local-declarations +| | | | | | | | | | | >--* epsilon +| | | | | | | | | | >--+ var-declaration +| | | | | | | | | | | >--+ type-specifier +| | | | | | | | | | | | >--* int +| | | | | | | | | | | >--* i +| | | | | | | | | | | >--* ; +| | | | | | | | | >--+ var-declaration +| | | | | | | | | | >--+ type-specifier +| | | | | | | | | | | >--* int +| | | | | | | | | | >--* x +| | | | | | | | | | >--* ; +| | | | | | | | >--+ var-declaration +| | | | | | | | | >--+ type-specifier +| | | | | | | | | | >--* int +| | | | | | | | | >--* k +| | | | | | | | | >--* ; +| | | | | | | >--+ statement-list +| | | | | | | | >--+ statement-list +| | | | | | | | | >--+ statement-list +| | | | | | | | | | >--+ statement-list +| | | | | | | | | | | >--+ statement-list +| | | | | | | | | | | | >--+ statement-list +| | | | | | | | | | | | | >--* epsilon +| | | | | | | | | | | | >--+ statement +| | | | | | | | | | | | | >--+ expression-stmt +| | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | >--* k +| | | | | | | | | | | | | | | >--* = +| | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | >--* low +| | | | | | | | | | | | | | >--* ; +| | | | | | | | | | | >--+ statement +| | | | | | | | | | | | >--+ expression-stmt +| | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | >--* x +| | | | | | | | | | | | | | >--* = +| | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | >--* a +| | | | | | | | | | | | | | | | | | | | >--* [ +| | | | | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | | | | | | >--* low +| | | | | | | | | | | | | | | | | | | | >--* ] +| | | | | | | | | | | | | >--* ; +| | | | | | | | | | >--+ statement +| | | | | | | | | | | >--+ expression-stmt +| | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | >--* i +| | | | | | | | | | | | | >--* = +| | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | >--* low +| | | | | | | | | | | | | | | | >--+ addop +| | | | | | | | | | | | | | | | | >--* + +| | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | | | | >--* 1 +| | | | | | | | | | | | >--* ; +| | | | | | | | | >--+ statement +| | | | | | | | | | >--+ iteration-stmt +| | | | | | | | | | | >--* while +| | | | | | | | | | | >--* ( +| | | | | | | | | | | >--+ expression +| | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | >--* i +| | | | | | | | | | | | | >--+ relop +| | | | | | | | | | | | | | >--* < +| | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | >--* high +| | | | | | | | | | | >--* ) +| | | | | | | | | | | >--+ statement +| | | | | | | | | | | | >--+ compound-stmt +| | | | | | | | | | | | | >--* { +| | | | | | | | | | | | | >--+ local-declarations +| | | | | | | | | | | | | | >--* epsilon +| | | | | | | | | | | | | >--+ statement-list +| | | | | | | | | | | | | | >--+ statement-list +| | | | | | | | | | | | | | | >--+ statement-list +| | | | | | | | | | | | | | | | >--* epsilon +| | | | | | | | | | | | | | | >--+ statement +| | | | | | | | | | | | | | | | >--+ selection-stmt +| | | | | | | | | | | | | | | | | >--* if +| | | | | | | | | | | | | | | | | >--* ( +| | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | | | >--* a +| | | | | | | | | | | | | | | | | | | | | | | >--* [ +| | | | | | | | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--* i +| | | | | | | | | | | | | | | | | | | | | | | >--* ] +| | | | | | | | | | | | | | | | | | | >--+ relop +| | | | | | | | | | | | | | | | | | | | >--* < +| | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | | | >--* x +| | | | | | | | | | | | | | | | | >--* ) +| | | | | | | | | | | | | | | | | >--+ statement +| | | | | | | | | | | | | | | | | | >--+ compound-stmt +| | | | | | | | | | | | | | | | | | | >--* { +| | | | | | | | | | | | | | | | | | | >--+ local-declarations +| | | | | | | | | | | | | | | | | | | | >--* epsilon +| | | | | | | | | | | | | | | | | | | >--+ statement-list +| | | | | | | | | | | | | | | | | | | | >--+ statement-list +| | | | | | | | | | | | | | | | | | | | | >--+ statement-list +| | | | | | | | | | | | | | | | | | | | | | >--* epsilon +| | | | | | | | | | | | | | | | | | | | | >--+ statement +| | | | | | | | | | | | | | | | | | | | | | >--+ expression-stmt +| | | | | | | | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | | | | | >--* x +| | | | | | | | | | | | | | | | | | | | | | | | >--* = +| | | | | | | | | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--* a +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--* [ +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--* i +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--* ] +| | | | | | | | | | | | | | | | | | | | | | | >--* ; +| | | | | | | | | | | | | | | | | | | | >--+ statement +| | | | | | | | | | | | | | | | | | | | | >--+ expression-stmt +| | | | | | | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | | | | >--* k +| | | | | | | | | | | | | | | | | | | | | | | >--* = +| | | | | | | | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--* i +| | | | | | | | | | | | | | | | | | | | | | >--* ; +| | | | | | | | | | | | | | | | | | | >--* } +| | | | | | | | | | | | | | >--+ statement +| | | | | | | | | | | | | | | >--+ expression-stmt +| | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | >--* i +| | | | | | | | | | | | | | | | | >--* = +| | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | | | | >--* i +| | | | | | | | | | | | | | | | | | | | >--+ addop +| | | | | | | | | | | | | | | | | | | | | >--* + +| | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | | | | | | | | >--* 1 +| | | | | | | | | | | | | | | | >--* ; +| | | | | | | | | | | | | >--* } +| | | | | | | | >--+ statement +| | | | | | | | | >--+ return-stmt +| | | | | | | | | | >--* return +| | | | | | | | | | >--+ expression +| | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | >--* k +| | | | | | | | | | >--* ; +| | | | | | | >--* } +| | | >--+ declaration +| | | | >--+ fun-declaration +| | | | | >--+ type-specifier +| | | | | | >--* void +| | | | | >--* sort +| | | | | >--* ( +| | | | | >--+ params +| | | | | | >--+ param-list +| | | | | | | >--+ param-list +| | | | | | | | >--+ param-list +| | | | | | | | | >--+ param +| | | | | | | | | | >--+ type-specifier +| | | | | | | | | | | >--* int +| | | | | | | | | | >--* a +| | | | | | | | | | >--* [ +| | | | | | | | | | >--* ] +| | | | | | | | >--* , +| | | | | | | | >--+ param +| | | | | | | | | >--+ type-specifier +| | | | | | | | | | >--* int +| | | | | | | | | >--* low +| | | | | | | >--* , +| | | | | | | >--+ param +| | | | | | | | >--+ type-specifier +| | | | | | | | | >--* int +| | | | | | | | >--* high +| | | | | >--* ) +| | | | | >--+ compound-stmt +| | | | | | >--* { +| | | | | | >--+ local-declarations +| | | | | | | >--+ local-declarations +| | | | | | | | >--+ local-declarations +| | | | | | | | | >--* epsilon +| | | | | | | | >--+ var-declaration +| | | | | | | | | >--+ type-specifier +| | | | | | | | | | >--* int +| | | | | | | | | >--* i +| | | | | | | | | >--* ; +| | | | | | | >--+ var-declaration +| | | | | | | | >--+ type-specifier +| | | | | | | | | >--* int +| | | | | | | | >--* k +| | | | | | | | >--* ; +| | | | | | >--+ statement-list +| | | | | | | >--+ statement-list +| | | | | | | | >--+ statement-list +| | | | | | | | | >--* epsilon +| | | | | | | | >--+ statement +| | | | | | | | | >--+ expression-stmt +| | | | | | | | | | >--+ expression +| | | | | | | | | | | >--+ var +| | | | | | | | | | | | >--* i +| | | | | | | | | | | >--* = +| | | | | | | | | | | >--+ expression +| | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | >--* low +| | | | | | | | | | >--* ; +| | | | | | | >--+ statement +| | | | | | | | >--+ iteration-stmt +| | | | | | | | | >--* while +| | | | | | | | | >--* ( +| | | | | | | | | >--+ expression +| | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | >--* i +| | | | | | | | | | | >--+ relop +| | | | | | | | | | | | >--* < +| | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | >--* high +| | | | | | | | | | | | >--+ addop +| | | | | | | | | | | | | >--* - +| | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | >--* 1 +| | | | | | | | | >--* ) +| | | | | | | | | >--+ statement +| | | | | | | | | | >--+ compound-stmt +| | | | | | | | | | | >--* { +| | | | | | | | | | | >--+ local-declarations +| | | | | | | | | | | | >--+ local-declarations +| | | | | | | | | | | | | >--* epsilon +| | | | | | | | | | | | >--+ var-declaration +| | | | | | | | | | | | | >--+ type-specifier +| | | | | | | | | | | | | | >--* int +| | | | | | | | | | | | | >--* t +| | | | | | | | | | | | | >--* ; +| | | | | | | | | | | >--+ statement-list +| | | | | | | | | | | | >--+ statement-list +| | | | | | | | | | | | | >--+ statement-list +| | | | | | | | | | | | | | >--+ statement-list +| | | | | | | | | | | | | | | >--+ statement-list +| | | | | | | | | | | | | | | | >--+ statement-list +| | | | | | | | | | | | | | | | | >--* epsilon +| | | | | | | | | | | | | | | | >--+ statement +| | | | | | | | | | | | | | | | | >--+ expression-stmt +| | | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | >--* k +| | | | | | | | | | | | | | | | | | | >--* = +| | | | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | | >--+ call +| | | | | | | | | | | | | | | | | | | | | | | | | >--* minloc +| | | | | | | | | | | | | | | | | | | | | | | | | >--* ( +| | | | | | | | | | | | | | | | | | | | | | | | | >--+ args +| | | | | | | | | | | | | | | | | | | | | | | | | | >--+ arg-list +| | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ arg-list +| | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ arg-list +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--* a +| | | | | | | | | | | | | | | | | | | | | | | | | | | | >--* , +| | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--* i +| | | | | | | | | | | | | | | | | | | | | | | | | | | >--* , +| | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--* high +| | | | | | | | | | | | | | | | | | | | | | | | | >--* ) +| | | | | | | | | | | | | | | | | | >--* ; +| | | | | | | | | | | | | | | >--+ statement +| | | | | | | | | | | | | | | | >--+ expression-stmt +| | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | >--* t +| | | | | | | | | | | | | | | | | | >--* = +| | | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | | | | >--* a +| | | | | | | | | | | | | | | | | | | | | | | | >--* [ +| | | | | | | | | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--* k +| | | | | | | | | | | | | | | | | | | | | | | | >--* ] +| | | | | | | | | | | | | | | | | >--* ; +| | | | | | | | | | | | | | >--+ statement +| | | | | | | | | | | | | | | >--+ expression-stmt +| | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | >--* a +| | | | | | | | | | | | | | | | | | >--* [ +| | | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | | | | >--* k +| | | | | | | | | | | | | | | | | | >--* ] +| | | | | | | | | | | | | | | | | >--* = +| | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | | | >--* a +| | | | | | | | | | | | | | | | | | | | | | | >--* [ +| | | | | | | | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--* i +| | | | | | | | | | | | | | | | | | | | | | | >--* ] +| | | | | | | | | | | | | | | | >--* ; +| | | | | | | | | | | | | >--+ statement +| | | | | | | | | | | | | | >--+ expression-stmt +| | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | >--* a +| | | | | | | | | | | | | | | | | >--* [ +| | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | | | >--* i +| | | | | | | | | | | | | | | | | >--* ] +| | | | | | | | | | | | | | | | >--* = +| | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | | >--* t +| | | | | | | | | | | | | | | >--* ; +| | | | | | | | | | | | >--+ statement +| | | | | | | | | | | | | >--+ expression-stmt +| | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | >--* i +| | | | | | | | | | | | | | | >--* = +| | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | | >--* i +| | | | | | | | | | | | | | | | | | >--+ addop +| | | | | | | | | | | | | | | | | | | >--* + +| | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | | | | | | >--* 1 +| | | | | | | | | | | | | | >--* ; +| | | | | | | | | | | >--* } +| | | | | | >--* } +| | >--+ declaration +| | | >--+ fun-declaration +| | | | >--+ type-specifier +| | | | | >--* void +| | | | >--* main +| | | | >--* ( +| | | | >--+ params +| | | | | >--* void +| | | | >--* ) +| | | | >--+ compound-stmt +| | | | | >--* { +| | | | | >--+ local-declarations +| | | | | | >--+ local-declarations +| | | | | | | >--* epsilon +| | | | | | >--+ var-declaration +| | | | | | | >--+ type-specifier +| | | | | | | | >--* int +| | | | | | | >--* i +| | | | | | | >--* ; +| | | | | >--+ statement-list +| | | | | | >--+ statement-list +| | | | | | | >--+ statement-list +| | | | | | | | >--+ statement-list +| | | | | | | | | >--+ statement-list +| | | | | | | | | | >--+ statement-list +| | | | | | | | | | | >--* epsilon +| | | | | | | | | | >--+ statement +| | | | | | | | | | | >--+ expression-stmt +| | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | >--* i +| | | | | | | | | | | | | >--* = +| | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | | | | >--* 0 +| | | | | | | | | | | | >--* ; +| | | | | | | | | >--+ statement +| | | | | | | | | | >--+ iteration-stmt +| | | | | | | | | | | >--* while +| | | | | | | | | | | >--* ( +| | | | | | | | | | | >--+ expression +| | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | >--* i +| | | | | | | | | | | | | >--+ relop +| | | | | | | | | | | | | | >--* < +| | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | | >--* 10 +| | | | | | | | | | | >--* ) +| | | | | | | | | | | >--+ statement +| | | | | | | | | | | | >--+ compound-stmt +| | | | | | | | | | | | | >--* { +| | | | | | | | | | | | | >--+ local-declarations +| | | | | | | | | | | | | | >--* epsilon +| | | | | | | | | | | | | >--+ statement-list +| | | | | | | | | | | | | | >--+ statement-list +| | | | | | | | | | | | | | | >--+ statement-list +| | | | | | | | | | | | | | | | >--* epsilon +| | | | | | | | | | | | | | | >--+ statement +| | | | | | | | | | | | | | | | >--+ expression-stmt +| | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | >--* x +| | | | | | | | | | | | | | | | | | | >--* [ +| | | | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | | | | | >--* i +| | | | | | | | | | | | | | | | | | | >--* ] +| | | | | | | | | | | | | | | | | | >--* = +| | | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | >--+ call +| | | | | | | | | | | | | | | | | | | | | | | | >--* input +| | | | | | | | | | | | | | | | | | | | | | | | >--* ( +| | | | | | | | | | | | | | | | | | | | | | | | >--+ args +| | | | | | | | | | | | | | | | | | | | | | | | | >--* epsilon +| | | | | | | | | | | | | | | | | | | | | | | | >--* ) +| | | | | | | | | | | | | | | | | >--* ; +| | | | | | | | | | | | | | >--+ statement +| | | | | | | | | | | | | | | >--+ expression-stmt +| | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | >--* i +| | | | | | | | | | | | | | | | | >--* = +| | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | | | | >--* i +| | | | | | | | | | | | | | | | | | | | >--+ addop +| | | | | | | | | | | | | | | | | | | | | >--* + +| | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | | | | | | | | >--* 1 +| | | | | | | | | | | | | | | | >--* ; +| | | | | | | | | | | | | >--* } +| | | | | | | | >--+ statement +| | | | | | | | | >--+ expression-stmt +| | | | | | | | | | >--+ expression +| | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | >--+ call +| | | | | | | | | | | | | | | | >--* sort +| | | | | | | | | | | | | | | | >--* ( +| | | | | | | | | | | | | | | | >--+ args +| | | | | | | | | | | | | | | | | >--+ arg-list +| | | | | | | | | | | | | | | | | | >--+ arg-list +| | | | | | | | | | | | | | | | | | | >--+ arg-list +| | | | | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | | | | | | >--* x +| | | | | | | | | | | | | | | | | | | >--* , +| | | | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | | | | | | | | | | >--* 0 +| | | | | | | | | | | | | | | | | | >--* , +| | | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | | | | | | | | | >--* 10 +| | | | | | | | | | | | | | | | >--* ) +| | | | | | | | | | >--* ; +| | | | | | | >--+ statement +| | | | | | | | >--+ expression-stmt +| | | | | | | | | >--+ expression +| | | | | | | | | | >--+ var +| | | | | | | | | | | >--* i +| | | | | | | | | | >--* = +| | | | | | | | | | >--+ expression +| | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | >--* 0 +| | | | | | | | | >--* ; +| | | | | | >--+ statement +| | | | | | | >--+ iteration-stmt +| | | | | | | | >--* while +| | | | | | | | >--* ( +| | | | | | | | >--+ expression +| | | | | | | | | >--+ simple-expression +| | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | >--+ term +| | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | >--* i +| | | | | | | | | | >--+ relop +| | | | | | | | | | | >--* < +| | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | >--+ term +| | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | >--* 10 +| | | | | | | | >--* ) +| | | | | | | | >--+ statement +| | | | | | | | | >--+ compound-stmt +| | | | | | | | | | >--* { +| | | | | | | | | | >--+ local-declarations +| | | | | | | | | | | >--* epsilon +| | | | | | | | | | >--+ statement-list +| | | | | | | | | | | >--+ statement-list +| | | | | | | | | | | | >--+ statement-list +| | | | | | | | | | | | | >--* epsilon +| | | | | | | | | | | | >--+ statement +| | | | | | | | | | | | | >--+ expression-stmt +| | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | >--+ call +| | | | | | | | | | | | | | | | | | | | >--* output +| | | | | | | | | | | | | | | | | | | | >--* ( +| | | | | | | | | | | | | | | | | | | | >--+ args +| | | | | | | | | | | | | | | | | | | | | >--+ arg-list +| | | | | | | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | | | | | | | | >--* x +| | | | | | | | | | | | | | | | | | | | | | | | | | | | >--* [ +| | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--* i +| | | | | | | | | | | | | | | | | | | | | | | | | | | | >--* ] +| | | | | | | | | | | | | | | | | | | | >--* ) +| | | | | | | | | | | | | | >--* ; +| | | | | | | | | | | >--+ statement +| | | | | | | | | | | | >--+ expression-stmt +| | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | >--* i +| | | | | | | | | | | | | | >--* = +| | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | >--* i +| | | | | | | | | | | | | | | | | >--+ addop +| | | | | | | | | | | | | | | | | | >--* + +| | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | | | | | >--* 1 +| | | | | | | | | | | | | >--* ; +| | | | | | | | | | >--* } +| | | | | >--* } diff --git a/tests/1-parser/output_student/normal/FAIL_assign.syntax_tree b/tests/1-parser/output_student/normal/FAIL_assign.syntax_tree new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tests/1-parser/output_student/normal/FAIL_local-decl.syntax_tree b/tests/1-parser/output_student/normal/FAIL_local-decl.syntax_tree new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tests/1-parser/output_student/normal/array.syntax_tree b/tests/1-parser/output_student/normal/array.syntax_tree new file mode 100644 index 0000000000000000000000000000000000000000..d5b549b2c72bf910f81a4fc7b6a6da1efa50af81 --- /dev/null +++ b/tests/1-parser/output_student/normal/array.syntax_tree @@ -0,0 +1,63 @@ +>--+ program +| >--+ declaration-list +| | >--+ declaration +| | | >--+ fun-declaration +| | | | >--+ type-specifier +| | | | | >--* int +| | | | >--* main +| | | | >--* ( +| | | | >--+ params +| | | | | >--* void +| | | | >--* ) +| | | | >--+ compound-stmt +| | | | | >--* { +| | | | | >--+ local-declarations +| | | | | | >--+ local-declarations +| | | | | | | >--* epsilon +| | | | | | >--+ var-declaration +| | | | | | | >--+ type-specifier +| | | | | | | | >--* int +| | | | | | | >--* array +| | | | | | | >--* [ +| | | | | | | >--* 1 +| | | | | | | >--* ] +| | | | | | | >--* ; +| | | | | >--+ statement-list +| | | | | | >--+ statement-list +| | | | | | | >--+ statement-list +| | | | | | | | >--* epsilon +| | | | | | | >--+ statement +| | | | | | | | >--+ expression-stmt +| | | | | | | | | >--+ expression +| | | | | | | | | | >--+ var +| | | | | | | | | | | >--* array +| | | | | | | | | | | >--* [ +| | | | | | | | | | | >--+ expression +| | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | | >--* 1 +| | | | | | | | | | | >--* ] +| | | | | | | | | | >--* = +| | | | | | | | | | >--+ expression +| | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | >--* 0 +| | | | | | | | | >--* ; +| | | | | | >--+ statement +| | | | | | | >--+ return-stmt +| | | | | | | | >--* return +| | | | | | | | >--+ expression +| | | | | | | | | >--+ simple-expression +| | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | >--+ term +| | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | >--* 0 +| | | | | | | | >--* ; +| | | | | >--* } diff --git a/tests/1-parser/output_student/normal/func.syntax_tree b/tests/1-parser/output_student/normal/func.syntax_tree new file mode 100644 index 0000000000000000000000000000000000000000..6464b70de3afa0c9c27e22ace2a23862a9d2b44a --- /dev/null +++ b/tests/1-parser/output_student/normal/func.syntax_tree @@ -0,0 +1,71 @@ +>--+ program +| >--+ declaration-list +| | >--+ declaration-list +| | | >--+ declaration +| | | | >--+ fun-declaration +| | | | | >--+ type-specifier +| | | | | | >--* float +| | | | | >--* foo +| | | | | >--* ( +| | | | | >--+ params +| | | | | | >--+ param-list +| | | | | | | >--+ param-list +| | | | | | | | >--+ param +| | | | | | | | | >--+ type-specifier +| | | | | | | | | | >--* float +| | | | | | | | | >--* a +| | | | | | | >--* , +| | | | | | | >--+ param +| | | | | | | | >--+ type-specifier +| | | | | | | | | >--* float +| | | | | | | | >--* b +| | | | | | | | >--* [ +| | | | | | | | >--* ] +| | | | | >--* ) +| | | | | >--+ compound-stmt +| | | | | | >--* { +| | | | | | >--+ local-declarations +| | | | | | | >--* epsilon +| | | | | | >--+ statement-list +| | | | | | | >--+ statement-list +| | | | | | | | >--* epsilon +| | | | | | | >--+ statement +| | | | | | | | >--+ return-stmt +| | | | | | | | | >--* return +| | | | | | | | | >--+ expression +| | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | >--* 1 +| | | | | | | | | >--* ; +| | | | | | >--* } +| | >--+ declaration +| | | >--+ fun-declaration +| | | | >--+ type-specifier +| | | | | >--* int +| | | | >--* main +| | | | >--* ( +| | | | >--+ params +| | | | | >--* void +| | | | >--* ) +| | | | >--+ compound-stmt +| | | | | >--* { +| | | | | >--+ local-declarations +| | | | | | >--* epsilon +| | | | | >--+ statement-list +| | | | | | >--+ statement-list +| | | | | | | >--* epsilon +| | | | | | >--+ statement +| | | | | | | >--+ return-stmt +| | | | | | | | >--* return +| | | | | | | | >--+ expression +| | | | | | | | | >--+ simple-expression +| | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | >--+ term +| | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | >--* 0 +| | | | | | | | >--* ; +| | | | | >--* } diff --git a/tests/1-parser/output_student/normal/if.syntax_tree b/tests/1-parser/output_student/normal/if.syntax_tree new file mode 100644 index 0000000000000000000000000000000000000000..d239b5cde83ffa94dc5a13eafcec2ef0f1176669 --- /dev/null +++ b/tests/1-parser/output_student/normal/if.syntax_tree @@ -0,0 +1,147 @@ +>--+ program +| >--+ declaration-list +| | >--+ declaration +| | | >--+ fun-declaration +| | | | >--+ type-specifier +| | | | | >--* int +| | | | >--* main +| | | | >--* ( +| | | | >--+ params +| | | | | >--* void +| | | | >--* ) +| | | | >--+ compound-stmt +| | | | | >--* { +| | | | | >--+ local-declarations +| | | | | | >--+ local-declarations +| | | | | | | >--+ local-declarations +| | | | | | | | >--* epsilon +| | | | | | | >--+ var-declaration +| | | | | | | | >--+ type-specifier +| | | | | | | | | >--* int +| | | | | | | | >--* a +| | | | | | | | >--* ; +| | | | | | >--+ var-declaration +| | | | | | | >--+ type-specifier +| | | | | | | | >--* int +| | | | | | | >--* b +| | | | | | | >--* ; +| | | | | >--+ statement-list +| | | | | | >--+ statement-list +| | | | | | | >--+ statement-list +| | | | | | | | >--+ statement-list +| | | | | | | | | >--+ statement-list +| | | | | | | | | | >--* epsilon +| | | | | | | | | >--+ statement +| | | | | | | | | | >--+ expression-stmt +| | | | | | | | | | | >--+ expression +| | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | >--* a +| | | | | | | | | | | | >--* = +| | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | | | >--* 1 +| | | | | | | | | | | >--* ; +| | | | | | | | >--+ statement +| | | | | | | | | >--+ expression-stmt +| | | | | | | | | | >--+ expression +| | | | | | | | | | | >--+ var +| | | | | | | | | | | | >--* b +| | | | | | | | | | | >--* = +| | | | | | | | | | | >--+ expression +| | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | | >--* 1 +| | | | | | | | | | >--* ; +| | | | | | | >--+ statement +| | | | | | | | >--+ selection-stmt +| | | | | | | | | >--* if +| | | | | | | | | >--* ( +| | | | | | | | | >--+ expression +| | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | >--* a +| | | | | | | | | | | >--+ relop +| | | | | | | | | | | | >--* != +| | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | >--* b +| | | | | | | | | >--* ) +| | | | | | | | | >--+ statement +| | | | | | | | | | >--+ compound-stmt +| | | | | | | | | | | >--* { +| | | | | | | | | | | >--+ local-declarations +| | | | | | | | | | | | >--* epsilon +| | | | | | | | | | | >--+ statement-list +| | | | | | | | | | | | >--+ statement-list +| | | | | | | | | | | | | >--* epsilon +| | | | | | | | | | | | >--+ statement +| | | | | | | | | | | | | >--+ selection-stmt +| | | | | | | | | | | | | | >--* if +| | | | | | | | | | | | | | >--* ( +| | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | >--* a +| | | | | | | | | | | | | | | | >--+ relop +| | | | | | | | | | | | | | | | | >--* == +| | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | >--* b +| | | | | | | | | | | | | | >--* ) +| | | | | | | | | | | | | | >--+ statement +| | | | | | | | | | | | | | | >--+ expression-stmt +| | | | | | | | | | | | | | | | >--* ; +| | | | | | | | | | | | | | >--* else +| | | | | | | | | | | | | | >--+ statement +| | | | | | | | | | | | | | | >--+ compound-stmt +| | | | | | | | | | | | | | | | >--* { +| | | | | | | | | | | | | | | | >--+ local-declarations +| | | | | | | | | | | | | | | | | >--* epsilon +| | | | | | | | | | | | | | | | >--+ statement-list +| | | | | | | | | | | | | | | | | >--+ statement-list +| | | | | | | | | | | | | | | | | | >--* epsilon +| | | | | | | | | | | | | | | | | >--+ statement +| | | | | | | | | | | | | | | | | | >--+ expression-stmt +| | | | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | >--* a +| | | | | | | | | | | | | | | | | | | | >--* = +| | | | | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | | | | | | >--* b +| | | | | | | | | | | | | | | | | | | >--* ; +| | | | | | | | | | | | | | | | >--* } +| | | | | | | | | | | >--* } +| | | | | | >--+ statement +| | | | | | | >--+ return-stmt +| | | | | | | | >--* return +| | | | | | | | >--+ expression +| | | | | | | | | >--+ simple-expression +| | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | >--+ term +| | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | >--* 0 +| | | | | | | | >--* ; +| | | | | >--* } diff --git a/tests/1-parser/output_student/normal/local-decl.syntax_tree b/tests/1-parser/output_student/normal/local-decl.syntax_tree new file mode 100644 index 0000000000000000000000000000000000000000..de7614ac3d375ee1914f93adb84cb5a915842a87 --- /dev/null +++ b/tests/1-parser/output_student/normal/local-decl.syntax_tree @@ -0,0 +1,48 @@ +>--+ program +| >--+ declaration-list +| | >--+ declaration +| | | >--+ fun-declaration +| | | | >--+ type-specifier +| | | | | >--* int +| | | | >--* main +| | | | >--* ( +| | | | >--+ params +| | | | | >--* void +| | | | >--* ) +| | | | >--+ compound-stmt +| | | | | >--* { +| | | | | >--+ local-declarations +| | | | | | >--+ local-declarations +| | | | | | | >--+ local-declarations +| | | | | | | | >--+ local-declarations +| | | | | | | | | >--* epsilon +| | | | | | | | >--+ var-declaration +| | | | | | | | | >--+ type-specifier +| | | | | | | | | | >--* int +| | | | | | | | | >--* i +| | | | | | | | | >--* ; +| | | | | | | >--+ var-declaration +| | | | | | | | >--+ type-specifier +| | | | | | | | | >--* float +| | | | | | | | >--* j +| | | | | | | | >--* ; +| | | | | | >--+ var-declaration +| | | | | | | >--+ type-specifier +| | | | | | | | >--* void +| | | | | | | >--* v +| | | | | | | >--* ; +| | | | | >--+ statement-list +| | | | | | >--+ statement-list +| | | | | | | >--* epsilon +| | | | | | >--+ statement +| | | | | | | >--+ return-stmt +| | | | | | | | >--* return +| | | | | | | | >--+ expression +| | | | | | | | | >--+ simple-expression +| | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | >--+ term +| | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | >--* 0 +| | | | | | | | >--* ; +| | | | | >--* } diff --git a/tests/1-parser/output_student/normal/skip_spaces.syntax_tree b/tests/1-parser/output_student/normal/skip_spaces.syntax_tree new file mode 100644 index 0000000000000000000000000000000000000000..781d45be1d026d23f72a0ae4eb531fb1e17bb254 --- /dev/null +++ b/tests/1-parser/output_student/normal/skip_spaces.syntax_tree @@ -0,0 +1,237 @@ +>--+ program +| >--+ declaration-list +| | >--+ declaration +| | | >--+ fun-declaration +| | | | >--+ type-specifier +| | | | | >--* int +| | | | >--* main +| | | | >--* ( +| | | | >--+ params +| | | | | >--* void +| | | | >--* ) +| | | | >--+ compound-stmt +| | | | | >--* { +| | | | | >--+ local-declarations +| | | | | | >--+ local-declarations +| | | | | | | >--+ local-declarations +| | | | | | | | >--+ local-declarations +| | | | | | | | | >--* epsilon +| | | | | | | | >--+ var-declaration +| | | | | | | | | >--+ type-specifier +| | | | | | | | | | >--* int +| | | | | | | | | >--* arr +| | | | | | | | | >--* [ +| | | | | | | | | >--* 100 +| | | | | | | | | >--* ] +| | | | | | | | | >--* ; +| | | | | | | >--+ var-declaration +| | | | | | | | >--+ type-specifier +| | | | | | | | | >--* int +| | | | | | | | >--* i +| | | | | | | | >--* ; +| | | | | | >--+ var-declaration +| | | | | | | >--+ type-specifier +| | | | | | | | >--* int +| | | | | | | >--* sum +| | | | | | | >--* ; +| | | | | >--+ statement-list +| | | | | | >--+ statement-list +| | | | | | | >--+ statement-list +| | | | | | | | >--+ statement-list +| | | | | | | | | >--+ statement-list +| | | | | | | | | | >--+ statement-list +| | | | | | | | | | | >--* epsilon +| | | | | | | | | | >--+ statement +| | | | | | | | | | | >--+ expression-stmt +| | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | >--* i +| | | | | | | | | | | | | >--* = +| | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | | | | >--* 0 +| | | | | | | | | | | | >--* ; +| | | | | | | | | >--+ statement +| | | | | | | | | | >--+ expression-stmt +| | | | | | | | | | | >--+ expression +| | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | >--* sum +| | | | | | | | | | | | >--* = +| | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | | | >--* 0 +| | | | | | | | | | | >--* ; +| | | | | | | | >--+ statement +| | | | | | | | | >--+ iteration-stmt +| | | | | | | | | | >--* while +| | | | | | | | | | >--* ( +| | | | | | | | | | >--+ expression +| | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | >--+ call +| | | | | | | | | | | | | | | | >--* getint +| | | | | | | | | | | | | | | | >--* ( +| | | | | | | | | | | | | | | | >--+ args +| | | | | | | | | | | | | | | | | >--* epsilon +| | | | | | | | | | | | | | | | >--* ) +| | | | | | | | | | >--* ) +| | | | | | | | | | >--+ statement +| | | | | | | | | | | >--+ compound-stmt +| | | | | | | | | | | | >--* { +| | | | | | | | | | | | >--+ local-declarations +| | | | | | | | | | | | | >--* epsilon +| | | | | | | | | | | | >--+ statement-list +| | | | | | | | | | | | | >--+ statement-list +| | | | | | | | | | | | | | >--+ statement-list +| | | | | | | | | | | | | | | >--* epsilon +| | | | | | | | | | | | | | >--+ statement +| | | | | | | | | | | | | | | >--+ expression-stmt +| | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | >--* arr +| | | | | | | | | | | | | | | | | | >--* [ +| | | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | | | | >--* i +| | | | | | | | | | | | | | | | | | >--* ] +| | | | | | | | | | | | | | | | | >--* = +| | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | >--+ call +| | | | | | | | | | | | | | | | | | | | | | | >--* getint +| | | | | | | | | | | | | | | | | | | | | | | >--* ( +| | | | | | | | | | | | | | | | | | | | | | | >--+ args +| | | | | | | | | | | | | | | | | | | | | | | | >--* epsilon +| | | | | | | | | | | | | | | | | | | | | | | >--* ) +| | | | | | | | | | | | | | | | >--* ; +| | | | | | | | | | | | | >--+ statement +| | | | | | | | | | | | | | >--+ expression-stmt +| | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | >--* i +| | | | | | | | | | | | | | | | >--* = +| | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | | | >--* i +| | | | | | | | | | | | | | | | | | | >--+ addop +| | | | | | | | | | | | | | | | | | | | >--* + +| | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | | | | | | | >--* 1 +| | | | | | | | | | | | | | | >--* ; +| | | | | | | | | | | | >--* } +| | | | | | | >--+ statement +| | | | | | | | >--+ iteration-stmt +| | | | | | | | | >--* while +| | | | | | | | | >--* ( +| | | | | | | | | >--+ expression +| | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | >--* i +| | | | | | | | | >--* ) +| | | | | | | | | >--+ statement +| | | | | | | | | | >--+ compound-stmt +| | | | | | | | | | | >--* { +| | | | | | | | | | | >--+ local-declarations +| | | | | | | | | | | | >--* epsilon +| | | | | | | | | | | >--+ statement-list +| | | | | | | | | | | | >--+ statement-list +| | | | | | | | | | | | | >--+ statement-list +| | | | | | | | | | | | | | >--* epsilon +| | | | | | | | | | | | | >--+ statement +| | | | | | | | | | | | | | >--+ expression-stmt +| | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | >--* i +| | | | | | | | | | | | | | | | >--* = +| | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | | | >--* i +| | | | | | | | | | | | | | | | | | | >--+ addop +| | | | | | | | | | | | | | | | | | | | >--* - +| | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | | | | | | | >--* 1 +| | | | | | | | | | | | | | | >--* ; +| | | | | | | | | | | | >--+ statement +| | | | | | | | | | | | | >--+ expression-stmt +| | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | >--* sum +| | | | | | | | | | | | | | | >--* = +| | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | | >--* sum +| | | | | | | | | | | | | | | | | | >--+ addop +| | | | | | | | | | | | | | | | | | | >--* + +| | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | >--* arr +| | | | | | | | | | | | | | | | | | | | | >--* [ +| | | | | | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | | | | | | | >--* i +| | | | | | | | | | | | | | | | | | | | | >--* ] +| | | | | | | | | | | | | | >--* ; +| | | | | | | | | | | >--* } +| | | | | | >--+ statement +| | | | | | | >--+ return-stmt +| | | | | | | | >--* return +| | | | | | | | >--+ expression +| | | | | | | | | >--+ simple-expression +| | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | >--* sum +| | | | | | | | | | | >--+ addop +| | | | | | | | | | | | >--* - +| | | | | | | | | | | >--+ term +| | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | >--* 79 +| | | | | | | | >--* ; +| | | | | >--* } diff --git a/tests/1-parser/output_student/testcases_general/1-return.syntax_tree b/tests/1-parser/output_student/testcases_general/1-return.syntax_tree new file mode 100644 index 0000000000000000000000000000000000000000..14f915622f73699628e9b5fd1ac808ccc78053a5 --- /dev/null +++ b/tests/1-parser/output_student/testcases_general/1-return.syntax_tree @@ -0,0 +1,23 @@ +>--+ program +| >--+ declaration-list +| | >--+ declaration +| | | >--+ fun-declaration +| | | | >--+ type-specifier +| | | | | >--* void +| | | | >--* main +| | | | >--* ( +| | | | >--+ params +| | | | | >--* void +| | | | >--* ) +| | | | >--+ compound-stmt +| | | | | >--* { +| | | | | >--+ local-declarations +| | | | | | >--* epsilon +| | | | | >--+ statement-list +| | | | | | >--+ statement-list +| | | | | | | >--* epsilon +| | | | | | >--+ statement +| | | | | | | >--+ return-stmt +| | | | | | | | >--* return +| | | | | | | | >--* ; +| | | | | >--* } diff --git a/tests/1-parser/output_student/testcases_general/10-funcall.syntax_tree b/tests/1-parser/output_student/testcases_general/10-funcall.syntax_tree new file mode 100644 index 0000000000000000000000000000000000000000..23c02ad407026b983df2c9a4efae9fdcb85ccd8c --- /dev/null +++ b/tests/1-parser/output_student/testcases_general/10-funcall.syntax_tree @@ -0,0 +1,92 @@ +>--+ program +| >--+ declaration-list +| | >--+ declaration-list +| | | >--+ declaration +| | | | >--+ fun-declaration +| | | | | >--+ type-specifier +| | | | | | >--* void +| | | | | >--* test +| | | | | >--* ( +| | | | | >--+ params +| | | | | | >--+ param-list +| | | | | | | >--+ param +| | | | | | | | >--+ type-specifier +| | | | | | | | | >--* int +| | | | | | | | >--* a +| | | | | >--* ) +| | | | | >--+ compound-stmt +| | | | | | >--* { +| | | | | | >--+ local-declarations +| | | | | | | >--* epsilon +| | | | | | >--+ statement-list +| | | | | | | >--+ statement-list +| | | | | | | | >--* epsilon +| | | | | | | >--+ statement +| | | | | | | | >--+ return-stmt +| | | | | | | | | >--* return +| | | | | | | | | >--* ; +| | | | | | >--* } +| | >--+ declaration +| | | >--+ fun-declaration +| | | | >--+ type-specifier +| | | | | >--* void +| | | | >--* main +| | | | >--* ( +| | | | >--+ params +| | | | | >--* void +| | | | >--* ) +| | | | >--+ compound-stmt +| | | | | >--* { +| | | | | >--+ local-declarations +| | | | | | >--+ local-declarations +| | | | | | | >--* epsilon +| | | | | | >--+ var-declaration +| | | | | | | >--+ type-specifier +| | | | | | | | >--* int +| | | | | | | >--* a +| | | | | | | >--* ; +| | | | | >--+ statement-list +| | | | | | >--+ statement-list +| | | | | | | >--+ statement-list +| | | | | | | | >--+ statement-list +| | | | | | | | | >--* epsilon +| | | | | | | | >--+ statement +| | | | | | | | | >--+ expression-stmt +| | | | | | | | | | >--+ expression +| | | | | | | | | | | >--+ var +| | | | | | | | | | | | >--* a +| | | | | | | | | | | >--* = +| | | | | | | | | | | >--+ expression +| | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | | >--* 10 +| | | | | | | | | | >--* ; +| | | | | | | >--+ statement +| | | | | | | | >--+ expression-stmt +| | | | | | | | | >--+ expression +| | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | >--+ call +| | | | | | | | | | | | | | | >--* test +| | | | | | | | | | | | | | | >--* ( +| | | | | | | | | | | | | | | >--+ args +| | | | | | | | | | | | | | | | >--+ arg-list +| | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | | | >--* a +| | | | | | | | | | | | | | | >--* ) +| | | | | | | | | >--* ; +| | | | | | >--+ statement +| | | | | | | >--+ return-stmt +| | | | | | | | >--* return +| | | | | | | | >--* ; +| | | | | >--* } diff --git a/tests/1-parser/output_student/testcases_general/11-funcall_chain.syntax_tree b/tests/1-parser/output_student/testcases_general/11-funcall_chain.syntax_tree new file mode 100644 index 0000000000000000000000000000000000000000..d2d487b833343b0671ddd11cfd8d068331dbed6b --- /dev/null +++ b/tests/1-parser/output_student/testcases_general/11-funcall_chain.syntax_tree @@ -0,0 +1,135 @@ +>--+ program +| >--+ declaration-list +| | >--+ declaration-list +| | | >--+ declaration +| | | | >--+ fun-declaration +| | | | | >--+ type-specifier +| | | | | | >--* int +| | | | | >--* addone +| | | | | >--* ( +| | | | | >--+ params +| | | | | | >--+ param-list +| | | | | | | >--+ param +| | | | | | | | >--+ type-specifier +| | | | | | | | | >--* int +| | | | | | | | >--* a +| | | | | >--* ) +| | | | | >--+ compound-stmt +| | | | | | >--* { +| | | | | | >--+ local-declarations +| | | | | | | >--* epsilon +| | | | | | >--+ statement-list +| | | | | | | >--+ statement-list +| | | | | | | | >--* epsilon +| | | | | | | >--+ statement +| | | | | | | | >--+ return-stmt +| | | | | | | | | >--* return +| | | | | | | | | >--+ expression +| | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | >--* a +| | | | | | | | | | | | >--+ addop +| | | | | | | | | | | | | >--* + +| | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | >--* 1 +| | | | | | | | | >--* ; +| | | | | | >--* } +| | >--+ declaration +| | | >--+ fun-declaration +| | | | >--+ type-specifier +| | | | | >--* int +| | | | >--* main +| | | | >--* ( +| | | | >--+ params +| | | | | >--* void +| | | | >--* ) +| | | | >--+ compound-stmt +| | | | | >--* { +| | | | | >--+ local-declarations +| | | | | | >--+ local-declarations +| | | | | | | >--* epsilon +| | | | | | >--+ var-declaration +| | | | | | | >--+ type-specifier +| | | | | | | | >--* int +| | | | | | | >--* result +| | | | | | | >--* ; +| | | | | >--+ statement-list +| | | | | | >--+ statement-list +| | | | | | | >--+ statement-list +| | | | | | | | >--* epsilon +| | | | | | | >--+ statement +| | | | | | | | >--+ expression-stmt +| | | | | | | | | >--+ expression +| | | | | | | | | | >--+ var +| | | | | | | | | | | >--* result +| | | | | | | | | | >--* = +| | | | | | | | | | >--+ expression +| | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | >--+ call +| | | | | | | | | | | | | | | | >--* addone +| | | | | | | | | | | | | | | | >--* ( +| | | | | | | | | | | | | | | | >--+ args +| | | | | | | | | | | | | | | | | >--+ arg-list +| | | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | >--+ call +| | | | | | | | | | | | | | | | | | | | | | | | >--* addone +| | | | | | | | | | | | | | | | | | | | | | | | >--* ( +| | | | | | | | | | | | | | | | | | | | | | | | >--+ args +| | | | | | | | | | | | | | | | | | | | | | | | | >--+ arg-list +| | | | | | | | | | | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ call +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--* addone +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--* ( +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ args +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ arg-list +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ call +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--* addone +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--* ( +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ args +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ arg-list +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--* 1230 +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--* ) +| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | >--* ) +| | | | | | | | | | | | | | | | | | | | | | | | >--* ) +| | | | | | | | | | | | | | | | >--* ) +| | | | | | | | | >--* ; +| | | | | | >--+ statement +| | | | | | | >--+ return-stmt +| | | | | | | | >--* return +| | | | | | | | >--+ expression +| | | | | | | | | >--+ simple-expression +| | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | >--+ term +| | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | >--* result +| | | | | | | | >--* ; +| | | | | >--* } diff --git a/tests/1-parser/output_student/testcases_general/12-funcall_recursion.syntax_tree b/tests/1-parser/output_student/testcases_general/12-funcall_recursion.syntax_tree new file mode 100644 index 0000000000000000000000000000000000000000..7face444a68485a9a6342ff2d46423832c630219 --- /dev/null +++ b/tests/1-parser/output_student/testcases_general/12-funcall_recursion.syntax_tree @@ -0,0 +1,150 @@ +>--+ program +| >--+ declaration-list +| | >--+ declaration-list +| | | >--+ declaration +| | | | >--+ fun-declaration +| | | | | >--+ type-specifier +| | | | | | >--* int +| | | | | >--* factorial +| | | | | >--* ( +| | | | | >--+ params +| | | | | | >--+ param-list +| | | | | | | >--+ param +| | | | | | | | >--+ type-specifier +| | | | | | | | | >--* int +| | | | | | | | >--* a +| | | | | >--* ) +| | | | | >--+ compound-stmt +| | | | | | >--* { +| | | | | | >--+ local-declarations +| | | | | | | >--* epsilon +| | | | | | >--+ statement-list +| | | | | | | >--+ statement-list +| | | | | | | | >--* epsilon +| | | | | | | >--+ statement +| | | | | | | | >--+ selection-stmt +| | | | | | | | | >--* if +| | | | | | | | | >--* ( +| | | | | | | | | >--+ expression +| | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | >--* a +| | | | | | | | | | | >--+ relop +| | | | | | | | | | | | >--* == +| | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | >--* 0 +| | | | | | | | | >--* ) +| | | | | | | | | >--+ statement +| | | | | | | | | | >--+ return-stmt +| | | | | | | | | | | >--* return +| | | | | | | | | | | >--+ expression +| | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | | >--* 1 +| | | | | | | | | | | >--* ; +| | | | | | | | | >--* else +| | | | | | | | | >--+ statement +| | | | | | | | | | >--+ return-stmt +| | | | | | | | | | | >--* return +| | | | | | | | | | | >--+ expression +| | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | >--* a +| | | | | | | | | | | | | | | >--+ mulop +| | | | | | | | | | | | | | | | >--* * +| | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | >--+ call +| | | | | | | | | | | | | | | | | >--* factorial +| | | | | | | | | | | | | | | | | >--* ( +| | | | | | | | | | | | | | | | | >--+ args +| | | | | | | | | | | | | | | | | | >--+ arg-list +| | | | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | | | | | | >--* a +| | | | | | | | | | | | | | | | | | | | | | >--+ addop +| | | | | | | | | | | | | | | | | | | | | | | >--* - +| | | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | | | | | | | | | | >--* 1 +| | | | | | | | | | | | | | | | | >--* ) +| | | | | | | | | | | >--* ; +| | | | | | >--* } +| | >--+ declaration +| | | >--+ fun-declaration +| | | | >--+ type-specifier +| | | | | >--* int +| | | | >--* main +| | | | >--* ( +| | | | >--+ params +| | | | | >--* void +| | | | >--* ) +| | | | >--+ compound-stmt +| | | | | >--* { +| | | | | >--+ local-declarations +| | | | | | >--+ local-declarations +| | | | | | | >--* epsilon +| | | | | | >--+ var-declaration +| | | | | | | >--+ type-specifier +| | | | | | | | >--* int +| | | | | | | >--* result +| | | | | | | >--* ; +| | | | | >--+ statement-list +| | | | | | >--+ statement-list +| | | | | | | >--+ statement-list +| | | | | | | | >--* epsilon +| | | | | | | >--+ statement +| | | | | | | | >--+ expression-stmt +| | | | | | | | | >--+ expression +| | | | | | | | | | >--+ var +| | | | | | | | | | | >--* result +| | | | | | | | | | >--* = +| | | | | | | | | | >--+ expression +| | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | >--+ call +| | | | | | | | | | | | | | | | >--* factorial +| | | | | | | | | | | | | | | | >--* ( +| | | | | | | | | | | | | | | | >--+ args +| | | | | | | | | | | | | | | | | >--+ arg-list +| | | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | | | | | | | | | >--* 10 +| | | | | | | | | | | | | | | | >--* ) +| | | | | | | | | >--* ; +| | | | | | >--+ statement +| | | | | | | >--+ return-stmt +| | | | | | | | >--* return +| | | | | | | | >--+ expression +| | | | | | | | | >--+ simple-expression +| | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | >--+ term +| | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | >--* result +| | | | | | | | >--* ; +| | | | | >--* } diff --git a/tests/1-parser/output_student/testcases_general/13-if_stmt.syntax_tree b/tests/1-parser/output_student/testcases_general/13-if_stmt.syntax_tree new file mode 100644 index 0000000000000000000000000000000000000000..15393ff9ce920c03db5de51b04ab9b076ebeda4b --- /dev/null +++ b/tests/1-parser/output_student/testcases_general/13-if_stmt.syntax_tree @@ -0,0 +1,86 @@ +>--+ program +| >--+ declaration-list +| | >--+ declaration +| | | >--+ fun-declaration +| | | | >--+ type-specifier +| | | | | >--* void +| | | | >--* main +| | | | >--* ( +| | | | >--+ params +| | | | | >--* void +| | | | >--* ) +| | | | >--+ compound-stmt +| | | | | >--* { +| | | | | >--+ local-declarations +| | | | | | >--+ local-declarations +| | | | | | | >--* epsilon +| | | | | | >--+ var-declaration +| | | | | | | >--+ type-specifier +| | | | | | | | >--* int +| | | | | | | >--* a +| | | | | | | >--* ; +| | | | | >--+ statement-list +| | | | | | >--+ statement-list +| | | | | | | >--+ statement-list +| | | | | | | | >--+ statement-list +| | | | | | | | | >--+ statement-list +| | | | | | | | | | >--* epsilon +| | | | | | | | | >--+ statement +| | | | | | | | | | >--+ expression-stmt +| | | | | | | | | | | >--+ expression +| | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | >--* a +| | | | | | | | | | | | >--* = +| | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | | | >--* 2 +| | | | | | | | | | | >--* ; +| | | | | | | | >--+ statement +| | | | | | | | | >--+ selection-stmt +| | | | | | | | | | >--* if +| | | | | | | | | | >--* ( +| | | | | | | | | | >--+ expression +| | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | >--* a +| | | | | | | | | | >--* ) +| | | | | | | | | | >--+ statement +| | | | | | | | | | | >--+ expression-stmt +| | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | >--* a +| | | | | | | | | | | | | >--* = +| | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | | | | >--* 3 +| | | | | | | | | | | | >--* ; +| | | | | | | >--+ statement +| | | | | | | | >--+ expression-stmt +| | | | | | | | | >--+ expression +| | | | | | | | | | >--+ var +| | | | | | | | | | | >--* a +| | | | | | | | | | >--* = +| | | | | | | | | | >--+ expression +| | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | >--* 4 +| | | | | | | | | >--* ; +| | | | | | >--+ statement +| | | | | | | >--+ return-stmt +| | | | | | | | >--* return +| | | | | | | | >--* ; +| | | | | >--* } diff --git a/tests/1-parser/output_student/testcases_general/14-while_stmt.syntax_tree b/tests/1-parser/output_student/testcases_general/14-while_stmt.syntax_tree new file mode 100644 index 0000000000000000000000000000000000000000..cab56f7844222a381e4b070726ebf39c1d3b1d76 --- /dev/null +++ b/tests/1-parser/output_student/testcases_general/14-while_stmt.syntax_tree @@ -0,0 +1,87 @@ +>--+ program +| >--+ declaration-list +| | >--+ declaration +| | | >--+ fun-declaration +| | | | >--+ type-specifier +| | | | | >--* void +| | | | >--* main +| | | | >--* ( +| | | | >--+ params +| | | | | >--* void +| | | | >--* ) +| | | | >--+ compound-stmt +| | | | | >--* { +| | | | | >--+ local-declarations +| | | | | | >--+ local-declarations +| | | | | | | >--* epsilon +| | | | | | >--+ var-declaration +| | | | | | | >--+ type-specifier +| | | | | | | | >--* int +| | | | | | | >--* i +| | | | | | | >--* ; +| | | | | >--+ statement-list +| | | | | | >--+ statement-list +| | | | | | | >--+ statement-list +| | | | | | | | >--+ statement-list +| | | | | | | | | >--* epsilon +| | | | | | | | >--+ statement +| | | | | | | | | >--+ expression-stmt +| | | | | | | | | | >--+ expression +| | | | | | | | | | | >--+ var +| | | | | | | | | | | | >--* i +| | | | | | | | | | | >--* = +| | | | | | | | | | | >--+ expression +| | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | | >--* 10 +| | | | | | | | | | >--* ; +| | | | | | | >--+ statement +| | | | | | | | >--+ iteration-stmt +| | | | | | | | | >--* while +| | | | | | | | | >--* ( +| | | | | | | | | >--+ expression +| | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | >--* i +| | | | | | | | | >--* ) +| | | | | | | | | >--+ statement +| | | | | | | | | | >--+ compound-stmt +| | | | | | | | | | | >--* { +| | | | | | | | | | | >--+ local-declarations +| | | | | | | | | | | | >--* epsilon +| | | | | | | | | | | >--+ statement-list +| | | | | | | | | | | | >--+ statement-list +| | | | | | | | | | | | | >--* epsilon +| | | | | | | | | | | | >--+ statement +| | | | | | | | | | | | | >--+ expression-stmt +| | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | >--* i +| | | | | | | | | | | | | | | >--* = +| | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | | >--* i +| | | | | | | | | | | | | | | | | | >--+ addop +| | | | | | | | | | | | | | | | | | | >--* - +| | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | | | | | | >--* 1 +| | | | | | | | | | | | | | >--* ; +| | | | | | | | | | | >--* } +| | | | | | >--+ statement +| | | | | | | >--+ return-stmt +| | | | | | | | >--* return +| | | | | | | | >--* ; +| | | | | >--* } diff --git a/tests/1-parser/output_student/testcases_general/15-if_while.syntax_tree b/tests/1-parser/output_student/testcases_general/15-if_while.syntax_tree new file mode 100644 index 0000000000000000000000000000000000000000..fbc2e5f4b190c50854169919db0d6df730039bf2 --- /dev/null +++ b/tests/1-parser/output_student/testcases_general/15-if_while.syntax_tree @@ -0,0 +1,215 @@ +>--+ program +| >--+ declaration-list +| | >--+ declaration +| | | >--+ fun-declaration +| | | | >--+ type-specifier +| | | | | >--* int +| | | | >--* main +| | | | >--* ( +| | | | >--+ params +| | | | | >--* void +| | | | >--* ) +| | | | >--+ compound-stmt +| | | | | >--* { +| | | | | >--+ local-declarations +| | | | | | >--+ local-declarations +| | | | | | | >--+ local-declarations +| | | | | | | | >--+ local-declarations +| | | | | | | | | >--* epsilon +| | | | | | | | >--+ var-declaration +| | | | | | | | | >--+ type-specifier +| | | | | | | | | | >--* int +| | | | | | | | | >--* i +| | | | | | | | | >--* ; +| | | | | | | >--+ var-declaration +| | | | | | | | >--+ type-specifier +| | | | | | | | | >--* int +| | | | | | | | >--* a +| | | | | | | | >--* ; +| | | | | | >--+ var-declaration +| | | | | | | >--+ type-specifier +| | | | | | | | >--* int +| | | | | | | >--* b +| | | | | | | >--* ; +| | | | | >--+ statement-list +| | | | | | >--+ statement-list +| | | | | | | >--+ statement-list +| | | | | | | | >--+ statement-list +| | | | | | | | | >--+ statement-list +| | | | | | | | | | >--+ statement-list +| | | | | | | | | | | >--* epsilon +| | | | | | | | | | >--+ statement +| | | | | | | | | | | >--+ expression-stmt +| | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | >--* a +| | | | | | | | | | | | | >--* = +| | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | | | | >--* 0 +| | | | | | | | | | | | >--* ; +| | | | | | | | | >--+ statement +| | | | | | | | | | >--+ expression-stmt +| | | | | | | | | | | >--+ expression +| | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | >--* b +| | | | | | | | | | | | >--* = +| | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | | | >--* 0 +| | | | | | | | | | | >--* ; +| | | | | | | | >--+ statement +| | | | | | | | | >--+ expression-stmt +| | | | | | | | | | >--+ expression +| | | | | | | | | | | >--+ var +| | | | | | | | | | | | >--* i +| | | | | | | | | | | >--* = +| | | | | | | | | | | >--+ expression +| | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | | >--* 10 +| | | | | | | | | | >--* ; +| | | | | | | >--+ statement +| | | | | | | | >--+ iteration-stmt +| | | | | | | | | >--* while +| | | | | | | | | >--* ( +| | | | | | | | | >--+ expression +| | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | >--* i +| | | | | | | | | >--* ) +| | | | | | | | | >--+ statement +| | | | | | | | | | >--+ compound-stmt +| | | | | | | | | | | >--* { +| | | | | | | | | | | >--+ local-declarations +| | | | | | | | | | | | >--* epsilon +| | | | | | | | | | | >--+ statement-list +| | | | | | | | | | | | >--+ statement-list +| | | | | | | | | | | | | >--+ statement-list +| | | | | | | | | | | | | | >--* epsilon +| | | | | | | | | | | | | >--+ statement +| | | | | | | | | | | | | | >--+ expression-stmt +| | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | >--* i +| | | | | | | | | | | | | | | | >--* = +| | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | | | >--* i +| | | | | | | | | | | | | | | | | | | >--+ addop +| | | | | | | | | | | | | | | | | | | | >--* - +| | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | | | | | | | >--* 1 +| | | | | | | | | | | | | | | >--* ; +| | | | | | | | | | | | >--+ statement +| | | | | | | | | | | | | >--+ selection-stmt +| | | | | | | | | | | | | | >--* if +| | | | | | | | | | | | | | >--* ( +| | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | >--* i +| | | | | | | | | | | | | | | | >--+ relop +| | | | | | | | | | | | | | | | | >--* < +| | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | | | | | >--* 5 +| | | | | | | | | | | | | | >--* ) +| | | | | | | | | | | | | | >--+ statement +| | | | | | | | | | | | | | | >--+ expression-stmt +| | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | >--* a +| | | | | | | | | | | | | | | | | >--* = +| | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | | | | >--* a +| | | | | | | | | | | | | | | | | | | | >--+ addop +| | | | | | | | | | | | | | | | | | | | | >--* + +| | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | | | >--* i +| | | | | | | | | | | | | | | | >--* ; +| | | | | | | | | | | | | | >--* else +| | | | | | | | | | | | | | >--+ statement +| | | | | | | | | | | | | | | >--+ compound-stmt +| | | | | | | | | | | | | | | | >--* { +| | | | | | | | | | | | | | | | >--+ local-declarations +| | | | | | | | | | | | | | | | | >--* epsilon +| | | | | | | | | | | | | | | | >--+ statement-list +| | | | | | | | | | | | | | | | | >--+ statement-list +| | | | | | | | | | | | | | | | | | >--* epsilon +| | | | | | | | | | | | | | | | | >--+ statement +| | | | | | | | | | | | | | | | | | >--+ expression-stmt +| | | | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | >--* b +| | | | | | | | | | | | | | | | | | | | >--* = +| | | | | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | | | | | | | >--* b +| | | | | | | | | | | | | | | | | | | | | | | >--+ addop +| | | | | | | | | | | | | | | | | | | | | | | | >--* + +| | | | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | | | | | | >--* i +| | | | | | | | | | | | | | | | | | | >--* ; +| | | | | | | | | | | | | | | | >--* } +| | | | | | | | | | | >--* } +| | | | | | >--+ statement +| | | | | | | >--+ return-stmt +| | | | | | | | >--* return +| | | | | | | | >--+ expression +| | | | | | | | | >--+ simple-expression +| | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | >--* a +| | | | | | | | | | | >--+ addop +| | | | | | | | | | | | >--* + +| | | | | | | | | | | >--+ term +| | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | >--* b +| | | | | | | | >--* ; +| | | | | >--* } diff --git a/tests/1-parser/output_student/testcases_general/16-if_chain.syntax_tree b/tests/1-parser/output_student/testcases_general/16-if_chain.syntax_tree new file mode 100644 index 0000000000000000000000000000000000000000..e9d43269e892ea418a11cc7b2cab6bcedb40e43d --- /dev/null +++ b/tests/1-parser/output_student/testcases_general/16-if_chain.syntax_tree @@ -0,0 +1,147 @@ +>--+ program +| >--+ declaration-list +| | >--+ declaration +| | | >--+ fun-declaration +| | | | >--+ type-specifier +| | | | | >--* int +| | | | >--* main +| | | | >--* ( +| | | | >--+ params +| | | | | >--* void +| | | | >--* ) +| | | | >--+ compound-stmt +| | | | | >--* { +| | | | | >--+ local-declarations +| | | | | | >--+ local-declarations +| | | | | | | >--+ local-declarations +| | | | | | | | >--+ local-declarations +| | | | | | | | | >--* epsilon +| | | | | | | | >--+ var-declaration +| | | | | | | | | >--+ type-specifier +| | | | | | | | | | >--* int +| | | | | | | | | >--* a +| | | | | | | | | >--* ; +| | | | | | | >--+ var-declaration +| | | | | | | | >--+ type-specifier +| | | | | | | | | >--* int +| | | | | | | | >--* b +| | | | | | | | >--* ; +| | | | | | >--+ var-declaration +| | | | | | | >--+ type-specifier +| | | | | | | | >--* int +| | | | | | | >--* c +| | | | | | | >--* ; +| | | | | >--+ statement-list +| | | | | | >--+ statement-list +| | | | | | | >--+ statement-list +| | | | | | | | >--+ statement-list +| | | | | | | | | >--+ statement-list +| | | | | | | | | | >--+ statement-list +| | | | | | | | | | | >--* epsilon +| | | | | | | | | | >--+ statement +| | | | | | | | | | | >--+ expression-stmt +| | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | >--* c +| | | | | | | | | | | | | >--* = +| | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | | | | >--* 0 +| | | | | | | | | | | | >--* ; +| | | | | | | | | >--+ statement +| | | | | | | | | | >--+ expression-stmt +| | | | | | | | | | | >--+ expression +| | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | >--* a +| | | | | | | | | | | | >--* = +| | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | | | >--* 2 +| | | | | | | | | | | >--* ; +| | | | | | | | >--+ statement +| | | | | | | | | >--+ expression-stmt +| | | | | | | | | | >--+ expression +| | | | | | | | | | | >--+ var +| | | | | | | | | | | | >--* b +| | | | | | | | | | | >--* = +| | | | | | | | | | | >--+ expression +| | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | | >--* 1 +| | | | | | | | | | >--* ; +| | | | | | | >--+ statement +| | | | | | | | >--+ selection-stmt +| | | | | | | | | >--* if +| | | | | | | | | >--* ( +| | | | | | | | | >--+ expression +| | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | >--* b +| | | | | | | | | >--* ) +| | | | | | | | | >--+ statement +| | | | | | | | | | >--+ selection-stmt +| | | | | | | | | | | >--* if +| | | | | | | | | | | >--* ( +| | | | | | | | | | | >--+ expression +| | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | >--* c +| | | | | | | | | | | >--* ) +| | | | | | | | | | | >--+ statement +| | | | | | | | | | | | >--+ expression-stmt +| | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | >--* a +| | | | | | | | | | | | | | >--* = +| | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | | | | | >--* 4 +| | | | | | | | | | | | | >--* ; +| | | | | | | | | | | >--* else +| | | | | | | | | | | >--+ statement +| | | | | | | | | | | | >--+ expression-stmt +| | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | >--* a +| | | | | | | | | | | | | | >--* = +| | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | | | | | >--* 3 +| | | | | | | | | | | | | >--* ; +| | | | | | >--+ statement +| | | | | | | >--+ return-stmt +| | | | | | | | >--* return +| | | | | | | | >--+ expression +| | | | | | | | | >--+ simple-expression +| | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | >--+ term +| | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | >--* a +| | | | | | | | >--* ; +| | | | | >--* } diff --git a/tests/1-parser/output_student/testcases_general/17-while_chain.syntax_tree b/tests/1-parser/output_student/testcases_general/17-while_chain.syntax_tree new file mode 100644 index 0000000000000000000000000000000000000000..05b930f8971a46af1feffaa795bcbc1359f9f2e1 --- /dev/null +++ b/tests/1-parser/output_student/testcases_general/17-while_chain.syntax_tree @@ -0,0 +1,165 @@ +>--+ program +| >--+ declaration-list +| | >--+ declaration +| | | >--+ fun-declaration +| | | | >--+ type-specifier +| | | | | >--* int +| | | | >--* main +| | | | >--* ( +| | | | >--+ params +| | | | | >--* void +| | | | >--* ) +| | | | >--+ compound-stmt +| | | | | >--* { +| | | | | >--+ local-declarations +| | | | | | >--+ local-declarations +| | | | | | | >--+ local-declarations +| | | | | | | | >--* epsilon +| | | | | | | >--+ var-declaration +| | | | | | | | >--+ type-specifier +| | | | | | | | | >--* int +| | | | | | | | >--* i +| | | | | | | | >--* ; +| | | | | | >--+ var-declaration +| | | | | | | >--+ type-specifier +| | | | | | | | >--* int +| | | | | | | >--* j +| | | | | | | >--* ; +| | | | | >--+ statement-list +| | | | | | >--+ statement-list +| | | | | | | >--+ statement-list +| | | | | | | | >--+ statement-list +| | | | | | | | | >--* epsilon +| | | | | | | | >--+ statement +| | | | | | | | | >--+ expression-stmt +| | | | | | | | | | >--+ expression +| | | | | | | | | | | >--+ var +| | | | | | | | | | | | >--* i +| | | | | | | | | | | >--* = +| | | | | | | | | | | >--+ expression +| | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | | >--* 10 +| | | | | | | | | | >--* ; +| | | | | | | >--+ statement +| | | | | | | | >--+ iteration-stmt +| | | | | | | | | >--* while +| | | | | | | | | >--* ( +| | | | | | | | | >--+ expression +| | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | >--* i +| | | | | | | | | >--* ) +| | | | | | | | | >--+ statement +| | | | | | | | | | >--+ compound-stmt +| | | | | | | | | | | >--* { +| | | | | | | | | | | >--+ local-declarations +| | | | | | | | | | | | >--* epsilon +| | | | | | | | | | | >--+ statement-list +| | | | | | | | | | | | >--+ statement-list +| | | | | | | | | | | | | >--+ statement-list +| | | | | | | | | | | | | | >--+ statement-list +| | | | | | | | | | | | | | | >--* epsilon +| | | | | | | | | | | | | | >--+ statement +| | | | | | | | | | | | | | | >--+ expression-stmt +| | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | >--* i +| | | | | | | | | | | | | | | | | >--* = +| | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | | | | >--* i +| | | | | | | | | | | | | | | | | | | | >--+ addop +| | | | | | | | | | | | | | | | | | | | | >--* - +| | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | | | | | | | | >--* 1 +| | | | | | | | | | | | | | | | >--* ; +| | | | | | | | | | | | | >--+ statement +| | | | | | | | | | | | | | >--+ expression-stmt +| | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | >--* j +| | | | | | | | | | | | | | | | >--* = +| | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | | >--* i +| | | | | | | | | | | | | | | >--* ; +| | | | | | | | | | | | >--+ statement +| | | | | | | | | | | | | >--+ iteration-stmt +| | | | | | | | | | | | | | >--* while +| | | | | | | | | | | | | | >--* ( +| | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | >--* j +| | | | | | | | | | | | | | >--* ) +| | | | | | | | | | | | | | >--+ statement +| | | | | | | | | | | | | | | >--+ compound-stmt +| | | | | | | | | | | | | | | | >--* { +| | | | | | | | | | | | | | | | >--+ local-declarations +| | | | | | | | | | | | | | | | | >--* epsilon +| | | | | | | | | | | | | | | | >--+ statement-list +| | | | | | | | | | | | | | | | | >--+ statement-list +| | | | | | | | | | | | | | | | | | >--* epsilon +| | | | | | | | | | | | | | | | | >--+ statement +| | | | | | | | | | | | | | | | | | >--+ expression-stmt +| | | | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | >--* j +| | | | | | | | | | | | | | | | | | | | >--* = +| | | | | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | | | | | | | >--* j +| | | | | | | | | | | | | | | | | | | | | | | >--+ addop +| | | | | | | | | | | | | | | | | | | | | | | | >--* - +| | | | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | | | | | | | | | | | >--* 1 +| | | | | | | | | | | | | | | | | | | >--* ; +| | | | | | | | | | | | | | | | >--* } +| | | | | | | | | | | >--* } +| | | | | | >--+ statement +| | | | | | | >--+ return-stmt +| | | | | | | | >--* return +| | | | | | | | >--+ expression +| | | | | | | | | >--+ simple-expression +| | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | >--* i +| | | | | | | | | | | >--+ addop +| | | | | | | | | | | | >--* + +| | | | | | | | | | | >--+ term +| | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | >--* j +| | | | | | | | >--* ; +| | | | | >--* } diff --git a/tests/1-parser/output_student/testcases_general/18-global_var.syntax_tree b/tests/1-parser/output_student/testcases_general/18-global_var.syntax_tree new file mode 100644 index 0000000000000000000000000000000000000000..17be8b969492cf068acc320830b915f0ab2122cd --- /dev/null +++ b/tests/1-parser/output_student/testcases_general/18-global_var.syntax_tree @@ -0,0 +1,52 @@ +>--+ program +| >--+ declaration-list +| | >--+ declaration-list +| | | >--+ declaration +| | | | >--+ var-declaration +| | | | | >--+ type-specifier +| | | | | | >--* int +| | | | | >--* a +| | | | | >--* ; +| | >--+ declaration +| | | >--+ fun-declaration +| | | | >--+ type-specifier +| | | | | >--* int +| | | | >--* main +| | | | >--* ( +| | | | >--+ params +| | | | | >--* void +| | | | >--* ) +| | | | >--+ compound-stmt +| | | | | >--* { +| | | | | >--+ local-declarations +| | | | | | >--* epsilon +| | | | | >--+ statement-list +| | | | | | >--+ statement-list +| | | | | | | >--+ statement-list +| | | | | | | | >--* epsilon +| | | | | | | >--+ statement +| | | | | | | | >--+ expression-stmt +| | | | | | | | | >--+ expression +| | | | | | | | | | >--+ var +| | | | | | | | | | | >--* a +| | | | | | | | | | >--* = +| | | | | | | | | | >--+ expression +| | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | >--* 10 +| | | | | | | | | >--* ; +| | | | | | >--+ statement +| | | | | | | >--+ return-stmt +| | | | | | | | >--* return +| | | | | | | | >--+ expression +| | | | | | | | | >--+ simple-expression +| | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | >--+ term +| | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | >--* a +| | | | | | | | >--* ; +| | | | | >--* } diff --git a/tests/1-parser/output_student/testcases_general/19-global_local_var.syntax_tree b/tests/1-parser/output_student/testcases_general/19-global_local_var.syntax_tree new file mode 100644 index 0000000000000000000000000000000000000000..8fb61e8ae7f7965bfaafb26f1ab740ed798b9724 --- /dev/null +++ b/tests/1-parser/output_student/testcases_general/19-global_local_var.syntax_tree @@ -0,0 +1,110 @@ +>--+ program +| >--+ declaration-list +| | >--+ declaration-list +| | | >--+ declaration-list +| | | | >--+ declaration +| | | | | >--+ var-declaration +| | | | | | >--+ type-specifier +| | | | | | | >--* int +| | | | | | >--* a +| | | | | | >--* ; +| | | >--+ declaration +| | | | >--+ fun-declaration +| | | | | >--+ type-specifier +| | | | | | >--* void +| | | | | >--* GlobalAssign +| | | | | >--* ( +| | | | | >--+ params +| | | | | | >--* void +| | | | | >--* ) +| | | | | >--+ compound-stmt +| | | | | | >--* { +| | | | | | >--+ local-declarations +| | | | | | | >--* epsilon +| | | | | | >--+ statement-list +| | | | | | | >--+ statement-list +| | | | | | | | >--+ statement-list +| | | | | | | | | >--* epsilon +| | | | | | | | >--+ statement +| | | | | | | | | >--+ expression-stmt +| | | | | | | | | | >--+ expression +| | | | | | | | | | | >--+ var +| | | | | | | | | | | | >--* a +| | | | | | | | | | | >--* = +| | | | | | | | | | | >--+ expression +| | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | | >--* 10 +| | | | | | | | | | >--* ; +| | | | | | | >--+ statement +| | | | | | | | >--+ return-stmt +| | | | | | | | | >--* return +| | | | | | | | | >--* ; +| | | | | | >--* } +| | >--+ declaration +| | | >--+ fun-declaration +| | | | >--+ type-specifier +| | | | | >--* int +| | | | >--* main +| | | | >--* ( +| | | | >--+ params +| | | | | >--* void +| | | | >--* ) +| | | | >--+ compound-stmt +| | | | | >--* { +| | | | | >--+ local-declarations +| | | | | | >--+ local-declarations +| | | | | | | >--* epsilon +| | | | | | >--+ var-declaration +| | | | | | | >--+ type-specifier +| | | | | | | | >--* int +| | | | | | | >--* a +| | | | | | | >--* ; +| | | | | >--+ statement-list +| | | | | | >--+ statement-list +| | | | | | | >--+ statement-list +| | | | | | | | >--+ statement-list +| | | | | | | | | >--* epsilon +| | | | | | | | >--+ statement +| | | | | | | | | >--+ expression-stmt +| | | | | | | | | | >--+ expression +| | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | >--+ call +| | | | | | | | | | | | | | | | >--* GlobalAssign +| | | | | | | | | | | | | | | | >--* ( +| | | | | | | | | | | | | | | | >--+ args +| | | | | | | | | | | | | | | | | >--* epsilon +| | | | | | | | | | | | | | | | >--* ) +| | | | | | | | | | >--* ; +| | | | | | | >--+ statement +| | | | | | | | >--+ expression-stmt +| | | | | | | | | >--+ expression +| | | | | | | | | | >--+ var +| | | | | | | | | | | >--* a +| | | | | | | | | | >--* = +| | | | | | | | | | >--+ expression +| | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | >--* 20 +| | | | | | | | | >--* ; +| | | | | | >--+ statement +| | | | | | | >--+ return-stmt +| | | | | | | | >--* return +| | | | | | | | >--+ expression +| | | | | | | | | >--+ simple-expression +| | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | >--+ term +| | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | >--* a +| | | | | | | | >--* ; +| | | | | >--* } diff --git a/tests/1-parser/output_student/testcases_general/2-decl_int.syntax_tree b/tests/1-parser/output_student/testcases_general/2-decl_int.syntax_tree new file mode 100644 index 0000000000000000000000000000000000000000..e548f2ad6d02221028c7dbf139ba3f3dd38e851c --- /dev/null +++ b/tests/1-parser/output_student/testcases_general/2-decl_int.syntax_tree @@ -0,0 +1,29 @@ +>--+ program +| >--+ declaration-list +| | >--+ declaration +| | | >--+ fun-declaration +| | | | >--+ type-specifier +| | | | | >--* void +| | | | >--* main +| | | | >--* ( +| | | | >--+ params +| | | | | >--* void +| | | | >--* ) +| | | | >--+ compound-stmt +| | | | | >--* { +| | | | | >--+ local-declarations +| | | | | | >--+ local-declarations +| | | | | | | >--* epsilon +| | | | | | >--+ var-declaration +| | | | | | | >--+ type-specifier +| | | | | | | | >--* int +| | | | | | | >--* a +| | | | | | | >--* ; +| | | | | >--+ statement-list +| | | | | | >--+ statement-list +| | | | | | | >--* epsilon +| | | | | | >--+ statement +| | | | | | | >--+ return-stmt +| | | | | | | | >--* return +| | | | | | | | >--* ; +| | | | | >--* } diff --git a/tests/1-parser/output_student/testcases_general/20-gcd_array.syntax_tree b/tests/1-parser/output_student/testcases_general/20-gcd_array.syntax_tree new file mode 100644 index 0000000000000000000000000000000000000000..915aaee3de3b976c942e7ede910e61a5c31a3667 --- /dev/null +++ b/tests/1-parser/output_student/testcases_general/20-gcd_array.syntax_tree @@ -0,0 +1,429 @@ +>--+ program +| >--+ declaration-list +| | >--+ declaration-list +| | | >--+ declaration-list +| | | | >--+ declaration-list +| | | | | >--+ declaration-list +| | | | | | >--+ declaration +| | | | | | | >--+ var-declaration +| | | | | | | | >--+ type-specifier +| | | | | | | | | >--* int +| | | | | | | | >--* x +| | | | | | | | >--* [ +| | | | | | | | >--* 1 +| | | | | | | | >--* ] +| | | | | | | | >--* ; +| | | | | >--+ declaration +| | | | | | >--+ var-declaration +| | | | | | | >--+ type-specifier +| | | | | | | | >--* int +| | | | | | | >--* y +| | | | | | | >--* [ +| | | | | | | >--* 1 +| | | | | | | >--* ] +| | | | | | | >--* ; +| | | | >--+ declaration +| | | | | >--+ fun-declaration +| | | | | | >--+ type-specifier +| | | | | | | >--* int +| | | | | | >--* gcd +| | | | | | >--* ( +| | | | | | >--+ params +| | | | | | | >--+ param-list +| | | | | | | | >--+ param-list +| | | | | | | | | >--+ param +| | | | | | | | | | >--+ type-specifier +| | | | | | | | | | | >--* int +| | | | | | | | | | >--* u +| | | | | | | | >--* , +| | | | | | | | >--+ param +| | | | | | | | | >--+ type-specifier +| | | | | | | | | | >--* int +| | | | | | | | | >--* v +| | | | | | >--* ) +| | | | | | >--+ compound-stmt +| | | | | | | >--* { +| | | | | | | >--+ local-declarations +| | | | | | | | >--* epsilon +| | | | | | | >--+ statement-list +| | | | | | | | >--+ statement-list +| | | | | | | | | >--* epsilon +| | | | | | | | >--+ statement +| | | | | | | | | >--+ selection-stmt +| | | | | | | | | | >--* if +| | | | | | | | | | >--* ( +| | | | | | | | | | >--+ expression +| | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | >--* v +| | | | | | | | | | | | >--+ relop +| | | | | | | | | | | | | >--* == +| | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | >--* 0 +| | | | | | | | | | >--* ) +| | | | | | | | | | >--+ statement +| | | | | | | | | | | >--+ return-stmt +| | | | | | | | | | | | >--* return +| | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | >--* u +| | | | | | | | | | | | >--* ; +| | | | | | | | | | >--* else +| | | | | | | | | | >--+ statement +| | | | | | | | | | | >--+ return-stmt +| | | | | | | | | | | | >--* return +| | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | >--+ call +| | | | | | | | | | | | | | | | | | >--* gcd +| | | | | | | | | | | | | | | | | | >--* ( +| | | | | | | | | | | | | | | | | | >--+ args +| | | | | | | | | | | | | | | | | | | >--+ arg-list +| | | | | | | | | | | | | | | | | | | | >--+ arg-list +| | | | | | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | | | | | | | >--* v +| | | | | | | | | | | | | | | | | | | | >--* , +| | | | | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | | | | | | | >--* u +| | | | | | | | | | | | | | | | | | | | | | | >--+ addop +| | | | | | | | | | | | | | | | | | | | | | | | >--* - +| | | | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | | | | | | | | >--* u +| | | | | | | | | | | | | | | | | | | | | | | | | >--+ mulop +| | | | | | | | | | | | | | | | | | | | | | | | | | >--* / +| | | | | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | | | | | | | >--* v +| | | | | | | | | | | | | | | | | | | | | | | | >--+ mulop +| | | | | | | | | | | | | | | | | | | | | | | | | >--* * +| | | | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | | | | | | >--* v +| | | | | | | | | | | | | | | | | | >--* ) +| | | | | | | | | | | | >--* ; +| | | | | | | >--* } +| | | >--+ declaration +| | | | >--+ fun-declaration +| | | | | >--+ type-specifier +| | | | | | >--* int +| | | | | >--* funArray +| | | | | >--* ( +| | | | | >--+ params +| | | | | | >--+ param-list +| | | | | | | >--+ param-list +| | | | | | | | >--+ param +| | | | | | | | | >--+ type-specifier +| | | | | | | | | | >--* int +| | | | | | | | | >--* u +| | | | | | | | | >--* [ +| | | | | | | | | >--* ] +| | | | | | | >--* , +| | | | | | | >--+ param +| | | | | | | | >--+ type-specifier +| | | | | | | | | >--* int +| | | | | | | | >--* v +| | | | | | | | >--* [ +| | | | | | | | >--* ] +| | | | | >--* ) +| | | | | >--+ compound-stmt +| | | | | | >--* { +| | | | | | >--+ local-declarations +| | | | | | | >--+ local-declarations +| | | | | | | | >--+ local-declarations +| | | | | | | | | >--+ local-declarations +| | | | | | | | | | >--* epsilon +| | | | | | | | | >--+ var-declaration +| | | | | | | | | | >--+ type-specifier +| | | | | | | | | | | >--* int +| | | | | | | | | | >--* a +| | | | | | | | | | >--* ; +| | | | | | | | >--+ var-declaration +| | | | | | | | | >--+ type-specifier +| | | | | | | | | | >--* int +| | | | | | | | | >--* b +| | | | | | | | | >--* ; +| | | | | | | >--+ var-declaration +| | | | | | | | >--+ type-specifier +| | | | | | | | | >--* int +| | | | | | | | >--* temp +| | | | | | | | >--* ; +| | | | | | >--+ statement-list +| | | | | | | >--+ statement-list +| | | | | | | | >--+ statement-list +| | | | | | | | | >--+ statement-list +| | | | | | | | | | >--+ statement-list +| | | | | | | | | | | >--* epsilon +| | | | | | | | | | >--+ statement +| | | | | | | | | | | >--+ expression-stmt +| | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | >--* a +| | | | | | | | | | | | | >--* = +| | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | >--* u +| | | | | | | | | | | | | | | | | | | >--* [ +| | | | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | | | | | | | | | | >--* 0 +| | | | | | | | | | | | | | | | | | | >--* ] +| | | | | | | | | | | | >--* ; +| | | | | | | | | >--+ statement +| | | | | | | | | | >--+ expression-stmt +| | | | | | | | | | | >--+ expression +| | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | >--* b +| | | | | | | | | | | | >--* = +| | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | >--* v +| | | | | | | | | | | | | | | | | | >--* [ +| | | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | | | | | | | | | >--* 0 +| | | | | | | | | | | | | | | | | | >--* ] +| | | | | | | | | | | >--* ; +| | | | | | | | >--+ statement +| | | | | | | | | >--+ selection-stmt +| | | | | | | | | | >--* if +| | | | | | | | | | >--* ( +| | | | | | | | | | >--+ expression +| | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | >--* a +| | | | | | | | | | | | >--+ relop +| | | | | | | | | | | | | >--* < +| | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | >--* b +| | | | | | | | | | >--* ) +| | | | | | | | | | >--+ statement +| | | | | | | | | | | >--+ compound-stmt +| | | | | | | | | | | | >--* { +| | | | | | | | | | | | >--+ local-declarations +| | | | | | | | | | | | | >--* epsilon +| | | | | | | | | | | | >--+ statement-list +| | | | | | | | | | | | | >--+ statement-list +| | | | | | | | | | | | | | >--+ statement-list +| | | | | | | | | | | | | | | >--+ statement-list +| | | | | | | | | | | | | | | | >--* epsilon +| | | | | | | | | | | | | | | >--+ statement +| | | | | | | | | | | | | | | | >--+ expression-stmt +| | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | >--* temp +| | | | | | | | | | | | | | | | | | >--* = +| | | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | | | | >--* a +| | | | | | | | | | | | | | | | | >--* ; +| | | | | | | | | | | | | | >--+ statement +| | | | | | | | | | | | | | | >--+ expression-stmt +| | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | >--* a +| | | | | | | | | | | | | | | | | >--* = +| | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | | | >--* b +| | | | | | | | | | | | | | | | >--* ; +| | | | | | | | | | | | | >--+ statement +| | | | | | | | | | | | | | >--+ expression-stmt +| | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | >--* b +| | | | | | | | | | | | | | | | >--* = +| | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | | >--* temp +| | | | | | | | | | | | | | | >--* ; +| | | | | | | | | | | | >--* } +| | | | | | | >--+ statement +| | | | | | | | >--+ return-stmt +| | | | | | | | | >--* return +| | | | | | | | | >--+ expression +| | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | >--+ call +| | | | | | | | | | | | | | | >--* gcd +| | | | | | | | | | | | | | | >--* ( +| | | | | | | | | | | | | | | >--+ args +| | | | | | | | | | | | | | | | >--+ arg-list +| | | | | | | | | | | | | | | | | >--+ arg-list +| | | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | | | | >--* a +| | | | | | | | | | | | | | | | | >--* , +| | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | | | >--* b +| | | | | | | | | | | | | | | >--* ) +| | | | | | | | | >--* ; +| | | | | | >--* } +| | >--+ declaration +| | | >--+ fun-declaration +| | | | >--+ type-specifier +| | | | | >--* int +| | | | >--* main +| | | | >--* ( +| | | | >--+ params +| | | | | >--* void +| | | | >--* ) +| | | | >--+ compound-stmt +| | | | | >--* { +| | | | | >--+ local-declarations +| | | | | | >--* epsilon +| | | | | >--+ statement-list +| | | | | | >--+ statement-list +| | | | | | | >--+ statement-list +| | | | | | | | >--+ statement-list +| | | | | | | | | >--* epsilon +| | | | | | | | >--+ statement +| | | | | | | | | >--+ expression-stmt +| | | | | | | | | | >--+ expression +| | | | | | | | | | | >--+ var +| | | | | | | | | | | | >--* x +| | | | | | | | | | | | >--* [ +| | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | | | >--* 0 +| | | | | | | | | | | | >--* ] +| | | | | | | | | | | >--* = +| | | | | | | | | | | >--+ expression +| | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | | >--* 90 +| | | | | | | | | | >--* ; +| | | | | | | >--+ statement +| | | | | | | | >--+ expression-stmt +| | | | | | | | | >--+ expression +| | | | | | | | | | >--+ var +| | | | | | | | | | | >--* y +| | | | | | | | | | | >--* [ +| | | | | | | | | | | >--+ expression +| | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | | >--* 0 +| | | | | | | | | | | >--* ] +| | | | | | | | | | >--* = +| | | | | | | | | | >--+ expression +| | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | >--* 18 +| | | | | | | | | >--* ; +| | | | | | >--+ statement +| | | | | | | >--+ return-stmt +| | | | | | | | >--* return +| | | | | | | | >--+ expression +| | | | | | | | | >--+ simple-expression +| | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | >--+ term +| | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | >--+ call +| | | | | | | | | | | | | | >--* funArray +| | | | | | | | | | | | | | >--* ( +| | | | | | | | | | | | | | >--+ args +| | | | | | | | | | | | | | | >--+ arg-list +| | | | | | | | | | | | | | | | >--+ arg-list +| | | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | | | >--* x +| | | | | | | | | | | | | | | | >--* , +| | | | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | | | | | | | | >--* y +| | | | | | | | | | | | | | >--* ) +| | | | | | | | >--* ; +| | | | | >--* } diff --git a/tests/1-parser/output_student/testcases_general/21-comment.syntax_tree b/tests/1-parser/output_student/testcases_general/21-comment.syntax_tree new file mode 100644 index 0000000000000000000000000000000000000000..14f915622f73699628e9b5fd1ac808ccc78053a5 --- /dev/null +++ b/tests/1-parser/output_student/testcases_general/21-comment.syntax_tree @@ -0,0 +1,23 @@ +>--+ program +| >--+ declaration-list +| | >--+ declaration +| | | >--+ fun-declaration +| | | | >--+ type-specifier +| | | | | >--* void +| | | | >--* main +| | | | >--* ( +| | | | >--+ params +| | | | | >--* void +| | | | >--* ) +| | | | >--+ compound-stmt +| | | | | >--* { +| | | | | >--+ local-declarations +| | | | | | >--* epsilon +| | | | | >--+ statement-list +| | | | | | >--+ statement-list +| | | | | | | >--* epsilon +| | | | | | >--+ statement +| | | | | | | >--+ return-stmt +| | | | | | | | >--* return +| | | | | | | | >--* ; +| | | | | >--* } diff --git a/tests/1-parser/output_student/testcases_general/3-decl_float.syntax_tree b/tests/1-parser/output_student/testcases_general/3-decl_float.syntax_tree new file mode 100644 index 0000000000000000000000000000000000000000..d42a0199e3f3b6bbed377204e1e5f44644293ba9 --- /dev/null +++ b/tests/1-parser/output_student/testcases_general/3-decl_float.syntax_tree @@ -0,0 +1,29 @@ +>--+ program +| >--+ declaration-list +| | >--+ declaration +| | | >--+ fun-declaration +| | | | >--+ type-specifier +| | | | | >--* void +| | | | >--* main +| | | | >--* ( +| | | | >--+ params +| | | | | >--* void +| | | | >--* ) +| | | | >--+ compound-stmt +| | | | | >--* { +| | | | | >--+ local-declarations +| | | | | | >--+ local-declarations +| | | | | | | >--* epsilon +| | | | | | >--+ var-declaration +| | | | | | | >--+ type-specifier +| | | | | | | | >--* float +| | | | | | | >--* a +| | | | | | | >--* ; +| | | | | >--+ statement-list +| | | | | | >--+ statement-list +| | | | | | | >--* epsilon +| | | | | | >--+ statement +| | | | | | | >--+ return-stmt +| | | | | | | | >--* return +| | | | | | | | >--* ; +| | | | | >--* } diff --git a/tests/1-parser/output_student/testcases_general/4-decl_int_array.syntax_tree b/tests/1-parser/output_student/testcases_general/4-decl_int_array.syntax_tree new file mode 100644 index 0000000000000000000000000000000000000000..5c5ad5a44c693926d0eed10583f6cfb2ac801815 --- /dev/null +++ b/tests/1-parser/output_student/testcases_general/4-decl_int_array.syntax_tree @@ -0,0 +1,32 @@ +>--+ program +| >--+ declaration-list +| | >--+ declaration +| | | >--+ fun-declaration +| | | | >--+ type-specifier +| | | | | >--* void +| | | | >--* main +| | | | >--* ( +| | | | >--+ params +| | | | | >--* void +| | | | >--* ) +| | | | >--+ compound-stmt +| | | | | >--* { +| | | | | >--+ local-declarations +| | | | | | >--+ local-declarations +| | | | | | | >--* epsilon +| | | | | | >--+ var-declaration +| | | | | | | >--+ type-specifier +| | | | | | | | >--* int +| | | | | | | >--* a +| | | | | | | >--* [ +| | | | | | | >--* 10 +| | | | | | | >--* ] +| | | | | | | >--* ; +| | | | | >--+ statement-list +| | | | | | >--+ statement-list +| | | | | | | >--* epsilon +| | | | | | >--+ statement +| | | | | | | >--+ return-stmt +| | | | | | | | >--* return +| | | | | | | | >--* ; +| | | | | >--* } diff --git a/tests/1-parser/output_student/testcases_general/5-decl_float_array.syntax_tree b/tests/1-parser/output_student/testcases_general/5-decl_float_array.syntax_tree new file mode 100644 index 0000000000000000000000000000000000000000..eb3ce1abe4f0e603cc60a2a1209664364777ed3b --- /dev/null +++ b/tests/1-parser/output_student/testcases_general/5-decl_float_array.syntax_tree @@ -0,0 +1,32 @@ +>--+ program +| >--+ declaration-list +| | >--+ declaration +| | | >--+ fun-declaration +| | | | >--+ type-specifier +| | | | | >--* void +| | | | >--* main +| | | | >--* ( +| | | | >--+ params +| | | | | >--* void +| | | | >--* ) +| | | | >--+ compound-stmt +| | | | | >--* { +| | | | | >--+ local-declarations +| | | | | | >--+ local-declarations +| | | | | | | >--* epsilon +| | | | | | >--+ var-declaration +| | | | | | | >--+ type-specifier +| | | | | | | | >--* float +| | | | | | | >--* a +| | | | | | | >--* [ +| | | | | | | >--* 10 +| | | | | | | >--* ] +| | | | | | | >--* ; +| | | | | >--+ statement-list +| | | | | | >--+ statement-list +| | | | | | | >--* epsilon +| | | | | | >--+ statement +| | | | | | | >--+ return-stmt +| | | | | | | | >--* return +| | | | | | | | >--* ; +| | | | | >--* } diff --git a/tests/1-parser/output_student/testcases_general/6-num_add_int.syntax_tree b/tests/1-parser/output_student/testcases_general/6-num_add_int.syntax_tree new file mode 100644 index 0000000000000000000000000000000000000000..0dc24fd70e9258de5db10b58a57e97602ccc4cc6 --- /dev/null +++ b/tests/1-parser/output_student/testcases_general/6-num_add_int.syntax_tree @@ -0,0 +1,58 @@ +>--+ program +| >--+ declaration-list +| | >--+ declaration +| | | >--+ fun-declaration +| | | | >--+ type-specifier +| | | | | >--* int +| | | | >--* main +| | | | >--* ( +| | | | >--+ params +| | | | | >--* void +| | | | >--* ) +| | | | >--+ compound-stmt +| | | | | >--* { +| | | | | >--+ local-declarations +| | | | | | >--+ local-declarations +| | | | | | | >--* epsilon +| | | | | | >--+ var-declaration +| | | | | | | >--+ type-specifier +| | | | | | | | >--* int +| | | | | | | >--* a +| | | | | | | >--* ; +| | | | | >--+ statement-list +| | | | | | >--+ statement-list +| | | | | | | >--+ statement-list +| | | | | | | | >--* epsilon +| | | | | | | >--+ statement +| | | | | | | | >--+ expression-stmt +| | | | | | | | | >--+ expression +| | | | | | | | | | >--+ var +| | | | | | | | | | | >--* a +| | | | | | | | | | >--* = +| | | | | | | | | | >--+ expression +| | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | | >--* 1000 +| | | | | | | | | | | | | >--+ addop +| | | | | | | | | | | | | | >--* + +| | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | >--* 234 +| | | | | | | | | >--* ; +| | | | | | >--+ statement +| | | | | | | >--+ return-stmt +| | | | | | | | >--* return +| | | | | | | | >--+ expression +| | | | | | | | | >--+ simple-expression +| | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | >--+ term +| | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | >--* a +| | | | | | | | >--* ; +| | | | | >--* } diff --git a/tests/1-parser/output_student/testcases_general/7-assign_int_var_local.syntax_tree b/tests/1-parser/output_student/testcases_general/7-assign_int_var_local.syntax_tree new file mode 100644 index 0000000000000000000000000000000000000000..276c6b7e21b6ace3f3d0add59e7f09a739490e1c --- /dev/null +++ b/tests/1-parser/output_student/testcases_general/7-assign_int_var_local.syntax_tree @@ -0,0 +1,51 @@ +>--+ program +| >--+ declaration-list +| | >--+ declaration +| | | >--+ fun-declaration +| | | | >--+ type-specifier +| | | | | >--* int +| | | | >--* main +| | | | >--* ( +| | | | >--+ params +| | | | | >--* void +| | | | >--* ) +| | | | >--+ compound-stmt +| | | | | >--* { +| | | | | >--+ local-declarations +| | | | | | >--+ local-declarations +| | | | | | | >--* epsilon +| | | | | | >--+ var-declaration +| | | | | | | >--+ type-specifier +| | | | | | | | >--* int +| | | | | | | >--* a +| | | | | | | >--* ; +| | | | | >--+ statement-list +| | | | | | >--+ statement-list +| | | | | | | >--+ statement-list +| | | | | | | | >--* epsilon +| | | | | | | >--+ statement +| | | | | | | | >--+ expression-stmt +| | | | | | | | | >--+ expression +| | | | | | | | | | >--+ var +| | | | | | | | | | | >--* a +| | | | | | | | | | >--* = +| | | | | | | | | | >--+ expression +| | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | >--* 1234 +| | | | | | | | | >--* ; +| | | | | | >--+ statement +| | | | | | | >--+ return-stmt +| | | | | | | | >--* return +| | | | | | | | >--+ expression +| | | | | | | | | >--+ simple-expression +| | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | >--+ term +| | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | >--* a +| | | | | | | | >--* ; +| | | | | >--* } diff --git a/tests/1-parser/output_student/testcases_general/8-assign_int_array_local.syntax_tree b/tests/1-parser/output_student/testcases_general/8-assign_int_array_local.syntax_tree new file mode 100644 index 0000000000000000000000000000000000000000..7e7acd88ef9b278cd4dfcd42fbb29c0e93060f28 --- /dev/null +++ b/tests/1-parser/output_student/testcases_general/8-assign_int_array_local.syntax_tree @@ -0,0 +1,72 @@ +>--+ program +| >--+ declaration-list +| | >--+ declaration +| | | >--+ fun-declaration +| | | | >--+ type-specifier +| | | | | >--* int +| | | | >--* main +| | | | >--* ( +| | | | >--+ params +| | | | | >--* void +| | | | >--* ) +| | | | >--+ compound-stmt +| | | | | >--* { +| | | | | >--+ local-declarations +| | | | | | >--+ local-declarations +| | | | | | | >--* epsilon +| | | | | | >--+ var-declaration +| | | | | | | >--+ type-specifier +| | | | | | | | >--* int +| | | | | | | >--* a +| | | | | | | >--* [ +| | | | | | | >--* 10 +| | | | | | | >--* ] +| | | | | | | >--* ; +| | | | | >--+ statement-list +| | | | | | >--+ statement-list +| | | | | | | >--+ statement-list +| | | | | | | | >--* epsilon +| | | | | | | >--+ statement +| | | | | | | | >--+ expression-stmt +| | | | | | | | | >--+ expression +| | | | | | | | | | >--+ var +| | | | | | | | | | | >--* a +| | | | | | | | | | | >--* [ +| | | | | | | | | | | >--+ expression +| | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | | >--* 3 +| | | | | | | | | | | >--* ] +| | | | | | | | | | >--* = +| | | | | | | | | | >--+ expression +| | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | >--* 1234 +| | | | | | | | | >--* ; +| | | | | | >--+ statement +| | | | | | | >--+ return-stmt +| | | | | | | | >--* return +| | | | | | | | >--+ expression +| | | | | | | | | >--+ simple-expression +| | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | >--+ term +| | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | >--* a +| | | | | | | | | | | | | | >--* [ +| | | | | | | | | | | | | | >--+ expression +| | | | | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | | | | | >--* 3 +| | | | | | | | | | | | | | >--* ] +| | | | | | | | >--* ; +| | | | | >--* } diff --git a/tests/1-parser/output_student/testcases_general/9-assign_cast.syntax_tree b/tests/1-parser/output_student/testcases_general/9-assign_cast.syntax_tree new file mode 100644 index 0000000000000000000000000000000000000000..69fc176e92d27fe522dee156ccd4eb8b27321f64 --- /dev/null +++ b/tests/1-parser/output_student/testcases_general/9-assign_cast.syntax_tree @@ -0,0 +1,93 @@ +>--+ program +| >--+ declaration-list +| | >--+ declaration +| | | >--+ fun-declaration +| | | | >--+ type-specifier +| | | | | >--* int +| | | | >--* main +| | | | >--* ( +| | | | >--+ params +| | | | | >--* void +| | | | >--* ) +| | | | >--+ compound-stmt +| | | | | >--* { +| | | | | >--+ local-declarations +| | | | | | >--+ local-declarations +| | | | | | | >--+ local-declarations +| | | | | | | | >--* epsilon +| | | | | | | >--+ var-declaration +| | | | | | | | >--+ type-specifier +| | | | | | | | | >--* int +| | | | | | | | >--* a +| | | | | | | | >--* ; +| | | | | | >--+ var-declaration +| | | | | | | >--+ type-specifier +| | | | | | | | >--* int +| | | | | | | >--* b +| | | | | | | >--* ; +| | | | | >--+ statement-list +| | | | | | >--+ statement-list +| | | | | | | >--+ statement-list +| | | | | | | | >--+ statement-list +| | | | | | | | | >--* epsilon +| | | | | | | | >--+ statement +| | | | | | | | | >--+ expression-stmt +| | | | | | | | | | >--+ expression +| | | | | | | | | | | >--+ var +| | | | | | | | | | | | >--* a +| | | | | | | | | | | >--* = +| | | | | | | | | | | >--+ expression +| | | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | | >--* 1 +| | | | | | | | | | | | | >--+ relop +| | | | | | | | | | | | | | >--* < +| | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | | >--* 3 +| | | | | | | | | | >--* ; +| | | | | | | >--+ statement +| | | | | | | | >--+ expression-stmt +| | | | | | | | | >--+ expression +| | | | | | | | | | >--+ var +| | | | | | | | | | | >--* b +| | | | | | | | | | >--* = +| | | | | | | | | | >--+ expression +| | | | | | | | | | | >--+ simple-expression +| | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | | >--+ integer +| | | | | | | | | | | | | | | | | >--* 2 +| | | | | | | | | | | | | >--+ addop +| | | | | | | | | | | | | | >--* + +| | | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | | >--+ float +| | | | | | | | | | | | | | | | >--* 2.4 +| | | | | | | | | >--* ; +| | | | | | >--+ statement +| | | | | | | >--+ return-stmt +| | | | | | | | >--* return +| | | | | | | | >--+ expression +| | | | | | | | | >--+ simple-expression +| | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | >--+ additive-expression +| | | | | | | | | | | | >--+ term +| | | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | | >--* a +| | | | | | | | | | | >--+ addop +| | | | | | | | | | | | >--* + +| | | | | | | | | | | >--+ term +| | | | | | | | | | | | >--+ factor +| | | | | | | | | | | | | >--+ var +| | | | | | | | | | | | | | >--* b +| | | | | | | | >--* ; +| | | | | >--* } diff --git a/tests/2-ir-gen/autogen/.gitignore b/tests/2-ir-gen/autogen/.gitignore old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/answers/lv0_1/decl_float.out b/tests/2-ir-gen/autogen/answers/lv0_1/decl_float.out old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/answers/lv0_1/decl_float_array.out b/tests/2-ir-gen/autogen/answers/lv0_1/decl_float_array.out old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/answers/lv0_1/decl_int.out b/tests/2-ir-gen/autogen/answers/lv0_1/decl_int.out old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/answers/lv0_1/decl_int_array.out b/tests/2-ir-gen/autogen/answers/lv0_1/decl_int_array.out old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/answers/lv0_1/input.in b/tests/2-ir-gen/autogen/answers/lv0_1/input.in old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/answers/lv0_1/input.out b/tests/2-ir-gen/autogen/answers/lv0_1/input.out old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/answers/lv0_1/output_float.out b/tests/2-ir-gen/autogen/answers/lv0_1/output_float.out old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/answers/lv0_1/output_int.out b/tests/2-ir-gen/autogen/answers/lv0_1/output_int.out old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/answers/lv0_1/return.out b/tests/2-ir-gen/autogen/answers/lv0_1/return.out old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/answers/lv0_2/num_add_float.out b/tests/2-ir-gen/autogen/answers/lv0_2/num_add_float.out old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/answers/lv0_2/num_add_int.out b/tests/2-ir-gen/autogen/answers/lv0_2/num_add_int.out old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/answers/lv0_2/num_add_mixed.out b/tests/2-ir-gen/autogen/answers/lv0_2/num_add_mixed.out old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/answers/lv0_2/num_comp1.out b/tests/2-ir-gen/autogen/answers/lv0_2/num_comp1.out old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/answers/lv0_2/num_comp2.out b/tests/2-ir-gen/autogen/answers/lv0_2/num_comp2.out old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/answers/lv0_2/num_div_float.out b/tests/2-ir-gen/autogen/answers/lv0_2/num_div_float.out old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/answers/lv0_2/num_div_int.out b/tests/2-ir-gen/autogen/answers/lv0_2/num_div_int.out old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/answers/lv0_2/num_div_mixed.out b/tests/2-ir-gen/autogen/answers/lv0_2/num_div_mixed.out old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/answers/lv0_2/num_eq_float.out b/tests/2-ir-gen/autogen/answers/lv0_2/num_eq_float.out old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/answers/lv0_2/num_eq_int.out b/tests/2-ir-gen/autogen/answers/lv0_2/num_eq_int.out old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/answers/lv0_2/num_eq_mixed.out b/tests/2-ir-gen/autogen/answers/lv0_2/num_eq_mixed.out old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/answers/lv0_2/num_ge_float.out b/tests/2-ir-gen/autogen/answers/lv0_2/num_ge_float.out old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/answers/lv0_2/num_ge_int.out b/tests/2-ir-gen/autogen/answers/lv0_2/num_ge_int.out old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/answers/lv0_2/num_ge_mixed.out b/tests/2-ir-gen/autogen/answers/lv0_2/num_ge_mixed.out old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/answers/lv0_2/num_gt_float.out b/tests/2-ir-gen/autogen/answers/lv0_2/num_gt_float.out old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/answers/lv0_2/num_gt_int.out b/tests/2-ir-gen/autogen/answers/lv0_2/num_gt_int.out old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/answers/lv0_2/num_gt_mixed.out b/tests/2-ir-gen/autogen/answers/lv0_2/num_gt_mixed.out old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/answers/lv0_2/num_le_float.out b/tests/2-ir-gen/autogen/answers/lv0_2/num_le_float.out old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/answers/lv0_2/num_le_int.out b/tests/2-ir-gen/autogen/answers/lv0_2/num_le_int.out old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/answers/lv0_2/num_le_mixed.out b/tests/2-ir-gen/autogen/answers/lv0_2/num_le_mixed.out old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/answers/lv0_2/num_lt_float.out b/tests/2-ir-gen/autogen/answers/lv0_2/num_lt_float.out old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/answers/lv0_2/num_lt_int.out b/tests/2-ir-gen/autogen/answers/lv0_2/num_lt_int.out old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/answers/lv0_2/num_lt_mixed.out b/tests/2-ir-gen/autogen/answers/lv0_2/num_lt_mixed.out old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/answers/lv0_2/num_mul_float.out b/tests/2-ir-gen/autogen/answers/lv0_2/num_mul_float.out old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/answers/lv0_2/num_mul_int.out b/tests/2-ir-gen/autogen/answers/lv0_2/num_mul_int.out old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/answers/lv0_2/num_mul_mixed.out b/tests/2-ir-gen/autogen/answers/lv0_2/num_mul_mixed.out old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/answers/lv0_2/num_neq_float.out b/tests/2-ir-gen/autogen/answers/lv0_2/num_neq_float.out old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/answers/lv0_2/num_neq_int.out b/tests/2-ir-gen/autogen/answers/lv0_2/num_neq_int.out old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/answers/lv0_2/num_neq_mixed.out b/tests/2-ir-gen/autogen/answers/lv0_2/num_neq_mixed.out old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/answers/lv0_2/num_sub_float.out b/tests/2-ir-gen/autogen/answers/lv0_2/num_sub_float.out old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/answers/lv0_2/num_sub_int.out b/tests/2-ir-gen/autogen/answers/lv0_2/num_sub_int.out old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/answers/lv0_2/num_sub_mixed.out b/tests/2-ir-gen/autogen/answers/lv0_2/num_sub_mixed.out old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/answers/lv1/assign_cmp.out b/tests/2-ir-gen/autogen/answers/lv1/assign_cmp.out old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/answers/lv1/assign_float_array_global.out b/tests/2-ir-gen/autogen/answers/lv1/assign_float_array_global.out old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/answers/lv1/assign_float_array_local.out b/tests/2-ir-gen/autogen/answers/lv1/assign_float_array_local.out old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/answers/lv1/assign_float_var_global.out b/tests/2-ir-gen/autogen/answers/lv1/assign_float_var_global.out old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/answers/lv1/assign_float_var_local.out b/tests/2-ir-gen/autogen/answers/lv1/assign_float_var_local.out old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/answers/lv1/assign_int_array_global.out b/tests/2-ir-gen/autogen/answers/lv1/assign_int_array_global.out old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/answers/lv1/assign_int_array_local.out b/tests/2-ir-gen/autogen/answers/lv1/assign_int_array_local.out old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/answers/lv1/assign_int_var_global.out b/tests/2-ir-gen/autogen/answers/lv1/assign_int_var_global.out old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/answers/lv1/assign_int_var_local.out b/tests/2-ir-gen/autogen/answers/lv1/assign_int_var_local.out old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/answers/lv1/idx_float.out b/tests/2-ir-gen/autogen/answers/lv1/idx_float.out old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/answers/lv1/innout.in b/tests/2-ir-gen/autogen/answers/lv1/innout.in old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/answers/lv1/innout.out b/tests/2-ir-gen/autogen/answers/lv1/innout.out old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/answers/lv1/iteration1.out b/tests/2-ir-gen/autogen/answers/lv1/iteration1.out old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/answers/lv1/iteration2.out b/tests/2-ir-gen/autogen/answers/lv1/iteration2.out old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/answers/lv1/negidx_float.out b/tests/2-ir-gen/autogen/answers/lv1/negidx_float.out old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/answers/lv1/negidx_floatfuncall.out b/tests/2-ir-gen/autogen/answers/lv1/negidx_floatfuncall.out old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/answers/lv1/negidx_int.out b/tests/2-ir-gen/autogen/answers/lv1/negidx_int.out old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/answers/lv1/negidx_intfuncall.out b/tests/2-ir-gen/autogen/answers/lv1/negidx_intfuncall.out old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/answers/lv1/negidx_voidfuncall.out b/tests/2-ir-gen/autogen/answers/lv1/negidx_voidfuncall.out old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/answers/lv1/scope.out b/tests/2-ir-gen/autogen/answers/lv1/scope.out old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/answers/lv1/selection1.out b/tests/2-ir-gen/autogen/answers/lv1/selection1.out old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/answers/lv1/selection2.out b/tests/2-ir-gen/autogen/answers/lv1/selection2.out old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/answers/lv1/selection3.out b/tests/2-ir-gen/autogen/answers/lv1/selection3.out old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/answers/lv1/transfer_float_to_int.out b/tests/2-ir-gen/autogen/answers/lv1/transfer_float_to_int.out old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/answers/lv1/transfer_int_to_float.out b/tests/2-ir-gen/autogen/answers/lv1/transfer_int_to_float.out old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/answers/lv2/assign_chain.out b/tests/2-ir-gen/autogen/answers/lv2/assign_chain.out old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/answers/lv2/funcall_array.out b/tests/2-ir-gen/autogen/answers/lv2/funcall_array.out old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/answers/lv2/funcall_array_array.out b/tests/2-ir-gen/autogen/answers/lv2/funcall_array_array.out old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/answers/lv2/funcall_chain.out b/tests/2-ir-gen/autogen/answers/lv2/funcall_chain.out old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/answers/lv2/funcall_float_array.out b/tests/2-ir-gen/autogen/answers/lv2/funcall_float_array.out old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/answers/lv2/funcall_int_array.out b/tests/2-ir-gen/autogen/answers/lv2/funcall_int_array.out old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/answers/lv2/funcall_type_mismatch1.out b/tests/2-ir-gen/autogen/answers/lv2/funcall_type_mismatch1.out old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/answers/lv2/funcall_type_mismatch2.out b/tests/2-ir-gen/autogen/answers/lv2/funcall_type_mismatch2.out old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/answers/lv2/funcall_var.out b/tests/2-ir-gen/autogen/answers/lv2/funcall_var.out old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/answers/lv2/return_in_middle1.out b/tests/2-ir-gen/autogen/answers/lv2/return_in_middle1.out old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/answers/lv2/return_in_middle2.out b/tests/2-ir-gen/autogen/answers/lv2/return_in_middle2.out old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/answers/lv2/return_type_mismatch1.out b/tests/2-ir-gen/autogen/answers/lv2/return_type_mismatch1.out old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/answers/lv2/return_type_mismatch2.out b/tests/2-ir-gen/autogen/answers/lv2/return_type_mismatch2.out old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/answers/lv3/complex1.out b/tests/2-ir-gen/autogen/answers/lv3/complex1.out old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/answers/lv3/complex2.in b/tests/2-ir-gen/autogen/answers/lv3/complex2.in old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/answers/lv3/complex2.out b/tests/2-ir-gen/autogen/answers/lv3/complex2.out old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/answers/lv3/complex3.in b/tests/2-ir-gen/autogen/answers/lv3/complex3.in old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/answers/lv3/complex3.out b/tests/2-ir-gen/autogen/answers/lv3/complex3.out old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/answers/lv3/complex4.out b/tests/2-ir-gen/autogen/answers/lv3/complex4.out old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/testcases/lv0_1/decl_float.cminus b/tests/2-ir-gen/autogen/testcases/lv0_1/decl_float.cminus old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/testcases/lv0_1/decl_float_array.cminus b/tests/2-ir-gen/autogen/testcases/lv0_1/decl_float_array.cminus old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/testcases/lv0_1/decl_int.cminus b/tests/2-ir-gen/autogen/testcases/lv0_1/decl_int.cminus old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/testcases/lv0_1/decl_int_array.cminus b/tests/2-ir-gen/autogen/testcases/lv0_1/decl_int_array.cminus old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/testcases/lv0_1/input.cminus b/tests/2-ir-gen/autogen/testcases/lv0_1/input.cminus old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/testcases/lv0_1/output_float.cminus b/tests/2-ir-gen/autogen/testcases/lv0_1/output_float.cminus old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/testcases/lv0_1/output_int.cminus b/tests/2-ir-gen/autogen/testcases/lv0_1/output_int.cminus old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/testcases/lv0_1/return.cminus b/tests/2-ir-gen/autogen/testcases/lv0_1/return.cminus old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/testcases/lv0_1/test b/tests/2-ir-gen/autogen/testcases/lv0_1/test new file mode 100755 index 0000000000000000000000000000000000000000..0d986a0035b980c39d1c8d34633965bcf98c8b42 Binary files /dev/null and b/tests/2-ir-gen/autogen/testcases/lv0_1/test differ diff --git a/tests/2-ir-gen/autogen/testcases/lv0_1/test.ll b/tests/2-ir-gen/autogen/testcases/lv0_1/test.ll new file mode 100644 index 0000000000000000000000000000000000000000..d0769e0f4d0cad93b8a45dd29977fd626ca4fd1a --- /dev/null +++ b/tests/2-ir-gen/autogen/testcases/lv0_1/test.ll @@ -0,0 +1,16 @@ +; ModuleID = 'cminus' +source_filename = "/jhe/2024ustc-jianmu-compiler_impl/tests/2-ir-gen/autogen/testcases/lv0_1/decl_float_array.cminus" + +declare i32 @input() + +declare void @output(i32) + +declare void @outputFloat(float) + +declare void @neg_idx_except() + +define void @main() { +label_entry: + %op0 = alloca [10 x float] + ret void +} diff --git a/tests/2-ir-gen/autogen/testcases/lv0_2/num_add_float.cminus b/tests/2-ir-gen/autogen/testcases/lv0_2/num_add_float.cminus old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/testcases/lv0_2/num_add_int.cminus b/tests/2-ir-gen/autogen/testcases/lv0_2/num_add_int.cminus old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/testcases/lv0_2/num_add_mixed.cminus b/tests/2-ir-gen/autogen/testcases/lv0_2/num_add_mixed.cminus old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/testcases/lv0_2/num_comp1.cminus b/tests/2-ir-gen/autogen/testcases/lv0_2/num_comp1.cminus old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/testcases/lv0_2/num_comp2.cminus b/tests/2-ir-gen/autogen/testcases/lv0_2/num_comp2.cminus old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/testcases/lv0_2/num_div_float.cminus b/tests/2-ir-gen/autogen/testcases/lv0_2/num_div_float.cminus old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/testcases/lv0_2/num_div_int.cminus b/tests/2-ir-gen/autogen/testcases/lv0_2/num_div_int.cminus old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/testcases/lv0_2/num_div_mixed.cminus b/tests/2-ir-gen/autogen/testcases/lv0_2/num_div_mixed.cminus old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/testcases/lv0_2/num_eq_float.cminus b/tests/2-ir-gen/autogen/testcases/lv0_2/num_eq_float.cminus old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/testcases/lv0_2/num_eq_int.cminus b/tests/2-ir-gen/autogen/testcases/lv0_2/num_eq_int.cminus old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/testcases/lv0_2/num_eq_mixed.cminus b/tests/2-ir-gen/autogen/testcases/lv0_2/num_eq_mixed.cminus old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/testcases/lv0_2/num_ge_float.cminus b/tests/2-ir-gen/autogen/testcases/lv0_2/num_ge_float.cminus old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/testcases/lv0_2/num_ge_int.cminus b/tests/2-ir-gen/autogen/testcases/lv0_2/num_ge_int.cminus old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/testcases/lv0_2/num_ge_mixed.cminus b/tests/2-ir-gen/autogen/testcases/lv0_2/num_ge_mixed.cminus old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/testcases/lv0_2/num_gt_float.cminus b/tests/2-ir-gen/autogen/testcases/lv0_2/num_gt_float.cminus old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/testcases/lv0_2/num_gt_int.cminus b/tests/2-ir-gen/autogen/testcases/lv0_2/num_gt_int.cminus old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/testcases/lv0_2/num_gt_mixed.cminus b/tests/2-ir-gen/autogen/testcases/lv0_2/num_gt_mixed.cminus old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/testcases/lv0_2/num_le_float.cminus b/tests/2-ir-gen/autogen/testcases/lv0_2/num_le_float.cminus old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/testcases/lv0_2/num_le_int.cminus b/tests/2-ir-gen/autogen/testcases/lv0_2/num_le_int.cminus old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/testcases/lv0_2/num_le_mixed.cminus b/tests/2-ir-gen/autogen/testcases/lv0_2/num_le_mixed.cminus old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/testcases/lv0_2/num_lt_float.cminus b/tests/2-ir-gen/autogen/testcases/lv0_2/num_lt_float.cminus old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/testcases/lv0_2/num_lt_int.cminus b/tests/2-ir-gen/autogen/testcases/lv0_2/num_lt_int.cminus old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/testcases/lv0_2/num_lt_mixed.cminus b/tests/2-ir-gen/autogen/testcases/lv0_2/num_lt_mixed.cminus old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/testcases/lv0_2/num_mul_float.cminus b/tests/2-ir-gen/autogen/testcases/lv0_2/num_mul_float.cminus old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/testcases/lv0_2/num_mul_int.cminus b/tests/2-ir-gen/autogen/testcases/lv0_2/num_mul_int.cminus old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/testcases/lv0_2/num_mul_mixed.cminus b/tests/2-ir-gen/autogen/testcases/lv0_2/num_mul_mixed.cminus old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/testcases/lv0_2/num_neq_float.cminus b/tests/2-ir-gen/autogen/testcases/lv0_2/num_neq_float.cminus old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/testcases/lv0_2/num_neq_int.cminus b/tests/2-ir-gen/autogen/testcases/lv0_2/num_neq_int.cminus old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/testcases/lv0_2/num_neq_mixed.cminus b/tests/2-ir-gen/autogen/testcases/lv0_2/num_neq_mixed.cminus old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/testcases/lv0_2/num_sub_float.cminus b/tests/2-ir-gen/autogen/testcases/lv0_2/num_sub_float.cminus old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/testcases/lv0_2/num_sub_int.cminus b/tests/2-ir-gen/autogen/testcases/lv0_2/num_sub_int.cminus old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/testcases/lv0_2/num_sub_mixed.cminus b/tests/2-ir-gen/autogen/testcases/lv0_2/num_sub_mixed.cminus old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/testcases/lv1/assign_cmp.cminus b/tests/2-ir-gen/autogen/testcases/lv1/assign_cmp.cminus old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/testcases/lv1/assign_float_array_global.cminus b/tests/2-ir-gen/autogen/testcases/lv1/assign_float_array_global.cminus old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/testcases/lv1/assign_float_array_local.cminus b/tests/2-ir-gen/autogen/testcases/lv1/assign_float_array_local.cminus old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/testcases/lv1/assign_float_var_global.cminus b/tests/2-ir-gen/autogen/testcases/lv1/assign_float_var_global.cminus old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/testcases/lv1/assign_float_var_local.cminus b/tests/2-ir-gen/autogen/testcases/lv1/assign_float_var_local.cminus old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/testcases/lv1/assign_int_array_global.cminus b/tests/2-ir-gen/autogen/testcases/lv1/assign_int_array_global.cminus old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/testcases/lv1/assign_int_array_local.cminus b/tests/2-ir-gen/autogen/testcases/lv1/assign_int_array_local.cminus old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/testcases/lv1/assign_int_var_global.cminus b/tests/2-ir-gen/autogen/testcases/lv1/assign_int_var_global.cminus old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/testcases/lv1/assign_int_var_local.cminus b/tests/2-ir-gen/autogen/testcases/lv1/assign_int_var_local.cminus old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/testcases/lv1/idx_float.cminus b/tests/2-ir-gen/autogen/testcases/lv1/idx_float.cminus old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/testcases/lv1/innout.cminus b/tests/2-ir-gen/autogen/testcases/lv1/innout.cminus old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/testcases/lv1/iteration1.cminus b/tests/2-ir-gen/autogen/testcases/lv1/iteration1.cminus old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/testcases/lv1/iteration2.cminus b/tests/2-ir-gen/autogen/testcases/lv1/iteration2.cminus old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/testcases/lv1/negidx_float.cminus b/tests/2-ir-gen/autogen/testcases/lv1/negidx_float.cminus old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/testcases/lv1/negidx_floatfuncall.cminus b/tests/2-ir-gen/autogen/testcases/lv1/negidx_floatfuncall.cminus old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/testcases/lv1/negidx_int.cminus b/tests/2-ir-gen/autogen/testcases/lv1/negidx_int.cminus old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/testcases/lv1/negidx_intfuncall.cminus b/tests/2-ir-gen/autogen/testcases/lv1/negidx_intfuncall.cminus old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/testcases/lv1/negidx_voidfuncall.cminus b/tests/2-ir-gen/autogen/testcases/lv1/negidx_voidfuncall.cminus old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/testcases/lv1/scope.cminus b/tests/2-ir-gen/autogen/testcases/lv1/scope.cminus old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/testcases/lv1/selection1.cminus b/tests/2-ir-gen/autogen/testcases/lv1/selection1.cminus old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/testcases/lv1/selection2.cminus b/tests/2-ir-gen/autogen/testcases/lv1/selection2.cminus old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/testcases/lv1/selection3.cminus b/tests/2-ir-gen/autogen/testcases/lv1/selection3.cminus old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/testcases/lv1/transfer_float_to_int.cminus b/tests/2-ir-gen/autogen/testcases/lv1/transfer_float_to_int.cminus old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/testcases/lv1/transfer_int_to_float.cminus b/tests/2-ir-gen/autogen/testcases/lv1/transfer_int_to_float.cminus old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/testcases/lv2/assign_chain.cminus b/tests/2-ir-gen/autogen/testcases/lv2/assign_chain.cminus old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/testcases/lv2/funcall_array_array.cminus b/tests/2-ir-gen/autogen/testcases/lv2/funcall_array_array.cminus old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/testcases/lv2/funcall_chain.cminus b/tests/2-ir-gen/autogen/testcases/lv2/funcall_chain.cminus old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/testcases/lv2/funcall_float_array.cminus b/tests/2-ir-gen/autogen/testcases/lv2/funcall_float_array.cminus old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/testcases/lv2/funcall_int_array.cminus b/tests/2-ir-gen/autogen/testcases/lv2/funcall_int_array.cminus old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/testcases/lv2/funcall_type_mismatch1.cminus b/tests/2-ir-gen/autogen/testcases/lv2/funcall_type_mismatch1.cminus old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/testcases/lv2/funcall_type_mismatch2.cminus b/tests/2-ir-gen/autogen/testcases/lv2/funcall_type_mismatch2.cminus old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/testcases/lv2/funcall_var.cminus b/tests/2-ir-gen/autogen/testcases/lv2/funcall_var.cminus old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/testcases/lv2/return_in_middle1.cminus b/tests/2-ir-gen/autogen/testcases/lv2/return_in_middle1.cminus old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/testcases/lv2/return_in_middle2.cminus b/tests/2-ir-gen/autogen/testcases/lv2/return_in_middle2.cminus old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/testcases/lv2/return_type_mismatch1.cminus b/tests/2-ir-gen/autogen/testcases/lv2/return_type_mismatch1.cminus old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/testcases/lv2/return_type_mismatch2.cminus b/tests/2-ir-gen/autogen/testcases/lv2/return_type_mismatch2.cminus old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/testcases/lv3/complex1.cminus b/tests/2-ir-gen/autogen/testcases/lv3/complex1.cminus old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/testcases/lv3/complex2.cminus b/tests/2-ir-gen/autogen/testcases/lv3/complex2.cminus old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/testcases/lv3/complex3.cminus b/tests/2-ir-gen/autogen/testcases/lv3/complex3.cminus old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/autogen/testcases/lv3/complex4.cminus b/tests/2-ir-gen/autogen/testcases/lv3/complex4.cminus old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/warmup/c_cases/assign.c b/tests/2-ir-gen/warmup/c_cases/assign.c old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/warmup/c_cases/fun.c b/tests/2-ir-gen/warmup/c_cases/fun.c old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/warmup/c_cases/if.c b/tests/2-ir-gen/warmup/c_cases/if.c old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/warmup/c_cases/while.c b/tests/2-ir-gen/warmup/c_cases/while.c old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/warmup/calculator/CMakeLists.txt b/tests/2-ir-gen/warmup/calculator/CMakeLists.txt old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/warmup/calculator/calc.cpp b/tests/2-ir-gen/warmup/calculator/calc.cpp old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/warmup/calculator/calc_ast.cpp b/tests/2-ir-gen/warmup/calculator/calc_ast.cpp old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/warmup/calculator/calc_ast.hpp b/tests/2-ir-gen/warmup/calculator/calc_ast.hpp old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/warmup/calculator/calc_builder.cpp b/tests/2-ir-gen/warmup/calculator/calc_builder.cpp old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/warmup/calculator/calc_builder.hpp b/tests/2-ir-gen/warmup/calculator/calc_builder.hpp old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/warmup/calculator/calculator.l b/tests/2-ir-gen/warmup/calculator/calculator.l old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/warmup/calculator/calculator.y b/tests/2-ir-gen/warmup/calculator/calculator.y old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/warmup/stu_cpp/assign_generator.cpp b/tests/2-ir-gen/warmup/stu_cpp/assign_generator.cpp old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/warmup/stu_cpp/fun_generator.cpp b/tests/2-ir-gen/warmup/stu_cpp/fun_generator.cpp old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/warmup/stu_cpp/if_generator.cpp b/tests/2-ir-gen/warmup/stu_cpp/if_generator.cpp old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/warmup/stu_cpp/while_generator.cpp b/tests/2-ir-gen/warmup/stu_cpp/while_generator.cpp old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/warmup/stu_ll/assign_hand.ll b/tests/2-ir-gen/warmup/stu_ll/assign_hand.ll old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/warmup/stu_ll/fun_hand.ll b/tests/2-ir-gen/warmup/stu_ll/fun_hand.ll old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/warmup/stu_ll/if_hand.ll b/tests/2-ir-gen/warmup/stu_ll/if_hand.ll old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/warmup/stu_ll/while_hand.ll b/tests/2-ir-gen/warmup/stu_ll/while_hand.ll old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/warmup/ta_gcd/gcd_array.c b/tests/2-ir-gen/warmup/ta_gcd/gcd_array.c old mode 100644 new mode 100755 diff --git a/tests/2-ir-gen/warmup/ta_gcd/gcd_array_generator.cpp b/tests/2-ir-gen/warmup/ta_gcd/gcd_array_generator.cpp old mode 100644 new mode 100755 diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt old mode 100644 new mode 100755 diff --git a/tests/testcases_general/1-return.cminus b/tests/testcases_general/1-return.cminus old mode 100644 new mode 100755 diff --git a/tests/testcases_general/1-return.out b/tests/testcases_general/1-return.out old mode 100644 new mode 100755 diff --git a/tests/testcases_general/10-funcall.cminus b/tests/testcases_general/10-funcall.cminus old mode 100644 new mode 100755 diff --git a/tests/testcases_general/10-funcall.out b/tests/testcases_general/10-funcall.out old mode 100644 new mode 100755 diff --git a/tests/testcases_general/11-funcall_chain.cminus b/tests/testcases_general/11-funcall_chain.cminus old mode 100644 new mode 100755 diff --git a/tests/testcases_general/11-funcall_chain.out b/tests/testcases_general/11-funcall_chain.out old mode 100644 new mode 100755 diff --git a/tests/testcases_general/12-funcall_recursion.cminus b/tests/testcases_general/12-funcall_recursion.cminus old mode 100644 new mode 100755 diff --git a/tests/testcases_general/12-funcall_recursion.out b/tests/testcases_general/12-funcall_recursion.out old mode 100644 new mode 100755 diff --git a/tests/testcases_general/13-if_stmt.cminus b/tests/testcases_general/13-if_stmt.cminus old mode 100644 new mode 100755 diff --git a/tests/testcases_general/13-if_stmt.out b/tests/testcases_general/13-if_stmt.out old mode 100644 new mode 100755 diff --git a/tests/testcases_general/14-while_stmt.cminus b/tests/testcases_general/14-while_stmt.cminus old mode 100644 new mode 100755 diff --git a/tests/testcases_general/14-while_stmt.out b/tests/testcases_general/14-while_stmt.out old mode 100644 new mode 100755 diff --git a/tests/testcases_general/15-if_while.cminus b/tests/testcases_general/15-if_while.cminus old mode 100644 new mode 100755 diff --git a/tests/testcases_general/15-if_while.out b/tests/testcases_general/15-if_while.out old mode 100644 new mode 100755 diff --git a/tests/testcases_general/16-if_chain.cminus b/tests/testcases_general/16-if_chain.cminus old mode 100644 new mode 100755 diff --git a/tests/testcases_general/16-if_chain.out b/tests/testcases_general/16-if_chain.out old mode 100644 new mode 100755 diff --git a/tests/testcases_general/17-while_chain.cminus b/tests/testcases_general/17-while_chain.cminus old mode 100644 new mode 100755 diff --git a/tests/testcases_general/17-while_chain.out b/tests/testcases_general/17-while_chain.out old mode 100644 new mode 100755 diff --git a/tests/testcases_general/18-global_var.cminus b/tests/testcases_general/18-global_var.cminus old mode 100644 new mode 100755 diff --git a/tests/testcases_general/18-global_var.out b/tests/testcases_general/18-global_var.out old mode 100644 new mode 100755 diff --git a/tests/testcases_general/19-global_local_var.cminus b/tests/testcases_general/19-global_local_var.cminus old mode 100644 new mode 100755 diff --git a/tests/testcases_general/19-global_local_var.out b/tests/testcases_general/19-global_local_var.out old mode 100644 new mode 100755 diff --git a/tests/testcases_general/2-decl_int.cminus b/tests/testcases_general/2-decl_int.cminus old mode 100644 new mode 100755 diff --git a/tests/testcases_general/2-decl_int.out b/tests/testcases_general/2-decl_int.out old mode 100644 new mode 100755 diff --git a/tests/testcases_general/20-gcd_array.cminus b/tests/testcases_general/20-gcd_array.cminus old mode 100644 new mode 100755 diff --git a/tests/testcases_general/20-gcd_array.out b/tests/testcases_general/20-gcd_array.out old mode 100644 new mode 100755 diff --git a/tests/testcases_general/21-comment.cminus b/tests/testcases_general/21-comment.cminus old mode 100644 new mode 100755 diff --git a/tests/testcases_general/21-comment.out b/tests/testcases_general/21-comment.out old mode 100644 new mode 100755 diff --git a/tests/testcases_general/3-decl_float.cminus b/tests/testcases_general/3-decl_float.cminus old mode 100644 new mode 100755 diff --git a/tests/testcases_general/3-decl_float.out b/tests/testcases_general/3-decl_float.out old mode 100644 new mode 100755 diff --git a/tests/testcases_general/4-decl_int_array.cminus b/tests/testcases_general/4-decl_int_array.cminus old mode 100644 new mode 100755 diff --git a/tests/testcases_general/4-decl_int_array.out b/tests/testcases_general/4-decl_int_array.out old mode 100644 new mode 100755 diff --git a/tests/testcases_general/5-decl_float_array.cminus b/tests/testcases_general/5-decl_float_array.cminus old mode 100644 new mode 100755 diff --git a/tests/testcases_general/5-decl_float_array.out b/tests/testcases_general/5-decl_float_array.out old mode 100644 new mode 100755 diff --git a/tests/testcases_general/6-num_add_int.cminus b/tests/testcases_general/6-num_add_int.cminus old mode 100644 new mode 100755 diff --git a/tests/testcases_general/6-num_add_int.out b/tests/testcases_general/6-num_add_int.out old mode 100644 new mode 100755 diff --git a/tests/testcases_general/7-assign_int_var_local.cminus b/tests/testcases_general/7-assign_int_var_local.cminus old mode 100644 new mode 100755 diff --git a/tests/testcases_general/7-assign_int_var_local.out b/tests/testcases_general/7-assign_int_var_local.out old mode 100644 new mode 100755 diff --git a/tests/testcases_general/8-assign_int_array_local.cminus b/tests/testcases_general/8-assign_int_array_local.cminus old mode 100644 new mode 100755 diff --git a/tests/testcases_general/8-assign_int_array_local.out b/tests/testcases_general/8-assign_int_array_local.out old mode 100644 new mode 100755 diff --git a/tests/testcases_general/9-assign_cast.cminus b/tests/testcases_general/9-assign_cast.cminus old mode 100644 new mode 100755 diff --git a/tests/testcases_general/9-assign_cast.out b/tests/testcases_general/9-assign_cast.out old mode 100644 new mode 100755 diff --git a/tests/testcases_general/README.md b/tests/testcases_general/README.md old mode 100644 new mode 100755