Version française
Home     About     Download     Resources     Contact us    
Browse thread
Testimonial: a tribute to Ocaml
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: skaller <skaller@u...>
Subject: Testimonial: a tribute to Ocaml
In a previous posting, I said thanks to those people who
helped me integrate an RD parser with Ocamlyacc LALR1 parser.
Thanks again! It allowed me to use the existing LALR1 parser engine,
and allow dynamic extensions to the grammar like this:

--------------------------
#keyword whenever
#statement repeat statements whenever expr ;

repeat 
  f x; g k; 
whenever 1>0;
--------------------------

This system was pretty lame, since it didn't allow recursion
or alternatives -- but it was proof-of-principle, and established
the mechanism for providing the linkage from the lexer to the parser.

I am VERY pleased that with almost no effort, I have now been
able to introduce both alternatives and arbitrary nonterminal
symbols, the latter supporting recursion:

-------------------------
#nonterminal idlist ident
#nonterminal idlist ident , idlist
#statement assign idlist = expr ;
assign a,b,c = (1,2,3);
-------------------------

This involved some refactoring.

However the point is .. after I got rid of the 
syntax and type errors so it compiled ..

IT WORKED FIRST TIME. So a big thanks to the Ocaml
team and contributors for a fine product!

-- 
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net