org.vishia.java2C
Class Java2C

java.lang.Object
  extended by org.vishia.mainCmd.MainCmd
      extended by org.vishia.java2C.Java2C
All Implemented Interfaces:
MainCmd_ifc, Report

public class Java2C
extends MainCmd

Main class of Java2C-translator to organize call from cmd line. TODO call from ANT should be implemented.


Field Summary
(package private)  Report console
          Aggregation to the Console ouput (implementation class of Report).
private  Java2C_Main.CmdlineArgs main
          The main instance for the Java2C translator.
 
Fields inherited from class org.vishia.mainCmd.MainCmd
cmdLineArgs, fReport, kError_writeInfoDirectly, kInfo_writeInfoDirectly, kInfoln_writeInfoDirectly, kWarning_writeInfoDirectly, listAboutInfo, listHelpInfo, mError_writeInfoDirectly, mNewln_writeInfoDirectly, mWarning_writeInfoDirectly, nLevelDisplayToReport, nReportLevel, nReportLevelDisplay
 
Fields inherited from interface org.vishia.mainCmd.Report
anytime, debug, error, eventOrder, exitSuccessfull, exitUserAbort, exitWithArgumentError, exitWithErrors, exitWithFileProblems, exitWithNotes, exitWithWarnings, fineDebug, fineEventOrder, fineInfo, info, interested, mNeverOutputToDisplay, mReportLevel, warning
 
Constructor Summary
private Java2C(java.lang.String[] args)
          Constructor of the main class.
 
Method Summary
protected  void callWithoutArguments()
          invoked from parseArguments if no argument is given.
protected  boolean checkArguments()
          Checks the cmdline arguments relation together.
static void main(java.lang.String[] args)
          main started from cmd line.
 void parseArguments(Java2C_Main.CmdlineArgs argData, java.lang.String[] args)
          parses all cmd line arguments.
protected  boolean testArgument(java.lang.String arg, int nArg)
          Tests one argument.
 
Methods inherited from class org.vishia.mainCmd.MainCmd
addAboutInfo, addHelpInfo, addStandardHelpInfo, executeCmdLine, executeCmdLine, executeCmdLine, executeCmdLine, executeCmdLine, executeCmdLine, exit, flushReport, getArgument, getExitErrorLevel, getLogMessageOutputConsole, getLogMessageOutputFile, getReportFileName, getReportLevel, getReportLevelFromIdent, openReportfile, parseArguments, parseArguments, report, report, reportln, reportln, setExitErrorLevel, setReportLevel, setReportLevelToIdent, startCmdLine, startCmdLine, switchToWindowOrStartCmdline, writeAboutInfo, writeDirectly, writeError, writeError, writeErrorDirectly, writeHelpInfo, writeInfo, writeInfoln, writeStackTrace, writeWarning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

console

Report console
Aggregation to the Console ouput (implementation class of Report).


main

private Java2C_Main.CmdlineArgs main
The main instance for the Java2C translator. This is the Java2C_Main.singleton - instance. Such an instance is also used if the translator is settled outside calling per cmdLine. The cmd line arguments are set to this instance. The instance is created before the command line arguments are parsed, because the cmd line argument values are set directly to this instance.

Constructor Detail

Java2C

private Java2C(java.lang.String[] args)
Constructor of the main class. The command line arguments are parsed here. After them the execute class is created as composition of Java2C.

Method Detail

main

public static void main(java.lang.String[] args)
main started from cmd line. A Java2C_Main.singleton is instanciated, all cmd line arguments are setted to it. The special cmd line arguments are:
-if:CONFIGFILE file contains configuration for translating, syntax see Java2C_Main#setConfigFile(String).
-o:OUTPUT outputpath, to this folder the file are written
-syntax:SYNTAXDIR path to the directory, for Java2C.zbnf, Java2Cstc.zbnf
All standard cmd line arguments are the same described in MainCmd.addStandardHelpInfo().


parseArguments

public void parseArguments(Java2C_Main.CmdlineArgs argData,
                           java.lang.String[] args)
                    throws java.text.ParseException
parses all cmd line arguments. This is a wrapper for parseArguments()-method from MainCmd, the MainCmd.parseArguments() is called inside. Before it is called, the aggregation to the Java2C-implementation class is set.

Throws:
java.text.ParseException

testArgument

protected boolean testArgument(java.lang.String arg,
                               int nArg)
Tests one argument. This method is invoked from MainCmd.parseArgument(String[]). It is abstract in the superclass MainCmd and have to be overwritten from the user.

Specified by:
testArgument in class MainCmd
Parameters:
argc - String of the actual parsed argument from cmd line
nArg - number of the argument in order of the command line, the first argument is number 1.
Returns:
true is okay, false if the argument doesn't match. The parseArgument method in MainCmd throws an exception, the application should be aborted.

callWithoutArguments

protected void callWithoutArguments()
                             throws java.text.ParseException
invoked from parseArguments if no argument is given. In the default implementation a help info is written and the application is terminated. The user should overwrite this method if the call without command line arguments is meaningfully.

Overrides:
callWithoutArguments in class MainCmd
Throws:
java.text.ParseException

checkArguments

protected boolean checkArguments()
Checks the cmdline arguments relation together. If there is an inconsistent, a message should be written. It may be also a warning.

Specified by:
checkArguments in class MainCmd
Returns:
true if all is ok. If false,