Skip to content

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.

2 participants