On Tue, 26 Jan 2010, Graeme Geldenhuys wrote:
Hi, Speaking of language syntax in another thread it got me thinking. Being around FPC for a few years now I have read many messages and saw patches regarding language extensions etc... Then today by pure accident while searching for Modula-2 if..then..end syntax I came across this page: http://www.scifac.ru.ac.za/coco/ Coco/R ( a compiler generator). A language syntax is described in a rather simple manner. You then feed this information into a program and it generates a parser and scanner. The above URL mentions versions available for Modula-2, Pascal, Delphi and many more... Students from the Rhodes University used Coco/R to create a new teaching language based on Modula-2. They called in Umbriel, and used Coco/R. http://scifac.ru.ac.za/cspt/sigplan.htm I gather FPC doesn't use something like this? If so, any specific reason why not? It seems like a very easy way to extend the language though. Simply describe the syntax and another program generates the code.
Mainly because it's very inefficient, has little useful error reporting and requires yet another tool. Also, when the compiler was created, Coco/R didn't exist yet. and I'm sure Florian can think of some more arguments :-) Michael. _______________________________________________ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel