Title:

Combined grammar importing lexer and parser grammar could not define
lexer rules

 

Description:

A combined grammar with imported lexer and parser grammar is given. In
this grammar

header rules have to be set for example for package declarations.

 

Software:

antlrworks-1.3.1.jar

 

--------

 

lexer grammar lex;

 

LETTER : 'a'..'z' ;

SPACE : ' ' ;

--------

 

parser grammar par;

 

letter : LETTER ;

spaces : SPACE+ ;

--------

 

grammar gram;

 

import lex, par;

 

@parser::header{

      package grammar;

}

 

@lexer::header{

      package grammar;

}

 

letters : letter+ ;

stuff : ( letters spaces )+ ;

--------

 

 

This grammar cannot be generated because of following error:

 

Cannot generate the grammar because:

error (143):  par.g:10:15: unknown or invalid action scope for parser
grammar: lexer

 

 

note: If the combined grammar only imports the lexer grammar, all will
be fine.

 

 

Best regards,

 

Michael Berger

Fraunhofer FOKUS

Kaiserin-Augusta-Allee 31

10589 Berlin

Tel: +49-30-3463-7176

 


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

Reply via email to