|
From: <lk...@us...> - 2004-11-10 17:44:17
|
Update of /cvsroot/openorb/OpenORB/src/compiler/org/openorb/compiler/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14012 Modified Files: IdlDoc.java Log Message: reformat "if then else" cascade to make it readable Index: IdlDoc.java =================================================================== RCS file: /cvsroot/openorb/OpenORB/src/compiler/org/openorb/compiler/doc/IdlDoc.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- IdlDoc.java 10 Feb 2004 21:02:36 -0000 1.4 +++ IdlDoc.java 10 Nov 2004 17:44:07 -0000 1.5 @@ -22,11 +22,11 @@ import org.openorb.compiler.parser.IdlParser; /** - * This class is the IDL parser for generating documentations + * This class is the IDL parser for generating documentations. */ public class IdlDoc { - private static final String IDL2JAVA_COMPILER = "IDL Documentation Tool"; + private static final String IDL2JAVA_COMPILER = "IDL Documentation Tool"; /** * IDL file name @@ -164,173 +164,186 @@ for ( int i = 0; i < args.length; i++ ) { if ( args[ i ].charAt( 0 ) != '-' ) + { idl_file_name_list.addElement( args[ i ] ); - else - if ( args[ i ].equals( "-h" ) ) - printUsage(); - else - if ( args[ i ].equals( "-html" ) ) + } + else if ( args[i].equals( "-h" ) ) + { + printUsage(); + } + else if ( args[i].equals( "-html" ) ) + { htmlDoc = true; - else - if ( args[ i ].equals( "-help" ) ) - printUsage(); - else - if ( args[ i ].equals( "-nopackage" ) ) - use_package = false; - else - if ( args[ i ].equals( "-noprefix" ) ) - usePrefix = false; - else - if ( args[ i ].equals( "-stylesheet" ) ) - stylesheet = true; - else - if ( args[ i ].equals( "-all" ) ) - cp.setM_map_all(true); - else - if ( args[ i ].startsWith( "-package:" ) ) - { - try - { - packageName = args[ i ].substring( 9, args[ i ].length() ); - } - catch ( StringIndexOutOfBoundsException ex ) - { } - - if ( packageName.equals( "" ) ) - { - System.out.println( "Package name cannot be empty..." ); - System.exit( 0 ); - } - } - else - if ( args[ i ].startsWith( "-title:" ) ) - { - try - { - title = args[ i ].substring( 7, args[ i ].length() ); - } - catch ( StringIndexOutOfBoundsException ex ) - { } - - } - else - if ( args[ i ].startsWith( "-header:" ) ) - { - try - { - header = args[ i ].substring( 7, args[ i ].length() ); - } - catch ( StringIndexOutOfBoundsException ex ) - { } - - } - else - if ( args[ i ].startsWith( "-footer:" ) ) - { - try - { - footer = args[ i ].substring( 7, args[ i ].length() ); - } - catch ( StringIndexOutOfBoundsException ex ) - { } + } + else if ( args[i].equals( "-help" ) ) + { + printUsage(); + } + else if ( args[i].equals( "-nopackage" ) ) + { + use_package = false; + } + else if ( args[i].equals( "-noprefix" ) ) + { + usePrefix = false; + } + else if ( args[i].equals( "-stylesheet" ) ) + { + stylesheet = true; + } + else if ( args[i].equals( "-all" ) ) + { + cp.setM_map_all(true); + } + else if ( args[i].startsWith( "-package:" ) ) + { + try + { + packageName = args[ i ].substring( 9, args[ i ].length() ); + } + catch ( StringIndexOutOfBoundsException ex ) + { + } - } - else - if ( args[ i ].startsWith( "-docname:" ) ) - { - try - { - filename = args[ i ].substring( 9, args[ i ].length() ); - } - catch ( StringIndexOutOfBoundsException ex ) - { } + if ( packageName.equals( "" ) ) + { + System.out.println( "Package name cannot be empty..." ); + System.exit( 0 ); + } + } + else if ( args[i].startsWith( "-title:" ) ) + { + try + { + title = args[ i ].substring( 7, args[ i ].length() ); + } + catch ( StringIndexOutOfBoundsException ex ) + { } - } - else - if ( args[ i ].startsWith( "-outdir:" ) ) - { - try - { - outdir = args[ i ].substring( 8, args[ i ].length() ); - } - catch ( StringIndexOutOfBoundsException ex ) - { } + } + else if ( args[i].startsWith( "-header:" ) ) + { + try + { + header = args[ i ].substring( 7, args[ i ].length() ); + } + catch ( StringIndexOutOfBoundsException ex ) + { } - if ( packageName == null ) - { - packageName = ""; - use_package = false; - } + } + else if ( args[i].startsWith( "-footer:" ) ) + { + try + { + footer = args[ i ].substring( 7, args[ i ].length() ); + } + catch ( StringIndexOutOfBoundsException ex ) + { + } + } + else if ( args[i].startsWith( "-docname:" ) ) + { + try + { + filename = args[ i ].substring( 9, args[ i ].length() ); + } + catch ( StringIndexOutOfBoundsException ex ) + { + } - } - else - if ( args[ i ].startsWith( "-codepage:" ) ) - { - try - { - codepage = args[ i ].substring( 10, args[ i ].length() ); - } - catch ( StringIndexOutOfBoundsException ex ) - { } - } - else - if ( args[ i ].startsWith( "-I" ) ) - { - try - { - String name = args[ i ].substring( 2, args[ i ].length() ); - URL url = null; + } + else if ( args[i].startsWith( "-outdir:" ) ) + { + try + { + outdir = args[ i ].substring( 8, args[ i ].length() ); + } + catch ( StringIndexOutOfBoundsException ex ) + { + } - try - { - url = new URL( name ); - } - catch ( MalformedURLException ex ) - { - try - { - url = new java.io.File( name ).toURL(); - } - catch ( MalformedURLException ex1 ) - {} + if ( packageName == null ) + { + packageName = ""; + use_package = false; + } - } + } + else if ( args[i].startsWith( "-codepage:" ) ) + { + try + { + codepage = args[ i ].substring( 10, args[ i ].length() ); + } + catch ( StringIndexOutOfBoundsException ex ) + { + } + } + else if ( args[i].startsWith( "-I" ) ) + { + try + { + String name = args[ i ].substring( 2, args[ i ].length() ); + URL url = null; - if ( url != null ) - cp.getM_includeList().addElement( url ); - } - catch ( StringIndexOutOfBoundsException ex ) - { } + try + { + url = new URL( name ); + } + catch ( MalformedURLException ex ) + { + try + { + url = new java.io.File( name ).toURL(); + } + catch ( MalformedURLException ex1 ) + { + } + } - } - else - if ( args[ i ].startsWith( "-D" ) ) - { - try - { - int idx = args[ i ].indexOf( '=' ); + if ( url != null ) + { + cp.getM_includeList().addElement( url ); + } + } + catch ( StringIndexOutOfBoundsException ex ) + { + } + } + else if ( args[i].startsWith( "-D" ) ) + { + try + { + int idx = args[ i ].indexOf( '=' ); - if ( idx < 0 ) - cp.getM_macros().put( args[ i ].substring( 2, args[ i ].length() ) , "" ); - else - cp.getM_macros().put( args[ i ].substring( 2, idx ) , args[ i ].substring( idx + 1 ) ); - } - catch ( StringIndexOutOfBoundsException ex ) - { } + if ( idx < 0 ) + { + cp.getM_macros().put( args[ i ].substring( 2, args[ i ].length() ) , "" ); + } + else + { + cp.getM_macros().put( args[ i ].substring( 2, idx ) , args[ i ].substring( idx + 1 ) ); + } + } + catch ( StringIndexOutOfBoundsException ex ) + { + } - } - else - { - System.out.println( "Bad parameter" ); - System.out.println( "Please, use no flag to display all compiler option flags" ); - System.exit( 0 ); - } + } + else + { + System.out.println( "Bad parameter: '" + args[i] + "'" ); + System.out.println( "Please, use no flag to display all compiler option flags" ); + System.exit( 0 ); + } } if ( packageName == null ) + { packageName = "corba_pkg"; + } - cp.setM_packageName(packageName); + cp.setM_packageName(packageName); } |