public class Main
{
public static void main(String[] args)
{
ASTPrinter printer = new ASTPrinter();
if (args.length == 0)
{
printer.print("<stdin>", JavaParser.processStdin());
return;
}
List<String> errors = new ArrayList<String>();
for (String arg : args)
{
if (arg.startsWith("-"))
{
switch (arg.charAt(1))
{
case 's':
printer.setShowSource(true);
break;
case 't':
printer.setShowTree(true);
break;
}
continue;
}
Node node = parse(arg);
if (node == null)
{
errors.add(arg);
}
else
{
printer.print(arg, node);
}
}
for (String error : errors)
{