Package org.adjective.syntactic.parser.util

Examples of org.adjective.syntactic.parser.util.ASTPrinter


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)
        {
View Full Code Here

TOP

Related Classes of org.adjective.syntactic.parser.util.ASTPrinter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.