Using %code directives instead of {% %} prologue.

This commit is contained in:
Stefano Sanfilippo 2014-11-28 19:06:27 +01:00
parent 66da783857
commit 4a8377ed71

View File

@ -1,8 +1,7 @@
%{ %code top {
#include "Nodes.hpp" #include "Nodes.hpp"
using namespace monicelli; using namespace monicelli;
%} }
%skeleton "lalr1.cc" %skeleton "lalr1.cc"
%require "3.0" %require "3.0"
@ -54,14 +53,14 @@ using namespace monicelli;
%nonassoc LOWER_THAN_ELSE %nonassoc LOWER_THAN_ELSE
%nonassoc BRANCH_ELSE %nonassoc BRANCH_ELSE
%{ %code {
#include <stack> #include <stack>
static std::stack<StatementList*> stmtStack; static std::stack<StatementList*> stmtStack;
static std::stack<ExpressionList*> argsStack; static std::stack<ExpressionList*> argsStack;
static std::stack<IdList*> paramsStack; static std::stack<IdList*> paramsStack;
static std::stack<BranchCaseList*> branchCaseStack; static std::stack<BranchCaseList*> branchCaseStack;
%} }
%union { %union {
int intval; int intval;