* gengtype-lex.l: Recognize typedef of functions without PARAMS macro.
authorKelley Cook <kelleycook@wideopenwest.com>
Sun, 5 Oct 2003 02:49:20 +0000 (02:49 +0000)
committerR. Kelley Cook <kcook@gcc.gnu.org>
Sun, 5 Oct 2003 02:49:20 +0000 (02:49 +0000)
From-SVN: r72106

gcc/ChangeLog
gcc/gengtype-lex.l

index e3201926c84ad3513c1001d957667956ad32d4cf..4ec56291cea6a8557d245ba06e25bd1e5f04f50d 100644 (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:
index bbdf9913be489493c5ec791d945a20da0880a220..5af585e1d2c5a9a4e77e8604be9e830566e3194d 100644 (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;