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 unsigned assignadjust (type* lhst, ExprDesc* rhs);
41 /* Adjust the type of the right hand expression so that it can be assigned to
42 * the type on the left hand side. This function is used for assignment and
43 * for converting parameters in a function call. It returns the code generator
44 * flags for the operation.
47 void exprhs (unsigned flags, int k, ExprDesc *lval);
48 /* Put the result of an expression into the primary register */
50 void Store (ExprDesc* lval, const type* StoreType);
51 /* Store the primary register into the location denoted by lval. If StoreType
52 * is given, use this type when storing instead of lval->Type. If StoreType
53 * is NULL, use lval->Type instead.
56 void expression1 (ExprDesc* lval);
57 /* Evaluate an expression on level 1 (no comma operator) and put it into
58 * the primary register
61 void expression (ExprDesc* lval);
62 /* Evaluate an expression and put it into the primary register */
64 int evalexpr (unsigned flags, int (*f) (ExprDesc*), ExprDesc* lval);
65 /* Will evaluate an expression via the given function. If the result is a
66 * constant, 0 is returned and the value is put in the lval struct. If the
67 * result is not constant, exprhs is called to bring the value into the
68 * primary register and 1 is returned.
71 void ConstExpr (ExprDesc* lval);
72 /* Get a constant value */
74 void ConstIntExpr (ExprDesc* Val);
75 /* Get a constant int value */
77 void intexpr (ExprDesc* lval);
78 /* Get an integer expression */
80 void boolexpr (ExprDesc* lval);
81 /* Get a boolean expression */
83 void test (unsigned label, int cond);
84 /* Generate code to perform test and jump if false. */
86 int hie10 (ExprDesc* lval);
87 /* Handle ++, --, !, unary - etc. */
89 int hie1 (ExprDesc* lval);
90 /* Parse first level of expression hierarchy. */
92 int hie0 (ExprDesc* lval);
93 /* Parse comma operator (highest level of expression hierarchy) */
95 void DefineData (ExprDesc* lval);
96 /* Output a data definition for the given expression */