Commit 66f4532f authored by lyz's avatar lyz

initial lab1

parents
cmake_minimum_required( VERSION 3.8 )
project(CMINUSF)
set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -std=c99")
SET(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} -O0 -Wall -g2 -ggdb")
SET(CMAKE_CXX_FLAGS_RELEASE "$ENV{CXXFLAGS} -O3 -Wall")
SET(CMAKE_CXX_FLAGS_ASAN "${CMAKE_CXX_FLAGS_DEBUG} -fsanitize=undefined -fsanitize=address")
set(default_build_type "Debug")
if(NOT(CMAKE_BUILD_TYPE_SHADOW STREQUAL CMAKE_BUILD_TYPE))
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to '${default_build_type}'")
set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE STRING "Choose the type of build." FORCE)
else()
message(STATUS "Building in ${CMAKE_BUILD_TYPE} mode")
endif()
set(CMAKE_BUILD_TYPE_SHADOW ${CMAKE_BUILD_TYPE} CACHE STRING "used to detect changes in build type" FORCE)
endif()
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
find_package(FLEX REQUIRED)
find_package(BISON REQUIRED)
find_package(LLVM REQUIRED CONFIG)
message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}")
message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}")
llvm_map_components_to_libnames(
llvm_libs
support
core
)
INCLUDE_DIRECTORIES(
include
include/cminusfc
include/common
include/lightir
${LLVM_INCLUDE_DIRS}
)
add_definitions(${LLVM_DEFINITIONS})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
include_directories(${PROJECT_SOURCE_DIR})
include_directories(${PROJECT_BINARY_DIR})
add_subdirectory(src)
# 简介
本仓库为 USTC 编译原理和技术 2024 的课程实验仓库。在本学期的编译实验中,你们将构建一个从词法分析器开始到后端代码生成的JIANMU编译器。
你们需要 fork 此 repo 到自己的仓库下,随后在自己的仓库中完成实验。
## 测试脚本使用方法
eval_phase1.sh: 测试phase1 词法分析器+语法分析器部分
-all: 测试所有测试集 (easy, normal, hard, testcases_general)
easy/normal/hard/testcases_general + yes/no/verbose: 测试单个测试集
yes: 使用diff判断正确性
no: 不使用diff判断正确性
verbose: 使用diff判断正确性,并看到更详细的输出
eval_phase2.sh: 测试phase2 syntax_tree -> ast 部分
使用方法与eval_phase1.sh完全相同, 会自动跳过生成syntax_tree fail的样例
\ No newline at end of file
#pragma once
extern "C" {
#include "syntax_tree.h"
extern syntax_tree *parse(const char *input);
}
#include <memory>
#include <string>
#include <vector>
enum CminusType { TYPE_INT, TYPE_FLOAT, TYPE_VOID };
enum RelOp {
// <=
OP_LE,
// <
OP_LT,
// >
OP_GT,
// >=
OP_GE,
// ==
OP_EQ,
// !=
OP_NEQ
};
enum AddOp {
// +
OP_PLUS,
// -
OP_MINUS
};
enum MulOp {
// *
OP_MUL,
// /
OP_DIV
};
class AST;
struct ASTNode;
struct ASTProgram;
struct ASTDeclaration;
struct ASTNum;
struct ASTVarDeclaration;
struct ASTFunDeclaration;
struct ASTParam;
struct ASTCompoundStmt;
struct ASTStatement;
struct ASTExpressionStmt;
struct ASTSelectionStmt;
struct ASTIterationStmt;
struct ASTReturnStmt;
struct ASTFactor;
struct ASTExpression;
struct ASTVar;
struct ASTAssignExpression;
struct ASTSimpleExpression;
struct ASTAdditiveExpression;
struct ASTTerm;
struct ASTCall;
class ASTVisitor;
class AST {
public:
AST() = delete;
AST(syntax_tree *);
AST(AST &&tree) {
root = tree.root;
tree.root = nullptr;
};
ASTProgram *get_root() { return root.get(); }
void run_visitor(ASTVisitor &visitor);
private:
ASTNode *transform_node_iter(syntax_tree_node *);
std::shared_ptr<ASTProgram> root = nullptr;
};
struct ASTNode {
virtual void accept(ASTVisitor &) = 0;
virtual ~ASTNode() = default;
};
struct ASTProgram : ASTNode {
virtual void accept(ASTVisitor &) override final;
virtual ~ASTProgram() = default;
std::vector<std::shared_ptr<ASTDeclaration>> declarations;
};
struct ASTDeclaration : ASTNode {
virtual ~ASTDeclaration() = default;
CminusType type;
std::string id;
};
struct ASTFactor : ASTNode {
virtual ~ASTFactor() = default;
};
struct ASTNum : ASTFactor {
virtual void accept(ASTVisitor &) override final;
CminusType type;
union {
int i_val;
float f_val;
};
};
struct ASTVarDeclaration : ASTDeclaration {
virtual void accept(ASTVisitor &) override final;
std::shared_ptr<ASTNum> num;
};
struct ASTFunDeclaration : ASTDeclaration {
virtual void accept(ASTVisitor &) override final;
std::vector<std::shared_ptr<ASTParam>> params;
std::shared_ptr<ASTCompoundStmt> compound_stmt;
};
struct ASTParam : ASTNode {
virtual void accept(ASTVisitor &) override final;
CminusType type;
std::string id;
// true if it is array param
bool isarray;
};
struct ASTStatement : ASTNode {
virtual ~ASTStatement() = default;
};
struct ASTCompoundStmt : ASTStatement {
virtual void accept(ASTVisitor &) override final;
std::vector<std::shared_ptr<ASTVarDeclaration>> local_declarations;
std::vector<std::shared_ptr<ASTStatement>> statement_list;
};
struct ASTExpressionStmt : ASTStatement {
virtual void accept(ASTVisitor &) override final;
std::shared_ptr<ASTExpression> expression;
};
struct ASTSelectionStmt : ASTStatement {
virtual void accept(ASTVisitor &) override final;
std::shared_ptr<ASTExpression> expression;
std::shared_ptr<ASTStatement> if_statement;
// should be nullptr if no else structure exists
std::shared_ptr<ASTStatement> else_statement;
};
struct ASTIterationStmt : ASTStatement {
virtual void accept(ASTVisitor &) override final;
std::shared_ptr<ASTExpression> expression;
std::shared_ptr<ASTStatement> statement;
};
struct ASTReturnStmt : ASTStatement {
virtual void accept(ASTVisitor &) override final;
// should be nullptr if return void
std::shared_ptr<ASTExpression> expression;
};
struct ASTExpression : ASTFactor {};
struct ASTAssignExpression : ASTExpression {
virtual void accept(ASTVisitor &) override final;
std::shared_ptr<ASTVar> var;
std::shared_ptr<ASTExpression> expression;
};
struct ASTSimpleExpression : ASTExpression {
virtual void accept(ASTVisitor &) override final;
std::shared_ptr<ASTAdditiveExpression> additive_expression_l;
std::shared_ptr<ASTAdditiveExpression> additive_expression_r;
RelOp op;
};
struct ASTVar : ASTFactor {
virtual void accept(ASTVisitor &) override final;
std::string id;
// nullptr if var is of int type
std::shared_ptr<ASTExpression> expression;
};
struct ASTAdditiveExpression : ASTNode {
virtual void accept(ASTVisitor &) override final;
std::shared_ptr<ASTAdditiveExpression> additive_expression;
AddOp op;
std::shared_ptr<ASTTerm> term;
};
struct ASTTerm : ASTNode {
virtual void accept(ASTVisitor &) override final;
std::shared_ptr<ASTTerm> term;
MulOp op;
std::shared_ptr<ASTFactor> factor;
};
struct ASTCall : ASTFactor {
virtual void accept(ASTVisitor &) override final;
std::string id;
std::vector<std::shared_ptr<ASTExpression>> args;
};
class ASTVisitor {
public:
virtual void visit(ASTProgram &) = 0;
virtual void visit(ASTNum &) = 0;
virtual void visit(ASTVarDeclaration &) = 0;
virtual void visit(ASTFunDeclaration &) = 0;
virtual void visit(ASTParam &) = 0;
virtual void visit(ASTCompoundStmt &) = 0;
virtual void visit(ASTExpressionStmt &) = 0;
virtual void visit(ASTSelectionStmt &) = 0;
virtual void visit(ASTIterationStmt &) = 0;
virtual void visit(ASTReturnStmt &) = 0;
virtual void visit(ASTAssignExpression &) = 0;
virtual void visit(ASTSimpleExpression &) = 0;
virtual void visit(ASTAdditiveExpression &) = 0;
virtual void visit(ASTVar &) = 0;
virtual void visit(ASTTerm &) = 0;
virtual void visit(ASTCall &) = 0;
};
class ASTPrinter : public ASTVisitor {
public:
virtual void visit(ASTProgram &) override final;
virtual void visit(ASTNum &) override final;
virtual void visit(ASTVarDeclaration &) override final;
virtual void visit(ASTFunDeclaration &) override final;
virtual void visit(ASTParam &) override final;
virtual void visit(ASTCompoundStmt &) override final;
virtual void visit(ASTExpressionStmt &) override final;
virtual void visit(ASTSelectionStmt &) override final;
virtual void visit(ASTIterationStmt &) override final;
virtual void visit(ASTReturnStmt &) override final;
virtual void visit(ASTAssignExpression &) override final;
virtual void visit(ASTSimpleExpression &) override final;
virtual void visit(ASTAdditiveExpression &) override final;
virtual void visit(ASTVar &) override final;
virtual void visit(ASTTerm &) override final;
virtual void visit(ASTCall &) override final;
void add_depth() { depth += 2; }
void remove_depth() { depth -= 2; }
private:
int depth = 0;
};
#ifndef LOGGING_HPP
#define LOGGING_HPP
#include <iostream>
#include <sstream>
#include <cstdlib>
enum LogLevel
{
DEBUG = 0,
INFO,
WARNING,
ERROR
};
struct LocationInfo
{
LocationInfo(std::string file, int line, const char *func) : file_(file), line_(line), func_(func) {}
~LocationInfo() = default;
std::string file_;
int line_;
const char *func_;
};
class LogStream;
class LogWriter;
class LogWriter
{
public:
LogWriter(LocationInfo location, LogLevel loglevel)
: location_(location), log_level_(loglevel)
{
char *logv = std::getenv("LOGV");
if (logv)
{
std::string string_logv = logv;
env_log_level = std::stoi(logv);
}
else
{
env_log_level = 4;
}
};
void operator<(const LogStream &stream);
private:
void output_log(const std::ostringstream &g);
LocationInfo location_;
LogLevel log_level_;
int env_log_level;
};
class LogStream
{
public:
template <typename T>
LogStream &operator<<(const T &val) noexcept
{
sstream_ << val;
return *this;
}
friend class LogWriter;
private:
std::stringstream sstream_{};
};
std::string level2string(LogLevel level);
std::string get_short_name(const char *file_path);
#define __FILESHORTNAME__ get_short_name(__FILE__)
#define LOG_IF(level) \
LogWriter(LocationInfo(__FILESHORTNAME__, __LINE__, __FUNCTION__), level) < LogStream()
#define LOG(level) LOG_##level
#define LOG_DEBUG LOG_IF(DEBUG)
#define LOG_INFO LOG_IF(INFO)
#define LOG_WARNING LOG_IF(WARNING)
#define LOG_ERROR LOG_IF(ERROR)
#endif
#ifndef __SYNTAXTREE_H__
#define __SYNTAXTREE_H__
#include <stdio.h>
#define SYNTAX_TREE_NODE_NAME_MAX 30
struct _syntax_tree_node {
struct _syntax_tree_node * parent;
struct _syntax_tree_node * children[10];
int children_num;
char name[SYNTAX_TREE_NODE_NAME_MAX];
};
typedef struct _syntax_tree_node syntax_tree_node;
syntax_tree_node * new_anon_syntax_tree_node();
syntax_tree_node * new_syntax_tree_node(const char * name);
int syntax_tree_add_child(syntax_tree_node * parent, syntax_tree_node * child);
void del_syntax_tree_node(syntax_tree_node * node, int recursive);
struct _syntax_tree {
syntax_tree_node * root;
};
typedef struct _syntax_tree syntax_tree;
syntax_tree* new_syntax_tree();
void del_syntax_tree(syntax_tree * tree);
void print_syntax_tree(FILE * fout, syntax_tree * tree);
#endif /* SyntaxTree.h */
add_subdirectory(parser)
add_subdirectory(common)
add_subdirectory(logging)
add_subdirectory(cminusfc)
add_executable(
cminusfc
main.cpp
)
target_link_libraries(
cminusfc
common
syntax
stdc++fs
)
install(
TARGETS cminusfc
RUNTIME DESTINATION bin
)
#include "ast.hpp"
#include <filesystem>
#include <iostream>
#include <string>
using std::string;
using std::operator""s;
struct Config
{
string exe_name; // compiler exe name
std::filesystem::path input_file;
std::filesystem::path output_file;
bool emitast{false};
Config(int argc, char **argv) : argc(argc), argv(argv)
{
parse_cmd_line();
check();
}
private:
int argc{-1};
char **argv{nullptr};
void parse_cmd_line();
void check();
// print helper infomation and exit
void print_help() const;
void print_err(const string &msg) const;
};
int main(int argc, char **argv)
{
Config config(argc, argv);
auto syntax_tree = parse(config.input_file.c_str());
auto ast = AST(syntax_tree);
ASTPrinter printer;
ast.run_visitor(printer);
return 0;
}
void Config::parse_cmd_line()
{
exe_name = argv[0];
for (int i = 1; i < argc; ++i)
{
if (argv[i] == "-h"s || argv[i] == "--help"s)
{
print_help();
}
else if (argv[i] == "-o"s)
{
if (output_file.empty() && i + 1 < argc)
{
output_file = argv[i + 1];
i += 1;
}
else
{
print_err("bad output file");
}
}
else if (argv[i] == "-emit-ast"s)
{
emitast = true;
}
else
{
if (input_file.empty())
{
input_file = argv[i];
}
else
{
string err =
"unrecognized command-line option \'"s + argv[i] + "\'"s;
print_err(err);
}
}
}
}
void Config::check()
{
if (input_file.empty())
{
print_err("no input file");
}
if (input_file.extension() != ".cminus")
{
print_err("file format not recognized");
}
if (output_file.empty())
{
output_file = input_file.stem();
}
}
void Config::print_help() const
{
std::cout << "Usage: " << exe_name
<< " [-h|--help] [-o <target-file>] [-mem2reg] [-emit-llvm] [-S] "
"<input-file>"
<< std::endl;
exit(0);
}
void Config::print_err(const string &msg) const
{
std::cout << exe_name << ": " << msg << std::endl;
exit(-1);
}
add_library(common STATIC
syntax_tree.c
ast.cpp
logging.cpp
)
target_link_libraries(common)
#include "ast.hpp"
#include <cstring>
#include <iostream>
#include <stack>
#define _AST_NODE_ERROR_ \
std::cerr << "Abort due to node cast error." \
"Contact with TAs to solve your problem." \
<< std::endl; \
std::abort();
// NOTE: use std::string instead of strcmp to compare strings,
// 注意使用这里的接口
#define _STR_EQ(a, b) (strcmp((a), (b)) == 0)
void AST::run_visitor(ASTVisitor &visitor) { root->accept(visitor); }
AST::AST(syntax_tree *s) {
if (s == nullptr) {
std::cerr << "empty input tree!" << std::endl;
std::abort();
}
auto node = transform_node_iter(s->root);
del_syntax_tree(s);
root = std::shared_ptr<ASTProgram>(static_cast<ASTProgram *>(node));
}
ASTNode *AST::transform_node_iter(syntax_tree_node *n) {
/*
example:
program -> declaration-list
declaration-list -> declaration-list declaration | declaration
将其转化成AST中ASTProgram的结构
*/
if (_STR_EQ(n->name, "program")) {
auto node = new ASTProgram();
// flatten declaration list
std::stack<syntax_tree_node *>
s; // 为什么这里要用stack呢?如果用其他数据结构应该如何实现
auto list_ptr = n->children[0];
while (list_ptr->children_num == 2) {
s.push(list_ptr->children[1]);
list_ptr = list_ptr->children[0];
}
s.push(list_ptr->children[0]);
while (!s.empty()) {
auto child_node =
static_cast<ASTDeclaration *>(transform_node_iter(s.top()));
auto child_node_shared = std::shared_ptr<ASTDeclaration>(child_node);
node->declarations.push_back(child_node_shared);
s.pop();
}
return node;
} else if (_STR_EQ(n->name, "declaration")) {
return transform_node_iter(n->children[0]);
} else if (_STR_EQ(n->name, "var-declaration")) {
auto node = new ASTVarDeclaration();
// NOTE: 思考 ASTVarDeclaration的结构,需要填充的字段有哪些
// type
// 为什么不会有 TYPE_VOID?
if (_STR_EQ(n->children[0]->children[0]->name, "int"))
node->type = TYPE_INT;
else
node->type = TYPE_FLOAT;
// id & num
// 由不同的表达式填充
if (n->children_num == 3) {
node->id = n->children[1]->name;
} else if (n->children_num == 6) {
node->id = n->children[1]->name;
int num = std::stoi(n->children[3]->name);
auto num_node = std::make_shared<ASTNum>();
num_node->i_val = num;
num_node->type = TYPE_INT;
node->num = num_node;
} else {
std::cerr << "[ast]: var-declaration transform failure!" << std::endl;
std::abort();
}
return node;
} else if (_STR_EQ(n->name, "fun-declaration")) {
// fun-declaration -> type-specifier ID ( params ) compound-stmt
// 由表达式和 ASTFunDeclaration的结构,我们需要填充
// type, id, params, compound_stmt 这四个字段
auto node = new ASTFunDeclaration();
// type 字段填充
if (_STR_EQ(n->children[0]->children[0]->name, "int")) {
node->type = TYPE_INT;
} else if (_STR_EQ(n->children[0]->children[0]->name, "float")) {
node->type = TYPE_FLOAT;
} else {
node->type = TYPE_VOID;
}
// 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
// 1.2 compound_stmt 字段填充
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
node->type = TYPE_FLOAT;
node->id = n->children[1]->name;
if (n->children_num > 2)
node->isarray = true;
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
return node;
} else if (_STR_EQ(n->name, "statement")) {
return transform_node_iter(n->children[0]);
} else if (_STR_EQ(n->name, "expression-stmt")) {
auto node = new ASTExpressionStmt();
if (n->children_num == 2) {
auto expr_node =
static_cast<ASTExpression *>(transform_node_iter(n->children[0]));
auto expr_node_ptr = std::shared_ptr<ASTExpression>(expr_node);
node->expression = expr_node_ptr;
}
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
// check whether this selection statement contains
// 5.3 else structure
return node;
} else if (_STR_EQ(n->name, "iteration-stmt")) {
auto node = new ASTIterationStmt();
auto expr_node =
static_cast<ASTExpression *>(transform_node_iter(n->children[2]));
auto expr_node_ptr = std::shared_ptr<ASTExpression>(expr_node);
node->expression = expr_node_ptr;
auto stmt_node =
static_cast<ASTStatement *>(transform_node_iter(n->children[4]));
auto stmt_node_ptr = std::shared_ptr<ASTStatement>(stmt_node);
node->statement = stmt_node_ptr;
return node;
} else if (_STR_EQ(n->name, "return-stmt")) {
auto node = new ASTReturnStmt();
if (n->children_num == 3) {
auto expr_node =
static_cast<ASTExpression *>(transform_node_iter(n->children[1]));
node->expression = std::shared_ptr<ASTExpression>(expr_node);
}
return node;
} else if (_STR_EQ(n->name, "expression")) {
// simple-expression
if (n->children_num == 1) {
return transform_node_iter(n->children[0]);
}
auto node = new ASTAssignExpression();
auto var_node = static_cast<ASTVar *>(transform_node_iter(n->children[0]));
node->var = std::shared_ptr<ASTVar>(var_node);
auto expr_node =
static_cast<ASTExpression *>(transform_node_iter(n->children[2]));
node->expression = std::shared_ptr<ASTExpression>(expr_node);
return node;
} else if (_STR_EQ(n->name, "var")) {
auto node = new ASTVar();
node->id = n->children[0]->name;
if (n->children_num == 4) {
auto expr_node =
static_cast<ASTExpression *>(transform_node_iter(n->children[2]));
node->expression = std::shared_ptr<ASTExpression>(expr_node);
}
return node;
} else if (_STR_EQ(n->name, "simple-expression")) {
auto node = new ASTSimpleExpression();
auto expr_node_1 = static_cast<ASTAdditiveExpression *>(
transform_node_iter(n->children[0]));
node->additive_expression_l =
std::shared_ptr<ASTAdditiveExpression>(expr_node_1);
if (n->children_num == 3) {
auto op_name = n->children[1]->children[0]->name;
if (_STR_EQ(op_name, "<="))
node->op = OP_LE;
else if (_STR_EQ(op_name, "<"))
node->op = OP_LT;
else if (_STR_EQ(op_name, ">"))
node->op = OP_GT;
else if (_STR_EQ(op_name, ">="))
node->op = OP_GE;
else if (_STR_EQ(op_name, "=="))
node->op = OP_EQ;
else if (_STR_EQ(op_name, "!="))
node->op = OP_NEQ;
auto expr_node_2 = static_cast<ASTAdditiveExpression *>(
transform_node_iter(n->children[2]));
node->additive_expression_r =
std::shared_ptr<ASTAdditiveExpression>(expr_node_2);
}
return node;
} 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
} else {
auto term_node =
static_cast<ASTTerm *>(transform_node_iter(n->children[0]));
node->term = std::shared_ptr<ASTTerm>(term_node);
}
return node;
} else if (_STR_EQ(n->name, "term")) {
auto node = new ASTTerm();
if (n->children_num == 3) {
auto term_node =
static_cast<ASTTerm *>(transform_node_iter(n->children[0]));
node->term = std::shared_ptr<ASTTerm>(term_node);
auto op_name = n->children[1]->children[0]->name;
if (_STR_EQ(op_name, "*"))
node->op = OP_MUL;
else if (_STR_EQ(op_name, "/"))
node->op = OP_DIV;
auto factor_node =
static_cast<ASTFactor *>(transform_node_iter(n->children[2]));
node->factor = std::shared_ptr<ASTFactor>(factor_node);
} else {
auto factor_node =
static_cast<ASTFactor *>(transform_node_iter(n->children[0]));
node->factor = std::shared_ptr<ASTFactor>(factor_node);
}
return node;
} else if (_STR_EQ(n->name, "factor")) {
int i = 0;
if (n->children_num == 3)
i = 1;
auto name = n->children[i]->name;
if (_STR_EQ(name, "expression") || _STR_EQ(name, "var") ||
_STR_EQ(name, "call"))
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
} else if (_STR_EQ(name, "float")) {
// 3.2
} else {
_AST_NODE_ERROR_
}
return num_node;
}
} else if (_STR_EQ(n->name, "call")) {
auto node = new ASTCall();
node->id = n->children[0]->name;
// flatten args
if (_STR_EQ(n->children[2]->children[0]->name, "arg-list")) {
auto list_ptr = n->children[2]->children[0];
auto s = std::stack<syntax_tree_node *>();
while (list_ptr->children_num == 3) {
s.push(list_ptr->children[2]);
list_ptr = list_ptr->children[0];
}
s.push(list_ptr->children[0]);
while (!s.empty()) {
auto expr_node =
static_cast<ASTExpression *>(transform_node_iter(s.top()));
auto expr_node_ptr = std::shared_ptr<ASTExpression>(expr_node);
node->args.push_back(expr_node_ptr);
s.pop();
}
}
return node;
} else {
std::cerr << "[ast]: transform failure!" << std::endl;
std::abort();
}
}
void ASTProgram::accept(ASTVisitor &visitor) { return visitor.visit(*this); }
void ASTNum::accept(ASTVisitor &visitor) { return visitor.visit(*this); }
void ASTVarDeclaration::accept(ASTVisitor &visitor) {
return visitor.visit(*this);
}
void ASTFunDeclaration::accept(ASTVisitor &visitor) {
return visitor.visit(*this);
}
void ASTParam::accept(ASTVisitor &visitor) { return visitor.visit(*this); }
void ASTCompoundStmt::accept(ASTVisitor &visitor) {
return visitor.visit(*this);
}
void ASTExpressionStmt::accept(ASTVisitor &visitor) {
return visitor.visit(*this);
}
void ASTSelectionStmt::accept(ASTVisitor &visitor) {
return visitor.visit(*this);
}
void ASTIterationStmt::accept(ASTVisitor &visitor) {
return visitor.visit(*this);
}
void ASTReturnStmt::accept(ASTVisitor &visitor) { return visitor.visit(*this); }
void ASTAssignExpression::accept(ASTVisitor &visitor) {
return visitor.visit(*this);
}
void ASTSimpleExpression::accept(ASTVisitor &visitor) {
return visitor.visit(*this);
}
void ASTAdditiveExpression::accept(ASTVisitor &visitor) {
return visitor.visit(*this);
}
void ASTVar::accept(ASTVisitor &visitor) { return visitor.visit(*this); }
void ASTTerm::accept(ASTVisitor &visitor) { return visitor.visit(*this); }
void ASTCall::accept(ASTVisitor &visitor) { return visitor.visit(*this); }
// NOTE: 打印AST的相关接口,无需修改
#define _DEBUG_PRINT_N_(N) \
{ std::cout << std::string(N, '-'); }
void ASTPrinter::visit(ASTProgram &node) {
_DEBUG_PRINT_N_(depth);
std::cout << "program" << std::endl;
add_depth();
for (auto decl : node.declarations) {
decl->accept(*this);
}
remove_depth();
}
void ASTPrinter::visit(ASTNum &node) {
_DEBUG_PRINT_N_(depth);
if (node.type == TYPE_INT) {
std::cout << "num (int): " << node.i_val << std::endl;
} else if (node.type == TYPE_FLOAT) {
std::cout << "num (float): " << node.f_val << std::endl;
} else {
_AST_NODE_ERROR_
}
}
void ASTPrinter::visit(ASTVarDeclaration &node) {
_DEBUG_PRINT_N_(depth);
std::cout << "var-declaration: " << node.id;
if (node.num != nullptr) {
std::cout << "[]" << std::endl;
add_depth();
node.num->accept(*this);
remove_depth();
return;
}
std::cout << std::endl;
}
void ASTPrinter::visit(ASTFunDeclaration &node) {
_DEBUG_PRINT_N_(depth);
std::cout << "fun-declaration: " << node.id << std::endl;
add_depth();
for (auto param : node.params) {
param->accept(*this);
}
node.compound_stmt->accept(*this);
remove_depth();
}
void ASTPrinter::visit(ASTParam &node) {
_DEBUG_PRINT_N_(depth);
std::cout << "param: " << node.id;
if (node.isarray)
std::cout << "[]";
std::cout << std::endl;
}
void ASTPrinter::visit(ASTCompoundStmt &node) {
_DEBUG_PRINT_N_(depth);
std::cout << "compound-stmt" << std::endl;
add_depth();
for (auto decl : node.local_declarations) {
decl->accept(*this);
}
for (auto stmt : node.statement_list) {
stmt->accept(*this);
}
remove_depth();
}
void ASTPrinter::visit(ASTExpressionStmt &node) {
_DEBUG_PRINT_N_(depth);
std::cout << "expression-stmt" << std::endl;
add_depth();
if (node.expression != nullptr)
node.expression->accept(*this);
remove_depth();
}
void ASTPrinter::visit(ASTSelectionStmt &node) {
_DEBUG_PRINT_N_(depth);
std::cout << "selection-stmt" << std::endl;
add_depth();
node.expression->accept(*this);
node.if_statement->accept(*this);
if (node.else_statement != nullptr)
node.else_statement->accept(*this);
remove_depth();
}
void ASTPrinter::visit(ASTIterationStmt &node) {
_DEBUG_PRINT_N_(depth);
std::cout << "iteration-stmt" << std::endl;
add_depth();
node.expression->accept(*this);
node.statement->accept(*this);
remove_depth();
}
void ASTPrinter::visit(ASTReturnStmt &node) {
_DEBUG_PRINT_N_(depth);
std::cout << "return-stmt";
if (node.expression == nullptr) {
std::cout << ": void" << std::endl;
} else {
std::cout << std::endl;
add_depth();
node.expression->accept(*this);
remove_depth();
}
}
void ASTPrinter::visit(ASTAssignExpression &node) {
_DEBUG_PRINT_N_(depth);
std::cout << "assign-expression" << std::endl;
add_depth();
node.var->accept(*this);
node.expression->accept(*this);
remove_depth();
}
void ASTPrinter::visit(ASTSimpleExpression &node) {
_DEBUG_PRINT_N_(depth);
std::cout << "simple-expression";
if (node.additive_expression_r == nullptr) {
std::cout << std::endl;
} else {
std::cout << ": ";
if (node.op == OP_LT) {
std::cout << "<";
} else if (node.op == OP_LE) {
std::cout << "<=";
} else if (node.op == OP_GE) {
std::cout << ">=";
} else if (node.op == OP_GT) {
std::cout << ">";
} else if (node.op == OP_EQ) {
std::cout << "==";
} else if (node.op == OP_NEQ) {
std::cout << "!=";
} else {
std::abort();
}
std::cout << std::endl;
}
add_depth();
node.additive_expression_l->accept(*this);
if (node.additive_expression_r != nullptr)
node.additive_expression_r->accept(*this);
remove_depth();
}
void ASTPrinter::visit(ASTAdditiveExpression &node) {
_DEBUG_PRINT_N_(depth);
std::cout << "additive-expression";
if (node.additive_expression == nullptr) {
std::cout << std::endl;
} else {
std::cout << ": ";
if (node.op == OP_PLUS) {
std::cout << "+";
} else if (node.op == OP_MINUS) {
std::cout << "-";
} else {
std::abort();
}
std::cout << std::endl;
}
add_depth();
if (node.additive_expression != nullptr)
node.additive_expression->accept(*this);
node.term->accept(*this);
remove_depth();
}
void ASTPrinter::visit(ASTVar &node) {
_DEBUG_PRINT_N_(depth);
std::cout << "var: " << node.id;
if (node.expression != nullptr) {
std::cout << "[]" << std::endl;
add_depth();
node.expression->accept(*this);
remove_depth();
return;
}
std::cout << std::endl;
}
void ASTPrinter::visit(ASTTerm &node) {
_DEBUG_PRINT_N_(depth);
std::cout << "term";
if (node.term == nullptr) {
std::cout << std::endl;
} else {
std::cout << ": ";
if (node.op == OP_MUL) {
std::cout << "*";
} else if (node.op == OP_DIV) {
std::cout << "/";
} else {
std::abort();
}
std::cout << std::endl;
}
add_depth();
if (node.term != nullptr)
node.term->accept(*this);
node.factor->accept(*this);
remove_depth();
}
void ASTPrinter::visit(ASTCall &node) {
_DEBUG_PRINT_N_(depth);
std::cout << "call: " << node.id << "()" << std::endl;
add_depth();
for (auto arg : node.args) {
arg->accept(*this);
}
remove_depth();
}
#include "logging.hpp"
void LogWriter::operator<(const LogStream &stream) {
std::ostringstream msg;
msg << stream.sstream_.rdbuf();
output_log(msg);
}
void LogWriter::output_log(const std::ostringstream &msg) {
if (log_level_ >= env_log_level)
std::cout << "[" << level2string(log_level_) << "] "
<< "(" << location_.file_
<< ":" << location_.line_
<< "L "<< location_.func_<<")"
<< msg.str() << std::endl;
}
std::string level2string(LogLevel level) {
switch (level)
{
case DEBUG:
return "DEBUG";
case INFO:
return "INFO";
case WARNING:
return "WARNING";
case ERROR:
return "ERROR";
default:
return "";
}
}
std::string get_short_name(const char * file_path) {
std::string short_file_path = file_path;
int index = short_file_path.find_last_of('/');
return short_file_path.substr(index+1);
}
#include <stdlib.h>
#include <string.h>
#include "syntax_tree.h"
syntax_tree_node * new_syntax_tree_node(const char * name)
{
syntax_tree_node * new_node = (syntax_tree_node *)malloc(sizeof(syntax_tree_node));
if (name)
strncpy(new_node->name, name, SYNTAX_TREE_NODE_NAME_MAX);
else
new_node->name[0] = '\0';
new_node->children_num = 0;
return new_node;
}
int syntax_tree_add_child(syntax_tree_node * parent, syntax_tree_node * child)
{
if (!parent || !child) return -1;
parent->children[parent->children_num++] = child;
return parent->children_num;
}
void del_syntax_tree_node(syntax_tree_node * node, int recursive)
{
if (!node) return;
int i;
if (recursive) {
for (i = 0; i < node->children_num; i++) {
del_syntax_tree_node(node->children[i], 1);
}
}
free(node);
}
syntax_tree * new_syntax_tree()
{
return (syntax_tree *)malloc(sizeof(syntax_tree));
}
void del_syntax_tree(syntax_tree * tree)
{
if (!tree) return;
if (tree->root) {
del_syntax_tree_node(tree->root, 1);
}
free(tree);
}
void print_syntax_tree_node(FILE * fout, syntax_tree_node * node, int level)
{
// assume fout valid now
// check if "node" empty pointer
if (!node) return;
// print myself
int i;
for (i = 0; i < level; i++) {
fprintf(fout, "| ");
}
fprintf(fout, ">--%s %s\n", (node->children_num ? "+" : "*"), node->name);
for (i = 0; i < node->children_num; i++) {
print_syntax_tree_node(fout, node->children[i], level + 1);
}
}
void print_syntax_tree(FILE * fout, syntax_tree * tree)
{
if (!fout) return;
print_syntax_tree_node(fout, tree->root, 0);
}
add_executable(test_ast test_ast.cpp)
add_executable(test_logging test_logging.cpp)
target_link_libraries(test_ast syntax common)
target_link_libraries(test_logging common)
install(
TARGETS test_logging
RUNTIME DESTINATION bin
)
install(
TARGETS test_ast
RUNTIME DESTINATION bin
)
#include "ast.hpp"
#include <iostream>
int main(int argc, char **argv) {
if (argc != 2) {
std::cout << "usage: " << argv[0] << " <cminus_file>" << std::endl;
} else {
auto s = parse(argv[1]);
auto a = AST(s);
auto printer = ASTPrinter();
a.run_visitor(printer);
}
return 0;
}
#include "logging.hpp"
// 引入头文件
int main() {
LOG(DEBUG) << "This is DEBUG log item.";
// 使用关键字LOG,括号中填入要输出的日志等级
// 紧接着就是<<以及日志的具体信息,这一步就跟使用std::cout一样
LOG(INFO) << "This is INFO log item";
LOG(WARNING) << "This is WARNING log item";
LOG(ERROR) << "This is ERROR log item";
return 0;
}
\ No newline at end of file
flex_target(lex lexical_analyzer.l ${CMAKE_CURRENT_BINARY_DIR}/lexical_analyzer.c)
bison_target(syntax syntax_analyzer.y
${CMAKE_CURRENT_BINARY_DIR}/syntax_analyzer.c
DEFINES_FILE ${PROJECT_BINARY_DIR}/syntax_analyzer.h)
add_flex_bison_dependency(lex syntax)
add_library(syntax STATIC
${BISON_syntax_OUTPUTS}
${FLEX_lex_OUTPUTS}
)
include_directories(${PROJECT_BINARY_DIR})
add_executable(parser parser.c)
target_link_libraries(parser syntax common)
add_executable(lexer lexer.c)
target_link_libraries(lexer syntax common)
install(
TARGETS parser
RUNTIME DESTINATION bin
)
install(
TARGETS lexer
RUNTIME DESTINATION bin
)
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<syntax_analyzer.h>
///
extern int lines;
extern int pos_start;
extern int pos_end;
///
extern FILE *yyin;
extern char *yytext;
extern int yylex();
// Mac-only hack.
YYSTYPE yylval;
///
int main(int argc, const char **argv) {
if (argc != 2) {
printf("usage: lexer input_file\n");
return 0;
}
const char *input_file = argv[1];
yyin = fopen(input_file, "r");
if (!yyin) {
fprintf(stderr, "cannot open file: %s\n", input_file);
return 1;
}
int token;
printf("%5s\t%10s\t%s\t%s\n", "Token", "Text", "Line", "Column (Start,End)");
while ((token = yylex())) {
printf("%-5d\t%10s\t%d\t(%d,%d)\n",
token, yytext,
lines, pos_start, pos_end);
}
return 0;
}
%option noyywrap
%{
/*****************声明和选项设置 begin*****************/
#include <stdio.h>
#include <stdlib.h>
#include "syntax_tree.h"
#include "syntax_analyzer.h"
int lines=1;
int pos_start=1;
int pos_end=1;
void pass_node(char *text){
yylval.node = new_syntax_tree_node(text);
}
/*****************声明和选项设置 end*****************/
%}
%x COMMENT
%%
/* 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;}
\- {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;}
\< {pos_start = pos_end; pos_end += 1; pass_node(yytext); return LT;}
\<= {pos_start = pos_end; pos_end += 2; pass_node(yytext); return LTE;}
\> {pos_start = pos_end; pos_end += 1; pass_node(yytext); return GT;}
\>= {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 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++; return ERROR; }
/****请在此补全所有flex的模式与动作 end******/
%%
#include "syntax_tree.h"
extern syntax_tree *parse(const char*);
int main(int argc, char *argv[])
{
syntax_tree *tree = NULL;
const char *input = NULL;
if (argc == 2) {
input = argv[1];
} else if(argc >= 3) {
printf("usage: %s <cminus_file>\n", argv[0]);
return 1;
}
// Call the syntax analyzer.
tree = parse(input);
print_syntax_tree(stdout, tree);
del_syntax_tree(tree);
return 0;
}
%{
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
#include "syntax_tree.h"
// external functions from lex
extern int yylex();
extern int yyparse();
extern int yyrestart();
extern FILE * yyin;
// external variables from lexical_analyzer module
extern int lines;
extern char * yytext;
extern int pos_end;
extern int pos_start;
// Global syntax tree
syntax_tree *gt;
// Error reporting
void yyerror(const char *s);
// Helper functions written for you with love
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. */
%union {
struct _syntax_tree_node * node;
char * name;
}
/* Your tokens here. */
%token <node> ERROR
%token <node> ADD
%token <node> SUB
%token <node> MUL
%token <node> DIV
%token <node> LT
%token <node> LTE
%token <node> GT
%token <node> GTE
%token <node> EQ
%token <node> NEQ
%token <node> ASSIN
%token <node> SEMICOLON
%token <node> COMMA
%token <node> LPARENTHESE
%token <node> RPARENTHESE
%token <node> LBRACKET
%token <node> RBRACKET
%token <node> LBRACE
%token <node> RBRACE
%token <node> ELSE
%token <node> IF
%token <node> INT
%token <node> RETURN
%token <node> VOID
%token <node> WHILE
%token <node> IDENTIFIER
%token <node> INTEGER
%token <node> FLOAT
%token <node> FLOATPOINT // 这个是 float 类型的 token
//%token <node> EOL
//%token <node> BLANK
//%token <node> COMMENT
%type <node> program declaration-list declaration var-declaration type-specifier fun-declaration params param-list param compound-stmt local-declarations statement-list statement expression-stmt selection-stmt iteration-stmt return-stmt expression var simple-expression relop additive-expression addop term mulop factor integer float call args arg-list
/* compulsory starting symbol */
%start program
%%
/* Your rules here. TA has completed many */
program : declaration-list {$$ = node( "program", 1, $1); gt->root = $$;}
;
declaration-list : declaration-list declaration {$$ = node( "declaration-list", 2, $1, $2);}
| declaration {$$ = node( "declaration-list", 1, $1);}
;
declaration : var-declaration {$$ = node( "declaration", 1, $1);}
| fun-declaration {$$ = node( "declaration", 1, $1);}
;
var-declaration : type-specifier IDENTIFIER SEMICOLON {$$ = node( "var-declaration", 3, $1, $2, $3);}
| type-specifier IDENTIFIER LBRACKET INTEGER RBRACKET SEMICOLON {$$ = node( "var-declaration", 6, $1, $2, $3, $4, $5, $6);}
;
type-specifier : INT {$$ = node( "type-specifier", 1, $1);}
| FLOAT { $$ = node( "type-specifier", 1, $1); }
| VOID {$$ = node( "type-specifier", 1, $1);}
;
fun-declaration : type-specifier IDENTIFIER LPARENTHESE params RPARENTHESE compound-stmt {$$ = node( "fun-declaration", 6, $1, $2, $3, $4, $5, $6);}
;
params : param-list {$$ = node( "params", 1, $1);}
| VOID {$$ = node( "params", 1, $1);}
;
param-list : param-list COMMA param {$$ = node( "param-list", 3, $1, $2, $3);}
| param {$$ = node( "param-list", 1, $1);}
;
param : type-specifier IDENTIFIER {$$ = node( "param", 2, $1, $2);}
| type-specifier IDENTIFIER LBRACKET RBRACKET {$$ = node( "param", 4, $1, $2, $3, $4);}
;
compound-stmt : LBRACE local-declarations statement-list RBRACE {$$ = node( "compound-stmt", 4, $1, $2, $3, $4);}
;
local-declarations : local-declarations var-declaration {$$ = node( "local-declarations", 2, $1, $2);}
| {$$ = node( "local-declarations",0);}
;
statement-list : statement-list statement {$$ = node( "statement-list", 2, $1, $2);}
| {$$ = node( "statement-list",0);}
// TODO: phase1. 补充其他的文法产生式逻辑
%%
/// The error reporting function.
void yyerror(const char * s)
{
// TO STUDENTS: This is just an example.
// You can customize it as you like.
fprintf(stderr, "error at line %d column %d: %s\n", lines, pos_start, s);
}
/// Parse input from file `input_path`, and prints the parsing results
/// to stdout. If input_path is NULL, read from stdin.
///
/// This function initializes essential states before running yyparse().
syntax_tree *parse(const char *input_path)
{
if (input_path != NULL) {
if (!(yyin = fopen(input_path, "r"))) {
fprintf(stderr, "[ERR] Open input file %s failed.\n", input_path);
exit(1);
}
} else {
yyin = stdin;
}
lines = pos_start = pos_end = 1;
gt = new_syntax_tree();
yyrestart(yyin);
yyparse();
return gt;
}
/// A helper function to quickly construct a tree node.
///
/// e.g. $$ = node("program", 1, $1);
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 来判断的
if (children_num == 0) {
child = new_syntax_tree_node("epsilon");
syntax_tree_add_child(p, child);
} else {
va_list ap;
va_start(ap, children_num);
for (int i = 0; i < children_num; ++i) {
child = va_arg(ap, syntax_tree_node *);
syntax_tree_add_child(p, child);
}
va_end(ap);
}
return p;
}
#!/bin/sh
rm -rf output_student/*
rm -rf output_student_ast/*
#!/bin/bash
# DO NOT MODIFY!
# If you need customized behavior, please create your own script.
function run_tests() {
local TESTCASE_DIR=$1
local OUTPUT_DIR=$2
local OUTPUT_STD_DIR=$3
local score=0
local total=0
mkdir -p "$OUTPUT_DIR"
# 对每个 .cminus 文件生成 syntax_tree 文件
for testcase in "$TESTCASE_DIR"/*.cminus; do
filename="$(basename "$testcase")"
echo "[info] Analyzing $filename"
# 生成学生的 syntax_tree 文件
"$BUILD_DIR"/parser "$testcase" > "$OUTPUT_DIR/${filename%.cminus}.syntax_tree"
# 比较当前文件的输出与标准输出
if [[ ${2:-no} != "no" ]]; then
echo "[info] Comparing $filename..."
# 如果是详细模式
if [[ ${2:-no} == "verbose" ]]; then
diff "$OUTPUT_DIR/${filename%.cminus}.syntax_tree" "$OUTPUT_STD_DIR/${filename%.cminus}.syntax_tree"
else
diff -q "$OUTPUT_DIR/${filename%.cminus}.syntax_tree" "$OUTPUT_STD_DIR/${filename%.cminus}.syntax_tree"
fi
# 检查 diff 的返回值
if [ $? -eq 0 ]; then
echo "[info] $filename is correct!"
let score=score+1 # 正确时得分+1
else
echo "[info] $filename differs from the expected output."
fi
fi
let total=total+1 # 总文件数+1
rm -f "$CUR_DIR/${filename%.cminus}"
done
# 输出当前测试集的得分
echo "[info] Score for $TESTCASE_DIR: $score/$total"
return $score
}
# 检查命令行参数是否足够
if [[ $# -lt 1 ]]; then
echo "usage: ./eval_phase1.sh <input> [<summary>]"
echo " <input> can be one of 'easy', 'normal', 'hard', 'testcases_general', or '-all'."
echo " <summary> can be one of 'no', 'yes', and 'verbose'. the default value is 'no'"
exit 1
fi
CUR_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
BUILD_DIR="$CUR_DIR/../../build"
# 检查是否使用了 -all 选项
if [[ $1 == "-all" ]]; then
TOTAL_SCORE=0
TOTAL_FILES=0
# 定义四个测试集
TESTCASES=("easy" "normal" "hard" "testcases_general")
for TESTCASE in "${TESTCASES[@]}"; do
if [[ $TESTCASE == "testcases_general" ]]; then
TESTCASE_DIR="$CUR_DIR/../$TESTCASE"
else
TESTCASE_DIR="$CUR_DIR/input/$TESTCASE"
fi
OUTPUT_DIR="$CUR_DIR/output_student/$TESTCASE"
OUTPUT_STD_DIR="$CUR_DIR/output_standard/$TESTCASE"
# 计算有效文件数
VALID_FILES=$(find "$TESTCASE_DIR" -maxdepth 1 -name '*.cminus' | wc -l)
echo "[info] Found $VALID_FILES valid files in $TESTCASE_DIR"
run_tests "$TESTCASE_DIR" "$OUTPUT_DIR" "$OUTPUT_STD_DIR" $2
CURRENT_SCORE=$?
let TOTAL_SCORE+=CURRENT_SCORE
TOTAL_FILES=$(($TOTAL_FILES + $VALID_FILES))
done
# 输出总分
echo "[info] Total score for all testcases: $TOTAL_SCORE/$TOTAL_FILES"
else
# 单个测试集处理
TESTCASE="$1"
if [[ $TESTCASE == "easy" || $TESTCASE == "normal" || $TESTCASE == "hard" ]]; then
TESTCASE_DIR="$CUR_DIR/input/$TESTCASE"
elif [[ $TESTCASE == "testcases_general" ]]; then
TESTCASE_DIR="$CUR_DIR/../$TESTCASE"
fi
OUTPUT_DIR="$CUR_DIR/output_student/$TESTCASE"
OUTPUT_STD_DIR="$CUR_DIR/output_standard/$TESTCASE"
# 运行单个测试集
run_tests "$TESTCASE_DIR" "$OUTPUT_DIR" "$OUTPUT_STD_DIR" $2
fi
\ No newline at end of file
#!/bin/bash
# DO NOT MODIFY!
# If you need customized behavior, please create your own script.
function run_tests() {
local TESTCASE_DIR=$1
local OUTPUT_DIR=$2
local OUTPUT_STD_DIR=$3
local score=0
local total=0
mkdir -p "$OUTPUT_DIR"
# 对每个 .cminus 文件生成 ast 文件
for testcase in "$TESTCASE_DIR"/*.cminus; do
filename="$(basename "$testcase")"
# 检查文件名是否以 FAIL 开头,跳过该文件
if [[ "$filename" == FAIL* ]]; then
echo "[info] Skipping $filename (starts with FAIL)"
continue
fi
echo "[info] Analyzing $filename"
# 生成学生的 AST 文件
"$BUILD_DIR"/cminusfc "$testcase" > "$OUTPUT_DIR/${filename%.cminus}.ast"
# 比较当前文件的输出与标准输出
if [[ ${2:-no} != "no" ]]; then
echo "[info] Comparing $filename..."
# 如果是详细模式
if [[ ${2:-no} == "verbose" ]]; then
diff "$OUTPUT_DIR/${filename%.cminus}.ast" "$OUTPUT_STD_DIR/${filename%.cminus}.ast"
else
diff -q "$OUTPUT_DIR/${filename%.cminus}.ast" "$OUTPUT_STD_DIR/${filename%.cminus}.ast"
fi
# 检查 diff 的返回值
if [ $? -eq 0 ]; then
echo "[info] $filename is correct!"
let score=score+1 # 正确时得分+1
else
echo "[info] $filename differs from the expected output."
fi
fi
let total=total+1 # 总文件数+1
rm -f "$CUR_DIR/${filename%.cminus}"
done
# 输出当前测试集的得分
echo "[info] Score for $TESTCASE_DIR: $score/$total"
return $score
}
# 检查命令行参数是否足够
if [[ $# -lt 1 ]]; then
echo "usage: ./eval_phase2.sh <input> [<summary>]"
echo " <input> can be one of 'easy', 'normal', 'hard', 'testcases_general', or '-all'."
echo " <summary> can be one of 'no', 'yes', and 'verbose'. the default value is 'no'"
exit 1
fi
CUR_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
BUILD_DIR="$CUR_DIR/../../build"
# 检查是否使用了 -all 选项
if [[ $1 == "-all" ]]; then
TOTAL_SCORE=0
TOTAL_FILES=0
# 定义四个测试集
TESTCASES=("easy" "normal" "hard" "testcases_general")
for TESTCASE in "${TESTCASES[@]}"; do
if [[ $TESTCASE == "testcases_general" ]]; then
TESTCASE_DIR="$CUR_DIR/../$TESTCASE"
else
TESTCASE_DIR="$CUR_DIR/input/$TESTCASE"
fi
OUTPUT_DIR="$CUR_DIR/output_student_ast/$TESTCASE"
OUTPUT_STD_DIR="$CUR_DIR/output_standard_ast/$TESTCASE"
# 计算有效文件数,跳过以 FAIL 开头的文件
VALID_FILES=$(find "$TESTCASE_DIR" -maxdepth 1 -name '*.cminus' ! -name 'FAIL*' | wc -l)
echo "[info] Found $VALID_FILES valid files in $TESTCASE_DIR"
# 运行测试集并跳过以 FAIL 开头的文件
run_tests "$TESTCASE_DIR" "$OUTPUT_DIR" "$OUTPUT_STD_DIR" $2
CURRENT_SCORE=$?
let TOTAL_SCORE+=CURRENT_SCORE
TOTAL_FILES=$(($TOTAL_FILES + $VALID_FILES))
done
# 输出总分
echo "[info] Total score for all testcases: $TOTAL_SCORE/$TOTAL_FILES"
else
# 单个测试集处理
TESTCASE="$1"
if [[ $TESTCASE == "easy" || $TESTCASE == "normal" || $TESTCASE == "hard" ]]; then
TESTCASE_DIR="$CUR_DIR/input/$TESTCASE"
elif [[ $TESTCASE == "testcases_general" ]]; then
TESTCASE_DIR="$CUR_DIR/../$TESTCASE"
fi
OUTPUT_DIR="$CUR_DIR/output_student_ast/$TESTCASE"
OUTPUT_STD_DIR="$CUR_DIR/output_standard_ast/$TESTCASE"
# 运行单个测试集
run_tests "$TESTCASE_DIR" "$OUTPUT_DIR" "$OUTPUT_STD_DIR" $2
fi
\ No newline at end of file
/* unclosed comment
\ No newline at end of file
// cminus dont support comment like that
int main(void){
return 0;
}
\ No newline at end of file
/* unclosed function */
int main(void)
{
\ No newline at end of file
int a1;
int f1(void) {}
int f2(void) {}
/*Basic num part*/
int main(void){
a = 0;
x = 0.0;
x = 1.;
x = .1;
a = 1+1;
a = a-1;
x = x*1;
x = a/x;
return 0;
}
\ No newline at end of file
int a;
int f(void) {}
int g(void) {}
/*
I konw it's weird, even stupid, to code C like this. w(゚Д゚)w
HOWEVER, we have to use some tricky cases to test your answer.
*/
float GVAR;
void NeverEverDeclareLikeThis;
int GARRAY[2333];
void MyFuncA(int floatNum, float intNum, void voidNums[]){
int IKnowYouAreVoid;
return MyFuncB(IKnowYouAreVoid);
}
float MyFuncB(void){
int IAmVoid[0];
return MyFuncA(.0, 0, IAmVoid);
}
int main(void){
int a; int b; int c;
a = b = c = (85 == 84 + 0.4);
if(a = b){
GARRAY[ ( MyFuncB() ) ] = GARRAY[c = 1.*.1 == 1.1];
}else if (MyFuncC(NotDeclared)){
}else;
return 0.;
}
\ No newline at end of file
/* associativity and precedence */
int main(void)
{
a = b = c = 1 + 1 / 2 * 1 * (1 + 1 + 1 - 1 / 1) + 3 + 4 * 3;
}
int gcd (int u, int v) { /* calculate the gcd of u and v */
if (v == 0) return u;
else return gcd(v, u - u / v * v); /* v,u-u/v*v is equals to u mod v*/
}
int main(void) {
int x; int y; int temp;
x = 72;
y = 18;
if (x<y) {
temp = x;
x = y;
y = temp;
}
gcd(x,y);
return 0;
}
void move(int x, int y)
{
putint(x); putch(32); putint(y); putch(44); putch(32);
}
void hanoi(int n, int one, int two, int three)
{
if (n == 1)
move(one, three);
else {
hanoi(n - 1, one, three, two);
move(one, three);
hanoi(n - 1, two, one, three);
}
}
int main(void )
{
int n;
n = getint();
while (n > 0) {
hanoi(getint(), 1, 2, 3);
putch(10);
n = n - 1;
}
return 0;
}
/* else should be bound to the closest if */
int main(void)
{
if (1) {} else if (2) {} else {}
return 0;
}
/* this is the sample program in C- in the book "Compiler Construction" */
/* A program to perform selection sort on a 10 element array. */
int x[10];
int minloc ( int a[], int low, int high )
{ int i; int x; int k;
k = low;
x = a[low];
i = low + 1;
while (i < high)
{ if (a[i] < x)
{ x = a[i];
k = i; }
i = i + 1;
}
return k;
}
void sort( int a[], int low, int high)
{ int i; int k;
i = low;
while ( i < high-1)
{ int t;
k = minloc(a, i, high);
t = a[k];
a[k] = a[i];
a[i] = t;
i = i + 1;
}
}
void main(void)
{ int i;
i = 0;
while ( i < 10)
{ x[i] = input();
i = i + 1; }
sort(x, 0, 10);
i = 0;
while (i < 10)
{ output(x[i]);
i = i + 1; }
}
int main(void){
int a;
a = 1;
int b;
return 0;
}
\ No newline at end of file
int main(void) {
int array[1];
array[1] = 0;
return 0;
}
float foo(float a, float b[]) {
return 1;
}
int main(void) {
return 0;
}
/*Basic selection part*/
int main(void){
int a; int b;
a = 1;
b = 1;
if(a != b){
if(a == b);
else{
a = b;
}
}
return 0;
}
\ No newline at end of file
int main(void) {
int i; float j;
void v;
return 0;
}
/*
int main() {
int arr[100];
int i;
int sum;
i = 0;
sum = 0;
while (getint()) {
arr[i] = getint();
i = i + 1;
}*/
int main(void) {
int arr[100];
int i;
int sum;
i = 0;
sum = 0;
while (getint()) {
arr[i] = getint();
i = i + 1;
}
while (i) {
i = i - 1;
sum = sum + arr[i];
}
return sum - 79;
}
>--+ 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
| | | | | | | | >--* ;
| | | | | >--* }
>--+ 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
| | | | | >--* }
>--+ 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.
| | | | | | | | >--* ;
| | | | | >--* }
>--+ 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
| | | | | | | | >--* ;
| | | | | >--* }
>--+ 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
| | | | | | | | >--* ;
| | | | | >--* }
>--+ 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
| | | | | | | | >--* ;
| | | | | >--* }
>--+ 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
| | | | | | | | >--* ;
| | | | | >--* }
>--+ 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
| | | | | | | | | | | | | >--* ;
| | | | | | | | | | >--* }
| | | | | >--* }
>--+ 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
| | | | | | | | >--* ;
| | | | | >--* }
>--+ 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
| | | | | | | | >--* ;
| | | | | >--* }
>--+ 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
| | | | | | | | >--* ;
| | | | | >--* }
>--+ 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
| | | | | | | | >--* ;
| | | | | >--* }
>--+ 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
| | | | | | | | >--* ;
| | | | | >--* }
>--+ 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
| | | | | | | | >--* ;
| | | | | >--* }
>--+ 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
| | | | | | | | >--* ;
| | | | | >--* }
>--+ 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
| | | | | | | | >--* ;
| | | | | >--* }
>--+ 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
| | | | | | | | >--* ;
| | | | | >--* }
>--+ 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
| | | | | | | | >--* ;
| | | | | >--* }
>--+ 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
| | | | | | | | >--* ;
| | | | | >--* }
>--+ 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
| | | | | | | | >--* ;
| | | | | >--* }
>--+ 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
| | | | | | | | >--* ;
| | | | | >--* }
>--+ 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
| | | | | | | | >--* ;
| | | | | >--* }
>--+ 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
| | | | | | | | >--* ;
| | | | | >--* }
>--+ 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
| | | | | | | | >--* ;
| | | | | >--* }
>--+ 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
| | | | | | | | >--* ;
| | | | | >--* }
>--+ 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
| | | | | | | | | | | | | | >--* )
| | | | | | | | >--* ;
| | | | | >--* }
>--+ 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
| | | | | | | | >--* ;
| | | | | >--* }
>--+ 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
| | | | | | | | >--* ;
| | | | | >--* }
>--+ 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
| | | | | | | | >--* ;
| | | | | >--* }
>--+ 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
| | | | | | | | >--* ;
| | | | | >--* }
>--+ 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
| | | | | | | | >--* ;
| | | | | >--* }
>--+ 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
| | | | | | | | >--* ;
| | | | | >--* }
>--+ 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
| | | | | | | | | | | | | | >--* ]
| | | | | | | | >--* ;
| | | | | >--* }
>--+ 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
| | | | | | | | >--* ;
| | | | | >--* }
program
--fun-declaration: main
----compound-stmt
------expression-stmt
--------assign-expression
----------var: a
----------simple-expression
------------additive-expression
--------------term
----------------num (int): 0
------expression-stmt
--------assign-expression
----------var: x
----------simple-expression
------------additive-expression
--------------term
----------------num (float): 0
------expression-stmt
--------assign-expression
----------var: x
----------simple-expression
------------additive-expression
--------------term
----------------num (float): 1
------expression-stmt
--------assign-expression
----------var: x
----------simple-expression
------------additive-expression
--------------term
----------------num (float): 0.1
------expression-stmt
--------assign-expression
----------var: a
----------simple-expression
------------additive-expression: +
--------------additive-expression
----------------term
------------------num (int): 1
--------------term
----------------num (int): 1
------expression-stmt
--------assign-expression
----------var: a
----------simple-expression
------------additive-expression: -
--------------additive-expression
----------------term
------------------var: a
--------------term
----------------num (int): 1
------expression-stmt
--------assign-expression
----------var: x
----------simple-expression
------------additive-expression
--------------term: *
----------------term
------------------var: x
----------------num (int): 1
------expression-stmt
--------assign-expression
----------var: x
----------simple-expression
------------additive-expression
--------------term: /
----------------term
------------------var: a
----------------var: x
------return-stmt
--------simple-expression
----------additive-expression
------------term
--------------num (int): 0
program
--var-declaration: a
--fun-declaration: f
----compound-stmt
--fun-declaration: g
----compound-stmt
program
--var-declaration: GVAR
--var-declaration: NeverEverDeclareLikeThis
--var-declaration: GARRAY[]
----num (int): 2333
--fun-declaration: MyFuncA
----param: floatNum
----param: intNum
----param: voidNums[]
----compound-stmt
------var-declaration: IKnowYouAreVoid
------return-stmt
--------simple-expression
----------additive-expression
------------term
--------------call: MyFuncB()
----------------simple-expression
------------------additive-expression
--------------------term
----------------------var: IKnowYouAreVoid
--fun-declaration: MyFuncB
----compound-stmt
------var-declaration: IAmVoid[]
--------num (int): 0
------return-stmt
--------simple-expression
----------additive-expression
------------term
--------------call: MyFuncA()
----------------simple-expression
------------------additive-expression
--------------------term
----------------------num (float): 0
----------------simple-expression
------------------additive-expression
--------------------term
----------------------num (int): 0
----------------simple-expression
------------------additive-expression
--------------------term
----------------------var: IAmVoid
--fun-declaration: main
----compound-stmt
------var-declaration: a
------var-declaration: b
------var-declaration: c
------expression-stmt
--------assign-expression
----------var: a
----------assign-expression
------------var: b
------------assign-expression
--------------var: c
--------------simple-expression
----------------additive-expression
------------------term
--------------------simple-expression: ==
----------------------additive-expression
------------------------term
--------------------------num (int): 85
----------------------additive-expression: +
------------------------additive-expression
--------------------------term
----------------------------num (int): 84
------------------------term
--------------------------num (float): 0.4
------selection-stmt
--------assign-expression
----------var: a
----------simple-expression
------------additive-expression
--------------term
----------------var: b
--------compound-stmt
----------expression-stmt
------------assign-expression
--------------var: GARRAY[]
----------------simple-expression
------------------additive-expression
--------------------term
----------------------simple-expression
------------------------additive-expression
--------------------------term
----------------------------call: MyFuncB()
--------------simple-expression
----------------additive-expression
------------------term
--------------------var: GARRAY[]
----------------------assign-expression
------------------------var: c
------------------------simple-expression: ==
--------------------------additive-expression
----------------------------term: *
------------------------------term
--------------------------------num (float): 1
------------------------------num (float): 0.1
--------------------------additive-expression
----------------------------term
------------------------------num (float): 1.1
--------selection-stmt
----------simple-expression
------------additive-expression
--------------term
----------------call: MyFuncC()
------------------simple-expression
--------------------additive-expression
----------------------term
------------------------var: NotDeclared
----------compound-stmt
----------expression-stmt
------return-stmt
--------simple-expression
----------additive-expression
------------term
--------------num (float): 0
program
--fun-declaration: main
----compound-stmt
------expression-stmt
--------assign-expression
----------var: a
----------assign-expression
------------var: b
------------assign-expression
--------------var: c
--------------simple-expression
----------------additive-expression: +
------------------additive-expression: +
--------------------additive-expression: +
----------------------additive-expression
------------------------term
--------------------------num (int): 1
----------------------term: *
------------------------term: *
--------------------------term: /
----------------------------term
------------------------------num (int): 1
----------------------------num (int): 2
--------------------------num (int): 1
------------------------simple-expression
--------------------------additive-expression: -
----------------------------additive-expression: +
------------------------------additive-expression: +
--------------------------------additive-expression
----------------------------------term
------------------------------------num (int): 1
--------------------------------term
----------------------------------num (int): 1
------------------------------term
--------------------------------num (int): 1
----------------------------term: /
------------------------------term
--------------------------------num (int): 1
------------------------------num (int): 1
--------------------term
----------------------num (int): 3
------------------term: *
--------------------term
----------------------num (int): 4
--------------------num (int): 3
program
--fun-declaration: gcd
----param: u
----param: v
----compound-stmt
------selection-stmt
--------simple-expression: ==
----------additive-expression
------------term
--------------var: v
----------additive-expression
------------term
--------------num (int): 0
--------return-stmt
----------simple-expression
------------additive-expression
--------------term
----------------var: u
--------return-stmt
----------simple-expression
------------additive-expression
--------------term
----------------call: gcd()
------------------simple-expression
--------------------additive-expression
----------------------term
------------------------var: v
------------------simple-expression
--------------------additive-expression: -
----------------------additive-expression
------------------------term
--------------------------var: u
----------------------term: *
------------------------term: /
--------------------------term
----------------------------var: u
--------------------------var: v
------------------------var: v
--fun-declaration: main
----compound-stmt
------var-declaration: x
------var-declaration: y
------var-declaration: temp
------expression-stmt
--------assign-expression
----------var: x
----------simple-expression
------------additive-expression
--------------term
----------------num (int): 72
------expression-stmt
--------assign-expression
----------var: y
----------simple-expression
------------additive-expression
--------------term
----------------num (int): 18
------selection-stmt
--------simple-expression: <
----------additive-expression
------------term
--------------var: x
----------additive-expression
------------term
--------------var: y
--------compound-stmt
----------expression-stmt
------------assign-expression
--------------var: temp
--------------simple-expression
----------------additive-expression
------------------term
--------------------var: x
----------expression-stmt
------------assign-expression
--------------var: x
--------------simple-expression
----------------additive-expression
------------------term
--------------------var: y
----------expression-stmt
------------assign-expression
--------------var: y
--------------simple-expression
----------------additive-expression
------------------term
--------------------var: temp
------expression-stmt
--------simple-expression
----------additive-expression
------------term
--------------call: gcd()
----------------simple-expression
------------------additive-expression
--------------------term
----------------------var: x
----------------simple-expression
------------------additive-expression
--------------------term
----------------------var: y
------return-stmt
--------simple-expression
----------additive-expression
------------term
--------------num (int): 0
program
--fun-declaration: move
----param: x
----param: y
----compound-stmt
------expression-stmt
--------simple-expression
----------additive-expression
------------term
--------------call: putint()
----------------simple-expression
------------------additive-expression
--------------------term
----------------------var: x
------expression-stmt
--------simple-expression
----------additive-expression
------------term
--------------call: putch()
----------------simple-expression
------------------additive-expression
--------------------term
----------------------num (int): 32
------expression-stmt
--------simple-expression
----------additive-expression
------------term
--------------call: putint()
----------------simple-expression
------------------additive-expression
--------------------term
----------------------var: y
------expression-stmt
--------simple-expression
----------additive-expression
------------term
--------------call: putch()
----------------simple-expression
------------------additive-expression
--------------------term
----------------------num (int): 44
------expression-stmt
--------simple-expression
----------additive-expression
------------term
--------------call: putch()
----------------simple-expression
------------------additive-expression
--------------------term
----------------------num (int): 32
--fun-declaration: hanoi
----param: n
----param: one
----param: two
----param: three
----compound-stmt
------selection-stmt
--------simple-expression: ==
----------additive-expression
------------term
--------------var: n
----------additive-expression
------------term
--------------num (int): 1
--------expression-stmt
----------simple-expression
------------additive-expression
--------------term
----------------call: move()
------------------simple-expression
--------------------additive-expression
----------------------term
------------------------var: one
------------------simple-expression
--------------------additive-expression
----------------------term
------------------------var: three
--------compound-stmt
----------expression-stmt
------------simple-expression
--------------additive-expression
----------------term
------------------call: hanoi()
--------------------simple-expression
----------------------additive-expression: -
------------------------additive-expression
--------------------------term
----------------------------var: n
------------------------term
--------------------------num (int): 1
--------------------simple-expression
----------------------additive-expression
------------------------term
--------------------------var: one
--------------------simple-expression
----------------------additive-expression
------------------------term
--------------------------var: three
--------------------simple-expression
----------------------additive-expression
------------------------term
--------------------------var: two
----------expression-stmt
------------simple-expression
--------------additive-expression
----------------term
------------------call: move()
--------------------simple-expression
----------------------additive-expression
------------------------term
--------------------------var: one
--------------------simple-expression
----------------------additive-expression
------------------------term
--------------------------var: three
----------expression-stmt
------------simple-expression
--------------additive-expression
----------------term
------------------call: hanoi()
--------------------simple-expression
----------------------additive-expression: -
------------------------additive-expression
--------------------------term
----------------------------var: n
------------------------term
--------------------------num (int): 1
--------------------simple-expression
----------------------additive-expression
------------------------term
--------------------------var: two
--------------------simple-expression
----------------------additive-expression
------------------------term
--------------------------var: one
--------------------simple-expression
----------------------additive-expression
------------------------term
--------------------------var: three
--fun-declaration: main
----compound-stmt
------var-declaration: n
------expression-stmt
--------assign-expression
----------var: n
----------simple-expression
------------additive-expression
--------------term
----------------call: getint()
------iteration-stmt
--------simple-expression: >
----------additive-expression
------------term
--------------var: n
----------additive-expression
------------term
--------------num (int): 0
--------compound-stmt
----------expression-stmt
------------simple-expression
--------------additive-expression
----------------term
------------------call: hanoi()
--------------------simple-expression
----------------------additive-expression
------------------------term
--------------------------call: getint()
--------------------simple-expression
----------------------additive-expression
------------------------term
--------------------------num (int): 1
--------------------simple-expression
----------------------additive-expression
------------------------term
--------------------------num (int): 2
--------------------simple-expression
----------------------additive-expression
------------------------term
--------------------------num (int): 3
----------expression-stmt
------------simple-expression
--------------additive-expression
----------------term
------------------call: putch()
--------------------simple-expression
----------------------additive-expression
------------------------term
--------------------------num (int): 10
----------expression-stmt
------------assign-expression
--------------var: n
--------------simple-expression
----------------additive-expression: -
------------------additive-expression
--------------------term
----------------------var: n
------------------term
--------------------num (int): 1
------return-stmt
--------simple-expression
----------additive-expression
------------term
--------------num (int): 0
program
--fun-declaration: main
----compound-stmt
------selection-stmt
--------simple-expression
----------additive-expression
------------term
--------------num (int): 1
--------compound-stmt
--------selection-stmt
----------simple-expression
------------additive-expression
--------------term
----------------num (int): 2
----------compound-stmt
----------compound-stmt
------return-stmt
--------simple-expression
----------additive-expression
------------term
--------------num (int): 0
program
--var-declaration: x[]
----num (int): 10
--fun-declaration: minloc
----param: a[]
----param: low
----param: high
----compound-stmt
------var-declaration: i
------var-declaration: x
------var-declaration: k
------expression-stmt
--------assign-expression
----------var: k
----------simple-expression
------------additive-expression
--------------term
----------------var: low
------expression-stmt
--------assign-expression
----------var: x
----------simple-expression
------------additive-expression
--------------term
----------------var: a[]
------------------simple-expression
--------------------additive-expression
----------------------term
------------------------var: low
------expression-stmt
--------assign-expression
----------var: i
----------simple-expression
------------additive-expression: +
--------------additive-expression
----------------term
------------------var: low
--------------term
----------------num (int): 1
------iteration-stmt
--------simple-expression: <
----------additive-expression
------------term
--------------var: i
----------additive-expression
------------term
--------------var: high
--------compound-stmt
----------selection-stmt
------------simple-expression: <
--------------additive-expression
----------------term
------------------var: a[]
--------------------simple-expression
----------------------additive-expression
------------------------term
--------------------------var: i
--------------additive-expression
----------------term
------------------var: x
------------compound-stmt
--------------expression-stmt
----------------assign-expression
------------------var: x
------------------simple-expression
--------------------additive-expression
----------------------term
------------------------var: a[]
--------------------------simple-expression
----------------------------additive-expression
------------------------------term
--------------------------------var: i
--------------expression-stmt
----------------assign-expression
------------------var: k
------------------simple-expression
--------------------additive-expression
----------------------term
------------------------var: i
----------expression-stmt
------------assign-expression
--------------var: i
--------------simple-expression
----------------additive-expression: +
------------------additive-expression
--------------------term
----------------------var: i
------------------term
--------------------num (int): 1
------return-stmt
--------simple-expression
----------additive-expression
------------term
--------------var: k
--fun-declaration: sort
----param: a[]
----param: low
----param: high
----compound-stmt
------var-declaration: i
------var-declaration: k
------expression-stmt
--------assign-expression
----------var: i
----------simple-expression
------------additive-expression
--------------term
----------------var: low
------iteration-stmt
--------simple-expression: <
----------additive-expression
------------term
--------------var: i
----------additive-expression: -
------------additive-expression
--------------term
----------------var: high
------------term
--------------num (int): 1
--------compound-stmt
----------var-declaration: t
----------expression-stmt
------------assign-expression
--------------var: k
--------------simple-expression
----------------additive-expression
------------------term
--------------------call: minloc()
----------------------simple-expression
------------------------additive-expression
--------------------------term
----------------------------var: a
----------------------simple-expression
------------------------additive-expression
--------------------------term
----------------------------var: i
----------------------simple-expression
------------------------additive-expression
--------------------------term
----------------------------var: high
----------expression-stmt
------------assign-expression
--------------var: t
--------------simple-expression
----------------additive-expression
------------------term
--------------------var: a[]
----------------------simple-expression
------------------------additive-expression
--------------------------term
----------------------------var: k
----------expression-stmt
------------assign-expression
--------------var: a[]
----------------simple-expression
------------------additive-expression
--------------------term
----------------------var: k
--------------simple-expression
----------------additive-expression
------------------term
--------------------var: a[]
----------------------simple-expression
------------------------additive-expression
--------------------------term
----------------------------var: i
----------expression-stmt
------------assign-expression
--------------var: a[]
----------------simple-expression
------------------additive-expression
--------------------term
----------------------var: i
--------------simple-expression
----------------additive-expression
------------------term
--------------------var: t
----------expression-stmt
------------assign-expression
--------------var: i
--------------simple-expression
----------------additive-expression: +
------------------additive-expression
--------------------term
----------------------var: i
------------------term
--------------------num (int): 1
--fun-declaration: main
----compound-stmt
------var-declaration: i
------expression-stmt
--------assign-expression
----------var: i
----------simple-expression
------------additive-expression
--------------term
----------------num (int): 0
------iteration-stmt
--------simple-expression: <
----------additive-expression
------------term
--------------var: i
----------additive-expression
------------term
--------------num (int): 10
--------compound-stmt
----------expression-stmt
------------assign-expression
--------------var: x[]
----------------simple-expression
------------------additive-expression
--------------------term
----------------------var: i
--------------simple-expression
----------------additive-expression
------------------term
--------------------call: input()
----------expression-stmt
------------assign-expression
--------------var: i
--------------simple-expression
----------------additive-expression: +
------------------additive-expression
--------------------term
----------------------var: i
------------------term
--------------------num (int): 1
------expression-stmt
--------simple-expression
----------additive-expression
------------term
--------------call: sort()
----------------simple-expression
------------------additive-expression
--------------------term
----------------------var: x
----------------simple-expression
------------------additive-expression
--------------------term
----------------------num (int): 0
----------------simple-expression
------------------additive-expression
--------------------term
----------------------num (int): 10
------expression-stmt
--------assign-expression
----------var: i
----------simple-expression
------------additive-expression
--------------term
----------------num (int): 0
------iteration-stmt
--------simple-expression: <
----------additive-expression
------------term
--------------var: i
----------additive-expression
------------term
--------------num (int): 10
--------compound-stmt
----------expression-stmt
------------simple-expression
--------------additive-expression
----------------term
------------------call: output()
--------------------simple-expression
----------------------additive-expression
------------------------term
--------------------------var: x[]
----------------------------simple-expression
------------------------------additive-expression
--------------------------------term
----------------------------------var: i
----------expression-stmt
------------assign-expression
--------------var: i
--------------simple-expression
----------------additive-expression: +
------------------additive-expression
--------------------term
----------------------var: i
------------------term
--------------------num (int): 1
program
--fun-declaration: main
----compound-stmt
------var-declaration: array[]
--------num (int): 1
------expression-stmt
--------assign-expression
----------var: array[]
------------simple-expression
--------------additive-expression
----------------term
------------------num (int): 1
----------simple-expression
------------additive-expression
--------------term
----------------num (int): 0
------return-stmt
--------simple-expression
----------additive-expression
------------term
--------------num (int): 0
program
--fun-declaration: foo
----param: a
----param: b[]
----compound-stmt
------return-stmt
--------simple-expression
----------additive-expression
------------term
--------------num (int): 1
--fun-declaration: main
----compound-stmt
------return-stmt
--------simple-expression
----------additive-expression
------------term
--------------num (int): 0
program
--fun-declaration: main
----compound-stmt
------var-declaration: a
------var-declaration: b
------expression-stmt
--------assign-expression
----------var: a
----------simple-expression
------------additive-expression
--------------term
----------------num (int): 1
------expression-stmt
--------assign-expression
----------var: b
----------simple-expression
------------additive-expression
--------------term
----------------num (int): 1
------selection-stmt
--------simple-expression: !=
----------additive-expression
------------term
--------------var: a
----------additive-expression
------------term
--------------var: b
--------compound-stmt
----------selection-stmt
------------simple-expression: ==
--------------additive-expression
----------------term
------------------var: a
--------------additive-expression
----------------term
------------------var: b
------------expression-stmt
------------compound-stmt
--------------expression-stmt
----------------assign-expression
------------------var: a
------------------simple-expression
--------------------additive-expression
----------------------term
------------------------var: b
------return-stmt
--------simple-expression
----------additive-expression
------------term
--------------num (int): 0
program
--fun-declaration: main
----compound-stmt
------var-declaration: i
------var-declaration: j
------var-declaration: v
------return-stmt
--------simple-expression
----------additive-expression
------------term
--------------num (int): 0
program
--fun-declaration: main
----compound-stmt
------var-declaration: arr[]
--------num (int): 100
------var-declaration: i
------var-declaration: sum
------expression-stmt
--------assign-expression
----------var: i
----------simple-expression
------------additive-expression
--------------term
----------------num (int): 0
------expression-stmt
--------assign-expression
----------var: sum
----------simple-expression
------------additive-expression
--------------term
----------------num (int): 0
------iteration-stmt
--------simple-expression
----------additive-expression
------------term
--------------call: getint()
--------compound-stmt
----------expression-stmt
------------assign-expression
--------------var: arr[]
----------------simple-expression
------------------additive-expression
--------------------term
----------------------var: i
--------------simple-expression
----------------additive-expression
------------------term
--------------------call: getint()
----------expression-stmt
------------assign-expression
--------------var: i
--------------simple-expression
----------------additive-expression: +
------------------additive-expression
--------------------term
----------------------var: i
------------------term
--------------------num (int): 1
------iteration-stmt
--------simple-expression
----------additive-expression
------------term
--------------var: i
--------compound-stmt
----------expression-stmt
------------assign-expression
--------------var: i
--------------simple-expression
----------------additive-expression: -
------------------additive-expression
--------------------term
----------------------var: i
------------------term
--------------------num (int): 1
----------expression-stmt
------------assign-expression
--------------var: sum
--------------simple-expression
----------------additive-expression: +
------------------additive-expression
--------------------term
----------------------var: sum
------------------term
--------------------var: arr[]
----------------------simple-expression
------------------------additive-expression
--------------------------term
----------------------------var: i
------return-stmt
--------simple-expression
----------additive-expression: -
------------additive-expression
--------------term
----------------var: sum
------------term
--------------num (int): 79
program
--fun-declaration: main
----compound-stmt
------return-stmt: void
program
--fun-declaration: test
----param: a
----compound-stmt
------return-stmt: void
--fun-declaration: main
----compound-stmt
------var-declaration: a
------expression-stmt
--------assign-expression
----------var: a
----------simple-expression
------------additive-expression
--------------term
----------------num (int): 10
------expression-stmt
--------simple-expression
----------additive-expression
------------term
--------------call: test()
----------------simple-expression
------------------additive-expression
--------------------term
----------------------var: a
------return-stmt: void
program
--fun-declaration: addone
----param: a
----compound-stmt
------return-stmt
--------simple-expression
----------additive-expression: +
------------additive-expression
--------------term
----------------var: a
------------term
--------------num (int): 1
--fun-declaration: main
----compound-stmt
------var-declaration: result
------expression-stmt
--------assign-expression
----------var: result
----------simple-expression
------------additive-expression
--------------term
----------------call: addone()
------------------simple-expression
--------------------additive-expression
----------------------term
------------------------call: addone()
--------------------------simple-expression
----------------------------additive-expression
------------------------------term
--------------------------------call: addone()
----------------------------------simple-expression
------------------------------------additive-expression
--------------------------------------term
----------------------------------------call: addone()
------------------------------------------simple-expression
--------------------------------------------additive-expression
----------------------------------------------term
------------------------------------------------num (int): 1230
------return-stmt
--------simple-expression
----------additive-expression
------------term
--------------var: result
program
--fun-declaration: factorial
----param: a
----compound-stmt
------selection-stmt
--------simple-expression: ==
----------additive-expression
------------term
--------------var: a
----------additive-expression
------------term
--------------num (int): 0
--------return-stmt
----------simple-expression
------------additive-expression
--------------term
----------------num (int): 1
--------return-stmt
----------simple-expression
------------additive-expression
--------------term: *
----------------term
------------------var: a
----------------call: factorial()
------------------simple-expression
--------------------additive-expression: -
----------------------additive-expression
------------------------term
--------------------------var: a
----------------------term
------------------------num (int): 1
--fun-declaration: main
----compound-stmt
------var-declaration: result
------expression-stmt
--------assign-expression
----------var: result
----------simple-expression
------------additive-expression
--------------term
----------------call: factorial()
------------------simple-expression
--------------------additive-expression
----------------------term
------------------------num (int): 10
------return-stmt
--------simple-expression
----------additive-expression
------------term
--------------var: result
program
--fun-declaration: main
----compound-stmt
------var-declaration: a
------expression-stmt
--------assign-expression
----------var: a
----------simple-expression
------------additive-expression
--------------term
----------------num (int): 2
------selection-stmt
--------simple-expression
----------additive-expression
------------term
--------------var: a
--------expression-stmt
----------assign-expression
------------var: a
------------simple-expression
--------------additive-expression
----------------term
------------------num (int): 3
------expression-stmt
--------assign-expression
----------var: a
----------simple-expression
------------additive-expression
--------------term
----------------num (int): 4
------return-stmt: void
program
--fun-declaration: main
----compound-stmt
------var-declaration: i
------expression-stmt
--------assign-expression
----------var: i
----------simple-expression
------------additive-expression
--------------term
----------------num (int): 10
------iteration-stmt
--------simple-expression
----------additive-expression
------------term
--------------var: i
--------compound-stmt
----------expression-stmt
------------assign-expression
--------------var: i
--------------simple-expression
----------------additive-expression: -
------------------additive-expression
--------------------term
----------------------var: i
------------------term
--------------------num (int): 1
------return-stmt: void
program
--fun-declaration: main
----compound-stmt
------var-declaration: i
------var-declaration: a
------var-declaration: b
------expression-stmt
--------assign-expression
----------var: a
----------simple-expression
------------additive-expression
--------------term
----------------num (int): 0
------expression-stmt
--------assign-expression
----------var: b
----------simple-expression
------------additive-expression
--------------term
----------------num (int): 0
------expression-stmt
--------assign-expression
----------var: i
----------simple-expression
------------additive-expression
--------------term
----------------num (int): 10
------iteration-stmt
--------simple-expression
----------additive-expression
------------term
--------------var: i
--------compound-stmt
----------expression-stmt
------------assign-expression
--------------var: i
--------------simple-expression
----------------additive-expression: -
------------------additive-expression
--------------------term
----------------------var: i
------------------term
--------------------num (int): 1
----------selection-stmt
------------simple-expression: <
--------------additive-expression
----------------term
------------------var: i
--------------additive-expression
----------------term
------------------num (int): 5
------------expression-stmt
--------------assign-expression
----------------var: a
----------------simple-expression
------------------additive-expression: +
--------------------additive-expression
----------------------term
------------------------var: a
--------------------term
----------------------var: i
------------compound-stmt
--------------expression-stmt
----------------assign-expression
------------------var: b
------------------simple-expression
--------------------additive-expression: +
----------------------additive-expression
------------------------term
--------------------------var: b
----------------------term
------------------------var: i
------return-stmt
--------simple-expression
----------additive-expression: +
------------additive-expression
--------------term
----------------var: a
------------term
--------------var: b
program
--fun-declaration: main
----compound-stmt
------var-declaration: a
------var-declaration: b
------var-declaration: c
------expression-stmt
--------assign-expression
----------var: c
----------simple-expression
------------additive-expression
--------------term
----------------num (int): 0
------expression-stmt
--------assign-expression
----------var: a
----------simple-expression
------------additive-expression
--------------term
----------------num (int): 2
------expression-stmt
--------assign-expression
----------var: b
----------simple-expression
------------additive-expression
--------------term
----------------num (int): 1
------selection-stmt
--------simple-expression
----------additive-expression
------------term
--------------var: b
--------selection-stmt
----------simple-expression
------------additive-expression
--------------term
----------------var: c
----------expression-stmt
------------assign-expression
--------------var: a
--------------simple-expression
----------------additive-expression
------------------term
--------------------num (int): 4
----------expression-stmt
------------assign-expression
--------------var: a
--------------simple-expression
----------------additive-expression
------------------term
--------------------num (int): 3
------return-stmt
--------simple-expression
----------additive-expression
------------term
--------------var: a
program
--fun-declaration: main
----compound-stmt
------var-declaration: i
------var-declaration: j
------expression-stmt
--------assign-expression
----------var: i
----------simple-expression
------------additive-expression
--------------term
----------------num (int): 10
------iteration-stmt
--------simple-expression
----------additive-expression
------------term
--------------var: i
--------compound-stmt
----------expression-stmt
------------assign-expression
--------------var: i
--------------simple-expression
----------------additive-expression: -
------------------additive-expression
--------------------term
----------------------var: i
------------------term
--------------------num (int): 1
----------expression-stmt
------------assign-expression
--------------var: j
--------------simple-expression
----------------additive-expression
------------------term
--------------------var: i
----------iteration-stmt
------------simple-expression
--------------additive-expression
----------------term
------------------var: j
------------compound-stmt
--------------expression-stmt
----------------assign-expression
------------------var: j
------------------simple-expression
--------------------additive-expression: -
----------------------additive-expression
------------------------term
--------------------------var: j
----------------------term
------------------------num (int): 1
------return-stmt
--------simple-expression
----------additive-expression: +
------------additive-expression
--------------term
----------------var: i
------------term
--------------var: j
program
--var-declaration: a
--fun-declaration: main
----compound-stmt
------expression-stmt
--------assign-expression
----------var: a
----------simple-expression
------------additive-expression
--------------term
----------------num (int): 10
------return-stmt
--------simple-expression
----------additive-expression
------------term
--------------var: a
program
--var-declaration: a
--fun-declaration: GlobalAssign
----compound-stmt
------expression-stmt
--------assign-expression
----------var: a
----------simple-expression
------------additive-expression
--------------term
----------------num (int): 10
------return-stmt: void
--fun-declaration: main
----compound-stmt
------var-declaration: a
------expression-stmt
--------simple-expression
----------additive-expression
------------term
--------------call: GlobalAssign()
------expression-stmt
--------assign-expression
----------var: a
----------simple-expression
------------additive-expression
--------------term
----------------num (int): 20
------return-stmt
--------simple-expression
----------additive-expression
------------term
--------------var: a
program
--fun-declaration: main
----compound-stmt
------var-declaration: a
------return-stmt: void
program
--var-declaration: x[]
----num (int): 1
--var-declaration: y[]
----num (int): 1
--fun-declaration: gcd
----param: u
----param: v
----compound-stmt
------selection-stmt
--------simple-expression: ==
----------additive-expression
------------term
--------------var: v
----------additive-expression
------------term
--------------num (int): 0
--------return-stmt
----------simple-expression
------------additive-expression
--------------term
----------------var: u
--------return-stmt
----------simple-expression
------------additive-expression
--------------term
----------------call: gcd()
------------------simple-expression
--------------------additive-expression
----------------------term
------------------------var: v
------------------simple-expression
--------------------additive-expression: -
----------------------additive-expression
------------------------term
--------------------------var: u
----------------------term: *
------------------------term: /
--------------------------term
----------------------------var: u
--------------------------var: v
------------------------var: v
--fun-declaration: funArray
----param: u[]
----param: v[]
----compound-stmt
------var-declaration: a
------var-declaration: b
------var-declaration: temp
------expression-stmt
--------assign-expression
----------var: a
----------simple-expression
------------additive-expression
--------------term
----------------var: u[]
------------------simple-expression
--------------------additive-expression
----------------------term
------------------------num (int): 0
------expression-stmt
--------assign-expression
----------var: b
----------simple-expression
------------additive-expression
--------------term
----------------var: v[]
------------------simple-expression
--------------------additive-expression
----------------------term
------------------------num (int): 0
------selection-stmt
--------simple-expression: <
----------additive-expression
------------term
--------------var: a
----------additive-expression
------------term
--------------var: b
--------compound-stmt
----------expression-stmt
------------assign-expression
--------------var: temp
--------------simple-expression
----------------additive-expression
------------------term
--------------------var: a
----------expression-stmt
------------assign-expression
--------------var: a
--------------simple-expression
----------------additive-expression
------------------term
--------------------var: b
----------expression-stmt
------------assign-expression
--------------var: b
--------------simple-expression
----------------additive-expression
------------------term
--------------------var: temp
------return-stmt
--------simple-expression
----------additive-expression
------------term
--------------call: gcd()
----------------simple-expression
------------------additive-expression
--------------------term
----------------------var: a
----------------simple-expression
------------------additive-expression
--------------------term
----------------------var: b
--fun-declaration: main
----compound-stmt
------expression-stmt
--------assign-expression
----------var: x[]
------------simple-expression
--------------additive-expression
----------------term
------------------num (int): 0
----------simple-expression
------------additive-expression
--------------term
----------------num (int): 90
------expression-stmt
--------assign-expression
----------var: y[]
------------simple-expression
--------------additive-expression
----------------term
------------------num (int): 0
----------simple-expression
------------additive-expression
--------------term
----------------num (int): 18
------return-stmt
--------simple-expression
----------additive-expression
------------term
--------------call: funArray()
----------------simple-expression
------------------additive-expression
--------------------term
----------------------var: x
----------------simple-expression
------------------additive-expression
--------------------term
----------------------var: y
program
--fun-declaration: main
----compound-stmt
------return-stmt: void
program
--fun-declaration: main
----compound-stmt
------var-declaration: a
------return-stmt: void
program
--fun-declaration: main
----compound-stmt
------var-declaration: a[]
--------num (int): 10
------return-stmt: void
program
--fun-declaration: main
----compound-stmt
------var-declaration: a[]
--------num (int): 10
------return-stmt: void
program
--fun-declaration: main
----compound-stmt
------var-declaration: a
------expression-stmt
--------assign-expression
----------var: a
----------simple-expression
------------additive-expression: +
--------------additive-expression
----------------term
------------------num (int): 1000
--------------term
----------------num (int): 234
------return-stmt
--------simple-expression
----------additive-expression
------------term
--------------var: a
program
--fun-declaration: main
----compound-stmt
------var-declaration: a
------expression-stmt
--------assign-expression
----------var: a
----------simple-expression
------------additive-expression
--------------term
----------------num (int): 1234
------return-stmt
--------simple-expression
----------additive-expression
------------term
--------------var: a
program
--fun-declaration: main
----compound-stmt
------var-declaration: a[]
--------num (int): 10
------expression-stmt
--------assign-expression
----------var: a[]
------------simple-expression
--------------additive-expression
----------------term
------------------num (int): 3
----------simple-expression
------------additive-expression
--------------term
----------------num (int): 1234
------return-stmt
--------simple-expression
----------additive-expression
------------term
--------------var: a[]
----------------simple-expression
------------------additive-expression
--------------------term
----------------------num (int): 3
program
--fun-declaration: main
----compound-stmt
------var-declaration: a
------var-declaration: b
------expression-stmt
--------assign-expression
----------var: a
----------simple-expression: <
------------additive-expression
--------------term
----------------num (int): 1
------------additive-expression
--------------term
----------------num (int): 3
------expression-stmt
--------assign-expression
----------var: b
----------simple-expression
------------additive-expression: +
--------------additive-expression
----------------term
------------------num (int): 2
--------------term
----------------num (float): 2.4
------return-stmt
--------simple-expression
----------additive-expression: +
------------additive-expression
--------------term
----------------var: a
------------term
--------------var: b
void test(int a) {
return;
}
void main(void) {
int a;
a = 10;
test(a);
return;
}
int addone(int a) { return a + 1; }
int main(void) {
int result;
result = addone(addone(addone(addone(1230))));
return result;
}
int factorial(int a) {
if(a==0)
return 1;
else
return a*factorial(a-1);
}
int main(void) {
int result;
result = factorial(10);
return result;
}
void main(void) {
int a;
a = 2;
if (a)
a = 3;
a = 4;
return;
}
void main(void) {
int i;
i = 10;
while (i) {
i = i - 1;
}
return;
}
int main(void) {
int i;
int a;
int b;
a = 0;
b = 0;
i = 10;
while (i) {
i = i - 1;
if (i < 5)
a = a + i;
else {
b = b + i;
}
}
return a + b;
}
int main(void) {
int a;
int b;
int c;
c = 0;
a = 2;
b = 1;
if (b)
if (c)
a = 4;
else
a = 3;
return a;
}
int main(void) {
int i;
int j;
i = 10;
while (i) {
i = i - 1;
j = i;
while(j) {
j = j - 1;
}
}
return i + j;
}
\ No newline at end of file
int a;
int main(void) {
a = 10;
return a;
}
\ No newline at end of file
int a;
void GlobalAssign(void) {
a = 10;
return;
}
int main(void) {
int a;
GlobalAssign();
a = 20;
return a;
}
void main(void) {
int a;
return;
}
int x[1];
int y[1];
int gcd(int u, int v) {
if (v == 0)
return u;
else
return gcd(v, u - u / v * v);
}
int funArray(int u[], int v[]) {
int a;
int b;
int temp;
a = u[0];
b = v[0];
if (a < b) {
temp = a;
a = b;
b = temp;
}
return gcd(a, b);
}
int main(void) {
x[0] = 90;
y[0] = 18;
return funArray(x, y);
}
\ No newline at end of file
/*this is comment*/
void main(void) { return; }
\ No newline at end of file
void main(void) {
float a;
return;
}
void main(void) {
int a[10];
return;
}
void main(void) {
float a[10];
return;
}
int main(void) {
int a;
a = 1000 + 234;
return a;
}
int main(void) {
int a;
a = 1234;
return a;
}
int main(void) {
int a[10];
a[3] = 1234;
return a[3];
}
int main(void) {
int a;
int b;
a = 1 < 3;
b = 2 + 2.4;
return a + b;
}
| case name | 语法特性 |
| ---- | ---- |
| 1-return.cminus | base case |
| 2-decl_int.cminus | int变量声明 |
| 3-decl_float.cminus | float变量声明 |
| 4-decl_int_array.cminus | int数组变量声明 |
| 5-decl_float_array.cminus | float数组变量声明 |
| 6-num_add_int.cminus | 加法运算 |
| 7-assign_int_var_local.cminus | 赋值语句 |
| 8-assign_int_array_local.cminus | 数组赋值语句 |
| 9-assign_cast.cminus | 类型转换情况 |
| 10-funcall.cminus | 函数调用 |
| 11-funcall_chain.cminus | 函数嵌套调用 |
| 12-funcall_recursion.cminus | 函数递归 |
| 13-if_stmt.cminus | if选择语句 |
| 14-while_stmt.cminus | while循环语句 |
| 15-if_while.cminus | if与while语句嵌套 |
| 16-if_recursion.cminus | if嵌套 |
| 17-while_recursion.cminus | while嵌套 |
| 18-global_var.cminus | 全局变量 |
| 19-global_local_var.cminus | 全局变量与局部变量重名 |
| 20-gcd_array.cminus | 稍微复杂一些的case |
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment