75 |
Since they are functions the caller does not need access to the |
Since they are functions the caller does not need access to the |
76 |
internal data structure, so they are safe to export for use in |
internal data structure, so they are safe to export for use in |
77 |
external modules. */ |
external modules. */ |
78 |
m4__token_type |
m4_symbol_type |
79 |
m4_token_get_type (m4_token *name) |
m4_get_symbol_value_type (m4_symbol_value *name) |
80 |
{ |
{ |
81 |
return TOKEN_TYPE (name); |
return VALUE_TYPE (name); |
82 |
} |
} |
83 |
|
|
84 |
char * |
char * |
85 |
m4_token_text (m4_token *name) |
m4_get_symbol_value_text (m4_symbol_value *name) |
86 |
{ |
{ |
87 |
return TOKEN_TEXT (name); |
return VALUE_TEXT (name); |
88 |
} |
} |
89 |
|
|
90 |
m4_builtin_func * |
m4_builtin_func * |
91 |
m4_token_func (m4_token *name) |
m4_get_symbol_value_func (m4_symbol_value *name) |
92 |
{ |
{ |
93 |
return TOKEN_FUNC (name); |
return VALUE_FUNC (name); |
94 |
} |
} |
95 |
|
|
96 |
|
|
101 |
applicable, MAX is the maximum number, negative if not applicable. |
applicable, MAX is the maximum number, negative if not applicable. |
102 |
ARGC, MIN, and MAX count ARGV[0], the name of the macro. */ |
ARGC, MIN, and MAX count ARGV[0], the name of the macro. */ |
103 |
boolean |
boolean |
104 |
m4_bad_argc (int argc, m4_token **argv, int min, int max) |
m4_bad_argc (int argc, m4_symbol_value **argv, int min, int max) |
105 |
{ |
{ |
106 |
if (min > 0 && argc < min) |
if (min > 0 && argc < min) |
107 |
{ |
{ |
135 |
VALUEP. If the conversion fails, print error message for macro. |
VALUEP. If the conversion fails, print error message for macro. |
136 |
Return TRUE iff conversion succeeds. */ |
Return TRUE iff conversion succeeds. */ |
137 |
boolean |
boolean |
138 |
m4_numeric_arg (int argc, m4_token **argv, int arg, int *valuep) |
m4_numeric_arg (int argc, m4_symbol_value **argv, int arg, int *valuep) |
139 |
{ |
{ |
140 |
char *endp; |
char *endp; |
141 |
|
|
155 |
/* Print ARGC arguments from the table ARGV to obstack OBS, separated by |
/* Print ARGC arguments from the table ARGV to obstack OBS, separated by |
156 |
SEP, and quoted by the current quotes, if QUOTED is TRUE. */ |
SEP, and quoted by the current quotes, if QUOTED is TRUE. */ |
157 |
void |
void |
158 |
m4_dump_args (struct obstack *obs, int argc, m4_token **argv, |
m4_dump_args (struct obstack *obs, int argc, m4_symbol_value **argv, |
159 |
const char *sep, boolean quoted) |
const char *sep, boolean quoted) |
160 |
{ |
{ |
161 |
int i; |
int i; |
224 |
int |
int |
225 |
m4_dump_symbol (const void *name, void *symbol, void *data) |
m4_dump_symbol (const void *name, void *symbol, void *data) |
226 |
{ |
{ |
227 |
if (SYMBOL_TYPE ((m4_symbol *) symbol) != M4_TOKEN_VOID) |
if (SYMBOL_TYPE ((m4_symbol *) symbol) != M4_SYMBOL_VOID) |
228 |
{ |
{ |
229 |
struct m4_dump_symbol_data *symbol_data |
struct m4_dump_symbol_data *symbol_data |
230 |
= (struct m4_dump_symbol_data *) data; |
= (struct m4_dump_symbol_data *) data; |
241 |
symbols, otherwise, only the specified symbols. */ |
symbols, otherwise, only the specified symbols. */ |
242 |
void |
void |
243 |
m4_dump_symbols (m4 *context, struct m4_dump_symbol_data *data, int argc, |
m4_dump_symbols (m4 *context, struct m4_dump_symbol_data *data, int argc, |
244 |
m4_token **argv, boolean complain) |
m4_symbol_value **argv, boolean complain) |
245 |
{ |
{ |
246 |
data->base = (const char **) obstack_base (data->obs); |
data->base = (const char **) obstack_base (data->obs); |
247 |
data->size = 0; |
data->size = 0; |
258 |
for (i = 1; i < argc; i++) |
for (i = 1; i < argc; i++) |
259 |
{ |
{ |
260 |
symbol = m4_symbol_lookup (M4SYMTAB, M4ARG (i)); |
symbol = m4_symbol_lookup (M4SYMTAB, M4ARG (i)); |
261 |
if (symbol != NULL && SYMBOL_TYPE (symbol) != M4_TOKEN_VOID) |
if (symbol != NULL && SYMBOL_TYPE (symbol) != M4_SYMBOL_VOID) |
262 |
m4_dump_symbol (M4ARG (i), symbol, data); |
m4_dump_symbol (M4ARG (i), symbol, data); |
263 |
else if (complain) |
else if (complain) |
264 |
M4WARN ((warning_status, 0, |
M4WARN ((warning_status, 0, |