mirror of
https://github.com/zeek/zeek.git
synced 2025-10-10 02:28:21 +00:00
Merge remote-tracking branch 'amazingpp/topic/amazingpp/bitshift-operators'
* amazingpp/topic/amazingpp/bitshift-operators: Add bitshift operators
This commit is contained in:
commit
5665696a05
12 changed files with 62 additions and 5 deletions
15
src/parse.y
15
src/parse.y
|
@ -5,7 +5,7 @@
|
|||
// Switching parser table type fixes ambiguity problems.
|
||||
%define lr.type ielr
|
||||
|
||||
%expect 195
|
||||
%expect 199
|
||||
|
||||
%token TOK_ADD TOK_ADD_TO TOK_ADDR TOK_ANY
|
||||
%token TOK_ATENDIF TOK_ATELSE TOK_ATIF TOK_ATIFDEF TOK_ATIFNDEF
|
||||
|
@ -46,6 +46,7 @@
|
|||
%left '|'
|
||||
%left '^'
|
||||
%left '&'
|
||||
%left TOK_LSHIFT TOK_RSHIFT
|
||||
%left '+' '-'
|
||||
%left '*' '/' '%'
|
||||
%left TOK_INCR TOK_DECR
|
||||
|
@ -563,6 +564,18 @@ expr:
|
|||
$$ = new BitExpr(EXPR_XOR, {AdoptRef{}, $1}, {AdoptRef{}, $3});
|
||||
}
|
||||
|
||||
| expr TOK_LSHIFT expr
|
||||
{
|
||||
set_location(@1, @3);
|
||||
$$ = new BitExpr(EXPR_LSHIFT, {AdoptRef{}, $1}, {AdoptRef{}, $3});
|
||||
}
|
||||
|
||||
| expr TOK_RSHIFT expr
|
||||
{
|
||||
set_location(@1, @3);
|
||||
$$ = new BitExpr(EXPR_RSHIFT, {AdoptRef{}, $1}, {AdoptRef{}, $3});
|
||||
}
|
||||
|
||||
| expr TOK_AND_AND expr
|
||||
{
|
||||
set_location(@1, @3);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue