Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / June 2006

Tip: Looking for answers? Try searching our database.

Runtime parser generator for Java?

Thread view: 
Aleksi Kallio - 16 Jun 2006 13:58 GMT
I need to do reliable input parsing of complex input strings, for
security purposes. Regexes are too weak for this. The easy way to do it
is to write context-free grammars and have a tool to validate input
against my grammar.

The issue is that I would like to keep my grammar flexible. All parser
generators for Java that I have found are, obviously, tools that
generate Java code. For me, loading grammar at runtime and creating
parser on fly to some appropriate memory structure would be the correct
solution. I do not want to generate a java-file, compile and load it.

Is there a tool that does the job? All I need is true/false if input
adheres to syntax. Informative error messages are a bonus.
Piotr Kobzda - 16 Jun 2006 16:05 GMT
pleksi Kallio wrote:

> I need to do reliable input parsing of complex input strings, for
> security purposes. Regexes are too weak for this. The easy way to do it
[quoted text clipped - 9 lines]
> Is there a tool that does the job? All I need is true/false if input
> adheres to syntax. Informative error messages are a bonus.

I don't know a parser generators which works the way you expect.
Nevertheless, using a JavaCompilerTool (from Java 6) you can generate
java-file, compile and load it -- all in memory. See example:
http://groups.google.com/group/pl.comp.lang.java/msg/d37010d1cce043d0

piotr


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.