[antlr-interest] Parsing Snippets of Code

Edwards, Waverly Waverly.Edwards at genesys.com
Thu Jul 24 07:05:36 PDT 2008


Let me start by saying, I don't know but...

I would think the surrounding information is needed in order to make a parse.
You would have to make assumptions based on context of the identifiers.  Basically, you would end
up with a best guess but not necessarily a verifiable parse.

I've desired to write a tool to translate snippets from one language to another.  It requires an
intimate knowledge of the source language and the tendencies of use.  If something like this does
exist using ANTLR I'd like to study it.  I've always found this type of tool fascinating.


W.
-----Original Message-----
From: antlr-interest-bounces at antlr.org [mailto:antlr-interest-bounces at antlr.org] On Behalf Of Dominik Raymann
Sent: Thursday, July 24, 2008 8:29 AM
To: antlr-interest at antlr.org
Subject: [antlr-interest] Parsing Snippets of Code

Hi there,

it is possible to parse Snippets of Code for a known languagewith ANTLR? In the FAQ example (http://www.antlr.org/wiki/pages/viewpage.action?pageId=789) for example what would I have to do to actually parse the given input (that represents a Java method), if I don't know whether it is a method, a method body, a class, a variable declaration or what else. Is this possible with ANTLR?

Cheers,

raymi
--
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! 
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer


More information about the antlr-interest mailing list