|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.vishia.java2C.Java2C_Main
public class Java2C_Main
This class is the main class of translation Java2C.
It is used from the command line call-implementation class Java2C.
| Nested Class Summary | |
|---|---|
static class |
Java2C_Main.CmdlineArgs
The gotten arguments from the command line are hold in this extra static class. |
private static class |
Java2C_Main.FileIn
One file entry to translate. |
static class |
Java2C_Main.InputFileParseResult
The instance of this class is filled with the result of parsing an input file given with -if:INPFILE cmd line calling argument. |
private static class |
Java2C_Main.ListFileIn
Helper class to create instances of Java2C_Main.FileIn for each detect input file. |
| Field Summary | |
|---|---|
private java.util.List<GenerateFile> |
allJavaFilesToRunSecondPass
List of all files processed in the first pass to consider in the second pass. |
private Java2C_Main.CmdlineArgs |
args
|
(package private) Report |
console
Aggregation to the Console implementation class. |
static LocalIdents |
externalTypes
Contains all types which are searched but not found in the Java2C translation. |
(package private) java.io.BufferedWriter |
fileRef
Writer for a file containing all enhanced references. |
private java.util.Map<java.lang.String,java.lang.String> |
importHeaders
Assignment between an import statement and a Headerfile. |
(package private) ConfigSrcPathPkg_ifc |
inputCfg
Access to the input configuration set with cmdLine option -if:INPUTCFG. |
(package private) JavaSources |
javaSources
|
private Java2C_Main.ListFileIn |
listFileIn
Instance of Java2C_Main.ListFileIn. |
private java.util.List<java.lang.String> |
listInputToTranslate
List of all java sources which are to translate given either in command line option -i
or in the input config file given with given with command line argument -if:INPFILE,
see #setConfigFile(String). |
private java.util.List<java.lang.String> |
listJavaSrcpath
List of all source pathes given either in command line option -srcpath:
or in the input config file given with given with command line argument -if:INPFILE,
see #setConfigFile(String). |
CCodeData |
localReferenceDummy
A CCodeInfo instance useable as dummy for local variable. |
(package private) ZbnfParser |
parser
The parser for *.java input files. |
private int |
recursion
Recursion respectively deepness of recursive call of #runFirstPassFile(JavaSrcTreeFile, int). |
static Java2C_Main |
singleton
The singleton instance of this class. |
private java.lang.String |
spaces
|
CRuntimeJavalikeClassData |
standardClassData
Instance with all ClassData and LocalIdents for the classes
appropriated in the CRuntimeJavalike C runtime environment. |
CCodeData |
staticReferenceDummy
A CCodeInfo instance useable as dummy for static variable. |
(package private) java.util.TreeMap<java.lang.String,ClassData> |
xxxallClassData
List of known types. |
| Constructor Summary | |
|---|---|
private |
Java2C_Main(Java2C_Main.CmdlineArgs args,
Report report)
Private Constructor for singleton. |
| Method Summary | |
|---|---|
boolean |
addInputFilemask(java.lang.String sMask,
java.lang.String sCPrefix,
java.lang.String sCPostfix)
|
static ClassData |
createExternalType(java.lang.String name,
java.lang.String pkg)
Creates a external type because no informations are available. |
private void |
createJavaPkgFileTreeFromCfg(java.lang.String sPkgPath,
ConfigSrcPathPkg_ifc.Set info)
Creates the package tree for all package replacements found in the configuration file. |
void |
execute()
Executes the translation for all files. |
static JavaSrcTreePkg |
getOrAddRootPkg(java.lang.String sName)
Creates or searches a package which is a root package. |
(package private) java.lang.String |
getPathOut()
|
static LocalIdents |
getRootLevelIdents()
Gets the FileLevelidents of the root level. |
static JavaSrcTreePkg |
getRootPkg(java.lang.String sName)
Searches a package which is a root package. |
(package private) boolean |
initZbnfParser()
Initializes before execute(). |
static void |
instanciateSingleton(Java2C_Main.CmdlineArgs args,
Report report)
The create routine for the singleton. |
private static ConfigSrcPathPkg_ifc |
readConfigFile(Java2C_Main.ListFileIn listFileIn,
java.lang.String sFileName,
Report console)
Parses the given File and build the input file information for translating. |
private GenerateFile |
runFirstPassFile(JavaSrcTreeFile javaSrc)
parses and translates one java file. |
ClassData |
runRequestedFirstPass(JavaSrcTreeFile javaSrc,
java.lang.String sPkgClassName)
Runs the first pass. |
private java.io.File |
searchFileStc(java.lang.String sFileNameStc)
Searches a class in any *.stc-File. |
(package private) void |
stop()
It's a debug helper. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
Report console
private final Java2C_Main.CmdlineArgs args
private final Java2C_Main.ListFileIn listFileIn
Java2C_Main.ListFileIn.
private java.util.List<java.lang.String> listJavaSrcpath
-srcpath:
or in the input config file given with given with command line argument -if:INPFILE,
see #setConfigFile(String).
private java.util.List<java.lang.String> listInputToTranslate
-i
or in the input config file given with given with command line argument -if:INPFILE,
see #setConfigFile(String).
final JavaSources javaSources
final ZbnfParser parser
Java2C.zbnf in directory given with cmd line args
-syntax:SYNTAXDIR in the routine #init()
called in execute().
java.io.BufferedWriter fileRef
final java.util.TreeMap<java.lang.String,ClassData> xxxallClassData
private final java.util.List<GenerateFile> allJavaFilesToRunSecondPass
ConfigSrcPathPkg_ifc inputCfg
private java.util.Map<java.lang.String,java.lang.String> importHeaders
public static final LocalIdents externalTypes
public CRuntimeJavalikeClassData standardClassData
ClassData and LocalIdents for the classes
appropriated in the CRuntimeJavalike C runtime environment. All this ClassData
are stored in #stdTypes, which is the base of all LocalIdents,
therefore this types are accessible in all scopes.
ClassData of this standard types are need,
the access is done via the singleton.standardClassData.
public final CCodeData localReferenceDummy
public final CCodeData staticReferenceDummy
private int recursion
#runFirstPassFile(JavaSrcTreeFile, int).
private java.lang.String spaces
public static Java2C_Main singleton
| Constructor Detail |
|---|
private Java2C_Main(Java2C_Main.CmdlineArgs args,
Report report)
throws java.io.FileNotFoundException,
java.lang.IllegalArgumentException,
java.io.IOException,
java.lang.IllegalAccessException,
java.lang.InstantiationException,
java.text.ParseException
java.lang.InstantiationException
java.lang.IllegalAccessException
java.io.IOException
java.lang.IllegalArgumentException
java.io.FileNotFoundException
java.text.ParseException| Method Detail |
|---|
public boolean addInputFilemask(java.lang.String sMask,
java.lang.String sCPrefix,
java.lang.String sCPostfix)
public static void instanciateSingleton(Java2C_Main.CmdlineArgs args,
Report report)
private static ConfigSrcPathPkg_ifc readConfigFile(Java2C_Main.ListFileIn listFileIn,
java.lang.String sFileName,
Report console)
throws java.text.ParseException
input::={ translate: ;}.
set::=<* ;=?inputpath>[ =: [*<* ;?Cname_prefix>|<**?Cname_postfix>*]].
A example of file content:
srcJava/org/vishia/exampleJava2C/java4c/*.java = *_PosCtrl; //the files for position control ..//TODO
sFileName -
java.text.ParseException
public void execute()
throws java.text.ParseException,
java.io.FileNotFoundException,
java.lang.IllegalArgumentException,
java.io.IOException,
java.lang.IllegalAccessException,
java.lang.InstantiationException
java.text.ParseException
java.lang.InstantiationException
java.lang.IllegalAccessException
java.io.IOException
java.lang.IllegalArgumentException
java.io.FileNotFoundException
private void createJavaPkgFileTreeFromCfg(java.lang.String sPkgPath,
ConfigSrcPathPkg_ifc.Set info)
sPkgPath - The path given in config-file replace:-statement.
The pathes can be separated with / or dot.java.lang.String getPathOut()
boolean initZbnfParser()
throws java.text.ParseException,
java.io.FileNotFoundException,
java.io.IOException,
java.lang.IllegalArgumentException,
java.lang.IllegalAccessException,
java.lang.InstantiationException
execute().
#sConfigFile if an cmd line argument -if:INPFILE is given.
parser with the syntax file Java2C.zbnf
using the path from cmd line argument -syntax:PATH.
#parserStruct with the syntax file Java2Cstc.zbnf
using the path from cmd line argument -syntax:PATH.
java.text.ParseException
java.io.FileNotFoundException
java.io.IOException
java.lang.InstantiationException
java.lang.IllegalAccessException
java.lang.IllegalArgumentException
private GenerateFile runFirstPassFile(JavaSrcTreeFile javaSrc)
throws java.io.FileNotFoundException,
java.io.IOException,
java.text.ParseException,
java.lang.IllegalArgumentException,
java.lang.IllegalAccessException,
java.lang.InstantiationException
execute() for any given input file,
runRequestedFirstPass(String sClassName) for any depended file.
readStructToClassData(String) is called, and nothing else. This produces the
for using the informations of this file.
StringPartFromFileLines.
parser.
GenerateFile and adds it to allJavaFilesToRunSecondPass.
This list will be processed for second path of translation.
GenerateFile#runFirstPass(ZbnfParseResultItem, LocalIdents, String)
to build the ClassData of all contained classes.
java.lang.InstantiationException
java.lang.IllegalAccessException
java.lang.IllegalArgumentException
java.io.FileNotFoundException
java.io.IOException
java.text.ParseException
public static final ClassData createExternalType(java.lang.String name,
java.lang.String pkg)
name - pkg -
public static final JavaSrcTreePkg getOrAddRootPkg(java.lang.String sName)
JavaSrcTreePkg#getOrAddPkg(String, String)
can be invoked to get or add a sub package or the method
{@link JavaSrcTreePkg#setFileJava(String, File, String, String, String, String, String, String, boolean)
can be invoked.
sName - The name of the root package
public static final JavaSrcTreePkg getRootPkg(java.lang.String sName)
sName - The name of the root package
public static final LocalIdents getRootLevelIdents()
void stop()
public ClassData runRequestedFirstPass(JavaSrcTreeFile javaSrc,
java.lang.String sPkgClassName)
throws java.io.FileNotFoundException,
java.lang.IllegalArgumentException,
java.io.IOException,
java.lang.IllegalAccessException,
java.lang.InstantiationException,
java.text.ParseException
runRequestedFirstPass in interface RunRequiredFirstPass_ifcsClassName - The name of the type in Java. The filename should be the same.
The file is searched in any package given as input parameter calling java2C.
Java2C_Main#userTypes.
java.text.ParseException
java.io.FileNotFoundException
java.lang.IllegalArgumentException
java.io.IOException
java.lang.IllegalAccessException
java.lang.InstantiationExceptionorg.vishia.java2C.RunRequiredFirstPass_ifc#runRequestedFirstPass(java.lang.String)private java.io.File searchFileStc(java.lang.String sFileNameStc)
sClassName -
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||