4 * Ullrich von Bassewitz, 21.06.1998
20 /*****************************************************************************/
22 /*****************************************************************************/
26 void ExprWithCheck (void (*Func) (ExprDesc*), ExprDesc *Expr);
27 /* Call an expression function with checks. */
29 void PushAddr (const ExprDesc* Expr);
30 /* If the expression contains an address that was somehow evaluated,
31 * push this address on the stack. This is a helper function for all
32 * sorts of implicit or explicit assignment functions where the lvalue
33 * must be saved if it's not constant, before evaluating the rhs.
36 void Store (ExprDesc* Expr, const Type* StoreType);
37 /* Store the primary register into the location denoted by lval. If StoreType
38 * is given, use this type when storing instead of lval->Type. If StoreType
39 * is NULL, use lval->Type instead.
42 int evalexpr (unsigned flags, void (*Func) (ExprDesc*), ExprDesc* Expr);
43 /* Will evaluate an expression via the given function. If the result is a
44 * constant, 0 is returned and the value is put in the lval struct. If the
45 * result is not constant, LoadExpr is called to bring the value into the
46 * primary register and 1 is returned.
49 void Expression0 (ExprDesc* Expr);
50 /* Evaluate an expression via hie0 and put the result into the primary register */
52 void ConstExpr (void (*Func) (ExprDesc*), ExprDesc* Expr);
53 /* Will evaluate an expression via the given function. If the result is not
54 * a constant of some sort, a diagnostic will be printed, and the value is
55 * replaced by a constant one to make sure there are no internal errors that
56 * result from this input error.
59 void BoolExpr (void (*Func) (ExprDesc*), ExprDesc* Expr);
60 /* Will evaluate an expression via the given function. If the result is not
61 * something that may be evaluated in a boolean context, a diagnostic will be
62 * printed, and the value is replaced by a constant one to make sure there
63 * are no internal errors that result from this input error.
66 void ConstAbsIntExpr (void (*Func) (ExprDesc*), ExprDesc* Expr);
67 /* Will evaluate an expression via the given function. If the result is not
68 * a constant numeric integer value, a diagnostic will be printed, and the
69 * value is replaced by a constant one to make sure there are no internal
70 * errors that result from this input error.
73 void hie10 (ExprDesc* lval);
74 /* Handle ++, --, !, unary - etc. */
76 void hie8 (ExprDesc* Expr);
77 /* Process + and - binary operators. */
79 void hie1 (ExprDesc* lval);
80 /* Parse first level of expression hierarchy. */
82 void hie0 (ExprDesc* Expr);
83 /* Parse comma operator. */