public void run(String file) {
try {
pp.addInput(new FileLexerSource(new File(file)));
for (;;) {
Token tok = pp.token();
if (tok == null)
break;
if (tok.getType() == Token.EOF)
break;
if (Token.getTokenName(tok.getType()).equals("{"))
pl.incLevel();
else if (Token.getTokenName(tok.getType()).equals("}"))
pl.decLevel();
if (tok.getType() != Token.P_LINE)
pl.getCurrent().write(tok.getText().getBytes());
}
} catch (Exception e) {
e.printStackTrace(System.err);
logger.error("Preprocessor error.");
// System.exit(1);