[antlr-interest] Scopes in lexers don't work

Terence Parr parrt at cs.usfca.edu
Tue Jul 24 08:45:37 PDT 2007


Guys, just a warning, I never really intended scopes to work in the  
lexer, though thanks to the nature of antlr's codegen, it worked with  
a tiny tweak.

Later, we might do scannerless parsing so we might want scopes in  
lexer.  For now, assume it's unsupported "feature".  Other targets  
are not required to support.

Ter

On Jul 24, 2007, at 8:36 AM, Thomas Brandon wrote:

> On 7/23/07, Kay Roepke <kroepke at classdump.org> wrote:
>> On Jul 22, 2007, at 4:32 PM, Kay Roepke wrote:
>>
>> > I'm sorry, you are right. There were two template invocations
>> > missing from
>> > lexerRule.
>> > When Ter is back, I'll talk to him and then submit. Should then be
>> > included
>> > in the next daily build/release.
>>
>> Just for reference: It's fixed in the depot. Until there's a build
>> available, you can use
>> the Java.stg from fisheye:
>> <http://fisheye2.cenqua.com/browse/antlr/src/org/antlr/codegen/
>> templates/Java/Java.stg?r=3930>
>>
> This fixes global scopes but dynamic scopes don't work as the scope
> object isn't declared. Adding
> "<ruleAttributeScope(scope=ruleDescriptor.ruleScope)>" to the start of
> the lexerRule template fixes this.
>
> Tom.
>> cheers,
>> -k
>> --
>> Kay Röpke
>> http://classdump.org/
>>
>>
>>
>>
>>



More information about the antlr-interest mailing list