Changeset View
Changeset View
Standalone View
Standalone View
head/sys/ddb/db_expr.c
Show All 28 Lines | |||||
* Author: David B. Golub, Carnegie Mellon University | * Author: David B. Golub, Carnegie Mellon University | ||||
* Date: 7/90 | * Date: 7/90 | ||||
*/ | */ | ||||
#include <sys/cdefs.h> | #include <sys/cdefs.h> | ||||
__FBSDID("$FreeBSD$"); | __FBSDID("$FreeBSD$"); | ||||
#include <sys/param.h> | #include <sys/param.h> | ||||
#include <sys/systm.h> | |||||
#include <ddb/ddb.h> | #include <ddb/ddb.h> | ||||
#include <ddb/db_lex.h> | #include <ddb/db_lex.h> | ||||
#include <ddb/db_access.h> | #include <ddb/db_access.h> | ||||
#include <ddb/db_command.h> | #include <ddb/db_command.h> | ||||
static bool db_add_expr(db_expr_t *valuep); | static bool db_add_expr(db_expr_t *valuep); | ||||
static bool db_mult_expr(db_expr_t *valuep); | static bool db_mult_expr(db_expr_t *valuep); | ||||
▲ Show 20 Lines • Show All 179 Lines • ▼ Show 20 Lines | while (t == tPLUS || t == tMINUS || t == tBIT_OR) { | ||||
break; | break; | ||||
case tMINUS: | case tMINUS: | ||||
lhs -= rhs; | lhs -= rhs; | ||||
break; | break; | ||||
case tBIT_OR: | case tBIT_OR: | ||||
lhs |= rhs; | lhs |= rhs; | ||||
break; | break; | ||||
default: | default: | ||||
__unreachable(); | __assert_unreachable(); | ||||
} | } | ||||
t = db_read_token(); | t = db_read_token(); | ||||
} | } | ||||
db_unread_token(t); | db_unread_token(t); | ||||
*valuep = lhs; | *valuep = lhs; | ||||
return (true); | return (true); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 67 Lines • ▼ Show 20 Lines | case tGREATER_EQ: | ||||
break; | break; | ||||
case tLESS: | case tLESS: | ||||
lhs = (lhs < rhs); | lhs = (lhs < rhs); | ||||
break; | break; | ||||
case tLESS_EQ: | case tLESS_EQ: | ||||
lhs = (lhs <= rhs); | lhs = (lhs <= rhs); | ||||
break; | break; | ||||
default: | default: | ||||
__unreachable(); | __assert_unreachable(); | ||||
} | } | ||||
t = db_read_token(); | t = db_read_token(); | ||||
} | } | ||||
db_unread_token(t); | db_unread_token(t); | ||||
*valuep = lhs; | *valuep = lhs; | ||||
return (true); | return (true); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 55 Lines • Show Last 20 Lines |