88 |
|
|
89 |
#include <assert.h> |
#include <assert.h> |
90 |
#include <ctype.h> |
#include <ctype.h> |
91 |
|
#include <stdlib.h> |
92 |
#include <string.h> |
#include <string.h> |
93 |
|
|
94 |
int |
int |
112 |
{ |
{ |
113 |
char buffer[256]; |
char buffer[256]; |
114 |
int c; |
int c; |
115 |
|
unsigned int i; |
116 |
|
|
117 |
#if YYPURE |
#if YYPURE |
118 |
# define yylval (*lvalp) |
# define yylval (*lvalp) |
119 |
]m4_bmatch([$1], [location],[ (void) llocp;])[ |
]m4_bmatch([$1], [location],[ (void) llocp;])[ |
120 |
#endif |
#endif |
121 |
|
|
122 |
while (1) { |
while (1) |
123 |
c = getchar (); |
{ |
124 |
switch (c) { |
c = getchar (); |
125 |
case EOF: |
switch (c) |
126 |
return 0; |
{ |
127 |
case ' ': case '\t': case '\n': case '\f': |
case EOF: |
128 |
break; |
return 0; |
129 |
default: |
case ' ': case '\t': case '\n': case '\f': |
130 |
if (isalpha (c)) { |
break; |
131 |
ungetc (c, stdin); |
default: |
132 |
scanf ("%[A-Za-z0-9_]", buffer); |
if (isalpha (c)) |
133 |
yylval = strdup (buffer); |
{ |
134 |
return isupper ((unsigned char) buffer[0]) ? TYPENAME : ID; |
i = 0; |
135 |
} |
|
136 |
return c; |
do |
137 |
|
{ |
138 |
|
buffer[i++] = c; |
139 |
|
if (i == sizeof buffer - 1) |
140 |
|
abort (); |
141 |
|
c = getchar (); |
142 |
|
} |
143 |
|
while (isalnum (c) || c == '_'); |
144 |
|
|
145 |
|
ungetc (c, stdin); |
146 |
|
buffer[i++] = 0; |
147 |
|
yylval = strcpy (malloc (i), buffer); |
148 |
|
return isupper ((unsigned char) buffer[0]) ? TYPENAME : ID; |
149 |
|
} |
150 |
|
return c; |
151 |
|
} |
152 |
} |
} |
|
} |
|
153 |
} |
} |
154 |
|
|
155 |
int |
int |