2010-12-28 Hui Zhu <teawater@gmail.com>
[deliverable/binutils-gdb.git] / gdb / parser-defs.h
index 6fcf7ae53058e2b5cf4c1c8592645a4bd6495fe2..16255755498cb4a8f1a9a3eba5bce9a8593e4d86 100644 (file)
@@ -29,6 +29,8 @@
 
 struct block;
 
+extern int parser_debug;
+
 extern struct expression *expout;
 extern int expout_size;
 extern int expout_ptr;
@@ -186,9 +188,15 @@ extern int dump_subexp (struct expression *, struct ui_file *, int);
 extern int dump_subexp_body_standard (struct expression *, 
                                      struct ui_file *, int);
 
-extern void operator_length (struct expression *, int, int *, int *);
+extern void operator_length (const struct expression *, int, int *, int *);
+
+extern void operator_length_standard (const struct expression *, int, int *,
+                                     int *);
 
-extern void operator_length_standard (struct expression *, int, int *, int *);
+extern int operator_check_standard (struct expression *exp, int pos,
+                                   int (*objfile_func)
+                                     (struct objfile *objfile, void *data),
+                                   void *data);
 
 extern char *op_name_standard (enum exp_opcode);
 
@@ -196,6 +204,12 @@ extern struct type *follow_types (struct type *);
 
 extern void null_post_parser (struct expression **, int);
 
+extern int parse_float (const char *p, int len, DOUBLEST *d,
+                       const char **suffix);
+
+extern int parse_c_float (struct gdbarch *gdbarch, const char *p, int len,
+                         DOUBLEST *d, struct type **t);
+
 /* During parsing of a C expression, the pointer to the next character
    is in this variable.  */
 
@@ -266,7 +280,20 @@ struct exp_descriptor
 
     /* Returns number of exp_elements needed to represent an operator and
        the number of subexpressions it takes.  */
-    void (*operator_length) (struct expression*, int, int*, int *);
+    void (*operator_length) (const struct expression*, int, int*, int *);
+
+    /* Call TYPE_FUNC and OBJFILE_FUNC for any TYPE and OBJFILE found being
+       referenced by the single operator of EXP at position POS.  Operator
+       parameters are located at positive (POS + number) offsets in EXP.
+       The functions should never be called with NULL TYPE or NULL OBJFILE.
+       Functions should get passed an arbitrary caller supplied DATA pointer.
+       If any of the functions returns non-zero value then (any other) non-zero
+       value should be immediately returned to the caller.  Otherwise zero
+       should be returned.  */
+    int (*operator_check) (struct expression *exp, int pos,
+                          int (*objfile_func) (struct objfile *objfile,
+                                               void *data),
+                          void *data);
 
     /* Name of this operator for dumping purposes.  */
     char *(*op_name) (enum exp_opcode);
@@ -298,6 +325,8 @@ extern void print_subexp_standard (struct expression *, int *,
 /* Function used to avoid direct calls to fprintf
    in the code generated by the bison parser.  */
 
-extern void parser_fprintf (FILE *, const char *, ...) ATTR_FORMAT (printf, 2 ,3);
+extern void parser_fprintf (FILE *, const char *, ...) ATTRIBUTE_PRINTF (2, 3);
+
+extern int exp_uses_objfile (struct expression *exp, struct objfile *objfile);
 
 #endif /* PARSER_DEFS_H */
This page took 0.024359 seconds and 4 git commands to generate.