[antlr-interest] Re: Translating PASCAL (or C) into JAVA
pietschoutteten
pietschoutteten at yahoo.com
Thu Feb 14 06:41:40 PST 2002
Thank you Robert.
I know that one can never translate some source for 100% and I am
aware of the problems you've mentioned, they are the problem. There
is always a part that have to be made by hand.
But my question is
how can I translate PASCAL into JAVA with ANTLR?
Thanks
Piet
--- In antlr-interest at y..., "Robert" <renyedi at y...> wrote:
> Hi
>
> It is possible to translate Pascal or C into Java, but not for the
whole
> language. There is a 80-90% part of the language that should be
translated
> relatively straightforward.
>
> However, when it comes about pointers and pointer related constructs
> problems arise (this is especially a problem in case of C). And
let's not
> forget about the source language's libraries for which you may not
have the
> source code and you should make an emulation. This is the hard part.
>
> Robert
>
> ----- Original Message -----
> From: "pietschoutteten" <pietschoutteten at y...>
> To: <antlr-interest at y...>
> Sent: Thursday, February 14, 2002 3:18 PM
> Subject: [antlr-interest] Translating PASCAL (or C) into JAVA
>
>
> > Hello all,
> >
> > I'm new to the mailing list and I'm 'playing' with ANTLR since a
few
> > days. The ideas behind ANTLR are magnificant and I find it a very
> > intelligent system, a real contribution to Computer Science.
> >
> > Now I have a simple question.
> >
> > I must find a system to translate Pascal files into JAVA. (can be
C
> > into JAVA aswell)
> > Can that be done with ANTLR?
> > Is there a quick solution to do that (perhaps starting from the
> > Pascal example?)
> >
> > I have testet the Pascal grammer (antlr-2.7.1
\java\examples\pascal)
> > and the GNU C parser from the website.
> >
> > ANTLR produces me the JAVA-files PascalLexer.java
PascalParser.java
> > and PascalTokenTypes.java
> > and I can build these together and test it with the example
P_0_1.pas
> > I also tested it with the grammer from Sinan (message 2398 Re:
Ter,
> > Would you mind looking at ....) which builds me an AST.
> >
> > My problem is that I want to translate this P_0_1.pas into JAVA
code!
> >
> > Is that possible?
> >
> > I also searched in the FAQ and the Messages list and read a lot of
> > discussions, but none of them goes into translating source-code
into
> > JAVA. And I searched in the ANTLR Reference Manual, which is
detailed
> > AND interesting, but I first have to know if my PASCAL to JAVA
> > translation is possible and how.
> > If so, I'm sure I will become a dedicated ANTLR-user.
> >
> > Thank you in advance to help this newcomer.
> > Piet Schoutteten
> >
> >
> >
> >
> >
> > Your use of Yahoo! Groups is subject to
http://docs.yahoo.com/info/terms/
> >
>
>
> _________________________________________________________
> Do You Yahoo!?
> Get your free @yahoo.com address at http://mail.yahoo.com
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
More information about the antlr-interest
mailing list