[antlr-interest] grammars without any rules

Terence Parr parrt at jguru.com
Tue Oct 16 11:50:12 PDT 2001


On Friday, October 12, 2001, at 11:20  PM, N.V.S. Karunakar wrote:

>>>    ANTLR doesn't allow a grammar definition without a rule. Consider
>>> this
>>> case - We define a lexer for a language K. In the next version of K
>>> which is
>>> NextK, all we do is to add a few keywords and add some syntactic
>>> constructs.
>>> We will use grammar inheritance to add more rules to the parser. to 
>>> add
>>> extra key words we inherit from the K's lexer. we can add the new key
>>> words
>>> to the tokens section of this new lexer. there is no need to add any 
>>> new
>>> lexer rules. but ANTLR insists on a rule. in this light can we allow
>>> grammars without any rules ?
>>
>> Howdy.  Can you just add a dummy rule?
>>
>> Ter
>
> we sure can add a dummy rule. But i was wondering why ANTLR should 
> insist on
> having at least one rule.

Purely a matter of almost nobody needing it so I didn't spend CPU time 
thinking about the problem ;)

Sorry.

Ter


 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 



More information about the antlr-interest mailing list