diff --git a/com.minres.rdl.parent/com.minres.rdl.ui/xtend-gen/com/minres/rdl/ui/RDLUiModule.java b/com.minres.rdl.parent/com.minres.rdl.ui/xtend-gen/com/minres/rdl/ui/RDLUiModule.java index f4a8c89..38135bf 100644 --- a/com.minres.rdl.parent/com.minres.rdl.ui/xtend-gen/com/minres/rdl/ui/RDLUiModule.java +++ b/com.minres.rdl.parent/com.minres.rdl.ui/xtend-gen/com/minres/rdl/ui/RDLUiModule.java @@ -25,7 +25,7 @@ public class RDLUiModule extends AbstractRDLUiModule { return RDLEObjectDocumentationProvider.class; } - public RDLUiModule(final AbstractUIPlugin arg0) { - super(arg0); + public RDLUiModule(final AbstractUIPlugin plugin) { + super(plugin); } } diff --git a/com.minres.rdl.parent/com.minres.rdl/src/com/minres/rdl/generator/Main.xtend b/com.minres.rdl.parent/com.minres.rdl/src/com/minres/rdl/generator/Main.xtend index 38da2f4..cc854c2 100644 --- a/com.minres.rdl.parent/com.minres.rdl/src/com/minres/rdl/generator/Main.xtend +++ b/com.minres.rdl.parent/com.minres.rdl/src/com/minres/rdl/generator/Main.xtend @@ -1,6 +1,5 @@ package com.minres.rdl.generator - import com.google.inject.Inject import com.google.inject.Provider import com.minres.rdl.RDLStandaloneSetup @@ -19,128 +18,107 @@ import org.eclipse.xtext.util.CancelIndicator import org.eclipse.xtext.validation.CheckMode import org.eclipse.xtext.validation.IResourceValidator import java.text.ParseException +import com.minres.rdl.generator.Options.Multiplicity +import com.minres.rdl.generator.Options.Separator class Main { - static class Option { - String flag - String value - def Option(String flag, String value) { - this.flag = flag - this.value = value - } - } - def static main(String[] args) { - if (args.empty) { - System::err.println('Aborting: no path to EMF resource provided!') - return - } - - try { - val injector = new RDLStandaloneSetup().createInjectorAndDoEMFRegistration - injector.getInstance(Main).run(args) - } catch(MalformedParametersException e){ - print("Command line error "+e.message) - } catch(IllegalArgumentException e){ - print("generation error "+e.message) - e.printStackTrace - } catch(ParseException e){ - print("parse problem "+e.message+" ("+ e.errorOffset+")") - - } - } + private static String USAGE_STR = "RDL2code [-h] [-v] [-o=] [-d=] [-p=] "; - @Inject Provider resourceSetProvider + def static main(String[] args) { + if (args.empty) { + System::err.println('Aborting: no path to RDL file provided!') + return + } + val injector = new RDLStandaloneSetup().createInjectorAndDoEMFRegistration + val Main main = injector.getInstance(Main) + try { + main.run(args) + } catch (MalformedParametersException e) { + print("Command line error " + e.message) + System.exit(1) + } catch (IllegalArgumentException e) { + print("generation error " + e.message) + e.printStackTrace + System.exit(2) + } catch (ParseException e) { + print("parse problem " + e.message + " (" + e.errorOffset + ")") + System.exit(3) + } + } - @Inject IResourceValidator validator + @Inject Provider resourceSetProvider - @Inject GeneratorDelegate generator + @Inject IResourceValidator validator - @Inject JavaIoFileSystemAccess fileAccess + @Inject GeneratorDelegate generator - var optsList = new ArrayList