Methods Summary |
---|
public void | addGrammar(persistence.antlr.preprocessor.Grammar g)
grammars.appendElement(g.getName(), g);
|
public void | addHeaderAction(java.lang.String a)
headerAction += a + System.getProperty("line.separator");
|
public void | generateExpandedFile()
if (!expanded) {
return; // don't generate if nothing got expanded
}
String expandedFileName = nameForExpandedGrammarFile(this.getName());
// create the new grammar file with expanded grammars
PrintWriter expF = tool.openOutputFile(expandedFileName);
expF.println(toString());
expF.close();
|
public persistence.antlr.collections.impl.IndexedVector | getGrammars()
return grammars;
|
public java.lang.String | getName()
return fileName;
|
public java.lang.String | nameForExpandedGrammarFile(java.lang.String f)
if (expanded) {
// strip path to original input, make expanded file in current dir
return "expanded" + tool.fileMinusPath(f);
}
else {
return f;
}
|
public void | setExpanded(boolean exp)
expanded = exp;
|
public void | setOptions(persistence.antlr.collections.impl.IndexedVector o)
options = o;
|
public java.lang.String | toString()
String h = headerAction == null ? "" : headerAction;
String o = options == null ? "" : Hierarchy.optionsToString(options);
StringBuffer s = new StringBuffer(10000); s.append(h); s.append(o);
for (Enumeration e = grammars.elements(); e.hasMoreElements();) {
Grammar g = (Grammar)e.nextElement();
s.append(g.toString());
}
return s.toString();
|