Skip to content

Commit

Permalink
It compiles!
Browse files Browse the repository at this point in the history
  • Loading branch information
oboroc committed Feb 8, 2020
1 parent 87ea452 commit 2afc577
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/parser.y
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 5,16 @@
#include <stdio.h>
#include "scanner.flex.h"
//int yylex(void);
//void yyerror(char const *);
void yyerror(char const *);
%}


/* Bison declarations. */
�fine parse.error verbose
�fine api.pure full
//�fine parse.error verbose
�fine api.value.type {double}
//�fine api.prefix {crass}

%token NUM
%left '-' ' '
%left '*' '/'
Expand Down Expand Up @@ -46,3 48,11 @@ exp:
;

%%



void yyerror(char const *s)
{
fprintf (stderr, "%s\n", s);
}

1 change: 1 addition & 0 deletions src/scanner.l
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 17,7 @@ TODO: use https://westes.github.io/flex/manual/Common-Patterns.html for basic pa
%{
%}

%option noyywrap
%option caseless reentrant yylineno
%option batch align 8bit fast read
%option warn backup verbose
Expand Down

0 comments on commit 2afc577

Please sign in to comment.