Felipe Monteiro de Carvalho wrote:
On Tue, Aug 3, 2010 at 4:49 AM, Kevan Hashemi hashemi@brandeis.edu wrote:
I guarantee you that's the case for me. I read through Bison and I liked it very much, and I am thoroughly convinced of its merit by your ^C example. But my first look through the Bison manual page suggested that the output was a C program that we would then compile and link to, which means that at least part of our Pascal compiler would be written in C.
There a software very similar to Bison written in Pascal for Pascal Applications. It is called plex / pyacc and included in Free Pascal. Here is one project which uses it:
http://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/utils/h2pas/
And here I started documenting it in our wiki:
I've only briefly looked at it so far, but one important question I have is, does it support GLR or another larger class of languages than the traditional LALR(1)? Yacc doesn't, Bison does.
As I said, GPC requires more than LALR(1) already (and with the addition of new features, it can only get worse).
Of course, it being free software, if it doesn't, it could be extended -- which would raise the question whether it's easier to do this or to port the (existing and working) Bison GLR implementation to Pascal. (Given that the project pages talk about Turbo Pascal a lot, I have my doubts. Accuse me of Borland bashing, but from experience, when given random samples of C vs. TP code, I'd usually rather work on the former.)
Frank