fork download
lex_by_file( FileName ) :-
	get_input_from_file( FileName, TokenList ),
	lex( TokenList, OutputList ),
	%write_output( OutputList ), !.
	maplist(writeln,OutputList),!.

%% atom_number(atom, number)
lex([],[]).
lex(['int' | T], ['TYPE: int' | R]) :-  lex(T, R).
lex(['bool' | T], ['TYPE: bool'] | R) :- lex(T, R).
lex([',' | T], ['COMMA: ,'] | R) :- lex(T, R).
lex([X | T], [X | R]) :- lex(T, R).
Success #stdin #stdout #stderr 0.02s 7000KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
ERROR: '$runtoplevel'/0: Undefined procedure: program/0
   Exception: (3) program ? EOF: exit