gcxml/src/gcxml/Gcxml.java
/**
     * @param args the command line arguments
     */
@param args the command line arguments
@param args the command line arguments
public static void main(String[] args) {
        final String delimiter = "\t";
        double[] pdf_versions = {1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 2.0};
        String inputFolder = inputFolder = System.getProperty("user.dir") + "/tsv/latest/";
        File folder = new File(inputFolder);
        File[] listOfFiles = folder.listFiles();
        if(args.length > 0){
            String argument = args[0];
            switch (argument){
                case "-all":
                    System.out.println("gcxml " + grammar_version);                 
                    for(int i = 0; i < pdf_versions.length; i++ ){
                        XMLCreator xmlcreator = new XMLCreator(listOfFiles, delimiter, String.valueOf(pdf_versions[i]));
                        xmlcreator.convertFile();
                    }
                    TSVUpdater tsv = new TSVUpdater();
                    break;
                case "-xml":
                    System.out.println("gcxml " + grammar_version);
                    if(args.length>1 && (!args[1].isEmpty())){
                        String pdf_version = args[1];
                        XMLCreator xmlcreator = new XMLCreator(listOfFiles, delimiter, pdf_version);
                        xmlcreator.convertFile();
                    }else{
                        for(int i = 0; i < pdf_versions.length; i++ ){
                            XMLCreator xmlcreator = new XMLCreator(listOfFiles, delimiter, String.valueOf(pdf_versions[i]));
                            xmlcreator.convertFile();
                        }
                    }
                    break;
                case "-sin":
                    System.out.println("gcxml " + grammar_version);
                    if(args.length>1 && !args[1].isEmpty()){
                        String version = args[1];
                        if(version.equals("1.0") || version.equals("1.1") || version.equals("1.2")
                                || version.equals("1.3") || version.equals("1.4") || version.equals("1.5")
                                || version.equals("1.6") || version.equals("1.7") || version.equals("2.0")){
                            XMLQuery query = new XMLQuery();
                            query.SinceVersion(version);
                        }else if(version.equals("-all")){
                            XMLQuery query = new XMLQuery();
                            query.SinceVersion();
                        }else{
                            System.out.println("There is no such PDF version. Correct values are: 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7 or 2.0");
                        }
                    }else{
                        System.out.println("PDF version was not specified. Correct values are: 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7 or 2.0");
                        System.out.println("If you want to display all keys and their version use '-all' as parameter.");
                    }
                    break;
                case "-dep":
                    System.out.println("gcxml " + grammar_version);
                    if(args.length>1 && !args[1].isEmpty()){
                        String version = args[1];
                        if(version.equals("1.0") || version.equals("1.1") || version.equals("1.2")
                                || version.equals("1.3") || version.equals("1.4") || version.equals("1.5")
                                || version.equals("1.6") || version.equals("1.7") || version.equals("2.0")){
                            XMLQuery query = new XMLQuery();
                            query.DeprecatedIn(version);
                        }else if(version.equals("-all")){
                            XMLQuery query = new XMLQuery();
                            query.DeprecatedIn();
                        }else{
                            System.out.println("There is no such PDF version. Correct values are: 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7 or 2.0");
                        }
                    }else{
                        System.out.println("PDF version was not specified. Correct values are: 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7 or 2.0");
                        System.out.println("If you want to display all keys and their version use '-all' as parameter.");
                    }
                    break;
                case "-so":
                    System.out.println("gcxml " + grammar_version);
                    XMLQuery query = new XMLQuery();
                    query.SchizophrenicObjects();
                    break;
                case "-kc":
                    System.out.println("gcxml " + grammar_version);
                    query = new XMLQuery();
                    query.KeyOccurrenceCount();
                    break;
                case "-po":
                    System.out.println("gcxml " + grammar_version);
                    if(args.length > 1){
                        query = new XMLQuery();
                        query.PotentialDicts(args[1]);
                    }else{
                        System.out.println("No keys specified. Expected list of keys, eg.: Key1,Key2,Key3");
                    }
                    break;
                case "-version":
                    System.out.println("gcxml " + grammar_version);
                    break;
                case "-tsv":
                    System.out.println("gcxml " + grammar_version);
                    TSVUpdater tsv2 = new TSVUpdater();
                    break;
                case "-sc":
                    System.out.println("gcxml " + grammar_version);
                    query = new XMLQuery();
                    query.getSpecialCases();
                    break;
                case "-help":
                    showHelp();
                    break;
                default:
                    showHelp();
            }
        }else{
            showHelp();
        }
    }
