
|
If you were logged in you would be able to see more operations.
|
|
|
ANTLR v3
Created: 18/Jun/08 12:08 PM
Updated: 18/Aug/08 11:41 AM
|
|
| Component/s: |
None
|
| Affects Version/s: |
None
|
| Fix Version/s: |
3.1.1
|
|
|
dimitrios Kolovos wwrote:
In the composite-java example that demonstrates the new "import" feature of 3.1 none of the parsers/lexers define @header or @lexer::header and as a result all generated classes do not contain a package declaration. Now, if I add
@header{package demo;}
and
@lexer::header{package demo;}
in Java.g, the JavaLexer and JavaParser contain the "package demo;" declaration but all the other files that are generated from sub-grammars (e.g. Java_JavaAnnotations, Java_JavaDecl) do not contain a package declaration. To add a package declaration to them I need to go in each sub-grammar and add a @header{package demo;}.
Is there a way to get package declarations in files generated by sub-grammars only by setting @header{}/@lexer::header{} in the top-level grammar?
Cheers,
Dimitrios
|
|
Description
|
dimitrios Kolovos wwrote:
In the composite-java example that demonstrates the new "import" feature of 3.1 none of the parsers/lexers define @header or @lexer::header and as a result all generated classes do not contain a package declaration. Now, if I add
@header{package demo;}
and
@lexer::header{package demo;}
in Java.g, the JavaLexer and JavaParser contain the "package demo;" declaration but all the other files that are generated from sub-grammars (e.g. Java_JavaAnnotations, Java_JavaDecl) do not contain a package declaration. To add a package declaration to them I need to go in each sub-grammar and add a @header{package demo;}.
Is there a way to get package declarations in files generated by sub-grammars only by setting @header{}/@lexer::header{} in the top-level grammar?
Cheers,
Dimitrios
|
Show » |
|