4 * Ullrich von Bassewitz, 21.06.1998
20 /*****************************************************************************/
22 /*****************************************************************************/
26 void PushAddr (ExprDesc* lval);
27 /* If the expression contains an address that was somehow evaluated,
28 * push this address on the stack. This is a helper function for all
29 * sorts of implicit or explicit assignment functions where the lvalue
30 * must be saved if it's not constant, before evaluating the rhs.
33 void ConstSubExpr (int (*F) (ExprDesc*), ExprDesc* Expr);
34 /* Will evaluate an expression via the given function. If the result is not
35 * a constant, a diagnostic will be printed, and the value is replaced by
36 * a constant one to make sure there are no internal errors that result
37 * from this input error.
40 void CheckBoolExpr (ExprDesc* lval);
41 /* Check if the given expression is a boolean expression, output a diagnostic
45 unsigned assignadjust (type* lhst, ExprDesc* rhs);
46 /* Adjust the type of the right hand expression so that it can be assigned to
47 * the type on the left hand side. This function is used for assignment and
48 * for converting parameters in a function call. It returns the code generator
49 * flags for the operation.
52 void exprhs (unsigned flags, int k, ExprDesc *lval);
53 /* Put the result of an expression into the primary register */
55 void Store (ExprDesc* lval, const type* StoreType);
56 /* Store the primary register into the location denoted by lval. If StoreType
57 * is given, use this type when storing instead of lval->Type. If StoreType
58 * is NULL, use lval->Type instead.
61 void expression1 (ExprDesc* lval);
62 /* Evaluate an expression on level 1 (no comma operator) and put it into
63 * the primary register
66 void expression (ExprDesc* lval);
67 /* Evaluate an expression and put it into the primary register */
69 int evalexpr (unsigned flags, int (*f) (ExprDesc*), ExprDesc* lval);
70 /* Will evaluate an expression via the given function. If the result is a
71 * constant, 0 is returned and the value is put in the lval struct. If the
72 * result is not constant, exprhs is called to bring the value into the
73 * primary register and 1 is returned.
76 void ConstExpr (ExprDesc* lval);
77 /* Get a constant value */
79 void ConstIntExpr (ExprDesc* Val);
80 /* Get a constant int value */
82 void intexpr (ExprDesc* lval);
83 /* Get an integer expression */
85 int hie10 (ExprDesc* lval);
86 /* Handle ++, --, !, unary - etc. */
88 int hie1 (ExprDesc* lval);
89 /* Parse first level of expression hierarchy. */
91 void DefineData (ExprDesc* lval);
92 /* Output a data definition for the given expression */
94 void Test (unsigned Label, int Invert);
95 /* Evaluate a boolean test expression and jump depending on the result of
96 * the test and on Invert.
99 void TestInParens (unsigned Label, int Invert);
100 /* Evaluate a boolean test expression in parenthesis and jump depending on
101 * the result of the test * and on Invert.