@Sam, what is the name of the Visual Studio extension you are talking about?
I tried to search for anything with ANTLR in it and it couldn't find
anything.

On Thu, Mar 24, 2011 at 8:50 AM, Sam Harwell <sharw...@pixelminegames.com>wrote:

> Hi Ranco,
>
> As mentioned in the CSharp3 documentation, you need to use both
> @lexer::namespace{...} and @parser::namespace{...} in a composite grammar.
> If you use the templates included in my Visual Studio extension, then these
> are automatically inserted for you (including using the correct namespace
> based on the location in the project where you placed them).
>
> I'll check into the namespace issue when it comes to imported grammars. The
> expected functionality is this should work once you have
> @lexer::namespace{...} and @parser::namespace{...} in the composite grammar
> , plus @namespace{...} in each of P and L.
>
> Thanks,
> Sam
>
> -----Original Message-----
> From: antlr-interest-boun...@antlr.org
> [mailto:antlr-interest-boun...@antlr.org] On Behalf Of Ranco Marcus
> Sent: Thursday, March 24, 2011 5:55 AM
> To: antlr-interest@antlr.org
> Subject: [antlr-interest] [CSharp3] @namespace and composite grammars
>
> To maximize reuse of our grammars we generally create separate lexer and
> parser grammars which are target agnostic (i.e. contain no target specific
> code). We then combine them into a composite grammar in which the target
> language and other implementation specific details are specified
> (header,members,namespace,etc.). This way, grammars can be used for
> multiple
> targets and we have maximum freedom to combine multiple lexers/parsers into
> larger ones.
>
> If a composite grammar C imports a parser grammar P and a lexer grammar L,
> the tool generates CParser, CLexer, C_P and C_L.
>
> Adding @namespace { <X> } to the composite grammar should IMHO put all four
> recognizers in namespace <X>. Currently, at least with the CSharp3 target,
> only CParser is put into the specified namespace.
>
> Specifying @lexer::namespace { <X> } to the composite grammar causes only
> the outermost lexer CLexer to be added to the specified namespace, not the
> imported lexer C_L. The same holds for @parser::namespace.
>
> Btw, if I'm not mistaken, there's no way to put recognizers in packages
> with
> the Java target. Is that correct?
>
> Best regards,
>
> Ranco Marcus
> Epirion Knowledge Solutions B.V.
>
>
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe:
> http://www.antlr.org/mailman/options/antlr-interest/your-email-address
>
>
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe:
> http://www.antlr.org/mailman/options/antlr-interest/your-email-address
>

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

-- 
You received this message because you are subscribed to the Google Groups 
"il-antlr-interest" group.
To post to this group, send email to il-antlr-inter...@googlegroups.com.
To unsubscribe from this group, send email to 
il-antlr-interest+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en.

Reply via email to