]> Git Repo - binutils.git/blobdiff - gdb/ch-exp.y
* breakpoint.h (bpstat): New field print_it.
[binutils.git] / gdb / ch-exp.y
index 279a0cda1ecb3dd0d05542356dd390a1c0ffd6c7..41ff24586500350f4d53e8f3e46938697c60267b 100644 (file)
@@ -54,6 +54,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 %{
 
 #include "defs.h"
+#include <ctype.h>
 #include "expression.h"
 #include "language.h"
 #include "value.h"
@@ -139,7 +140,36 @@ yyerror PARAMS ((char *));
     int *ivec;
   }
 
-%token <voidval> FIXME
+%token <voidval> FIXME_01
+%token <voidval> FIXME_02
+%token <voidval> FIXME_03
+%token <voidval> FIXME_04
+%token <voidval> FIXME_05
+%token <voidval> FIXME_06
+%token <voidval> FIXME_07
+%token <voidval> FIXME_08
+%token <voidval> FIXME_09
+%token <voidval> FIXME_10
+%token <voidval> FIXME_11
+%token <voidval> FIXME_12
+%token <voidval> FIXME_13
+%token <voidval> FIXME_14
+%token <voidval> FIXME_15
+%token <voidval> FIXME_16
+%token <voidval> FIXME_17
+%token <voidval> FIXME_18
+%token <voidval> FIXME_19
+%token <voidval> FIXME_20
+%token <voidval> FIXME_21
+%token <voidval> FIXME_22
+%token <voidval> FIXME_23
+%token <voidval> FIXME_24
+%token <voidval> FIXME_25
+%token <voidval> FIXME_26
+%token <voidval> FIXME_27
+%token <voidval> FIXME_28
+%token <voidval> FIXME_29
+%token <voidval> FIXME_30
 
 %token <typed_val>     INTEGER_LITERAL
 %token <ulval>         BOOLEAN_LITERAL
@@ -152,8 +182,6 @@ yyerror PARAMS ((char *));
 %token <sval>          CHARACTER_STRING_LITERAL
 %token <sval>          BIT_STRING_LITERAL
 
-%token <voidval>       STRING
-%token <voidval>       CONSTANT
 %token <voidval>       '.'
 %token <voidval>       ';'
 %token <voidval>       ':'
@@ -182,7 +210,6 @@ yyerror PARAMS ((char *));
 %token <voidval>       NOT
 %token <voidval>       POINTER
 %token <voidval>       RECEIVE
-%token <voidval>       SC
 %token <voidval>       '['
 %token <voidval>       ']'
 %token <voidval>       '('
@@ -249,7 +276,6 @@ yyerror PARAMS ((char *));
 %type <voidval>                operand_4
 %type <voidval>                operand_5
 %type <voidval>                operand_6
-%type <voidval>                integer_literal_expression
 %type <voidval>                synonym_name
 %type <voidval>                value_enumeration_name
 %type <voidval>                value_do_with_name
@@ -295,7 +321,7 @@ value               :       expression
                        }
                ;
 
-undefined_value        :       FIXME
+undefined_value        :       FIXME_01
                        {
                          $$ = 0;       /* FIXME */
                        }
@@ -307,7 +333,7 @@ location    :       access_name
                        {
                          $$ = 0;       /* FIXME */
                        }
-               |       FIXME
+               |       FIXME_02
                        {
                          $$ = 0;       /* FIXME */
                        }
@@ -339,7 +365,7 @@ access_name :       LOCATION_NAME
                          write_exp_elt_intern ($1);
                          write_exp_elt_opcode (OP_INTERNALVAR); 
                        }
-               |       FIXME
+               |       FIXME_03
                        {
                          $$ = 0;       /* FIXME */
                        }
@@ -507,7 +533,7 @@ literal             :       INTEGER_LITERAL
 
 /* Z.200, 5.2.5 */
 
-tuple          :       FIXME
+tuple          :       FIXME_04
                        {
                          $$ = 0;       /* FIXME */
                        }
@@ -570,7 +596,7 @@ value_structure_field:      structure_primitive_value '.' field_name
 
 /* Z.200, 5.2.11 */
 
-expression_conversion: mode_name '(' expression ')'
+expression_conversion: mode_name parenthesised_expression
                        {
                          $$ = 0;       /* FIXME */
                        }
@@ -578,7 +604,7 @@ expression_conversion:      mode_name '(' expression ')'
 
 /* Z.200, 5.2.12 */
 
-value_procedure_call:  FIXME
+value_procedure_call:  FIXME_05
                        {
                          $$ = 0;       /* FIXME */
                        }
@@ -594,7 +620,7 @@ value_built_in_routine_call:        chill_value_built_in_routine_call
 
 /* Z.200, 5.2.14 */
 
-start_expression:      FIXME
+start_expression:      FIXME_06
                        {
                          $$ = 0;       /* FIXME */
                        }       /* Not in GNU-Chill */
@@ -602,7 +628,7 @@ start_expression:   FIXME
 
 /* Z.200, 5.2.15 */
 
-zero_adic_operator:    FIXME
+zero_adic_operator:    FIXME_07
                        {
                          $$ = 0;       /* FIXME */
                        }
@@ -759,7 +785,7 @@ operand_3   :       operand_4
                        }
                |       operand_3 SLASH_SLASH operand_4
                        {
-                         $$ = 0;       /* FIXME */
+                         write_exp_elt_opcode (BINOP_CONCAT);
                        }
                ;
 
