Commit 159315dd authored by Nicaudie Charlotte's avatar Nicaudie Charlotte

Added base content for parser

parent ed948a8e
/*
Tokens declarations
*/
%token <int> INT
%token <float> FLOAT
%token INIT ITER
%token TRANSLATION ROTATION
%token COMMA SEMICOLON
%token BEGIN END DEF
%token OR
%token IF ELSE
%token LPAREN RPAREN
%token PLUS MINUS TIMES DIV
%token REPEAT PENUP PENDOWN FORWARD TURNLEFT TURNRIGHT
%token COLOR BLACK WHITE RED GREEN BLUE
%token EOF
/*
Tokens priorities and associativities
*/
%left MINUS PLUS
%left TIMES DIV
%nonassoc uminus // used to negate a number
%nonassoc IF
%nonassoc ELSE
/*
Grammar entry point
*/
%start prog
/*
Value types returned by the parser
*/
%type <Ast.program> prog
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment