public static String buildGeneralParserAncillaries(String packageDecl,
            String parserName,
            boolean gatherStatistics,
            boolean isPretty,
            String runtimeQuietLevel)
	{
		String ancillaries = "";
		ancillaries += "    public static void main(String[] args)\n";
		ancillaries += "    {\n";
		ancillaries += "        " + CompilerLogger.class.getName() + " logger = new " + StringBasedCompilerLogger.class.getName() + "();\n";
		ancillaries += "        logger.setLevel(" + CompilerLogMessageSort.class.getName() + ".ERROR);\n";
		ancillaries += "        logger.setOut(System.err);\n";
		ancillaries += "        boolean useFile = false;\n";
		ancillaries += "        String filename = \"<stdin>\";\n";
		ancillaries += "        " + Reader.class.getName() + " reader = null;\n";
		ancillaries += "        try\n";
		ancillaries += "        {\n";
		ancillaries += "	        int i;\n";
		ancillaries += "    	    for(i = 0;i < args.length;i++)\n";
		ancillaries += "        	{\n";
		ancillaries += "        		if(args[i].charAt(0) != '-') break;\n";
		ancillaries += "	        	else if(args[i].equals(\"-f\"))\n";
		ancillaries += "    	    	{\n";
		ancillaries += "        			i++;\n";
		ancillaries += "            	    if(i >= args.length) logger.logErrorMessage(" + CompilerLogMessageSort.class.getName() + ".ERROR,null,\"A filename must be provided with switch '-f'\");\n";
		ancillaries += "                    useFile = true;\n";
		ancillaries += "                	filename = args[i];\n";
		ancillaries += " 	               continue;\n";
		ancillaries += "    	        }\n";
		ancillaries += "        	}\n";
		ancillaries += "            if(!useFile) reader = new " + InputStreamReader.class.getName() + "(System.in);\n";
		ancillaries += "            else\n";
		ancillaries += "    		{\n";
		ancillaries += "    	        try\n";
		ancillaries += "        	    {\n";
		ancillaries += "                	reader = new " + FileReader.class.getName() + "(filename);\n";
		ancillaries += "            	}\n";
		ancillaries += "            	catch(" + FileNotFoundException.class.getName() + " ex)\n";
		ancillaries += "            	{\n";
		ancillaries += "              	  logger.logErrorMessage(" + CompilerLogMessageSort.class.getName() + ".ERROR,null,\"File not found: '\" + filename + \"'\");\n";
		ancillaries += "            	}\n";
		ancillaries += "        	}\n";
		ancillaries += "            " + LALREngine.class.getName() + " engine = new " + ((packageDecl == null || packageDecl.equals("") || packageDecl.equals("NONE")) ? "" : (packageDecl + ".")) + parserName + "(reader,logger);\n";
		ancillaries += "            engine.startEngine(" + InputPosition.class.getName() + ".initialPos(filename));\n";
		ancillaries += "            Object parseTree = engine.runEngine();\n";
		if(!gatherStatistics) ancillaries += "            if(parseTree instanceof " + ParseTree.class.getName() + ") " + LALRParseTreePrettyPrinter.class.getName() + ".run(" + isPretty + ",(" + ParseTree.class.getName() + ") parseTree,logger,System.out);\n";
		ancillaries += "            if(logger.isLoggable(" + CompilerLogMessageSort.class.getName() + ".TICK))\n";
		ancillaries += "            {\n";
		ancillaries += "                logger.logTick(1,engine.retrieveStatistics().toString());\n";
		ancillaries += "            }\n";
		ancillaries += "        }\n";
		ancillaries += "        catch(" + Exception.class.getName() + " ex)\n";
		ancillaries += "        {\n";
		ancillaries += "            if(logger.isLoggable(" + CompilerLogMessageSort.class.getName() + ".DEBUG)) ex.printStackTrace(System.err);\n";
		ancillaries += "            else System.err.println(ex.getMessage());\n";
		ancillaries += "            System.exit(1);\n";
		ancillaries += "        }\n";
		ancillaries += "    }\n";
		return ancillaries;
	}