Are the AntlrV4 g4 grammars current?

68 views
Skip to first unread message

Gerald Rosenberg

unread,
Jun 16, 2015, 3:06:17 AM6/16/15
to antlr-di...@googlegroups.com
Are the ANTLRv4Parser.g4 and ANTLRv4Lexer.g4 grammars in the grammars- v4 repository current?  Looks like they may not have been updated in the last year. 

If there is a more current version, could I bother you to update the public copies?  Or is there a dev branch somewhere that I can grab the current version from?

Thanks much!

Eric Vergnaud

unread,
Jun 16, 2015, 11:48:33 AM6/16/15
to antlr-di...@googlegroups.com
Hi,

what makes you think that they are not current?

Eric

Terence Parr

unread,
Jun 16, 2015, 12:01:13 PM6/16/15
to antlr-di...@googlegroups.com
hi Gerald,The most current version is in my intellij a plug-in repository. In fact it would be awesome to upgrade it to use lexical modes and so on because it’s more or less a copy of the version written with version 3. For example, the tokens within tokens{} sections are not treated differently than outside of that section. Everything is just an id etc… happy to help bring this into this century

Ter

--
You received this message because you are subscribed to the Google Groups "antlr-discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to antlr-discussi...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sam Harwell

unread,
Jun 16, 2015, 2:34:17 PM6/16/15
to antlr-di...@googlegroups.com

The one in ANTLRWorks 2 expands on the modes in the IntelliJ lexer to also support parsing semantic content within actions/arg actions.

https://github.com/tunnelvisionlabs/antlrworks2/blob/master/org-antlr-works-editor/src/org/antlr/works/editor/grammar/experimental/GrammarLexer.g4

 

Note that this lexer requires the use of a class containing an override of emit() and an implementation of handleBeginArgAction():

https://github.com/tunnelvisionlabs/antlrworks2/blob/master/org-antlr-works-editor/src/org/antlr/works/editor/grammar/experimental/GrammarLexer.java

 

Sam

Gerald Rosenberg

unread,
Jun 16, 2015, 6:38:08 PM6/16/15
to antlr-di...@googlegroups.com
@Eric - The existing grammar is a year old and the last commit message mentions making compatible with v4.3.

@Ter - Thanks.  I will review and update as appropriate - and send a pull request when done.

@Sam - Thanks, also.  I will review and merge in as appropriate.

Best,
Gerald

Gerald Rosenberg

unread,
Jun 19, 2015, 12:49:59 AM6/19/15
to antlr-di...@googlegroups.com
@Sam & Ter,


On Tuesday, June 16, 2015 at 11:34:17 AM UTC-7, Sam Harwell wrote:

The one in ANTLRWorks 2 expands on the modes in the IntelliJ lexer to also support parsing semantic content within actions/arg actions.


 
Do we really want to provide parse rules for the internal content of the Argument and Action blocks in the repo version of the Antlr v4 grammar (beyond tracking nested braces)?  What can we say with certainty about how they should be parsed -- all depends on the back-end language, right?

Terence Parr

unread,
Jun 19, 2015, 3:07:15 PM6/19/15
to antlr-di...@googlegroups.com
For the stuff inside arguments in actions I don’t think we want to parse that stuff, but inside options and tokens{} sections would be a good idea if it is convenient.
Ter
Reply all
Reply to author
Forward
0 new messages