[Mono-devel-list] Pascal compiler?
Jonathan Gilbert
2a5gjx302 at sneakemail.com
Mon Mar 14 00:01:56 EST 2005
At 07:21 PM 13/03/2005 -0800, Grant Hess wrote:
>Just a quick update.
>
>I've started putting together a quick .jay parser based on the Object
>Pascal ver6 spec. I've got the entire spec entered, but I don't have a
>good way to build a scanner yet. Also the .jay file is very sparse!
>Only one rule actually has any action associated with it, and that was
>required to make jay function.
>
>I'm still open to using recursive descent instead of a generated parser,
>if we decide to go that way, but I already had most of the grammar file
>created from an older (dead!) project.
>
>Is there a c# equivalent to (f)lex like jay is to yacc?
I have ported JFlex to C# and made it available as a sourceforge project:
http://sourceforge.net/projects/csflex/
There is one release there, and I have successfully used it in conjunction
with my other port of Java CUP (C# CUP, not currently on sourceforge but
downloadable at http://israel.........../cup_gui/) to make a parser for a
significant superset of the C# language.
I don't know how .jay compares to C# CUP, but I do know that C# CUP and C#
Flex interoperate seamlessly (as do Java CUP and JFlex on the Java side of
things). You shouldn't have any problems making it serve tokens to Jay with
a simple adapter or what have you, but if it is an issue, I can certainly
recommend C# CUP. It is a table-driven LALR(1) parser generator. Beware of
the backtracking option, though; I added it myself, and while it works
perfectly in some cases, in others it seems to end up with a completely
incorrect sequence of tokens. I have yet to figure out what the problem is.
The reason it is not a sourceforge project is that I have yet to hear back
from the project author. Maybe I'll just give up on that and make it
available as is my right anyway according to the license. :-)
Good luck with your project,
Jonathan Gilbert
More information about the Mono-devel-list
mailing list