}
private void generateStatements(int phase, GrammarData grammarData,
StatementList statementList, boolean generateDeclarations) {
for (Def def : defList) {
Comments comments = new Comments();
// Show the definition.
List<String> statement = def.getStatement();
String defname = def.getVarName() + " = ";
boolean tab = false;
if (statement.size() > 1) {
comments.add(tab, defname.trim()); // Add comment.
defname = "";
tab = true;
}
for (String s : statement) {
comments.add(tab, defname + s);
defname = "";
}
if (statementList != null && comments.hasElements()) {
statementList.add(new Statement(phase, comments));
}
String name = def.getVarName();
GrammarElement grammarElement = def.getVal();
grammarElement.generate(phase, false, generateDeclarations, true, false, null, name, name, "*", "*", grammarData, statementList);