Can ANTLR generate a parser in a specified Java package?

Terence Parr

Sure. Just put the package statement in the header action:

header {
package org.antlr.test;

class P extends Parser;

a : A;

You'll see that ANTLR generates the following output:

// $ANTLR 2.7.0a11: "t.g" -> "P.java"$

package org.antlr.test;
0 Comments  (click to add your comment)
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.