[antlr-interest] [csharp2] - scope privacy

Sam Harwell sharwell at pixelminegames.com
Thu Oct 30 07:50:18 PDT 2008


IMO, ideally the following would apply:

* Parser rules and global scopes are private by default
* Parser rules and global scopes can be marked by the keywords 'public'
or 'protected', similar to how 'fragment' can sit on a lexer rule.
* Classes holding parser rule return values (when present) take on the
visibility of the parser rule
* Local scopes inherit the visibility of their parent rule by default,
but can also be marked with explicit visibility

Sam

-----Original Message-----
From: antlr-interest-bounces at antlr.org
[mailto:antlr-interest-bounces at antlr.org] On Behalf Of Johannes Luber
Sent: Thursday, October 30, 2008 7:57 AM
To: Heinrich du Toit
Cc: antlr-interest at antlr.org
Subject: Re: [antlr-interest] [csharp2] - scope privacy

Heinrich du Toit schrieb:
> Hi
> 
> In c# target..
> 
> The global scope class that's created is created protected inside the 
> parser class.
> 
> Can I somehow get the generator to declare this public.
> As I want the info inside the scope to be exported to an outside api
class.
> 
> It would be easier to simply export the scope class rather than having
a 
> whole lot of function calls for every bit of information.
> 
> Thanks in advance!
> Heinrich

Currently there is no way to do so beyond modifying the StringTemplate
files. Maybe Ter will add another option in a later version.

Johannes
> 
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe:
http://www.antlr.org/mailman/options/antlr-interest/your-email-addr
ess
> 


List: http://www.antlr.org/mailman/listinfo/antlr-interest
Unsubscribe:
http://www.antlr.org/mailman/options/antlr-interest/your-email-addr
ess



More information about the antlr-interest mailing list