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 MarkedExprWithCheck (void (*Func) (ExprDesc*), ExprDesc* Expr);
30 /* Call an expression function with checks and record start and end of the
34 void PushAddr (const ExprDesc* Expr);
35 /* If the expression contains an address that was somehow evaluated,
36 * push this address on the stack. This is a helper function for all
37 * sorts of implicit or explicit assignment functions where the lvalue
38 * must be saved if it's not constant, before evaluating the rhs.
41 void Store (ExprDesc* Expr, const Type* StoreType);
42 /* Store the primary register into the location denoted by lval. If StoreType
43 * is given, use this type when storing instead of lval->Type. If StoreType
44 * is NULL, use lval->Type instead.
47 int evalexpr (unsigned flags, void (*Func) (ExprDesc*), ExprDesc* Expr);
48 /* Will evaluate an expression via the given function. If the result is a
49 * constant, 0 is returned and the value is put in the Expr struct. If the
50 * result is not constant, LoadExpr is called to bring the value into the
51 * primary register and 1 is returned.
54 void Expression0 (ExprDesc* Expr);
55 /* Evaluate an expression via hie0 and put the result into the primary register */
57 void ConstExpr (void (*Func) (ExprDesc*), ExprDesc* Expr);
58 /* Will evaluate an expression via the given function. If the result is not
59 * a constant of some sort, a diagnostic will be printed, and the value is
60 * replaced by a constant one to make sure there are no internal errors that
61 * result from this input error.
64 void BoolExpr (void (*Func) (ExprDesc*), ExprDesc* Expr);
65 /* Will evaluate an expression via the given function. If the result is not
66 * something that may be evaluated in a boolean context, a diagnostic will be
67 * printed, and the value is replaced by a constant one to make sure there
68 * are no internal errors that result from this input error.
71 void ConstAbsIntExpr (void (*Func) (ExprDesc*), ExprDesc* Expr);
72 /* Will evaluate an expression via the given function. If the result is not
73 * a constant numeric integer value, a diagnostic will be printed, and the
74 * value is replaced by a constant one to make sure there are no internal
75 * errors that result from this input error.
78 void hie10 (ExprDesc* lval);
79 /* Handle ++, --, !, unary - etc. */
81 void hie8 (ExprDesc* Expr);
82 /* Process + and - binary operators. */
84 void hie1 (ExprDesc* lval);
85 /* Parse first level of expression hierarchy. */
87 void hie0 (ExprDesc* Expr);
88 /* Parse comma operator. */