Searching for answers . . . no answers found.

Sunday, January 11, 2009

Bootstrapping

Proving to be harder than I thought to finally kick the MSc work into gear. It's been an atypical week with D. falling ill and then recovering, but then the weekend got in the way and we've just done a huge bunch of nothing. And let's not even talk about Hawkeye. Zé surely has a lot of on his plate with a new baby and all, but I should have been more active on that front as well.

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:

Followers

About Me

My photo
Always an ace on the river.