Debugger: Even more operators
Vicki Pfau vi@endrift.com
Thu, 28 Dec 2017 19:58:32 -0500
2 files changed,
36 insertions(+),
0 deletions(-)
M
src/debugger/cli-debugger.c
→
src/debugger/cli-debugger.c
@@ -569,6 +569,21 @@ break;
case OP_XOR: current ^= next; break; + case OP_LESS: + current = current < next; + break; + case OP_GREATER: + current = current > next; + break; + case OP_EQUAL: + current = current == next; + break; + case OP_LE: + current = current <= next; + break; + case OP_GE: + current = current >= next; + break; } return current; }
M
src/debugger/parser.c
→
src/debugger/parser.c
@@ -43,6 +43,12 @@ break;
case '^': lvNext->token.operatorValue = OP_XOR; break; + case '<': + lvNext->token.operatorValue = OP_LESS; + break; + case '>': + lvNext->token.operatorValue = OP_GREATER; + break; default: lvNext->token.type = TOKEN_ERROR_TYPE; break;@@ -125,6 +131,8 @@ case '/':
case '&': case '|': case '^': + case '<': + case '>': lv->token.type = TOKEN_IDENTIFIER_TYPE; lv->token.identifierValue = strndup(tokenStart, string - tokenStart - 1); lv = _lexOperator(lv, token);@@ -151,6 +159,11 @@ case '+':
case '-': case '*': case '/': + case '&': + case '|': + case '^': + case '<': + case '>': lv->token.type = TOKEN_UINT_TYPE; lv->token.uintValue = next; lv = _lexOperator(lv, token);@@ -189,6 +202,8 @@ case '/':
case '&': case '|': case '^': + case '<': + case '>': lv->token.type = TOKEN_UINT_TYPE; lv->token.uintValue = next; lv = _lexOperator(lv, token);@@ -246,6 +261,8 @@ case '/':
case '&': case '|': case '^': + case '<': + case '>': lv->token.type = TOKEN_UINT_TYPE; lv->token.uintValue = next; lv = _lexOperator(lv, token);@@ -291,6 +308,8 @@ case '/':
case '&': case '|': case '^': + case '<': + case '>': lv->token.type = TOKEN_UINT_TYPE; lv->token.uintValue = next; lv = _lexOperator(lv, token);@@ -327,6 +346,8 @@ case '/':
case '&': case '|': case '^': + case '<': + case '>': lvNext = malloc(sizeof(struct LexVector)); lvNext->next = lv->next; lvNext->token.type = TOKEN_CLOSE_PAREN_TYPE;