public static void main(String args[]) throws Exception {
                boolean shortOutputs = MainCodeGen.shortOutputs;
                PseuCoParser parser = null;
                if (args.length >= 1) {
                        if (!shortOutputs) {
                                System.out.println("file: " + args[0]);
                        }

                        try {
                                parser = new PseuCoParser(new File(args[0]));
                                if (!shortOutputs) {
                                        System.out.println("Parser Created");
                                }
                        } catch (Exception e) {
                                if (shortOutputs) {
                                        System.err.println(e.toString());
                                } else {
                                        e.printStackTrace();
                                }
                                System.out.println("Please enter pseuco code:");
                                String path = PseuCoParser.class.getProtectionDomain().getCodeSource().getLocation().getPath();
                                parser = new PseuCoParser(System.in);
                                parser.currentFile = new File(path);
                        }
                } else {
                                System.out.println("Please enter pseuco code:");
                                String path = PseuCoParser.class.getProtectionDomain().getCodeSource().getLocation().getPath();
                                parser = new PseuCoParser(System.in);
                                parser.currentFile = new File(path);
                }

                parser.Program();

                LDNode n = (LDNode) parser.rootNode();

//			System.out.println(n.qTree());

                try {
                        TypeChecker t = new TypeChecker(n);
                        t.checkTypes();
                } catch (Exception e) {
                        if (shortOutputs) {
                                throw e;
                        } else {
                                e.printStackTrace();
                                return;
                        }
                }

                // start code generation
                MainCodeGen.rootNode = n;
                MainCodeGen.main(new String[0]);
        }