[antlr-interest] grammars without any rules

N.V.S. Karunakar karunakar at objectsymphony.com
Fri Oct 12 23:20:20 PDT 2001

> >    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.



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

More information about the antlr-interest mailing list