2004-10-06 Felix Lee <felix+log1@specifixinc.com>
[deliverable/binutils-gdb.git] / gdb / ada-lex.l
index 21dba2c021b53ef79db2bd6097d47c98ab364880..e4b8999d4e4015b84ec02b0d5f0bfddae49abe57 100644 (file)
@@ -26,9 +26,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 /* each successive token and places a semantic value into yylval */
 /* (ada-lval), defined by the parser.   */
 
-/* Run flex with (at least) the -i option (case-insensitive), and the -I */
-/* option (interactive---no unnecessary lookahead).  */
-
 DIG    [0-9]
 NUM10  ({DIG}({DIG}|_)*)
 HEXDIG [0-9a-f]
@@ -45,8 +42,6 @@ EXP   (e[+-]{NUM10})
 POSEXP  (e"+"?{NUM10})
 
 %{
-#define malloc xmalloc
-#define free xfree
 
 #define NUMERAL_WIDTH 256
 #define LONGEST_SIGN ((ULONGEST) 1 << (sizeof(LONGEST) * HOST_CHAR_BIT - 1))
@@ -89,6 +84,8 @@ static int find_dot_all (const char *);
 
 %}
 
+%option case-insensitive interactive nodefault
+
 %s IN_STRING BEFORE_QUAL_QUOTE
 
 %%
@@ -144,14 +141,14 @@ static int find_dot_all (const char *);
                }
 
 <INITIAL>"'"({GRAPHIC}|\")"'" {
-                  yylval.typed_val.type = builtin_type_ada_char;
+                  yylval.typed_val.type = type_char ();
                   yylval.typed_val.val = yytext[1];
                   return CHARLIT;
                }
 
 <INITIAL>"'[\""{HEXDIG}{2}"\"]'"   {
                    int v;
-                   yylval.typed_val.type = builtin_type_ada_char;
+                   yylval.typed_val.type = type_char ();
                   sscanf (yytext+3, "%2x", &v);
                   yylval.typed_val.val = v;
                   return CHARLIT;
@@ -350,7 +347,7 @@ resize_tempbuf (unsigned int n)
   if (tempbufsize < n)
     {
       tempbufsize = (n+63) & ~63;
-      tempbuf = (char *) xrealloc (tempbuf, tempbufsize);
+      tempbuf = (char *) realloc (tempbuf, tempbufsize);
     }
 }
 
@@ -478,9 +475,9 @@ processInt (const char *base0, const char *num0, const char *exp0)
     }
 
   if ((result >> (TARGET_INT_BIT-1)) == 0)
-    yylval.typed_val.type = builtin_type_ada_int;
+    yylval.typed_val.type = type_int ();
   else if ((result >> (TARGET_LONG_BIT-1)) == 0)
-    yylval.typed_val.type = builtin_type_ada_long;
+    yylval.typed_val.type = type_long ();
   else if (((result >> (TARGET_LONG_BIT-1)) >> 1) == 0)
     {
       /* We have a number representable as an unsigned integer quantity.
@@ -500,7 +497,7 @@ processInt (const char *base0, const char *num0, const char *exp0)
       return INT;
     }
   else
-    yylval.typed_val.type = builtin_type_ada_long_long;
+    yylval.typed_val.type = type_long_long ();
 
   yylval.typed_val.val = (LONGEST) result;
   return INT;
@@ -527,11 +524,11 @@ processReal (const char *num0)
       yylval.typed_val_float.dval = temp;
     }
 
-  yylval.typed_val_float.type = builtin_type_ada_float;
+  yylval.typed_val_float.type = type_float ();
   if (sizeof(DOUBLEST) >= TARGET_DOUBLE_BIT / TARGET_CHAR_BIT)
-    yylval.typed_val_float.type = builtin_type_ada_double;
+    yylval.typed_val_float.type = type_double ();
   if (sizeof(DOUBLEST) >= TARGET_LONG_DOUBLE_BIT / TARGET_CHAR_BIT)
-    yylval.typed_val_float.type = builtin_type_ada_long_double;
+    yylval.typed_val_float.type = type_long_double ();
 
   return FLOAT;
 }
@@ -745,7 +742,7 @@ name_lookup (char *name0, char *err_name, int *token_type, int depth)
                                                          current_gdbarch,
                                                          name);
          if (type == NULL && strcmp ("system__address", name) == 0)
-           type = builtin_type_ada_system_address;
+           type = type_system_address ();
          if (type != NULL)
            {
              /* First check to see if we have a regular definition of this
@@ -924,3 +921,10 @@ yywrap(void)
 {
   return 1;
 }
+
+/* Dummy definition to suppress warnings about unused static definitions. */
+typedef void (*dummy_function) ();
+dummy_function ada_flex_use[] = 
+{ 
+  (dummy_function) yyrealloc, (dummy_function) yyunput
+};
This page took 0.025616 seconds and 4 git commands to generate.