public static void main ( String [ ] args ) { final String delimiter = "\t" ; double [ ] pdf_versions = { 1.0 , 1.1 , 1.2 , 1.3 , 1.4 , 1.5 , 1.6 , 1.7 , 2.0 } ; String inputFolder = inputFolder = System . getProperty ( "user.dir" ) + "/tsv/latest/" ; File folder = new File ( inputFolder ) ; File [ ] listOfFiles = folder . listFiles ( ) ; if ( args . length > 0 ) { String argument = args [ 0 ] ; switch ( argument ) { case "-all" : System . out . println ( "gcxml " + grammar_version ) ; for ( int i = 0 ; i < pdf_versions . length ; i ++ ) { XMLCreator xmlcreator = new XMLCreator ( listOfFiles , delimiter , String . valueOf ( pdf_versions [ i ] ) ) ; xmlcreator . convertFile ( ) ; } TSVUpdater tsv = new TSVUpdater ( ) ; break ; case "-xml" : System . out . println ( "gcxml " + grammar_version ) ; if ( args . length > 1 && ( ! args [ 1 ] . isEmpty ( ) ) ) { String pdf_version = args [ 1 ] ; XMLCreator xmlcreator = new XMLCreator ( listOfFiles , delimiter , pdf_version ) ; xmlcreator . convertFile ( ) ; } else { for ( int i = 0 ; i < pdf_versions . length ; i ++ ) { XMLCreator xmlcreator = new XMLCreator ( listOfFiles , delimiter , String . valueOf ( pdf_versions [ i ] ) ) ; xmlcreator . convertFile ( ) ; } } break ; case "-sin" : System . out . println ( "gcxml " + grammar_version ) ; if ( args . length > 1 && ! args [ 1 ] . isEmpty ( ) ) { String version = args [ 1 ] ; if ( version . equals ( "1.0" ) || version . equals ( "1.1" ) || version . equals ( "1.2" ) || version . equals ( "1.3" ) || version . equals ( "1.4" ) || version . equals ( "1.5" ) || version . equals ( "1.6" ) || version . equals ( "1.7" ) || version . equals ( "2.0" ) ) { XMLQuery query = new XMLQuery ( ) ; query . SinceVersion ( version ) ; } else if ( version . equals ( "-all" ) ) { XMLQuery query = new XMLQuery ( ) ; query . SinceVersion ( ) ; } else { System . out . println ( "There is no such PDF version. Correct values are: 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7 or 2.0" ) ; } } else { System . out . println ( "PDF version was not specified. Correct values are: 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7 or 2.0" ) ; System . out . println ( "If you want to display all keys and their version use '-all' as parameter." ) ; } break ; case "-dep" : System . out . println ( "gcxml " + grammar_version ) ; if ( args . length > 1 && ! args [ 1 ] . isEmpty ( ) ) { String version = args [ 1 ] ; if ( version . equals ( "1.0" ) || version . equals ( "1.1" ) || version . equals ( "1.2" ) || version . equals ( "1.3" ) || version . equals ( "1.4" ) || version . equals ( "1.5" ) || version . equals ( "1.6" ) || version . equals ( "1.7" ) || version . equals ( "2.0" ) ) { XMLQuery query = new XMLQuery ( ) ; query . DeprecatedIn ( version ) ; } else if ( version . equals ( "-all" ) ) { XMLQuery query = new XMLQuery ( ) ; query . DeprecatedIn ( ) ; } else { System . out . println ( "There is no such PDF version. Correct values are: 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7 or 2.0" ) ; } } else { System . out . println ( "PDF version was not specified. Correct values are: 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7 or 2.0" ) ; System . out . println ( "If you want to display all keys and their version use '-all' as parameter." ) ; } break ; case "-so" : System . out . println ( "gcxml " + grammar_version ) ; XMLQuery query = new XMLQuery ( ) ; query . SchizophrenicObjects ( ) ; break ; case "-kc" : System . out . println ( "gcxml " + grammar_version ) ; query = new XMLQuery ( ) ; query . KeyOccurrenceCount ( ) ; break ; case "-po" : System . out . println ( "gcxml " + grammar_version ) ; if ( args . length > 1 ) { query = new XMLQuery ( ) ; query . PotentialDicts ( args [ 1 ] ) ; } else { System . out . println ( "No keys specified. Expected list of keys, eg.: Key1,Key2,Key3" ) ; } break ; case "-version" : System . out . println ( "gcxml " + grammar_version ) ; break ; case "-tsv" : System . out . println ( "gcxml " + grammar_version ) ; TSVUpdater tsv2 = new TSVUpdater ( ) ; break ; case "-sc" : System . out . println ( "gcxml " + grammar_version ) ; query = new XMLQuery ( ) ; query . getSpecialCases ( ) ; break ; case "-help" : showHelp ( ) ; break ; default : showHelp ( ) ; } } else { showHelp ( ) ; } }
@param args the command line arguments
@param args the command line arguments
// run -xml and -tsv at once for all pdf versions // create grammar in xml format for each pdf version from the latest tsv files. // display keys introduced in pdf version x.x or all // display keys deprecated in pdf version x.x or all