Mercurial > hg > octave-terminal
changeset 2899:0d79a8c11a2b
[project @ 1997-04-30 03:09:23 by jwe]
author | jwe |
---|---|
date | Wed, 30 Apr 1997 03:09:23 +0000 |
parents | 8303749672be |
children | 5ed088015839 |
files | src/parse.y |
diffstat | 1 files changed, 27 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/parse.y +++ b/src/parse.y @@ -311,6 +311,7 @@ // Tokens with line and column information. %token <tok_val> '=' ':' '-' '+' '*' '/' %token <tok_val> ADD_EQ SUB_EQ MUL_EQ DIV_EQ EMUL_EQ EDIV_EQ AND_EQ OR_EQ +%token <tok_val> LSHIFT_EQ RSHIFT_EQ LSHIFT RSHIFT %token <tok_val> EXPR_AND_AND EXPR_OR_OR %token <tok_val> EXPR_AND EXPR_OR EXPR_NOT %token <tok_val> EXPR_LT EXPR_LE EXPR_EQ EXPR_NE EXPR_GE EXPR_GT @@ -378,10 +379,11 @@ // Precedence and associativity. %left ';' ',' '\n' -%right '=' ADD_EQ SUB_EQ MUL_EQ DIV_EQ EMUL_EQ EDIV_EQ OR_EQ AND_EQ +%right '=' ADD_EQ SUB_EQ MUL_EQ DIV_EQ EMUL_EQ EDIV_EQ OR_EQ AND_EQ LSHIFT_EQ RSHIFT_EQ %left EXPR_AND_AND EXPR_OR_OR %left EXPR_AND EXPR_OR %left EXPR_LT EXPR_LE EXPR_EQ EXPR_NE EXPR_GE EXPR_GT +%left LSHIFT RSHIFT %left ':' %left '-' '+' EPLUS EMINUS %left '*' '/' LEFTDIV EMUL EDIV ELEFTDIV @@ -814,6 +816,10 @@ { $$ = make_assign_op (MUL_EQ, $1, $2, $3); } | variable DIV_EQ simple_expr { $$ = make_assign_op (DIV_EQ, $1, $2, $3); } + | variable LSHIFT_EQ simple_expr + { $$ = make_assign_op (LSHIFT_EQ, $1, $2, $3); } + | variable RSHIFT_EQ simple_expr + { $$ = make_assign_op (RSHIFT_EQ, $1, $2, $3); } | variable EMUL_EQ simple_expr { $$ = make_assign_op (EMUL_EQ, $1, $2, $3); } | variable EDIV_EQ simple_expr @@ -859,6 +865,10 @@ { $$ = make_binary_op (LEFTDIV, $1, $2, $3); } | simple_expr ELEFTDIV simple_expr { $$ = make_binary_op (ELEFTDIV, $1, $2, $3); } + | simple_expr LSHIFT simple_expr + { $$ = make_binary_op (LSHIFT, $1, $2, $3); } + | simple_expr RSHIFT simple_expr + { $$ = make_binary_op (RSHIFT, $1, $2, $3); } | simple_expr EXPR_LT simple_expr { $$ = make_binary_op (EXPR_LT, $1, $2, $3); } | simple_expr EXPR_LE simple_expr @@ -1693,6 +1703,14 @@ t = octave_value::el_ldiv; break; + case LSHIFT: + t = octave_value::lshift; + break; + + case RSHIFT: + t = octave_value::rshift; + break; + case EXPR_LT: t = octave_value::lt; break; @@ -2127,6 +2145,14 @@ t = octave_value::div_eq; break; + case LSHIFT_EQ: + t = octave_value::lshift_eq; + break; + + case RSHIFT_EQ: + t = octave_value::rshift_eq; + break; + case EMUL_EQ: t = octave_value::el_mul_eq; break;