diff options
author | Iain Buclaw <ibuclaw@gdcproject.org> | 2014-06-19 19:29:26 +0100 |
---|---|---|
committer | Iain Buclaw <ibuclaw@gdcproject.org> | 2014-06-19 19:30:20 +0100 |
commit | 3ed9baed43c5253b2e88e5576773957432e268c4 (patch) | |
tree | 3583d0c119cbbe7e8fb62b45cf20a166cb64e9bb /gdb/d-lang.c | |
parent | 78c164b00654c7f422694035bc0e1817f90c86b5 (diff) | |
download | gdb-3ed9baed43c5253b2e88e5576773957432e268c4.zip gdb-3ed9baed43c5253b2e88e5576773957432e268c4.tar.gz gdb-3ed9baed43c5253b2e88e5576773957432e268c4.tar.bz2 |
Initial pass at D language expression parser support.
gdb/
2014-06-05 Iain Buclaw <ibuclaw@gdcproject.org>
* Makefile.in (SFILES): Add d-exp.y.
(YYFILES): Add d-exp.c.
(YYOBJ): Add d-exp.o.
(local-maintainer-clean): Delete d-exp.c.
* d-exp.y: New file.
* d-lang.h (d_parse): New declaration.
(d_error): New declaration.
* d-lang.c (d_op_print_tab): Add entry for BINOP_CONCAT and BINOP_EXP.
Set BINOP_EQUAL and BINOP_NOTEQUAL to same precedence as other
PREC_ORDER operators.
(d_language_defn): Use d_parse, d_error instead of c_parse, c_error.
gdb/testsuite/
2014-06-05 Iain Buclaw <ibuclaw@gdcproject.org>
* gdb.dlang/expression.exp: New file.
Diffstat (limited to 'gdb/d-lang.c')
-rw-r--r-- | gdb/d-lang.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/gdb/d-lang.c b/gdb/d-lang.c index 434f30a..87d82da 100644 --- a/gdb/d-lang.c +++ b/gdb/d-lang.c @@ -96,8 +96,8 @@ static const struct op_print d_op_print_tab[] = {"|", BINOP_BITWISE_IOR, PREC_BITWISE_IOR, 0}, {"^", BINOP_BITWISE_XOR, PREC_BITWISE_XOR, 0}, {"&", BINOP_BITWISE_AND, PREC_BITWISE_AND, 0}, - {"==", BINOP_EQUAL, PREC_EQUAL, 0}, - {"!=", BINOP_NOTEQUAL, PREC_EQUAL, 0}, + {"==", BINOP_EQUAL, PREC_ORDER, 0}, + {"!=", BINOP_NOTEQUAL, PREC_ORDER, 0}, {"<=", BINOP_LEQ, PREC_ORDER, 0}, {">=", BINOP_GEQ, PREC_ORDER, 0}, {">", BINOP_GTR, PREC_ORDER, 0}, @@ -106,9 +106,11 @@ static const struct op_print d_op_print_tab[] = {"<<", BINOP_LSH, PREC_SHIFT, 0}, {"+", BINOP_ADD, PREC_ADD, 0}, {"-", BINOP_SUB, PREC_ADD, 0}, + {"~", BINOP_CONCAT, PREC_ADD, 0}, {"*", BINOP_MUL, PREC_MUL, 0}, {"/", BINOP_DIV, PREC_MUL, 0}, {"%", BINOP_REM, PREC_MUL, 0}, + {"^^", BINOP_EXP, PREC_REPEAT, 0}, {"@", BINOP_REPEAT, PREC_REPEAT, 0}, {"-", UNOP_NEG, PREC_PREFIX, 0}, {"!", UNOP_LOGICAL_NOT, PREC_PREFIX, 0}, @@ -228,8 +230,8 @@ static const struct language_defn d_language_defn = array_row_major, macro_expansion_no, &exp_descriptor_c, - c_parse, - c_error, + d_parse, + d_error, null_post_parser, c_printchar, /* Print a character constant. */ c_printstr, /* Function to print string constant. */ |