Using %code directives instead of {% %} prologue.
This commit is contained in:
parent
66da783857
commit
4a8377ed71
|
@ -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;
|
||||||
|
|
Reference in New Issue
Block a user