Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Grammar file(Customize grammar file)
Grammar file [message #1736097] Sat, 25 June 2016 21:03 Go to next message
Pavel Vlasenko is currently offline Pavel VlasenkoFriend
Messages: 1
Registered: June 2016
Junior Member
Hi.
I want to add my own parse rules to the grammar file Java.g.
But i can't find documentation or tutorial about grammar in JDT.
Re: Grammar file [message #1736301 is a reply to message #1736097] Tue, 28 June 2016 10:27 Go to previous message
Stephan Herrmann is currently offline Stephan HerrmannFriend
Messages: 1853
Registered: July 2009
Senior Member
First, this file is written for use by jikespg [1][2]. I'm not aware of any user documentation for this parser generator, but an eclipse plugin exists [3], that should assist you in editing a .g file.

After editing java.g you'd need to follow this HowTo[4] to re-generate the parser infra structure, into which you'd implement additional consumeXYZ() methods.
The HowTo is a bit more involved than needed, if you are on Linux, you may adapt and use a shell script from the Object Teams project to automate these steps [5] (beware that comments in that script are in German ...).

HTH,
Stephan

[1] http://jikes.sourceforge.net/
[2] https://sourceforge.net/projects/jikes/files/Jikes%20Parser%20Generator/1.3/
[3] https://sourceforge.net/projects/jgedit/
[4] https://eclipse.org/jdt/core/howto/generate%20parser/generateParser.html
[5] http://git.eclipse.org/c/objectteams/org.eclipse.objectteams.git/tree/org.eclipse.jdt.core/scripts/generateOTParser.sh
Previous Topic:get org.eclipse.jdt.core.ICompilationUnit without IJavaProject
Next Topic:AST-View SourceCode Download-Link
Goto Forum:
  


Current Time: Fri Apr 26 16:48:28 GMT 2024

Powered by FUDForum. Page generated in 0.03159 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top