515 |
return TRUE; |
return TRUE; |
516 |
} |
} |
517 |
|
|
518 |
/* When a BUILTIN token is seen, next_token () uses init_builtin_token |
/* When a BUILTIN token is seen, m4__next_token () uses init_builtin_token |
519 |
to retrieve the value of the function pointer. */ |
to retrieve the value of the function pointer. */ |
520 |
static void |
static void |
521 |
init_builtin_token (m4 *context, m4_symbol_value *token) |
init_builtin_token (m4 *context, m4_symbol_value *token) |
718 |
is a potential macro name; and M4_TOKEN_SIMPLE for any single character |
is a potential macro name; and M4_TOKEN_SIMPLE for any single character |
719 |
that is not a part of any of the previous types. |
that is not a part of any of the previous types. |
720 |
|
|
721 |
M4_next_token () returns the token type, and passes back a pointer to the |
M4__next_token () returns the token type, and passes back a pointer to |
722 |
token data through VALUE. The token text is collected on the obstack |
the token data through VALUE. The token text is collected on the obstack |
723 |
token_stack, which never contains more than one token text at a time. |
token_stack, which never contains more than one token text at a time. |
724 |
The storage pointed to by the fields in VALUE is therefore subject to |
The storage pointed to by the fields in VALUE is therefore subject to |
725 |
change the next time next_token () is called. */ |
change the next time m4__next_token () is called. */ |
726 |
m4__token_type |
m4__token_type |
727 |
m4__next_token (m4 *context, m4_symbol_value *token) |
m4__next_token (m4 *context, m4_symbol_value *token) |
728 |
{ |
{ |
890 |
{ |
{ |
891 |
obstack_1grow (&token_stack, ch); |
obstack_1grow (&token_stack, ch); |
892 |
|
|
893 |
if (M4_IS_OTHER (M4SYNTAX, ch) || M4_IS_NUM (M4SYNTAX, ch)) |
if (M4_IS_OTHER (M4SYNTAX, ch) || M4__IS_STRING (M4SYNTAX, ch)) |
894 |
{ |
{ |
895 |
while ((ch = next_char(context)) != CHAR_EOF |
while ((ch = next_char(context)) != CHAR_EOF |
896 |
&& (M4_IS_OTHER (M4SYNTAX, ch) || M4_IS_NUM (M4SYNTAX, ch))) |
&& (M4_IS_OTHER (M4SYNTAX, ch) |
897 |
obstack_1grow (&token_stack, ch); |
|| M4__IS_STRING (M4SYNTAX, ch))) |
898 |
|
{ |
899 |
|
obstack_1grow (&token_stack, ch); |
900 |
|
} |
901 |
|
|
902 |
if (ch != CHAR_EOF) |
if (ch != CHAR_EOF) |
903 |
unget_input(ch); |
unget_input(ch); |
921 |
else |
else |
922 |
type = M4_TOKEN_SIMPLE; |
type = M4_TOKEN_SIMPLE; |
923 |
} |
} |
924 |
else /* EVERYTHING ELSE */ |
else /* EVERYTHING ELSE AGAIN?! */ |
925 |
{ |
{ |
926 |
obstack_1grow (&token_stack, ch); |
obstack_1grow (&token_stack, ch); |
927 |
|
|
928 |
if (M4_IS_OTHER (M4SYNTAX, ch) || M4_IS_NUM (M4SYNTAX, ch)) |
if (M4_IS_OTHER (M4SYNTAX, ch) || M4__IS_STRING (M4SYNTAX, ch)) |
929 |
type = M4_TOKEN_STRING; |
type = M4_TOKEN_STRING; |
930 |
else if (M4_IS_SPACE (M4SYNTAX, ch)) |
else if (M4_IS_SPACE (M4SYNTAX, ch)) |
931 |
type = M4_TOKEN_SPACE; |
type = M4_TOKEN_SPACE; |