/* 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.
#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' ) \
/* Initialize the lexer for processing new expression. */
-void
+static void
lexer_init (FILE *inp)
{
BEGIN INITIAL;
/* 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.
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)
{
}
name[i] = '\000';
- result.ptr = name;
result.length = i;
return result;
}