Avoid assuming SSA_NAME_IDENTIFIER is nonnull.
[gcc.git] / gcc / gengtype-lex.l
index 4c316a3e2ea49e6f447fad61f7ddcc8d07ca0172..97b117984c1e33668c05afae832acdf0377cbc34 100644 (file)
@@ -1,7 +1,6 @@
 /* -*- indented-text -*- */
 /* Process source files and output type information.
-   Copyright (C) 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010, 2012
-   Free Software Foundation, Inc.
+   Copyright (C) 2002-2021 Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -22,10 +21,11 @@ along with GCC; see the file COPYING3.  If not see
 %option noinput
 
 %{
-#ifdef GENERATOR_FILE
-#include "bconfig.h"
-#else
+#ifdef HOST_GENERATOR_FILE
 #include "config.h"
+#define GENERATOR_FILE 1
+#else
+#include "bconfig.h"
 #endif
 #include "system.h"
 
@@ -53,12 +53,12 @@ update_lineno (const char *l, size_t len)
 CID    [[: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|HARD_REG_SET
+IWORD  short|long|(un)?signed|char|int|HOST_WIDE_INT|uint64_t|int64_t|bool|size_t|BOOL_BITFIELD|CPPCHAR_SIGNED_T|ino_t|dev_t|HARD_REG_SET
 ITYPE  {IWORD}({WS}{IWORD})*
     /* Include '::' in identifiers to capture C++ scope qualifiers.  */
 ID     {CID}({HWS}::{HWS}{CID})*
 EOID   [^[:alnum:]_]
-CXX_KEYWORD inline|public:|private:|protected:|template|operator|friend
+CXX_KEYWORD inline|public:|private:|protected:|template|operator|friend|static|mutable
 
 %x in_struct in_struct_comment in_comment
 %option warn noyywrap nounput nodefault perf-report
@@ -111,6 +111,7 @@ CXX_KEYWORD inline|public:|private:|protected:|template|operator|friend
 "const"/{EOID}                 /* don't care */
 {CXX_KEYWORD}/{EOID}                   |
 "~"                                    |
+"^"                                    |
 "&"                                    {
     *yylval = XDUPVAR (const char, yytext, yyleng, yyleng + 1);
     return IGNORABLE_CXX_KEYWORD;
@@ -124,10 +125,9 @@ CXX_KEYWORD inline|public:|private:|protected:|template|operator|friend
 "ptr_alias"/{EOID}             { return PTR_ALIAS; }
 "nested_ptr"/{EOID}            { return NESTED_PTR; }
 "user"/{EOID}                  { return USER_GTY; }
-[0-9]+                         { return NUM; }
-"param"[0-9]*"_is"/{EOID}              {
+[0-9]+                         {
   *yylval = XDUPVAR (const char, yytext, yyleng, yyleng+1);
-  return PARAM_IS;
+  return NUM;
 }
 
 {IWORD}({WS}{IWORD})*/{EOID}           |
@@ -162,7 +162,7 @@ CXX_KEYWORD inline|public:|private:|protected:|template|operator|friend
 }
 
 "..."                          { return ELLIPSIS; }
-[(){},*:<>;=%|+\!\?\.-]                { return yytext[0]; }
+[(){},*:<>;=%/|+\!\?\.-]       { return yytext[0]; }
 
    /* ignore pp-directives */
 ^{HWS}"#"{HWS}[a-z_]+[^\n]*\n   {lexer_line.line++;}