TokenStream* new_token_stream(tokens, values)

- create a new token-stream Tokens *tokens; int *values;

void delete_token_stream(tt)

- delete a token-stream TokenStream *tt;

This module implements input from a token array. A new token-stream is created by new_token_stream(). The first argument tokens contains the actual tokens. It is ended with 0. The argument values holds the values corresponding to the tokens. For example, with a token TOK_DIGIT belongs a value of '0', '1', ..., '9'. If values equals 0, then the values will be ignored.

void token_stream(tt)

- make tt the current token-stream P_TokenStream tt;

int token_current_ch()

- return the current token

int token_current_ch_value()

- return the value of the current token

int token_next_ch()

- return the next token

void token_pushback_ch(l)

- push back l tokens int l;

The current token stream is set by token_stream(). All other functions act on the current token-stream.

token_in.c token_in.h