2014-11-29 00:47:50 +01:00
|
|
|
/*
|
2014-11-29 21:38:52 +01:00
|
|
|
* Monicelli: an esoteric language compiler
|
2014-12-02 16:22:03 +01:00
|
|
|
*
|
2014-11-29 00:47:50 +01:00
|
|
|
* Copyright (C) 2014 Stefano Sanfilippo
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2014-11-28 19:06:27 +01:00
|
|
|
%code top {
|
|
|
|
#include "Nodes.hpp"
|
|
|
|
using namespace monicelli;
|
|
|
|
}
|
2014-11-23 19:04:25 +01:00
|
|
|
|
2014-11-28 19:00:51 +01:00
|
|
|
%skeleton "lalr1.cc"
|
|
|
|
%require "3.0"
|
|
|
|
%language "c++"
|
|
|
|
|
|
|
|
%defines
|
|
|
|
%locations
|
|
|
|
%token-table
|
|
|
|
|
|
|
|
%define parse.error verbose
|
|
|
|
%define api.namespace {monicelli}
|
|
|
|
%define parser_class_name {Parser}
|
|
|
|
|
|
|
|
%lex-param {Scanner &scanner}
|
|
|
|
%parse-param {Scanner &scanner}
|
|
|
|
%parse-param {Program &program}
|
|
|
|
|
2014-11-24 23:56:54 +01:00
|
|
|
%code requires {
|
2014-11-28 19:00:51 +01:00
|
|
|
#include "Nodes.hpp"
|
|
|
|
|
|
|
|
namespace monicelli {
|
|
|
|
class Scanner;
|
|
|
|
}
|
2014-11-24 23:56:54 +01:00
|
|
|
}
|
|
|
|
|
2014-11-28 19:00:51 +01:00
|
|
|
%code {
|
|
|
|
static int yylex(Parser::semantic_type*, Parser::location_type*, Scanner&);
|
|
|
|
}
|
2014-11-23 19:04:25 +01:00
|
|
|
|
2014-11-29 22:31:25 +01:00
|
|
|
%token MAIN ERROR
|
2014-11-23 19:04:25 +01:00
|
|
|
%token RETURN
|
|
|
|
%token ARTICLE TYPENAME STAR
|
|
|
|
%token VARDECL ASSIGN
|
|
|
|
%token PRINT INPUT
|
2014-11-25 00:47:51 +01:00
|
|
|
%token ASSERT BANG
|
2014-11-23 19:04:25 +01:00
|
|
|
%token LOOP_BEGIN LOOP_CONDITION
|
2014-11-23 19:24:10 +01:00
|
|
|
%token BRANCH_CONDITION BRANCH_BEGIN BRANCH_ELSE BRANCH_END CASE_END
|
2014-11-23 22:33:50 +01:00
|
|
|
%token COLON COMMA
|
2014-12-02 14:14:58 +01:00
|
|
|
%token FUN_DECL PARAMS FUN_CALL FUN_END
|
2014-11-23 19:04:25 +01:00
|
|
|
%token ABORT
|
|
|
|
%token ID NUMBER FLOAT
|
|
|
|
|
|
|
|
%left OP_LT OP_GT OP_LTE OP_GTE
|
|
|
|
%left OP_PLUS OP_MINUS
|
|
|
|
%left OP_TIMES OP_DIV
|
|
|
|
%left OP_SHL OP_SHR
|
|
|
|
|
|
|
|
%nonassoc LOWER_THAN_ELSE
|
|
|
|
%nonassoc BRANCH_ELSE
|
|
|
|
|
2014-11-27 20:01:52 +01:00
|
|
|
%union {
|
|
|
|
int intval;
|
|
|
|
double floatval;
|
2014-11-28 00:01:24 +01:00
|
|
|
std::string* strval;
|
2014-11-27 20:01:52 +01:00
|
|
|
bool boolval;
|
2014-11-28 19:07:47 +01:00
|
|
|
Type typeval;
|
|
|
|
Statement* statementval;
|
2015-03-05 01:16:40 +01:00
|
|
|
PointerList<Statement>* statlistval;
|
2014-11-28 19:07:47 +01:00
|
|
|
Assert* assertval;
|
|
|
|
FunctionCall* callval;
|
|
|
|
Print* printval;
|
|
|
|
Input* inputval;
|
|
|
|
Abort* abortval;
|
|
|
|
Branch* branchval;
|
2014-12-02 16:22:03 +01:00
|
|
|
Branch::Body* branchbodyval;
|
2014-11-28 19:07:47 +01:00
|
|
|
VarDeclaration* declval;
|
|
|
|
Assignment* assignval;
|
|
|
|
Loop* loopval;
|
|
|
|
BranchCase *caseval;
|
2015-03-05 01:16:40 +01:00
|
|
|
PointerList<BranchCase> *caselistval;
|
2014-11-28 19:07:47 +01:00
|
|
|
Return* returnval;
|
|
|
|
Expression* expressionval;
|
2015-03-05 01:16:40 +01:00
|
|
|
PointerList<Expression>* exprlistval;
|
2014-11-28 19:07:47 +01:00
|
|
|
SemiExpression *semiexpval;
|
|
|
|
Id* idval;
|
|
|
|
Number* numericval;
|
|
|
|
Function* funval;
|
2014-11-30 13:03:45 +01:00
|
|
|
FunArg *argval;
|
2015-03-05 01:16:40 +01:00
|
|
|
PointerList<FunArg> *arglistval;
|
2014-11-28 19:07:47 +01:00
|
|
|
Main* mainval;
|
2014-11-27 20:01:52 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
%type<intval> NUMBER
|
|
|
|
%type<floatval> FLOAT
|
|
|
|
%type<strval> ID
|
2014-11-30 13:03:45 +01:00
|
|
|
%type<typeval> TYPENAME fun_return
|
2014-11-27 20:01:52 +01:00
|
|
|
%type<statementval> statement
|
2014-12-02 16:22:03 +01:00
|
|
|
%type<statlistval> statements
|
|
|
|
%type<branchbodyval> branch_body
|
2014-11-27 20:01:52 +01:00
|
|
|
%type<assertval> assert_stmt
|
|
|
|
%type<callval> fun_call
|
2014-11-30 13:03:45 +01:00
|
|
|
%type<argval> arg_decl
|
2014-12-02 16:22:03 +01:00
|
|
|
%type<arglistval> args_decl args
|
2014-11-27 20:01:52 +01:00
|
|
|
%type<funval> fun_decl
|
|
|
|
%type<printval> print_stmt
|
|
|
|
%type<inputval> input_stmt
|
|
|
|
%type<abortval> abort_stmt
|
|
|
|
%type<branchval> branch_stmt
|
|
|
|
%type<caseval> case_stmt
|
2014-12-02 16:22:03 +01:00
|
|
|
%type<caselistval> cases
|
2014-11-27 20:01:52 +01:00
|
|
|
%type<declval> var_decl
|
|
|
|
%type<assignval> assign_stmt
|
|
|
|
%type<loopval> loop_stmt
|
|
|
|
%type<returnval> return_stmt
|
|
|
|
%type<expressionval> expression maybe_expression simple_expression var_init
|
2014-12-02 16:22:03 +01:00
|
|
|
%type<exprlistval> call_arglist call_args
|
2014-11-27 20:01:52 +01:00
|
|
|
%type<semiexpval> semi_expression
|
|
|
|
%type<idval> variable
|
|
|
|
%type<numericval> numeric
|
|
|
|
%type<mainval> main
|
|
|
|
%type<boolval> pointer
|
2014-11-23 19:04:25 +01:00
|
|
|
|
2014-11-24 23:57:24 +01:00
|
|
|
%start program
|
|
|
|
|
2014-11-23 19:04:25 +01:00
|
|
|
%%
|
|
|
|
|
|
|
|
program:
|
2014-11-27 20:01:52 +01:00
|
|
|
/* epsilon */
|
|
|
|
| fun_decls main fun_decls {
|
2014-11-28 19:00:51 +01:00
|
|
|
program.setMain($2);
|
2014-11-27 20:01:52 +01:00
|
|
|
}
|
2014-11-23 19:04:25 +01:00
|
|
|
;
|
|
|
|
fun_decls:
|
2014-11-27 20:01:52 +01:00
|
|
|
/* epsilon */
|
|
|
|
| fun_decl {
|
2014-11-28 19:00:51 +01:00
|
|
|
program.addFunction($1);
|
2014-11-27 20:01:52 +01:00
|
|
|
}
|
|
|
|
fun_decls
|
2014-11-23 19:04:25 +01:00
|
|
|
;
|
|
|
|
fun_decl:
|
2014-12-02 16:22:03 +01:00
|
|
|
FUN_DECL fun_return ID args FUN_END statements {
|
|
|
|
$$ = new Function(new Id($3), $2, $4, $6);
|
2014-11-27 20:01:52 +01:00
|
|
|
}
|
2014-11-23 19:04:25 +01:00
|
|
|
;
|
2014-11-30 13:03:45 +01:00
|
|
|
fun_return:
|
|
|
|
/* epsilon */ { $$ = Type::VOID; } | TYPENAME { $$ = $1; }
|
|
|
|
;
|
2014-11-23 19:04:25 +01:00
|
|
|
args:
|
2015-03-05 01:16:40 +01:00
|
|
|
/* epsilon */ {
|
|
|
|
$$ = new PointerList<FunArg>();
|
|
|
|
}
|
|
|
|
| PARAMS args_decl {
|
|
|
|
$$ = $2;
|
|
|
|
}
|
2014-11-23 19:04:25 +01:00
|
|
|
;
|
2014-11-30 13:03:45 +01:00
|
|
|
args_decl:
|
|
|
|
arg_decl {
|
2015-03-05 01:16:40 +01:00
|
|
|
$$ = new PointerList<FunArg>();
|
2014-12-02 16:22:03 +01:00
|
|
|
$$->push_back($1);
|
2014-11-27 20:01:52 +01:00
|
|
|
}
|
2014-12-02 16:22:03 +01:00
|
|
|
| args_decl COMMA arg_decl {
|
|
|
|
$1->push_back($3);
|
2014-11-27 20:01:52 +01:00
|
|
|
}
|
2014-11-23 19:04:25 +01:00
|
|
|
;
|
2014-11-30 13:03:45 +01:00
|
|
|
arg_decl:
|
|
|
|
variable pointer TYPENAME {
|
|
|
|
$$ = new FunArg($1, $3, $2);
|
2014-11-27 20:01:52 +01:00
|
|
|
}
|
2014-11-23 19:04:25 +01:00
|
|
|
;
|
|
|
|
main:
|
2014-12-02 16:22:03 +01:00
|
|
|
MAIN statements {
|
|
|
|
$$ = new Main($2);
|
2014-11-27 20:01:52 +01:00
|
|
|
}
|
2014-11-23 19:04:25 +01:00
|
|
|
;
|
|
|
|
statements:
|
2014-11-27 20:01:52 +01:00
|
|
|
/* epsilon */ {
|
2015-03-05 01:16:40 +01:00
|
|
|
$$ = new PointerList<Statement>();
|
2014-11-27 20:01:52 +01:00
|
|
|
}
|
2014-12-02 16:22:03 +01:00
|
|
|
| statements statement {
|
|
|
|
if ($2 != nullptr) {
|
|
|
|
$1->push_back($2);
|
2014-11-27 20:01:52 +01:00
|
|
|
}
|
2014-12-02 16:22:03 +01:00
|
|
|
$$ = $1;
|
2014-11-27 20:01:52 +01:00
|
|
|
}
|
2014-11-23 20:48:23 +01:00
|
|
|
;
|
2014-11-25 00:46:34 +01:00
|
|
|
statement:
|
2014-11-27 20:01:52 +01:00
|
|
|
assert_stmt { $$ = $1; }
|
|
|
|
| fun_call { $$ = $1; }
|
|
|
|
| print_stmt { $$ = $1; }
|
|
|
|
| input_stmt { $$ = $1; }
|
|
|
|
| abort_stmt { $$ = $1; }
|
|
|
|
| branch_stmt { $$ = $1; }
|
|
|
|
| var_decl { $$ = $1; }
|
|
|
|
| assign_stmt { $$ = $1; }
|
|
|
|
| loop_stmt { $$ = $1; }
|
|
|
|
| return_stmt { $$ = $1; }
|
|
|
|
| COMMA { $$ = nullptr; }
|
2014-11-23 19:04:25 +01:00
|
|
|
;
|
|
|
|
var_decl:
|
2014-11-27 20:01:52 +01:00
|
|
|
VARDECL variable COMMA pointer TYPENAME var_init {
|
|
|
|
$$ = new VarDeclaration($2, $5, $4, $6);
|
|
|
|
}
|
2014-11-23 19:04:25 +01:00
|
|
|
;
|
|
|
|
pointer:
|
2014-11-27 20:01:52 +01:00
|
|
|
/* epsilon */ { $$ = false; } | STAR { $$ = true; }
|
2014-11-23 19:04:25 +01:00
|
|
|
;
|
|
|
|
var_init:
|
2014-11-27 20:01:52 +01:00
|
|
|
/* epsilon */ { $$ = nullptr; } | ASSIGN expression { $$ = $2; }
|
2014-11-23 19:04:25 +01:00
|
|
|
;
|
|
|
|
numeric:
|
2014-11-27 20:01:52 +01:00
|
|
|
NUMBER { $$ = new Integer($1); } | FLOAT { $$ = new Float($1); }
|
2014-11-23 19:04:25 +01:00
|
|
|
;
|
|
|
|
variable:
|
2014-11-27 23:52:13 +01:00
|
|
|
ID {
|
|
|
|
$$ = new Id($1);
|
|
|
|
}
|
|
|
|
| ARTICLE ID {
|
|
|
|
$$ = new Id($2);
|
|
|
|
}
|
2014-11-23 19:04:25 +01:00
|
|
|
;
|
|
|
|
assign_stmt:
|
2014-11-27 20:01:52 +01:00
|
|
|
variable ASSIGN expression {
|
|
|
|
$$ = new Assignment($1, $3);
|
|
|
|
}
|
2014-11-23 19:04:25 +01:00
|
|
|
;
|
|
|
|
print_stmt:
|
2014-11-27 20:01:52 +01:00
|
|
|
expression PRINT {
|
|
|
|
$$ = new Print($1);
|
2014-12-10 20:38:32 +01:00
|
|
|
program.addModule(new Module("iostream", Module::SYSTEM));
|
2014-11-27 20:01:52 +01:00
|
|
|
}
|
2014-11-23 19:04:25 +01:00
|
|
|
;
|
|
|
|
input_stmt:
|
2014-11-27 20:01:52 +01:00
|
|
|
INPUT variable {
|
|
|
|
$$ = new Input($2);
|
2014-12-10 20:38:32 +01:00
|
|
|
program.addModule(new Module("iostream", Module::SYSTEM));
|
2014-11-27 20:01:52 +01:00
|
|
|
}
|
2014-11-23 19:04:25 +01:00
|
|
|
;
|
|
|
|
return_stmt:
|
2014-11-27 20:01:52 +01:00
|
|
|
RETURN maybe_expression BANG {
|
|
|
|
$$ = new Return($2);
|
|
|
|
}
|
|
|
|
;
|
|
|
|
maybe_expression:
|
|
|
|
expression { $$ = $1; } | /* epsilon */ { $$ = nullptr; }
|
2014-11-23 19:04:25 +01:00
|
|
|
;
|
|
|
|
loop_stmt:
|
2014-12-02 16:22:03 +01:00
|
|
|
LOOP_BEGIN statements LOOP_CONDITION expression {
|
|
|
|
$$ = new Loop($2, $4);
|
2014-11-27 20:01:52 +01:00
|
|
|
}
|
2014-11-23 19:04:25 +01:00
|
|
|
;
|
|
|
|
branch_stmt:
|
2014-12-02 16:22:03 +01:00
|
|
|
BRANCH_CONDITION variable BRANCH_BEGIN branch_body BRANCH_END {
|
|
|
|
$$ = new Branch($2, $4);
|
2014-11-27 20:01:52 +01:00
|
|
|
}
|
2014-11-23 19:04:25 +01:00
|
|
|
;
|
|
|
|
branch_body:
|
2014-11-27 20:01:52 +01:00
|
|
|
cases %prec LOWER_THAN_ELSE {
|
2014-12-02 16:22:03 +01:00
|
|
|
$$ = new Branch::Body($1);
|
2014-11-27 20:01:52 +01:00
|
|
|
}
|
2014-12-02 16:22:03 +01:00
|
|
|
| cases BRANCH_ELSE COLON statements {
|
|
|
|
$$ = new Branch::Body($1, $4);
|
2014-11-27 20:01:52 +01:00
|
|
|
}
|
2014-11-23 19:04:25 +01:00
|
|
|
;
|
|
|
|
cases:
|
2014-12-02 16:22:03 +01:00
|
|
|
case_stmt {
|
2015-03-05 01:16:40 +01:00
|
|
|
$$ = new PointerList<BranchCase>();
|
2014-12-02 16:22:03 +01:00
|
|
|
$$->push_back($1);
|
|
|
|
}
|
|
|
|
| cases CASE_END case_stmt {
|
|
|
|
$1->push_back($3);
|
|
|
|
$$ = $1;
|
|
|
|
}
|
2014-11-23 19:04:25 +01:00
|
|
|
;
|
|
|
|
case_stmt:
|
2014-12-02 16:22:03 +01:00
|
|
|
semi_expression COLON statements {
|
|
|
|
$$ = new BranchCase($1, $3);
|
2014-11-27 20:01:52 +01:00
|
|
|
}
|
2014-11-23 19:04:25 +01:00
|
|
|
;
|
|
|
|
fun_call:
|
2014-12-02 16:22:03 +01:00
|
|
|
FUN_CALL ID call_args FUN_END {
|
|
|
|
$$ = new FunctionCall(new Id($2), $3);
|
2014-11-27 20:01:52 +01:00
|
|
|
}
|
2014-11-25 00:39:01 +01:00
|
|
|
;
|
|
|
|
call_args:
|
2014-12-02 16:22:03 +01:00
|
|
|
/* epsilon */ {
|
2015-03-05 01:16:40 +01:00
|
|
|
$$ = new PointerList<Expression>();
|
2014-12-02 16:22:03 +01:00
|
|
|
}
|
|
|
|
| PARAMS call_arglist {
|
|
|
|
$$ = $2;
|
|
|
|
}
|
2014-11-25 00:39:01 +01:00
|
|
|
;
|
|
|
|
call_arglist:
|
2014-12-02 16:22:03 +01:00
|
|
|
expression {
|
2015-03-05 01:16:40 +01:00
|
|
|
$$ = new PointerList<Expression>();
|
2014-12-02 16:22:03 +01:00
|
|
|
$$->push_back($1);
|
|
|
|
}
|
|
|
|
| call_arglist COMMA expression {
|
|
|
|
$$->push_back($3);
|
|
|
|
}
|
2014-11-23 19:04:25 +01:00
|
|
|
;
|
|
|
|
abort_stmt:
|
2014-11-27 20:01:52 +01:00
|
|
|
ABORT {
|
|
|
|
$$ = new Abort();
|
2014-12-10 20:38:32 +01:00
|
|
|
program.addModule(new Module("cstdlib", Module::SYSTEM));
|
2014-11-27 20:01:52 +01:00
|
|
|
}
|
2014-11-23 19:04:25 +01:00
|
|
|
;
|
|
|
|
assert_stmt:
|
2014-11-27 20:01:52 +01:00
|
|
|
ASSERT expression BANG {
|
|
|
|
$$ = new Assert($2);
|
2014-12-10 20:38:32 +01:00
|
|
|
program.addModule(new Module("cassert", Module::SYSTEM));
|
2014-11-27 20:01:52 +01:00
|
|
|
}
|
2014-11-23 19:04:25 +01:00
|
|
|
;
|
|
|
|
expression:
|
2014-11-27 20:01:52 +01:00
|
|
|
simple_expression {
|
|
|
|
$$ = $1;
|
|
|
|
}
|
|
|
|
| expression OP_LT expression {
|
|
|
|
$$ = new ExpLt($1, $3);
|
|
|
|
}
|
|
|
|
| expression OP_GT expression {
|
|
|
|
$$ = new ExpGt($1, $3);
|
|
|
|
}
|
|
|
|
| expression OP_LTE expression {
|
2014-11-27 21:30:42 +01:00
|
|
|
$$ = new ExpLte($1, $3);
|
2014-11-27 20:01:52 +01:00
|
|
|
}
|
|
|
|
| expression OP_GTE expression {
|
2014-11-27 21:30:42 +01:00
|
|
|
$$ = new ExpGte($1, $3);
|
2014-11-27 20:01:52 +01:00
|
|
|
}
|
|
|
|
| expression OP_PLUS expression {
|
|
|
|
$$ = new ExpPlus($1, $3);
|
|
|
|
}
|
|
|
|
| expression OP_MINUS expression {
|
|
|
|
$$ = new ExpMinus($1, $3);
|
|
|
|
}
|
|
|
|
| expression OP_TIMES expression {
|
|
|
|
$$ = new ExpTimes($1, $3);
|
|
|
|
}
|
|
|
|
| expression OP_DIV expression {
|
|
|
|
$$ = new ExpDiv($1, $3);
|
|
|
|
}
|
|
|
|
| expression OP_SHL expression {
|
|
|
|
$$ = new ExpShl($1, $3);
|
|
|
|
}
|
|
|
|
| expression OP_SHR expression {
|
|
|
|
$$ = new ExpShr($1, $3);
|
|
|
|
}
|
2014-11-23 19:04:25 +01:00
|
|
|
;
|
2014-11-23 20:47:39 +01:00
|
|
|
semi_expression:
|
2014-11-27 20:01:52 +01:00
|
|
|
expression {
|
|
|
|
$$ = new SemiExpEq($1);
|
|
|
|
}
|
|
|
|
| OP_LT expression {
|
|
|
|
$$ = new SemiExpLt($2);
|
|
|
|
}
|
|
|
|
| OP_GT expression {
|
|
|
|
$$ = new SemiExpGt($2);
|
|
|
|
}
|
|
|
|
| OP_LTE expression {
|
|
|
|
$$ = new SemiExpLte($2);
|
|
|
|
}
|
|
|
|
| OP_GTE expression {
|
|
|
|
$$ = new SemiExpGte($2);
|
|
|
|
}
|
|
|
|
| OP_PLUS expression {
|
|
|
|
$$ = new SemiExpPlus($2);
|
|
|
|
}
|
|
|
|
| OP_MINUS expression {
|
|
|
|
$$ = new SemiExpMinus($2);
|
|
|
|
}
|
|
|
|
| OP_TIMES expression {
|
|
|
|
$$ = new SemiExpTimes($2);
|
|
|
|
}
|
|
|
|
| OP_DIV expression {
|
|
|
|
$$ = new SemiExpDiv($2);
|
|
|
|
}
|
|
|
|
| OP_SHL expression {
|
|
|
|
$$ = new SemiExpShl($2);
|
|
|
|
}
|
|
|
|
| OP_SHR expression {
|
|
|
|
$$ = new SemiExpShr($2);
|
|
|
|
}
|
2014-11-23 20:47:39 +01:00
|
|
|
;
|
2014-11-24 00:14:27 +01:00
|
|
|
simple_expression:
|
2014-11-27 20:01:52 +01:00
|
|
|
fun_call { $$ = $1; }
|
|
|
|
| numeric { $$ = $1; }
|
|
|
|
| variable { $$ = $1; }
|
2014-11-24 00:14:27 +01:00
|
|
|
;
|
2014-11-23 19:04:25 +01:00
|
|
|
%%
|
|
|
|
|
2014-11-28 19:00:51 +01:00
|
|
|
#include "Scanner.hpp"
|
|
|
|
|
|
|
|
void Parser::error(const location_type& loc, const std::string &message) {
|
2014-11-28 20:02:41 +01:00
|
|
|
std::cerr << "line " << loc.begin.line << ", col " << loc.begin.column;
|
2014-11-28 19:00:51 +01:00
|
|
|
std::cerr << ": " << message << std::endl;
|
2014-11-29 22:31:25 +01:00
|
|
|
std::exit(1);
|
2014-11-28 19:00:51 +01:00
|
|
|
}
|
|
|
|
|
2014-11-28 20:03:49 +01:00
|
|
|
int yylex(Parser::semantic_type *lval, Parser::location_type *loc, Scanner &scanner) {
|
2014-11-28 20:02:41 +01:00
|
|
|
return scanner.yylex(lval, loc);
|
2014-11-28 19:00:51 +01:00
|
|
|
}
|
|
|
|
|