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

Add an accessLevel parser option. #2126

Merged
merged 1 commit into from Nov 29, 2017

Conversation

ewanmellor
Copy link
Contributor

Add an accessLevel parser option. Use this to specify the access level
(public, etc) used on the classes and protocols in the generated
parser / lexer / listeners. This required adding the option to
tool.Grammar.parserOptions so that it was known as a valid option, and
to codegen.model.{Recognizer,ListenerFile,VisitorFile} so that it was
available to the template in all the necessary contexts.

The Swift template has been extended to recognize this option, and generate
classes and members using "open", "public" or "internal" as appropriate.

This is only fully implemented for Swift. The option is generic, but
the language-specific templates will need to be updated for any language
that would like similar support.

Closes #1597.

Add an accessLevel parser option.  Use this to specify the access level
(public, etc) used on the classes and protocols in the generated
parser / lexer / listeners.  This required adding the option to
tool.Grammar.parserOptions so that it was known as a valid option, and
to codegen.model.{Recognizer,ListenerFile,VisitorFile} so that it was
available to the template in all the necessary contexts.

The Swift template has been extended to recognize this option, and generate
classes and members using "open", "public" or "internal" as appropriate.

This is only fully implemented for Swift.  The option is generic, but
the language-specific templates will need to be updated for any language
that would like similar support.

Closes antlr#1597.
@parrt parrt added the actions label Nov 29, 2017
@parrt parrt added this to the 4.7.1 milestone Nov 29, 2017
@parrt parrt merged commit e8dd805 into antlr:master Nov 29, 2017
@ewanmellor ewanmellor deleted the generator-access-levels branch November 30, 2017 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants