lab6-c1

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
% option noyywrap bison - bridge bison - locations
%{
#include < stdio .h >
#include < stdlib .h >
#define TAG_IDENT 1
#define TAG_NUMBER 2
#define TAG_CHAR 3
#define TAG_LPAREN 4
#define TAG_RPAREN 5
#define TAG_PLUS 6
#define TAG_MINUS 7
#define TAG_MULTIPLY 8
#define TAG_DIVIDE 9
char * tag_names [] =
{
" END_OF_PRO GRAM " , " IDENT " , " NUMBER " ,
" CHAR " , " LPAREN " , " RPAREN " , " PLUS " ,
" MINUS " , " MULTIPLY " , " DIVIDE "
};