Lines Matching refs:expr
36 ExprResolveLhs(struct xkb_context *ctx, const ExprDef *expr, in ExprResolveLhs() argument
40 switch (expr->expr.op) { in ExprResolveLhs()
43 *field_rtrn = xkb_atom_text(ctx, expr->ident.ident); in ExprResolveLhs()
47 *elem_rtrn = xkb_atom_text(ctx, expr->field_ref.element); in ExprResolveLhs()
48 *field_rtrn = xkb_atom_text(ctx, expr->field_ref.field); in ExprResolveLhs()
52 *elem_rtrn = xkb_atom_text(ctx, expr->array_ref.element); in ExprResolveLhs()
53 *field_rtrn = xkb_atom_text(ctx, expr->array_ref.field); in ExprResolveLhs()
54 *index_rtrn = expr->array_ref.entry; in ExprResolveLhs()
59 log_wsgo(ctx, "Unexpected operator %d in ResolveLhs\n", expr->expr.op); in ExprResolveLhs()
124 ExprResolveBoolean(struct xkb_context *ctx, const ExprDef *expr, in ExprResolveBoolean() argument
130 switch (expr->expr.op) { in ExprResolveBoolean()
132 if (expr->expr.value_type != EXPR_TYPE_BOOLEAN) { in ExprResolveBoolean()
135 expr_value_type_to_string(expr->expr.value_type)); in ExprResolveBoolean()
138 *set_rtrn = expr->boolean.set; in ExprResolveBoolean()
142 ident = xkb_atom_text(ctx, expr->ident.ident); in ExprResolveBoolean()
162 xkb_atom_text(ctx, expr->field_ref.element), in ExprResolveBoolean()
163 xkb_atom_text(ctx, expr->field_ref.field)); in ExprResolveBoolean()
168 ok = ExprResolveBoolean(ctx, expr, set_rtrn); in ExprResolveBoolean()
180 expr_op_type_to_string(expr->expr.op)); in ExprResolveBoolean()
185 expr->expr.op); in ExprResolveBoolean()
193 ExprResolveKeyCode(struct xkb_context *ctx, const ExprDef *expr, in ExprResolveKeyCode() argument
198 switch (expr->expr.op) { in ExprResolveKeyCode()
200 if (expr->expr.value_type != EXPR_TYPE_INT) { in ExprResolveKeyCode()
203 expr_value_type_to_string(expr->expr.value_type)); in ExprResolveKeyCode()
207 *kc = (xkb_keycode_t) expr->integer.ival; in ExprResolveKeyCode()
214 if (!ExprResolveKeyCode(ctx, expr->binary.left, &leftRtrn) || in ExprResolveKeyCode()
215 !ExprResolveKeyCode(ctx, expr->binary.right, &rightRtrn)) in ExprResolveKeyCode()
218 switch (expr->expr.op) { in ExprResolveKeyCode()
244 if (!ExprResolveKeyCode(ctx, expr->unary.child, &leftRtrn)) in ExprResolveKeyCode()
251 return ExprResolveKeyCode(ctx, expr->unary.child, kc); in ExprResolveKeyCode()
255 expr->expr.op); in ExprResolveKeyCode()
273 ExprResolveIntegerLookup(struct xkb_context *ctx, const ExprDef *expr, in ExprResolveIntegerLookup() argument
282 switch (expr->expr.op) { in ExprResolveIntegerLookup()
284 if (expr->expr.value_type != EXPR_TYPE_INT) { in ExprResolveIntegerLookup()
287 expr_value_type_to_string(expr->expr.value_type)); in ExprResolveIntegerLookup()
291 *val_rtrn = expr->integer.ival; in ExprResolveIntegerLookup()
296 ok = lookup(ctx, lookupPriv, expr->ident.ident, EXPR_TYPE_INT, &u); in ExprResolveIntegerLookup()
300 xkb_atom_text(ctx, expr->ident.ident)); in ExprResolveIntegerLookup()
308 xkb_atom_text(ctx, expr->field_ref.element), in ExprResolveIntegerLookup()
309 xkb_atom_text(ctx, expr->field_ref.field)); in ExprResolveIntegerLookup()
316 left = expr->binary.left; in ExprResolveIntegerLookup()
317 right = expr->binary.right; in ExprResolveIntegerLookup()
322 switch (expr->expr.op) { in ExprResolveIntegerLookup()
341 expr_op_type_to_string(expr->expr.op)); in ExprResolveIntegerLookup()
357 left = expr->unary.child; in ExprResolveIntegerLookup()
361 *val_rtrn = (expr->expr.op == EXPR_NEGATE ? -l : ~l); in ExprResolveIntegerLookup()
365 left = expr->unary.child; in ExprResolveIntegerLookup()
371 expr->expr.op); in ExprResolveIntegerLookup()
379 ExprResolveInteger(struct xkb_context *ctx, const ExprDef *expr, in ExprResolveInteger() argument
382 return ExprResolveIntegerLookup(ctx, expr, val_rtrn, NULL, NULL); in ExprResolveInteger()
386 ExprResolveGroup(struct xkb_context *ctx, const ExprDef *expr, in ExprResolveGroup() argument
392 ok = ExprResolveIntegerLookup(ctx, expr, &result, SimpleLookup, in ExprResolveGroup()
408 ExprResolveLevel(struct xkb_context *ctx, const ExprDef *expr, in ExprResolveLevel() argument
414 ok = ExprResolveIntegerLookup(ctx, expr, &result, SimpleLookup, in ExprResolveLevel()
430 ExprResolveButton(struct xkb_context *ctx, const ExprDef *expr, int *btn_rtrn) in ExprResolveButton() argument
432 return ExprResolveIntegerLookup(ctx, expr, btn_rtrn, SimpleLookup, in ExprResolveButton()
437 ExprResolveString(struct xkb_context *ctx, const ExprDef *expr, in ExprResolveString() argument
440 switch (expr->expr.op) { in ExprResolveString()
442 if (expr->expr.value_type != EXPR_TYPE_STRING) { in ExprResolveString()
444 expr_value_type_to_string(expr->expr.value_type)); in ExprResolveString()
448 *val_rtrn = expr->string.str; in ExprResolveString()
453 xkb_atom_text(ctx, expr->ident.ident)); in ExprResolveString()
458 xkb_atom_text(ctx, expr->field_ref.element), in ExprResolveString()
459 xkb_atom_text(ctx, expr->field_ref.field)); in ExprResolveString()
472 expr_op_type_to_string(expr->expr.op)); in ExprResolveString()
477 expr->expr.op); in ExprResolveString()
484 ExprResolveEnum(struct xkb_context *ctx, const ExprDef *expr, in ExprResolveEnum() argument
487 if (expr->expr.op != EXPR_IDENT) { in ExprResolveEnum()
489 expr_op_type_to_string(expr->expr.op)); in ExprResolveEnum()
493 if (!SimpleLookup(ctx, values, expr->ident.ident, EXPR_TYPE_INT, in ExprResolveEnum()
496 xkb_atom_text(ctx, expr->ident.ident)); in ExprResolveEnum()
509 ExprResolveMaskLookup(struct xkb_context *ctx, const ExprDef *expr, in ExprResolveMaskLookup() argument
519 switch (expr->expr.op) { in ExprResolveMaskLookup()
521 if (expr->expr.value_type != EXPR_TYPE_INT) { in ExprResolveMaskLookup()
524 expr_value_type_to_string(expr->expr.value_type)); in ExprResolveMaskLookup()
527 *val_rtrn = (unsigned int) expr->integer.ival; in ExprResolveMaskLookup()
531 ok = lookup(ctx, lookupPriv, expr->ident.ident, EXPR_TYPE_INT, in ExprResolveMaskLookup()
535 xkb_atom_text(ctx, expr->ident.ident)); in ExprResolveMaskLookup()
540 xkb_atom_text(ctx, expr->field_ref.element), in ExprResolveMaskLookup()
541 xkb_atom_text(ctx, expr->field_ref.field)); in ExprResolveMaskLookup()
559 left = expr->binary.left; in ExprResolveMaskLookup()
560 right = expr->binary.right; in ExprResolveMaskLookup()
565 switch (expr->expr.op) { in ExprResolveMaskLookup()
575 (expr->expr.op == EXPR_DIVIDE ? "divide" : "multiply")); in ExprResolveMaskLookup()
588 left = expr->unary.child; in ExprResolveMaskLookup()
598 left = expr->unary.child; in ExprResolveMaskLookup()
601 (expr->expr.op == EXPR_NEGATE ? "-" : "!")); in ExprResolveMaskLookup()
606 expr->expr.op); in ExprResolveMaskLookup()
614 ExprResolveMask(struct xkb_context *ctx, const ExprDef *expr, in ExprResolveMask() argument
617 return ExprResolveMaskLookup(ctx, expr, mask_rtrn, SimpleLookup, values); in ExprResolveMask()
621 ExprResolveModMask(struct xkb_context *ctx, const ExprDef *expr, in ExprResolveModMask() argument
626 return ExprResolveMaskLookup(ctx, expr, mask_rtrn, LookupModMask, &priv); in ExprResolveModMask()
630 ExprResolveKeySym(struct xkb_context *ctx, const ExprDef *expr, in ExprResolveKeySym() argument
635 if (expr->expr.op == EXPR_IDENT) { in ExprResolveKeySym()
636 const char *str = xkb_atom_text(ctx, expr->ident.ident); in ExprResolveKeySym()
642 if (!ExprResolveInteger(ctx, expr, &val)) in ExprResolveKeySym()
660 if (def->expr.op != EXPR_IDENT) { in ExprResolveMod()
664 expr_op_type_to_string(def->expr.op)); in ExprResolveMod()