From 75a947c66bfb69704a2114da55143870cdb24398 Mon Sep 17 00:00:00 2001 From: Per Bothner Date: Sat, 19 Apr 1997 19:11:28 +0000 Subject: [PATCH] * java-exp.y: Combine TRUE and FALSE into BOOLEAN_LITERAL. (Avoids name clash with broken AIX header files.) --- gdb/ChangeLog | 5 +++++ gdb/java-exp.y | 24 ++++++++++++------------ 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 6c217cf909e..40c47f3ba86 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +Sat Apr 19 11:56:10 1997 Per Bothner + + * java-exp.y: Combine TRUE and FALSE into BOOLEAN_LITERAL. + (Avoids name clash with broken AIX header files.) + Sat Apr 19 01:49:37 1997 Peter Schauer (pes@regent.e-technik.tu-muenchen.de) * serial.c (serial_log_command): Fix fputs_unfiltered calls. diff --git a/gdb/java-exp.y b/gdb/java-exp.y index 3d810a9b206..0f27cbd4c27 100644 --- a/gdb/java-exp.y +++ b/gdb/java-exp.y @@ -145,7 +145,7 @@ static int parse_number PARAMS ((char *, int, int, YYSTYPE *)); %} -%type rcurly BooleanLiteral Dims Dims_opt +%type rcurly Dims Dims_opt %type ClassOrInterfaceType ClassType /* ReferenceType Type ArrayType */ %type IntegralType FloatingPointType NumericType PrimitiveType @@ -154,6 +154,7 @@ parse_number PARAMS ((char *, int, int, YYSTYPE *)); %token IDENTIFIER %token STRING_LITERAL +%token BOOLEAN_LITERAL %token TYPENAME %type Name SimpleName QualifiedName ForcedName @@ -174,7 +175,7 @@ parse_number PARAMS ((char *, int, int, YYSTYPE *)); %token ASSIGN_MODIFY -%token THIS SUPER TRUE FALSE NEW +%token THIS SUPER NEW %left ',' %right '=' ASSIGN_MODIFY @@ -208,13 +209,6 @@ StringLiteral: } ; -BooleanLiteral: - FALSE - { $$ = 0; } -| TRUE - { $$ = 1; } -; - Literal : INTEGER_LITERAL { write_exp_elt_opcode (OP_LONG); @@ -234,7 +228,7 @@ Literal : write_exp_elt_type ($1.type); write_exp_elt_dblcst ($1.dval); write_exp_elt_opcode (OP_DOUBLE); } -| BooleanLiteral +| BOOLEAN_LITERAL { write_exp_elt_opcode (OP_LONG); write_exp_elt_type (java_boolean_type); write_exp_elt_longcst ((LONGEST)$1); @@ -1079,7 +1073,10 @@ yylex () if (STREQN (tokstart, "short", 5)) return SHORT; if (STREQN (tokstart, "false", 5)) - return FALSE; + { + yylval.lval = 0; + return BOOLEAN_LITERAL; + } if (STREQN (tokstart, "super", 5)) return SUPER; if (STREQN (tokstart, "float", 5)) @@ -1093,7 +1090,10 @@ yylex () if (STREQN (tokstart, "char", 4)) return CHAR; if (STREQN (tokstart, "true", 4)) - return TRUE; + { + yylval.lval = 1; + return BOOLEAN_LITERAL; + } if (current_language->la_language == language_cplus && STREQN (tokstart, "this", 4)) { -- 2.30.2