mirror of
https://github.com/Relintai/scons_gd.git
synced 2025-03-20 19:12:32 +01:00
50 lines
461 B
Plaintext
50 lines
461 B
Plaintext
%{
|
|
#include<stdio.h>
|
|
|
|
int yyerror(char *s);
|
|
int yylex();
|
|
|
|
int regs[26];
|
|
int base;
|
|
|
|
%}
|
|
|
|
%start digit
|
|
|
|
%union { int a; }
|
|
|
|
|
|
%token DIGIT LETTER
|
|
|
|
%left '|'
|
|
%left '&'
|
|
%left '+' '-'
|
|
%left '*' '/' '%'
|
|
%left UMINUS /*supplies precedence for unary minus */
|
|
|
|
%% /* beginning of rules section */
|
|
|
|
digit: DIGIT;
|
|
|
|
|
|
%%
|
|
int
|
|
main()
|
|
{
|
|
return(yyparse());
|
|
}
|
|
|
|
int
|
|
yyerror(s)
|
|
char *s;
|
|
{
|
|
fprintf(stderr, "%s\n",s);
|
|
return(0);
|
|
}
|
|
|
|
int
|
|
yywrap()
|
|
{
|
|
return(1);
|
|
}
|