1.7 struct argument

An argument has the following structure:
 
struct argument {
        int arg_type;
        union {
                char *string;
                struct expression *exp;
        } u;
        struct argument *next;
};

arg_type

This member specifies the type of the argument. Table 1.7 shows its values.
u
This member represents for one specific type of argument. It can be a string, or an expression. Therefore, it is a union of two pointers, one to a string, and the other to an expression structure (see section1.4). Which pointer is active depends on the value of arg_type. Table 1.7 shows the rule.
next
This member is a pointer to the next argument in the list.

Table 1.7 Argument Types

Name
Value
Active Member in Union
Argument Data Structure
STRING
0
u.string
a string
EXP
1
u.exp
an expression structure

table of content