59 lines
647 B
Plaintext
59 lines
647 B
Plaintext
%{
|
|
|
|
#include <string>
|
|
|
|
%}
|
|
|
|
%token INDENT
|
|
%token DEDENT
|
|
%token NEWLINE
|
|
%token AND
|
|
%token BREAK
|
|
%token DEF
|
|
%token ELIF
|
|
%token ELSE
|
|
%token FOR
|
|
%token IF
|
|
%token NOT
|
|
%token OR
|
|
%token RETURN
|
|
%token WHILE
|
|
%token BOOLEAN
|
|
%token IDENTIFIER
|
|
%token ASSIGN
|
|
%token PLUS
|
|
%token MINUS
|
|
%token TIMES
|
|
%token DIVIDEDBY
|
|
%token EQ
|
|
%token NEQ
|
|
%token GT
|
|
%token GTE
|
|
%token LT
|
|
%token LTE
|
|
%token LPAREN
|
|
%token RPAREN
|
|
%token COMMA
|
|
%token COLON
|
|
|
|
%define api.value.type { std::string }
|
|
%define api.pure full
|
|
%define api.push-pull push
|
|
|
|
%%
|
|
|
|
program
|
|
: statements {}
|
|
;
|
|
|
|
statements
|
|
: statement statements {}
|
|
| statement {}
|
|
;
|
|
|
|
statement
|
|
: PLUS {}
|
|
;
|
|
|
|
%%
|