BTW, I'm afraid this blog will turn quite technical for a while now...
Anyway, first steps for the masters work is writing a scanner/parser pair using Flex and Bison. This should parse a subset of Prolog used in GNU/Prolog to represent WAM instructions. It looks something like this:
predicate('$$find_existing_stream/3_$aux1'/3,41,static,private,built_in,[
load_cut_level(3),
try_me_else(1),
allocate(4),
get_variable(y(0),0),
get_variable(y(1),1),
get_variable(y(2),2),
get_variable(y(3),3),
put_value(y(0),0),
call(current_stream/1),
put_value(y(0),0),
put_structure(file_name/1,1),
unify_local_value(y(1)),
call(stream_property/2),
put_value(y(0),0),
put_value(y(2),1),
call(stream_property/2),
cut(y(3)),
deallocate,
proceed,
Beautiful, ain't it? If I have something working by Tuesday, I'd be a happy man.
No comments:
Post a Comment