/* YACC parser for Java expressions, for GDB.
- Copyright (C) 1997, 1998, 1999, 2000, 2006, 2007, 2008
+ Copyright (C) 1997, 1998, 1999, 2000, 2006, 2007, 2008, 2009
Free Software Foundation, Inc.
-This file is part of GDB.
+ This file is part of GDB.
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 51 Franklin Street, Fifth Floor,
-Boston, MA 02110-1301, USA. */
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* Parse a Java expression from text in a string,
and return the result as a struct expression pointer.
/*** Needs some error checking for the float case ***/
static int
-parse_number (p, len, parsed_float, putithere)
- char *p;
- int len;
- int parsed_float;
- YYSTYPE *putithere;
+parse_number (char *p, int len, int parsed_float, YYSTYPE *putithere)
{
ULONGEST n = 0;
ULONGEST limit, limit_div_base;
/* Read one token, getting characters through lexptr. */
static int
-yylex ()
+yylex (void)
{
int c;
int namelen;
}
void
-yyerror (msg)
- char *msg;
+yyerror (char *msg)
{
if (prev_lexptr)
lexptr = prev_lexptr;
}
static struct type *
-java_type_from_name (name)
- struct stoken name;
-
+java_type_from_name (struct stoken name)
{
char *tmp = copy_name (name);
struct type *typ = java_lookup_class (tmp);
qualified name (has '.'), generate a field access for each part. */
static void
-push_fieldnames (name)
- struct stoken name;
+push_fieldnames (struct stoken name)
{
int i;
struct stoken token;
Handle VAR, TYPE, TYPE.FIELD1....FIELDN and VAR.FIELD1....FIELDN. */
static void
-push_expression_name (name)
- struct stoken name;
+push_expression_name (struct stoken name)
{
char *tmp;
struct type *typ;
into a freshly malloc'ed struct expression. Its language_defn is set
to null. */
static struct expression *
-copy_exp (expr, endpos)
- struct expression *expr;
- int endpos;
+copy_exp (struct expression *expr, int endpos)
{
int len = length_of_subexp (expr, endpos);
struct expression *new
/* Insert the expression NEW into the current expression (expout) at POS. */
static void
-insert_exp (pos, new)
- int pos;
- struct expression *new;
+insert_exp (int pos, struct expression *new)
{
int newlen = new->nelts;