fuck yeah
This commit is contained in:
parent
05ba6f6e7f
commit
4d16b6fb08
3 changed files with 14 additions and 15 deletions
10
src/parser.y
10
src/parser.y
|
|
@ -8,17 +8,20 @@
|
|||
|
||||
%code requires {
|
||||
#include <string>
|
||||
class Scanner; // Forward declaration
|
||||
}
|
||||
|
||||
%code {
|
||||
#include <iostream>
|
||||
#include "../src/scanner.hpp"
|
||||
|
||||
int scanner_lex(yy::parser::semantic_type* yylval);
|
||||
|
||||
// Define yylex to use the scanner's lex method
|
||||
#undef yylex
|
||||
#define yylex scanner_lex
|
||||
#define yylex scanner->lex
|
||||
}
|
||||
|
||||
%parse-param { Scanner* scanner }
|
||||
|
||||
%token <std::string> WORD
|
||||
%token NUMBER
|
||||
%token CHAR
|
||||
|
|
@ -36,7 +39,6 @@ element:
|
|||
;
|
||||
|
||||
%%
|
||||
|
||||
namespace yy {
|
||||
void parser::error(const std::string& msg)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue