Re: antlr output with J#

George Neuner <>
4 Oct 2005 01:44:40 -0400

          From comp.compilers

Related articles
antlr output with J# (2005-10-02)
Re: antlr output with J# (George Neuner) (2005-10-04)
| List of all articles for this month |

From: George Neuner <>
Newsgroups: comp.compilers,
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, 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 or ask in

>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.


Post a followup to this message

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