Re: antlr output with J#

George Neuner <gneuner2@comcast.net>
4 Oct 2005 01:44:40 -0400

          From comp.compilers

Related articles
antlr output with J# theschof@cs.com (2005-10-02)
Re: antlr output with J# gneuner2@comcast.net (George Neuner) (2005-10-04)
| List of all articles for this month |
From: George Neuner <gneuner2@comcast.net>
Newsgroups: comp.compilers,comp.compilers.tools.pccts
Date: 4 Oct 2005 01:44:40 -0400
Organization: Compilers Central
References: 05-10-010
Keywords: PCCTS, Java
Posted-Date: 04 Oct 2005 01:44:40 EDT

On 2 Oct 2005 02:50:50 -0400, theschof@cs.com wrote:


>Does anyone know if it's possible to use antlr output with J#?
    :
>Basically the question boils
>down to would antlr ever generate code which used a java api library
>above 1.1 or language feature above jdk 1.1 (J# supports these with
>some exceptions which I can't imagine antlr output would ever use).


I don't know whether ANTLR Java code will run under J#. It would be
best to ask ANTLR's creator, Terence Parr. You can find his email
address at www.antlr.org or ask in comp.compilers.tools.pccts.




>Just using antlr's C# output wouldn't be ideal because this is for a
>library which may need to used in both a java environment and a .NET
>one and my thinking is that if I can stick to the subset of java 1.1 J#
>supports I can keep maximum flexibility.


One issue you may run into is with Java's method code size limitation.
Depending on the complexity of your grammar, the generator could
create some very long methods that just won't compile. It is very
_unlikely_, but it can happen.




Another possible solution, if you can stand it, would be to use PCCTS.
It is not as sophisticated, but it works the same way as ANTLR and
generates C code which could be called from either .NET or Java. The
primary drawback is that it does not also generate a lexer. It comes
with a separate lexer tool called DLG, or you can use (F)lex.


George


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.