@@ -788,6 +814,8 @@ operand_4   :       operand_5
                ;
 
 /* Z.200, 5.3.8 */
+/* Note that we accept any expression for BINOP_CONCAT, not just
+   integer literal expressions. (FIXME?) */
 
 operand_5      :       operand_6
                        {
@@ -801,9 +829,9 @@ operand_5   :       operand_6
                        {
                          write_exp_elt_opcode (UNOP_LOGICAL_NOT);
                        }
-               |       '(' integer_literal_expression ')' operand_6
+               |       parenthesised_expression operand_6
                        {
-                         $$ = 0;       /* FIXME */
+                         write_exp_elt_opcode (BINOP_CONCAT);
                        }
                ;
 
@@ -928,16 +956,6 @@ length_argument :  location
                        }
                ;
 
-/* Z.200, 12.4.3 */
-/* FIXME:  For now we just accept only a single integer literal. */
-
-integer_literal_expression:
-                       INTEGER_LITERAL
-                       {
-                         $$ = 0;
-                       }
-               ;
-
 /* Z.200, 12.4.3 */
 
 array_primitive_value :        primitive_value
@@ -949,29 +967,29 @@ array_primitive_value :   primitive_value
 
 /* Things which still need productions... */
 
-array_mode_name                :       FIXME { $$ = 0; }
-string_mode_name       :       FIXME { $$ = 0; }
-variant_structure_mode_name:   FIXME { $$ = 0; }
-synonym_name           :       FIXME { $$ = 0; }
-value_enumeration_name         :       FIXME { $$ = 0; }
-value_do_with_name     :       FIXME { $$ = 0; }
-value_receive_name     :       FIXME { $$ = 0; }
-string_primitive_value         :       FIXME { $$ = 0; }
-start_element          :       FIXME { $$ = 0; }
-left_element           :       FIXME { $$ = 0; }
-right_element          :       FIXME { $$ = 0; }
-slice_size             :       FIXME { $$ = 0; }
-lower_element          :       FIXME { $$ = 0; }
-upper_element          :       FIXME { $$ = 0; }
-first_element          :       FIXME { $$ = 0; }
-structure_primitive_value:     FIXME { $$ = 0; }
-field_name             :       FIXME { $$ = 0; }
-mode_name              :       FIXME { $$ = 0; }
-boolean_expression     :       FIXME { $$ = 0; }
-case_selector_list     :       FIXME { $$ = 0; }
-subexpression          :       FIXME { $$ = 0; }
-case_label_specification:      FIXME { $$ = 0; }
-buffer_location        :       FIXME { $$ = 0; }
+array_mode_name                :       FIXME_08 { $$ = 0; }
+string_mode_name       :       FIXME_09 { $$ = 0; }
+variant_structure_mode_name:   FIXME_10 { $$ = 0; }
+synonym_name           :       FIXME_11 { $$ = 0; }
+value_enumeration_name         :       FIXME_12 { $$ = 0; }
+value_do_with_name     :       FIXME_13 { $$ = 0; }
+value_receive_name     :       FIXME_14 { $$ = 0; }
+string_primitive_value         :       FIXME_15 { $$ = 0; }
+start_element          :       FIXME_16 { $$ = 0; }
+left_element           :       FIXME_17 { $$ = 0; }
+right_element          :       FIXME_18 { $$ = 0; }
+slice_size             :       FIXME_19 { $$ = 0; }
+lower_element          :       FIXME_20 { $$ = 0; }
+upper_element          :       FIXME_21 { $$ = 0; }
+first_element          :       FIXME_22 { $$ = 0; }
+structure_primitive_value:     FIXME_23 { $$ = 0; }
+field_name             :       FIXME_24 { $$ = 0; }
+mode_name              :       FIXME_25 { $$ = 0; }
+boolean_expression     :       FIXME_26 { $$ = 0; }
+case_selector_list     :       FIXME_27 { $$ = 0; }
+subexpression          :       FIXME_28 { $$ = 0; }
+case_label_specification:      FIXME_29 { $$ = 0; }
+buffer_location        :       FIXME_30 { $$ = 0; }
 
 %%
 
@@ -1367,6 +1385,12 @@ match_string_literal ()
    Note that more than a single character, enclosed in single quotes, is
    a string literal.
 
+   Also note that the control sequence form is not in GNU Chill since it
+   is ambiguous with the string literal form using single quotes.  I.E.
+   is '^(7)' a character literal or a string literal.  In theory it it
+   possible to tell by context, but GNU Chill doesn't accept the control
+   sequence form, so neither do we (for now the code is disabled).
+
    Returns CHARACTER_LITERAL if a match is found.
    */
 
@@ -1397,6 +1421,7 @@ match_character_literal ()
       
       if ((*tokptr == '^') && (*(tokptr + 1) == '('))
        {
+#if 0     /* Disable, see note above. -fnf */
          /* Match and decode a control sequence.  Return zero if we don't
             find a valid integer literal, or if the next unconsumed character
             after the integer literal is not the trailing ')'.
@@ -1407,6 +1432,9 @@ match_character_literal ()
            {
              return (0);
            }
+#else
+         return (0);
+#endif
        }
       else
        {
@@ -1771,7 +1799,6 @@ yylex ()
            case '+':
            case '-':
            case '*':
-           case '/':
            case '(':
            case ')':
            case '[':
This page took 0.035089 seconds and 4 git commands to generate.