Hi Ter,

I've seen the Jira issue. It doesn't describe what I've found. My
grammar is OK with ANTLR-3.1.1 and it breaks with ANTLR-3.1.2. Sorry
if I was unclear the first time.

This should be reproduceable with following grammar Bug.g:

<<<<<<<<<<

grammar Bug ;

options { output = AST ; }

tokens {
  PART ;
}

part
  : (   p += levelIntroducer
      | p += cellRowSequence
    )
    EOF
    -> ^( PART $p+ )
  ;

levelIntroducer : 'L' ;
cellRowSequence : 'C' ;

>>>>>>>>>>

I try to start the debugger from ANTLRWorks-1.2.3. As it compiles the
Java code I get this:

[06:39:46] Checking Grammar...
[06:39:57] /Users/Laurent/Novelang/antlrworks/BugParser.java:142:
incompatible types
[06:39:57] found   : BugParser.levelIntroducer_return
[06:39:57] required: BugParser.cellRowSequence_return
[06:39:57]                     p=levelIntroducer();
[06:39:57]                                      ^
[06:39:57] Note: /Users/Laurent/Novelang/antlrworks/BugParser.java
uses unchecked or unsafe operations.
[06:39:57] Note: Recompile with -Xlint:unchecked for details.
[06:39:57] 1 error
[06:40:45] /Users/Laurent/Novelang/antlrworks/BugParser.java:142:
incompatible types
[06:40:45] found   : BugParser.levelIntroducer_return
[06:40:45] required: BugParser.cellRowSequence_return
[06:40:45]                     p=levelIntroducer();
[06:40:45]                                      ^
[06:40:45] Note: /Users/Laurent/Novelang/antlrworks/BugParser.java
uses unchecked or unsafe operations.
[06:40:45] Note: Recompile with -Xlint:unchecked for details.
[06:40:45] 1 error

I had a look at the Java code generated by ANTLR-3.1.1 where p seems
declared as RuleReturnScope. With ANTLR-3.1.2, p has the type of the
last rule (BugParser.cellRowSequence_return).


Thanks for all the hard work,

c.


On Sat, Feb 28, 2009 at 5:58 PM, Terence Parr <[email protected]> wrote:
> hi. should work if output=AST (I added a comment to existing request to be
> sure):
>
> http://www.antlr.org/jira/browse/ANTLR-381
>
> if not output=AST, it doesn't know what to put in list.  the internal return
> object? one of the return values?
>
> Ter
> On Feb 27, 2009, at 4:07 PM, Laurent Caillette wrote:
>
>>  (   p += levelIntroducer
>>     | p += paragraph
>>     | p += blockQuote
>>     | p += literal
>>     | p += bigDashedListItem
>>     | p += cellRowSequence
>>   )
>
>

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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/il-antlr-interest?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to