libiberty/md5: fix strict alias warnings
[deliverable/binutils-gdb.git] / gdb / ada-lex.l
index 9886553e4b501362fb35564cacf1689e464bf4bb..714265ef385ef3d9cf130cf6c9facae91e704847 100644 (file)
@@ -1,6 +1,6 @@
 /* FLEX lexer for Ada expressions, for GDB.
-   Copyright (C) 1994, 1997, 1998, 2000, 2001, 2002, 2003, 2007, 2008, 2009
-   Free Software Foundation, Inc.
+   Copyright (C) 1994, 1997-1998, 2000-2003, 2007-2012 Free Software
+   Foundation, Inc.
 
    This file is part of GDB.
 
@@ -58,6 +58,10 @@ static int find_dot_all (const char *);
 #undef YY_DECL
 #define YY_DECL static int yylex ( void )
 
+/* Flex generates a static function "input" which is not used.
+   Defining YY_NO_INPUT comments it out.  */
+#define YY_NO_INPUT
+
 #undef YY_INPUT
 #define YY_INPUT(BUF, RESULT, MAX_SIZE) \
     if ( *lexptr == '\000' ) \
@@ -160,6 +164,15 @@ if         {
                  return 0;
                }
 
+(task|thread)  {
+                  /* This keyword signals the end of the expression and
+                     will be processed separately.  */
+                 while (*lexptr != 't' && *lexptr != 'T')
+                   lexptr--;
+                 yyrestart(NULL);
+                 return 0;
+               }
+
        /* ADA KEYWORDS */
 
 abs            { return ABS; }
@@ -280,7 +293,7 @@ false               { return FALSEKEYWORD; }
 
 /* Initialize the lexer for processing new expression. */
 
-void
+static void
 lexer_init (FILE *inp)
 {
   BEGIN INITIAL;
@@ -397,7 +410,9 @@ processReal (const char *num0)
 
 
 /* Store a canonicalized version of NAME0[0..LEN-1] in yylval.ssym.  The
-   resulting string is valid until the next call to ada_parse.  It differs
+   resulting string is valid until the next call to ada_parse.  If
+   NAME0 contains the substring "___", it is assumed to be already
+   encoded and the resulting name is equal to it.  Otherwise, it differs
    from NAME0 in that:
     + Characters between '...' or <...> are transfered verbatim to 
       yylval.ssym.
@@ -417,8 +432,18 @@ processId (const char *name0, int len)
   int i0, i;
   struct stoken result;
 
+  result.ptr = name;
   while (len > 0 && isspace (name0[len-1]))
     len -= 1;
+
+  if (strstr (name0, "___") != NULL)
+    {
+      strncpy (name, name0, len);
+      name[len] = '\000';
+      result.length = len;
+      return result;
+    }
+
   i = i0 = 0;
   while (i0 < len)
     {
@@ -458,7 +483,6 @@ processId (const char *name0, int len)
     }
   name[i] = '\000';
 
-  result.ptr = name;
   result.length = i;
   return result;
 }
This page took 0.029729 seconds and 4 git commands to generate.