[antlr-interest] grammars without any rules

Terence Parr parrt at jguru.com
Fri Oct 12 10:59:19 PDT 2001


On Friday, October 12, 2001, at 03:39  AM, N.V.S. Karunakar wrote:

> Hi,
>
>    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


 

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



More information about the antlr-interest mailing list