Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to generate abstract classes #36

Closed
sharwell opened this issue Mar 1, 2012 · 2 comments
Closed

Option to generate abstract classes #36

sharwell opened this issue Mar 1, 2012 · 2 comments

Comments

@sharwell
Copy link
Member

sharwell commented Mar 1, 2012

For lexers and parsers which have an inherent requirement to implement some features in a derived class, it would be convenient to be able to generate the lexer/parser classes as abstract. This would also allow abstract methods instead of stubs which throw UnsupportedOperationException to be placed in the @members{} blocks.

In addition, it would be especially useful if it prepended Abstract to the name of the class generated for an abstract parser grammar FooParser:

  • AbstractFooParser
  • FooParserParseListener / FooParserListener / FooParserVisitor
  • FooParserBaseParseListener / FooParserBaseListener / FooParserBaseVisitor
@parrt
Copy link
Member

parrt commented Mar 4, 2012

yeah, we need cmd-line options like -package, -superclass, -abstract-parser

@sharwell
Copy link
Member Author

sharwell commented Mar 8, 2012

Two other issues cover the -package and -superclass options.

sharwell added a commit to sharwell/antlr4 that referenced this issue Mar 26, 2012
…tion and "-abstract" command line option. Resolves antlr#36.
parrt pushed a commit that referenced this issue Jun 30, 2015
parrt added a commit that referenced this issue Jul 5, 2015
sharwell added a commit to sharwell/antlr4 that referenced this issue Dec 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants