OSDN Git Service

Daily bump.
[pf3gnuchains/gcc-fork.git] / gcc / gengtype-lex.l
index 8cec71b..a71cce0 100644 (file)
@@ -1,6 +1,7 @@
 /* -*- indented-text -*- */
 /* Process source files and output type information.
-   Copyright (C) 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc.
+   Copyright (C) 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010
+   Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -18,8 +19,14 @@ You should have received a copy of the GNU General Public License
 along with GCC; see the file COPYING3.  If not see
 <http://www.gnu.org/licenses/>.  */
 
+%option noinput
+
 %{
+#ifdef GENERATOR_FILE
 #include "bconfig.h"
+#else
+#include "config.h"
+#endif
 #include "system.h"
 
 #define malloc xmalloc
@@ -46,7 +53,7 @@ update_lineno (const char *l, size_t len)
 ID     [[:alpha:]_][[:alnum:]_]*
 WS     [[:space:]]+
 HWS    [ \t\r\v\f]*
-IWORD  short|long|(un)?signed|char|int|HOST_WIDE_INT|HOST_WIDEST_INT|bool|size_t|BOOL_BITFIELD|CPPCHAR_SIGNED_T|ino_t|dev_t
+IWORD  short|long|(un)?signed|char|int|HOST_WIDE_INT|HOST_WIDEST_INT|bool|size_t|BOOL_BITFIELD|CPPCHAR_SIGNED_T|ino_t|dev_t|HARD_REG_SET
 ITYPE  {IWORD}({WS}{IWORD})*
 EOID   [^[:alnum:]_]
 
@@ -116,7 +123,7 @@ EOID        [^[:alnum:]_]
 "nested_ptr"/{EOID}            { return NESTED_PTR; }
 [0-9]+                         { return NUM; }
 "param"[0-9]*"_is"/{EOID}              {
-  *yylval = xmemdup (yytext, yyleng, yyleng+1);
+  *yylval = XDUPVAR (const char, yytext, yyleng, yyleng+1);
   return PARAM_IS;
 }
 
@@ -127,28 +134,28 @@ EOID      [^[:alnum:]_]
   for (len = yyleng; ISSPACE (yytext[len-1]); len--)
     ;
 
-  *yylval = xmemdup (yytext, len, len+1);
+  *yylval = XDUPVAR (const char, yytext, len, len+1);
   update_lineno (yytext, yyleng);
   return SCALAR;
 }
 
 
 {ID}/{EOID}                    {
-  *yylval = xmemdup (yytext, yyleng, yyleng+1);
+  *yylval = XDUPVAR (const char, yytext, yyleng, yyleng+1);
   return ID;
 }
 
 \"([^"\\]|\\.)*\"              {
-  *yylval = xmemdup (yytext+1, yyleng-2, yyleng-1);
+  *yylval = XDUPVAR (const char, yytext+1, yyleng-2, yyleng-1);
   return STRING;
 }
   /* This "terminal" avoids having to parse integer constant expressions.  */
 "["[^\[\]]*"]"                 {
-  *yylval = xmemdup (yytext+1, yyleng-2, yyleng-1);
+  *yylval = XDUPVAR (const char, yytext+1, yyleng-2, yyleng-1);
   return ARRAY;
 }
 "'"("\\".|[^\\])"'"            {
-  *yylval = xmemdup (yytext+1, yyleng-2, yyleng);
+  *yylval = XDUPVAR (const char, yytext+1, yyleng-2, yyleng);
   return CHAR;
 }
 
@@ -187,9 +194,6 @@ EOID        [^[:alnum:]_]
 }
 
 ^{HWS}"#"{HWS}"define"{WS}"GTY(" /* do nothing */
-{WS}"GTY"{WS}?"("      {
-  error_at_line (&lexer_line, "stray GTY marker");
-}
 
 %%
 
@@ -202,7 +206,7 @@ yybegin (const char *fname)
       perror (fname);
       exit (1);
     }
-  lexer_line.file = fname;
+  lexer_line.file = input_file_by_name (fname);
   lexer_line.line = 1;
 }