[antlr-interest] code in "prolog"

Boulanger Jean-Louis jean-louis.boulanger at hds.utc.fr
Sat May 1 15:52:38 PDT 2004


Hello,

In a structured JAVA application, I use ANTLR. And I want say that the JAVA
generated code, from grammar,  is part of a package .

In my grammar, I introduced:

// Import the necessary classes
{
        package GRAMMAR;
 
        import java.io.*;
 
        import antlr.debug.misc.*;
        import antlr.DumpASTVisitor;
}
 
class BParser extends Parser;
options
{
....
}

....

In the generated code, I found:
// $ANTLR 2.7.3 (20040411-2): "B.g" -> "BParser.java"$
 
import antlr.TokenBuffer;
import antlr.TokenStreamException;
import antlr.TokenStreamIOException;
import antlr.ANTLRException;
import antlr.LLkParser;
import antlr.Token;
import antlr.TokenStream;
import antlr.RecognitionException;
import antlr.NoViableAltException;
import antlr.MismatchedTokenException;
import antlr.SemanticException;
import antlr.ParserSharedInputState;
import antlr.collections.impl.BitSet;
import antlr.collections.AST;
import java.util.Hashtable;
import antlr.ASTFactory;
import antlr.ASTPair;
import antlr.collections.impl.ASTArray;
 
        package GRAMMAR;
                                                                               

        import java.io.*;
 
        import antlr.debug.misc.*;
        import antlr.DumpASTVisitor;
....


This generated an error during compilation.
Why the "prolog" code is not introduced in the beginning of the file ?

Have you another solution ?

Boulanger JL

-------------------------------------------------
Laboratoire Heudiasyc. UMR CNRS 6599
http://www.hds.utc.fr


 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/antlr-interest/

<*> To unsubscribe from this group, send an email to:
     antlr-interest-unsubscribe at yahoogroups.com

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



More information about the antlr-interest mailing list