[antlr-interest] @header package not generated for <T>Lexer.java

Pranab Dhar pdhar at tibco.com
Wed Jun 6 13:16:05 PDT 2007


Hi,

       I was able to generate the Parser and the Lexer java code from
the grammar and the package defined in the @header section of the
grammar does not get generated in the Lexer code.

 

grammar Tql;

 

options {

      language=Java;

      output=AST;

      backtrack=true;

      k=2;

      memoize=true;

}

 

tokens {

      SELECT_EXPR;

      ..

}

 

@header {

      package com.xxx.yyy.query.parser;   

}

 

And the generated lexer code is something like

 

 

// $ANTLR 3.0
C:\\xxxx\\workspaces\\xxxxxx\\src\\com\\xxxxx\\xxxx\\query\\parser\\TOql
.g 2007-06-06 12:05:44

 

import org.antlr.runtime.*;

import java.util.Stack;

import java.util.List;

import java.util.ArrayList;

 

public class TqlLexer extends Lexer {

 

And the Parser code looks like

 

// $ANTLR 3.0 C
C:\\xxxx\\workspaces\\xxxxxx\\src\\com\\xxxxx\\xxxx\\query\\parser\\TOql
.g 2007-06-06 12:05:43

 

      package com.xxx.yyy.query.parser;   

 

 

import org.antlr.runtime.*;

import java.util.Stack;

import java.util.List;

import java.util.ArrayList;

import java.util.Map;

import java.util.HashMap;

 

import org.antlr.runtime.tree.*;

 

public class TqlParser extends Parser {

    public static final String[] tokenNames = new String[] {

 

Any help and guidance is appreciated.

 

Thanks,

 

Pranab

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20070606/95044976/attachment.html 


More information about the antlr-interest mailing list