:- module lexer.
:- use_module builtin, char, int, io, list, private_builtin, require, string, table_builtin.
:- type lexer.string_token_context == int.
:- type lexer.scanned_past_whitespace
	--->	scanned_past_whitespace 
	;	not_scanned_past_whitespace .
:- type lexer.get_token_action
	--->	action_whitespace 
	;	action_alpha_lower 
	;	action_alpha_upper_uscore 
	;	action_zero 
	;	action_nonzero_digit 
	;	action_special_token 
	;	action_dot 
	;	action_percent 
	;	action_quote 
	;	action_slash 
	;	action_hash 
	;	action_backquote 
	;	action_dollar 
	;	action_graphic_token .
:- pred lexer.get_token_list_2(io.input_stream, lexer.token, int, lexer.token_list, io.state, io.state).
:- mode lexer.get_token_list_2((builtin.in), (builtin.in), (builtin.in), (builtin.out), (builtin.di), (builtin.uo)) is det.
:- pred lexer.get_token(io.input_stream, lexer.token, int, io.state, io.state).
:- mode lexer.get_token((builtin.in), (builtin.out), (builtin.out), (builtin.di), (builtin.uo)) is det.
lexer.get_token_list(Tokens_4, STATE_VARIABLE_IO_0_9, STATE_VARIABLE_IO_10) :-
    io.input_stream(Stream_6, STATE_VARIABLE_IO_0_9, STATE_VARIABLE_IO_11_11),
    lexer.get_token(Stream_6, Token_7, Context_8, STATE_VARIABLE_IO_11_11, STATE_VARIABLE_IO_12_12),
    lexer.get_token_list_2(Stream_6, Token_7, Context_8, Tokens_4, STATE_VARIABLE_IO_12_12, STATE_VARIABLE_IO_10).
lexer.string_get_token_list(String_5, Tokens_6, STATE_VARIABLE_Posn_0_9, STATE_VARIABLE_Posn_10) :-
    string.length(String_5, Len_8),
    lexer.string_get_token_list_max(String_5, Len_8, Tokens_6, STATE_VARIABLE_Posn_0_9, STATE_VARIABLE_Posn_10).
:- pragma exceptions(predicate, (lexer.get_token_list), 3, 0, may_throw(user_exception)).
:- pragma exceptions(predicate, (lexer.string_get_token_list_max), 5, 0, may_throw(user_exception)).
:- pragma exceptions(predicate, (lexer.string_get_token_list), 4, 0, may_throw(user_exception)).
:- pragma exceptions(predicate, (lexer.token_to_string), 2, 0, may_throw(user_exception)).
:- pragma exceptions(predicate, (lexer.graphic_token_char), 1, 0, will_not_throw).
:- pragma exceptions(predicate, (lexer.get_token_list_2), 6, 0, may_throw(user_exception)).
:- pragma exceptions(predicate, (lexer.get_token), 5, 0, may_throw(user_exception)).
:- pragma termination_info(lexer.get_token_list((builtin.out), (builtin.di), (builtin.uo)), infinite, can_loop).
:- pragma termination_info(lexer.string_get_token_list_max((builtin.in), (builtin.in), (builtin.out), (builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(lexer.string_get_token_list((builtin.in), (builtin.out), (builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(lexer.token_to_string((builtin.in), (builtin.out)), infinite, can_loop).
:- pragma termination_info(lexer.graphic_token_char((builtin.in)), finite(0, [no]), cannot_loop).
:- pragma termination_info(lexer.get_token_list_2((builtin.in), (builtin.in), (builtin.in), (builtin.out), (builtin.di), (builtin.uo)), infinite, can_loop).
:- pragma termination_info(lexer.get_token((builtin.in), (builtin.out), (builtin.out), (builtin.di), (builtin.uo)), infinite, can_loop).
