-static int hie10 (struct expent* lval);
+static int hie10 (ExprDesc* lval);
/* Handle ++, --, !, unary - etc. */
-static int IsNullPtr (struct expent* lval)
+static int IsNullPtr (ExprDesc* lval)
/* Return true if this is the NULL pointer constant */
{
return (IsClassInt (lval->e_tptr) && /* Is it an int? */
-static unsigned typeadjust (struct expent* lhs, struct expent* rhs, int NoPush)
+static unsigned typeadjust (ExprDesc* lhs, ExprDesc* rhs, int NoPush)
/* Adjust the two values for a binary operation. lhs is expected on stack or
* to be constant, rhs is expected to be in the primary register or constant.
* The function will put the type of the result into lhs and return the
-unsigned assignadjust (type* lhst, struct expent* rhs)
+unsigned assignadjust (type* lhst, ExprDesc* rhs)
/* Adjust the type of the right hand expression so that it can be assigned to
* the type on the left hand side. This function is used for assignment and
* for converting parameters in a function call. It returns the code generator
-void DefineData (struct expent* lval)
+void DefineData (ExprDesc* lval)
/* Output a data definition for the given expression */
{
unsigned flags = lval->e_flags;
-static void lconst (unsigned flags, struct expent* lval)
+static void lconst (unsigned flags, ExprDesc* lval)
/* Load primary reg with some constant value. */
{
switch (lval->e_flags & E_MCTYPE) {
-static void PushAddr (struct expent* lval)
+static void PushAddr (ExprDesc* lval)
/* If the expression contains an address that was somehow evaluated,
* push this address on the stack. This is a helper function for all
* sorts of implicit or explicit assignment functions where the lvalue
-void exprhs (unsigned flags, int k, struct expent *lval)
+void exprhs (unsigned flags, int k, ExprDesc *lval)
/* Put the result of an expression into the primary register */
{
int f;
* The function returns the size of the parameters pushed.
*/
{
- struct expent lval;
+ ExprDesc lval;
/* Initialize variables */
SymEntry* Param = 0; /* Keep gcc silent */
-static void CallFunction (struct expent* lval)
+static void CallFunction (ExprDesc* lval)
/* Perform a function call. Called from hie11, this routine will
* either call the named function, or the function pointer in a/x.
*/
-static int primary (struct expent* lval)
+static int primary (ExprDesc* lval)
/* This is the lowest level of the expression parser. */
{
int k;
-static int arrayref (int k, struct expent* lval)
+static int arrayref (int k, ExprDesc* lval)
/* Handle an array reference */
{
unsigned lflags;
int ConstBaseAddr;
int ConstSubAddr;
int l;
- struct expent lval2;
+ ExprDesc lval2;
CodeMark Mark1;
CodeMark Mark2;
type* tptr1;
-static int structref (int k, struct expent* lval)
+static int structref (int k, ExprDesc* lval)
/* Process struct field after . or ->. */
{
ident Ident;
-static int hie11 (struct expent *lval)
+static int hie11 (ExprDesc *lval)
/* Handle compound types (structs and arrays) */
{
int k;
-static void store (struct expent* lval)
+static void store (ExprDesc* lval)
/* Store primary reg into this reference */
{
int f;
-static void pre_incdec (struct expent* lval, void (*inc) (unsigned, unsigned long))
+static void pre_incdec (ExprDesc* lval, void (*inc) (unsigned, unsigned long))
/* Handle --i and ++i */
{
int k;
-static void post_incdec (struct expent *lval, int k, void (*inc) (unsigned, unsigned long))
+static void post_incdec (ExprDesc *lval, int k, void (*inc) (unsigned, unsigned long))
/* Handle i-- and i++ */
{
unsigned flags;
-static void unaryop (int tok, struct expent* lval)
+static void unaryop (int tok, ExprDesc* lval)
/* Handle unary -/+ and ~ */
{
int k;
-static int typecast (struct expent* lval)
+static int typecast (ExprDesc* lval)
/* Handle an explicit cast */
{
int k;
-static int hie10 (struct expent* lval)
+static int hie10 (ExprDesc* lval)
/* Handle ++, --, !, unary - etc. */
{
int k;
static int hie_internal (GenDesc** ops, /* List of generators */
- struct expent* lval, /* parent expr's lval */
- int (*hienext) (struct expent*),
+ ExprDesc* lval, /* parent expr's lval */
+ int (*hienext) (ExprDesc*),
int* UsedGen) /* next higher level */
/* Helper function */
{
int k;
- struct expent lval2;
+ ExprDesc lval2;
CodeMark Mark1;
CodeMark Mark2;
GenDesc* Gen;
static int hie_compare (GenDesc** ops, /* List of generators */
- struct expent* lval, /* parent expr's lval */
- int (*hienext) (struct expent*))
+ ExprDesc* lval, /* parent expr's lval */
+ int (*hienext) (ExprDesc*))
/* Helper function for the compare operators */
{
int k;
- struct expent lval2;
+ ExprDesc lval2;
CodeMark Mark1;
CodeMark Mark2;
GenDesc* Gen;
-static int hie9 (struct expent *lval)
+static int hie9 (ExprDesc *lval)
/* Process * and / operators. */
{
static GenDesc* hie9_ops [] = {
-static void parseadd (int k, struct expent* lval)
+static void parseadd (int k, ExprDesc* lval)
/* Parse an expression with the binary plus operator. lval contains the
* unprocessed left hand side of the expression and will contain the
* result of the expression on return.
*/
{
- struct expent lval2;
+ ExprDesc lval2;
unsigned flags; /* Operation flags */
CodeMark Mark; /* Remember code position */
type* lhst; /* Type of left hand side */
-static void parsesub (int k, struct expent* lval)
+static void parsesub (int k, ExprDesc* lval)
/* Parse an expression with the binary minus operator. lval contains the
* unprocessed left hand side of the expression and will contain the
* result of the expression on return.
*/
{
- struct expent lval2;
+ ExprDesc lval2;
unsigned flags; /* Operation flags */
type* lhst; /* Type of left hand side */
type* rhst; /* Type of right hand side */
-static int hie8 (struct expent* lval)
+static int hie8 (ExprDesc* lval)
/* Process + and - binary operators. */
{
int k = hie9 (lval);
-static int hie7 (struct expent *lval)
+static int hie7 (ExprDesc *lval)
/* Parse << and >>. */
{
static GenDesc* hie7_ops [] = {
-static int hie6 (struct expent *lval)
+static int hie6 (ExprDesc *lval)
/* process greater-than type comparators */
{
static GenDesc* hie6_ops [] = {
-static int hie5 (struct expent *lval)
+static int hie5 (ExprDesc *lval)
{
static GenDesc* hie5_ops[] = {
&GenEQ, &GenNE, 0
-static int hie4 (struct expent* lval)
+static int hie4 (ExprDesc* lval)
/* Handle & (bitwise and) */
{
static GenDesc* hie4_ops [] = {
-static int hie3 (struct expent *lval)
+static int hie3 (ExprDesc *lval)
/* Handle ^ (bitwise exclusive or) */
{
static GenDesc* hie3_ops [] = {
-static int hie2 (struct expent *lval)
+static int hie2 (ExprDesc *lval)
/* Handle | (bitwise or) */
{
static GenDesc* hie2_ops [] = {
-static int hieAnd (struct expent* lval, unsigned TrueLab, int* BoolOp)
+static int hieAnd (ExprDesc* lval, unsigned TrueLab, int* BoolOp)
/* Process "exp && exp" */
{
int k;
int lab;
- struct expent lval2;
+ ExprDesc lval2;
k = hie2 (lval);
if (CurTok.Tok == TOK_BOOL_AND) {
-static int hieOr (struct expent *lval)
+static int hieOr (ExprDesc *lval)
/* Process "exp || exp". */
{
int k;
- struct expent lval2;
+ ExprDesc lval2;
int BoolOp = 0; /* Did we have a boolean op? */
int AndOp; /* Did we have a && operation? */
unsigned TrueLab; /* Jump to this label if true */
-static int hieQuest (struct expent *lval)
+static int hieQuest (ExprDesc *lval)
/* Parse "lvalue ? exp : exp" */
{
int k;
int labf;
int labt;
- struct expent lval2; /* Expression 2 */
- struct expent lval3; /* Expression 3 */
+ ExprDesc lval2; /* Expression 2 */
+ ExprDesc lval3; /* Expression 3 */
type* type2; /* Type of expression 2 */
type* type3; /* Type of expression 3 */
type* rtype; /* Type of result */
-static void opeq (GenDesc* Gen, struct expent *lval, int k)
+static void opeq (GenDesc* Gen, ExprDesc *lval, int k)
/* Process "op=" operators. */
{
- struct expent lval2;
+ ExprDesc lval2;
unsigned flags;
CodeMark Mark;
int MustScale;
-static void addsubeq (GenDesc* Gen, struct expent *lval, int k)
+static void addsubeq (GenDesc* Gen, ExprDesc *lval, int k)
/* Process the += and -= operators */
{
- struct expent lval2;
+ ExprDesc lval2;
unsigned flags;
int MustScale;
-static void Assignment (struct expent* lval)
+static void Assignment (ExprDesc* lval)
/* Parse an assignment */
{
int k;
- struct expent lval2;
+ ExprDesc lval2;
unsigned flags;
type* ltype = lval->e_tptr;
-int hie1 (struct expent* lval)
+int hie1 (ExprDesc* lval)
/* Parse first level of expression hierarchy. */
{
int k;
-int hie0 (struct expent *lval)
+int hie0 (ExprDesc *lval)
/* Parse comma operator. */
{
int k;
-int evalexpr (unsigned flags, int (*f) (struct expent*), struct expent* lval)
+int evalexpr (unsigned flags, int (*f) (ExprDesc*), ExprDesc* lval)
/* Will evaluate an expression via the given function. If the result is a
* constant, 0 is returned and the value is put in the lval struct. If the
* result is not constant, exprhs is called to bring the value into the
-int expr (int (*func) (struct expent*), struct expent *lval)
+int expr (int (*func) (ExprDesc*), ExprDesc *lval)
/* Expression parser; func is either hie0 or hie1. */
{
int k;
-void expression1 (struct expent* lval)
+void expression1 (ExprDesc* lval)
/* Evaluate an expression on level 1 (no comma operator) and put it into
* the primary register
*/
-void expression (struct expent* lval)
+void expression (ExprDesc* lval)
/* Evaluate an expression and put it into the primary register */
{
memset (lval, 0, sizeof (*lval));
-void constexpr (struct expent* lval)
+void constexpr (ExprDesc* lval)
/* Get a constant value */
{
memset (lval, 0, sizeof (*lval));
-void intexpr (struct expent* lval)
+void intexpr (ExprDesc* lval)
/* Get an integer expression */
{
expression (lval);
-void boolexpr (struct expent* lval)
+void boolexpr (ExprDesc* lval)
/* Get a boolean expression */
{
/* Read an expression */
/* Generate code to perform test and jump if false. */
{
int k;
- struct expent lval;
+ ExprDesc lval;
/* Eat the parenthesis */
ConsumeLParen ();
#define E_FORCETEST 0x0002 /* if expr has NOT set CC, force a test */
/* Describe the result of an expression */
-struct expent {
+typedef struct ExprDesc ExprDesc;
+struct ExprDesc {
struct SymEntry* Sym; /* Symbol table entry if known */
type* e_tptr; /* Type array of expression */
long e_const; /* Value if expression constant */
* a string literal in parenthesis.
*/
-unsigned assignadjust (type* lhst, struct expent* rhs);
+unsigned assignadjust (type* lhst, ExprDesc* rhs);
/* Adjust the type of the right hand expression so that it can be assigned to
* the type on the left hand side. This function is used for assignment and
* for converting parameters in a function call. It returns the code generator
* flags for the operation.
*/
-void exprhs (unsigned flags, int k, struct expent *lval);
+void exprhs (unsigned flags, int k, ExprDesc *lval);
/* Put the result of an expression into the primary register */
-void expression1 (struct expent* lval);
+void expression1 (ExprDesc* lval);
/* Evaluate an expression on level 1 (no comma operator) and put it into
* the primary register
*/
-void expression (struct expent* lval);
+void expression (ExprDesc* lval);
/* Evaluate an expression and put it into the primary register */
-int evalexpr (unsigned flags, int (*f) (struct expent*), struct expent* lval);
+int evalexpr (unsigned flags, int (*f) (ExprDesc*), ExprDesc* lval);
/* Will evaluate an expression via the given function. If the result is a
* constant, 0 is returned and the value is put in the lval struct. If the
* result is not constant, exprhs is called to bring the value into the
* primary register and 1 is returned.
*/
-void constexpr (struct expent* lval);
+void constexpr (ExprDesc* lval);
/* Get a constant value */
-void intexpr (struct expent* lval);
+void intexpr (ExprDesc* lval);
/* Get an integer expression */
-void boolexpr (struct expent* lval);
+void boolexpr (ExprDesc* lval);
/* Get a boolean expression */
void test (unsigned label, int cond);
/* Generate code to perform test and jump if false. */
-int hie1 (struct expent* lval);
+int hie1 (ExprDesc* lval);
/* Parse first level of expression hierarchy. */
-int hie0 (struct expent* lval);
+int hie0 (ExprDesc* lval);
/* Parse comma operator (highest level of expression hierarchy) */
-void DefineData (struct expent* lval);
+void DefineData (ExprDesc* lval);
/* Output a data definition for the given expression */