public inbox for archer-commits@sourceware.org
help / color / mirror / Atom feed
* [SCM] archer-cpparser-branch: Initial check-in of new parser infrastructure, which means it doesn't do anything at all...
@ 2010-05-13 20:52 kseitz
0 siblings, 0 replies; only message in thread
From: kseitz @ 2010-05-13 20:52 UTC (permalink / raw)
To: archer-commits
The branch, archer-cpparser-branch has been updated
via b294ce655bcdd978843343018950868037e17497 (commit)
from 6a5e91e5fad1b8e575f3127597fda514d2c1bc6b (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email.
- Log -----------------------------------------------------------------
commit b294ce655bcdd978843343018950868037e17497
Author: keiths <keiths@redhat.com>
Date: Thu May 13 13:49:59 2010 -0700
Initial check-in of new parser infrastructure, which means it doesn't do
anything at all...
-----------------------------------------------------------------------
Summary of changes:
gdb/Makefile.in | 4 ++--
gdb/c-exp.y | 6 +++---
gdb/c-lang.c | 47 +++++++++++++++++++++++++++++++++++++++++++----
gdb/c-lang.h | 7 +++++++
gdb/cparser.c | 14 ++++++++++++++
gdb/d-lang.c | 4 ++--
6 files changed, 71 insertions(+), 11 deletions(-)
create mode 100644 gdb/cparser.c
First 500 lines of diff:
diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index 754671f..f4d1c5e 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -656,7 +656,7 @@ SFILES = ada-exp.y ada-lang.c ada-typeprint.c ada-valprint.c ada-tasks.c \
bcache.c \
bfd-target.c \
block.c blockframe.c breakpoint.c buildsym.c \
- c-exp.y c-lang.c c-typeprint.c c-valprint.c \
+ c-exp.y cparser.c c-lang.c c-typeprint.c c-valprint.c \
charset.c cli-out.c coffread.c coff-pe-read.c \
complaints.c completer.c corefile.c \
cp-abi.c cp-support.c cp-namespace.c cp-valprint.c \
@@ -834,7 +834,7 @@ COMMON_OBS = $(DEPFILES) $(CONFIG_OBS) $(YYOBJ) \
dbxread.o coffread.o coff-pe-read.o \
dwarf2read.o mipsread.o stabsread.o corefile.o \
dwarf2expr.o dwarf2loc.o dwarf2-frame.o \
- ada-lang.o c-lang.o d-lang.o f-lang.o objc-lang.o \
+ ada-lang.o cparser.o c-lang.o d-lang.o f-lang.o objc-lang.o \
ada-tasks.o \
ui-out.o cli-out.o \
varobj.o vec.o wrapper.o \
diff --git a/gdb/c-exp.y b/gdb/c-exp.y
index 4db4103..5fca2fe 100644
--- a/gdb/c-exp.y
+++ b/gdb/c-exp.y
@@ -67,7 +67,7 @@
#define yymaxdepth c_maxdepth
#define yyparse c_parse_internal
#define yylex c_lex
-#define yyerror c_error
+#define yyerror c_old_error
#define yylval c_lval
#define yychar c_char
#define yydebug c_debug
@@ -1286,7 +1286,7 @@ operator_stoken (const char *op)
strcpy (st.ptr, operator_string);
strcat (st.ptr, op);
- /* The toplevel (c_parse) will free the memory allocated here. */
+ /* The toplevel (c_old_parse) will free the memory allocated here. */
make_cleanup (free, st.ptr);
return st;
};
@@ -2570,7 +2570,7 @@ yylex (void)
}
int
-c_parse (void)
+c_old_parse (void)
{
int result;
struct cleanup *back_to = make_cleanup (free_current_contents,
diff --git a/gdb/c-lang.c b/gdb/c-lang.c
index 305c549..288805e 100644
--- a/gdb/c-lang.c
+++ b/gdb/c-lang.c
@@ -1145,6 +1145,44 @@ const struct exp_descriptor exp_descriptor_c =
evaluate_subexp_c
};
+const struct language_defn c_old_language_defn =
+{
+ "c", /* Language name */
+ language_c,
+ range_check_off,
+ type_check_off,
+ case_sensitive_on,
+ array_row_major,
+ macro_expansion_c,
+ &exp_descriptor_c,
+ c_old_parse,
+ c_old_error,
+ null_post_parser,
+ c_printchar, /* Print a character constant */
+ c_printstr, /* Function to print string constant */
+ c_emit_char, /* Print a single char */
+ c_print_type, /* Print a type using appropriate syntax */
+ c_print_typedef, /* Print a typedef using appropriate syntax */
+ c_val_print, /* Print a value using appropriate syntax */
+ c_value_print, /* Print a top-level value */
+ NULL, /* Language specific skip_trampoline */
+ NULL, /* name_of_this */
+ basic_lookup_symbol_nonlocal, /* lookup_symbol_nonlocal */
+ basic_lookup_transparent_type,/* lookup_transparent_type */
+ NULL, /* Language specific symbol demangler */
+ NULL, /* Language specific class_name_from_physname */
+ c_op_print_tab, /* expression operators for printing */
+ 1, /* c-style arrays */
+ 0, /* String lower bound */
+ default_word_break_characters,
+ default_make_symbol_completion_list,
+ c_language_arch_info,
+ default_print_array_index,
+ default_pass_by_reference,
+ c_get_string,
+ LANG_MAGIC
+};
+
const struct language_defn c_language_defn =
{
"c", /* Language name */
@@ -1312,8 +1350,8 @@ const struct language_defn asm_language_defn =
array_row_major,
macro_expansion_c,
&exp_descriptor_c,
- c_parse,
- c_error,
+ c_old_parse,
+ c_old_error,
null_post_parser,
c_printchar, /* Print a character constant */
c_printstr, /* Function to print string constant */
@@ -1355,8 +1393,8 @@ const struct language_defn minimal_language_defn =
array_row_major,
macro_expansion_c,
&exp_descriptor_c,
- c_parse,
- c_error,
+ c_old_parse,
+ c_old_error,
null_post_parser,
c_printchar, /* Print a character constant */
c_printstr, /* Function to print string constant */
@@ -1387,6 +1425,7 @@ void
_initialize_c_language (void)
{
add_language (&c_language_defn);
+ add_language (&c_old_language_defn);
add_language (&cplus_language_defn);
add_language (&asm_language_defn);
add_language (&minimal_language_defn);
diff --git a/gdb/c-lang.h b/gdb/c-lang.h
index c2cdd56..7bb4668 100644
--- a/gdb/c-lang.h
+++ b/gdb/c-lang.h
@@ -56,6 +56,13 @@ enum c_string_type
/* Defined in c-exp.y. */
+extern int c_old_parse (void);
+
+extern void c_old_error (char *);
+
+extern int c_parse_escape (char **, struct obstack *);
+
+/* Defined in cparser.c. */
extern int c_parse (void);
extern void c_error (char *);
diff --git a/gdb/cparser.c b/gdb/cparser.c
new file mode 100644
index 0000000..1a18007
--- /dev/null
+++ b/gdb/cparser.c
@@ -0,0 +1,14 @@
+#include "defs.h"
+
+int
+c_parse (void)
+{
+ return 0;
+}
+
+void
+c_error (char *msg)
+{
+ char *lexptr = "unknown";
+ error ("A %s in expression, near %s'.", (msg ? msg : "error"), lexptr);
+}
diff --git a/gdb/d-lang.c b/gdb/d-lang.c
index 6db521b..4fc31b5 100644
--- a/gdb/d-lang.c
+++ b/gdb/d-lang.c
@@ -243,8 +243,8 @@ static const struct language_defn d_language_defn =
array_row_major,
macro_expansion_c,
&exp_descriptor_c,
- c_parse,
- c_error,
+ c_old_parse,
+ c_old_error,
null_post_parser,
c_printchar, /* Print a character constant. */
c_printstr, /* Function to print string constant. */
hooks/post-receive
--
Repository for Project Archer.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2010-05-13 20:52 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-13 20:52 [SCM] archer-cpparser-branch: Initial check-in of new parser infrastructure, which means it doesn't do anything at all kseitz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).