Thanks,i explicitly created "annexextension.simpleCalc" and placed my
grammar file in that package,it worked. I thought ANTLR build creates a
package(if one doesn't exist) for the newly generated Lexer and Paser files
and puts them accordingly.



On Sat, Sep 19, 2009 at 1:03 AM, Indhu Bharathi <[email protected]>wrote:

> Check if you are creating the lexer/parser under the right directories.
> Look like the files are getting generated at root level in source tree.
>
>
>
> On Sep 19, 2009, at 9:28 AM, Sailesh Kandula <[email protected]> wrote:
>
>  While building my first ANTLR project SimpleCalc.g i ran into the error:
>>
>> The declared package "annexextension.SimpleCalc" does not  match expected
>> package "".
>>
>> SimpleCalc.g :
>>
>> header {
>>    package annexextension.SimpleCalc;
>> }
>> {
>>        import antlr.TokenStreamRecognitionException;
>> }
>>
>> class SimpleCalcParser extends Parser ;
>>
>>
>> expr    : term ( ( PLUS | MINUS )  term )* ;
>> term    : factor ( ( MULT | DIV ) factor )* ;
>> factor    : NUMBER ;
>>
>> class SimpleLexer extends Lexer;
>>
>> ...
>>
>>
>> If i remove the package declaration it builds(of course).  I read past
>> threads and FAQ but couldn't find any pointers. I'm using Eclipse 3.5.1 with
>> org.antlr.ui (version 4.1.0) plugin. Any hints?
>>
>>
>> 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
-~----------~----~----~----~------~----~------~--~---

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

Reply via email to