* gengtype-lex.l: Recognize typedef of functions without PARAMS macro.

From-SVN: r72106
This commit is contained in:
Kelley Cook 2003-10-05 02:49:20 +00:00 committed by R. Kelley Cook
parent d72c6c58a9
commit 790ca6641b
2 changed files with 37 additions and 0 deletions

View File

@ -1,3 +1,7 @@
2003-10-04 Kelley Cook <kelleycook@wideopenwest.com>
* gengtype-lex.l: Recognize typedef of functions without PARAMS macro.
2003-10-04 Nathanael Nerode <neroden@gcc.gnu.org>
* config/v850/v850-c.c, config/v850/v850-protos.h, config/v850/v850.c:

View File

@ -132,6 +132,23 @@ ITYPE {IWORD}({WS}{IWORD})*
do_typedef (xmemdup (namestart, namelen, namelen+1), t, &lexer_line);
update_lineno (yytext, yyleng);
}
[^[:alnum:]_]typedef{WS}{ID}{WS}{ID}{WS}"(" {
char *namestart;
size_t namelen;
struct type *t;
for (namestart = yytext + yyleng - 2; ISSPACE (*namestart); namestart--)
;
for (namelen = 1; !ISSPACE (namestart[-namelen]); namelen++)
;
namestart -= namelen - 1;
t = create_scalar_type ("function type", sizeof ("function type")-1);
do_typedef (xmemdup (namestart, namelen, namelen+1), t, &lexer_line);
update_lineno (yytext, yyleng);
}
[^[:alnum:]_]typedef{WS}{ID}{WS}?"("{WS}?"*"{WS}?{ID}{WS}?")"{WS}?PARAMS {
char *namestart;
size_t namelen;
@ -148,6 +165,22 @@ ITYPE {IWORD}({WS}{IWORD})*
update_lineno (yytext, yyleng);
}
[^[:alnum:]_]typedef{WS}{ID}{WS}?"("{WS}?"*"{WS}?{ID}{WS}?")"{WS}?"(" {
char *namestart;
size_t namelen;
struct type *t;
for (namestart = yytext + yyleng - 2; !ISIDNUM (*namestart); namestart--)
;
for (namelen = 1; ISIDNUM (namestart[-namelen]); namelen++)
;
namestart -= namelen - 1;
t = create_scalar_type ("function type", sizeof ("function type")-1);
do_typedef (xmemdup (namestart, namelen, namelen+1), t, &lexer_line);
update_lineno (yytext, yyleng);
}
[^[:alnum:]_](typedef{WS})?(struct|union){WS}{ID}{WS}/"GTY" {
char *tagstart;
size_t taglen;