Jump to content

Compiler/lexical analyzer: Difference between revisions

m
minor prolog fix
(Added Prolog)
m (minor prolog fix)
Line 6,137:
tokenize(In,[0|NewLines],1,1,Tokens),
check_for_exceptions(Tokens),
exclude(=token_name(space(_,_)), Tokens,RelTokens).
 
tokenize([],NewLines,Pos,LineNo,[end_of_input(LineNo,Offset)]) :-
Line 6,162:
position_offset([Line|_],Pos,Offset) :- Offset is Pos - Line.
token_name(Name,Tok) :- functor(Tok,Name,_).
 
% Get a list of all the newlines and their position in the data
% This is used to create accurate row/column numbers.
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.