|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.vishia.java2C.ClassData
class ClassData
This class represents the content of a java class while Translation.
The instance is created and filled while executing the first pass of translation,
that is the detecting of the class elements and generating the C-header.
It is used for the second pass, the generation of C-file.
Chars are used to identify the kind of a element or type:
| C | a class type identifier |
| I | an interface type identifier |
| B | a basic scalar type |
| Nested Class Summary | |
|---|---|
static class |
ClassData.CastInfo
Simple Data class to hold Strings and modes for generation casting. |
(package private) static class |
ClassData.InheritanceInfo
Holds Informations about superclasses and interfaces. |
(package private) static class |
ClassData.InitInfoVariable
This class saves the position of zbnfInit in a parse result to the named variable. |
(package private) static class |
ClassData.MethodArg
unused yet, need? |
private static class |
ClassData.MethodOverrideable
This class composed the reference of a method and the name of implementation of the method in an inheriting class. |
private static class |
ClassData.MethodOverrideCheck
Instances of this class are created only temporary while running first pass of this class. |
(package private) class |
ClassData.MethodWithZbnfItem
|
| Field Summary | |
|---|---|
private boolean |
basedOnObject
|
boolean |
bEmbedded
Set if instances should only used embedded. |
private boolean |
bExternal
True if the class isn't known in Java2C context. |
private boolean |
bFinalizeNeed
Set true if any enhanced reference type is need. |
private boolean |
bInterface
Set if it is an interface. |
private short |
bitArrayNeed
Some bits set if the array form of the type is need anywhere. |
private java.util.TreeMap<java.lang.String,ClassData.CastInfo> |
castableFromType
Types from which a cast is possible, and its cast rule. |
private java.util.TreeMap<java.lang.String,ClassData.CastInfo> |
castableInitializerFromType
Types from which a cast for initial values is possible, and its cast rule. |
private java.util.TreeMap<java.lang.String,ClassData.CastInfo> |
castableToType
Types to which a cast is possible, and its cast rule. |
LocalIdents |
classLevelIdents
All known identifiers of this class. |
java.util.List<FieldData> |
classLevelIdentsOwn
All identifiers of only this class. |
java.util.Map<java.lang.String,ClassData> |
classLevelUsageTypes
All identifiers of only this class. |
FieldData |
classTypeInfo
If this or a unnamed instance of the class is used as a reference,
this field supplied the necessary instance infos. |
char |
creationMode
Mode of anynymous class: C: inner class at class level F: class at file level P: primary class created in CRuntimeJavalike Y: anonymous class b: In a statement block. |
(package private) CCodeData |
ctorCodeInfo
This codeinfo is used if a super constructor is called. |
char |
cVaArgIdent
Char which identifies a value in a variable argument list. |
(package private) GenerateFile |
fileContainsClass
The context of generating the whole file, where the class is defined. |
private boolean |
hasFields
true if it has fields. |
(package private) ClassData.InheritanceInfo |
inheritanceInfo
Tree of all method tables of interfaces and the superclasses. |
private java.util.List<ClassData> |
innerClasses
All inner classes of only this class. |
boolean |
isAbstract
Set if it is an abstract class. |
boolean |
isConstant
Set if the class or interface has only get-methods, so that it is able to declare as const* in C. |
boolean |
isFinal
Set if the class is final. |
boolean |
isNonStaticInner
Set if the class is a non-static inner class (only inner classes can be static or non-static). |
boolean |
isStaticInstanciated
Set if java2c = staticInstance is found in description of the class. |
private java.util.TreeMap<java.lang.String,java.lang.Object> |
methods
Index of all methods with the same number of arguments. |
private java.util.TreeMap<java.lang.String,java.lang.Object> |
methodsCheckOverriding
This index is only temporary used while the first pass is running. |
private java.util.TreeMap<java.lang.String,Method> |
methodsCname
Index of all methods with its C name. |
private java.util.List<ClassData.MethodOverrideable> |
methodsOverrideableNew
This index stores methods, which are designated as override-able, but they are defined in this class, the aren't found in any base class. |
(package private) java.util.Queue<ClassData.MethodWithZbnfItem> |
methodsWithZbnf
|
private static java.lang.String |
newLineIndent
Helper variable to generate indentation, see indent(int) |
(package private) int |
nrofConstructor
|
(package private) ClassData |
outerClazz
The outer class of this or null. |
java.lang.String |
sArgSensitiveName
Short form of type-name for argument sensitive C-routine names. |
java.lang.String |
sClassNameC
The full name, like produced in C. |
java.lang.String |
sClassNameJava
The full name in java, dot to separate outer.inner class names. |
java.lang.String |
sClassNameJavaFullqualified
|
java.lang.String |
sFileName
The file were the class is defined in C. |
private java.lang.String |
sInfo
Information String given in constructor. |
java.lang.String |
sPackage
|
java.lang.String |
sSourceOfClassData
The source, from where the ClassData are created. |
(package private) java.util.List<ClassData.InitInfoVariable> |
staticVariables
List of all static variables either with initial values or not. |
(package private) CCodeData |
thisCodeInfo
This codeinfo is used if a classlevel ident is accessed. |
(package private) CCodeData |
typeCodeInfo
This codeinfo contains an cCode == "" and the correct type. |
private java.util.List<ClassData.InitInfoVariable> |
variablesToInit
List of parse result items of initial values for variables. |
private ZbnfParseResultItem |
zbnfClass
For second pass, the parse result. |
private ZbnfParseResultItem |
zbnfFinalizeMethod
For finalize method body, null if no finalize method is defined for java. |
| Constructor Summary | |
|---|---|
ClassData(java.lang.String sSourceOfClassData,
GenerateFile fileContainsClass,
java.lang.String sFileName,
java.lang.String sPkgJava,
java.lang.String sNameJava,
java.lang.String sNameCP,
java.lang.String sArgSensitiveName,
char cVaArgIdent,
ClassData outerClassData,
ClassData superClassData,
ClassData[] ifcClassData,
ZbnfParseResultItem zbnfClass,
char access,
java.lang.String infos,
char creationMode)
|
|
ClassData(java.lang.String sSourceOfClassData,
java.lang.String sPkgJava,
java.lang.String sNameJava,
java.lang.String sNameC,
java.lang.String sArgSensitiveName,
char cVaArgIdent,
java.lang.String sFileName,
char access,
java.lang.String infos)
|
|
| Method Summary | |
|---|---|
void |
addCastFromType(ClassData srcType,
java.lang.String cast,
java.lang.String modeAccessDstSrc)
adds a casting possibility from a given type to this. |
void |
addCastInitializerFromType(ClassData srcType,
java.lang.String cast,
java.lang.String modeAccessDstSrc)
adds a casting possibility for initializer. |
void |
addCastToType(ClassData dstType,
java.lang.String cast,
java.lang.String modeAccessDstSrc)
adds a casting possibility to a given type from this. |
void |
addEnhancedRefType(java.lang.String sRefType)
If a type is used as enhanced reference in the code of the class, it is noted here and in Java2CMain. |
void |
addField(java.lang.String sIdent,
FieldData identInfo)
|
(package private) void |
addInnerClass(ClassData innerClass)
Adds in inner class to the class. |
void |
addMethod(Method m)
Registers a given Method. |
void |
addMethod(java.lang.String sNameJava,
java.lang.String sNameUnambiguous,
FieldData returnType,
ClassData[] paramsType)
Adds. |
void |
addMethod(java.lang.String sNameJava,
java.lang.String sNameUnambiguous,
int modifier,
FieldData returnType)
Registers a argumentless method if the class is parsed or a standard class is initialized. |
void |
addMethod(java.lang.String sNameJava,
java.lang.String sNameUnambiguous,
int modifier,
FieldData returnType,
ClassData[] paramsType)
Registers a Method if the class is parsed or a standard class is initialized. |
(package private) Method |
addMethod(java.lang.String sMethodNameJava,
java.lang.String sMethodNameUnambiguous,
int modifier,
FieldData retType,
FieldData[] argTypes)
|
(package private) Method |
addMethod(java.lang.String sMethodNameJava,
java.lang.String sMethodNameUnambiguous,
java.lang.String sImplementationName,
int modifier,
FieldData retType,
FieldData[] argTypes)
Creates a method and adds it to the lists. |
private void |
addMethodToList(Method method)
Adds the method to the lists methods and methodsCname |
void |
addMtblRefType(java.lang.String sRefType,
char intension)
If a type is used as method-table- reference in the code of the class, it is noted here. |
private Method |
checkParameterMethod(java.lang.Object omethodFound,
java.util.List<CCodeData> paramsTypeCheck)
|
private boolean |
checkParameterTypesMethod(Method methodTest,
FieldData[] paramsType)
|
(package private) void |
completeFieldIdentsForInnerClasses()
Copies all field idents of this class to its non-static inner classes, because the inner classes should know the idents of its outer class. |
void |
completeInheritanceWithListMethods(java.util.List<java.lang.String> methodNames)
copies the override-able methods given in param in the inheritance info. |
void |
completeInheritanceWithOwnMethods()
copies the new override-able methods of this class in the inheritance info. |
(package private) void |
completeTypesForInnerClasses()
Completes the type information of this outer class for all its inner classes. |
private void |
fillMethodsOverrideable(ClassData.InheritanceInfo inheritanceInfo,
java.lang.String sPathToMtbl,
java.lang.String sPathToBase)
Fills the methodsCheckOverriding with the informations given in inheritanceInfo. |
java.lang.String |
gen_ClassCppDefinitionContent()
Generates the content of the class definition for C++, to write in the header-file. |
private int |
gen_MethodCpp(java.lang.StringBuilder u,
Method method,
int bitZchar)
|
java.lang.String |
gen_MethodTableDefinitionContent()
returns the definition of the methodtable of the class and all superclasses. |
private java.lang.String |
gen_MethodTableSuperStruct()
returns the definition of the method-table of a superclass or interface as embedded struct. |
(package private) java.lang.String |
genMethodTableContent(ClassData.InheritanceInfo inheritanceInfo,
java.lang.String sClassName,
int indent)
returns the definition of the methodtable of the class and all superclasses. |
(package private) ZbnfParseResultItem |
getBodyForFinalize()
Gets the body for the finalize method. |
ClassData.CastInfo |
getCastInfoFromType(java.lang.String typeSrc)
Returns the info how to cast from this type to another. |
ClassData.CastInfo |
getCastInfoToType(java.lang.String typeSrc)
Returns the info how to downcast from this type to another. |
ClassData.CastInfo |
getCastInitializerFromType(java.lang.String typeSrc)
Returns the info how to downcast from this type to another. |
java.lang.String |
getClassCtype_s()
Returns the name of the class used as C-type. |
ClassData |
getClassData()
returns the instance because it is. |
java.lang.String |
getClassIdentName()
Returns the indentification name of a class. |
java.lang.String |
getClassNameJava()
Returns the name of the class used in Java without package information. |
java.lang.String |
getClassNameJavaFullqualified()
|
FieldData |
getFieldIdent(java.lang.String name)
Test whether the field is known and returns it data. |
ClassData[] |
getInterfaces()
Returns all interfaces of immediate level (not interfaces of base classes). |
JavaSrcTreePkg |
getJavaPkg()
Implements JavaSources.ClassDataOrJavaSrcFile.getJavaPkg() |
JavaSrcTreeFile |
getJavaSrc()
returns null because it is not. |
LocalIdents |
getLocalIdents(java.lang.String sClassName)
Returns the identifier of classes or packages, which are available in the implementing package, file or class. |
(package private) Method |
getMethodPerCname(java.lang.String sNameC)
|
ClassData |
getOuterClass()
Returns the ClassData of outer class or null. |
(package private) ZbnfParseResultItem |
getParseResult()
|
ConfigSrcPathPkg_ifc.Set |
getReplaceCinfo()
This method returns null because for ready-to-use types this informations are not necessary. |
ClassData |
getSuperClassData()
Returns the superclass or null. |
java.lang.String |
getTypeName()
Implements JavaSources.ClassDataOrJavaSrcFile.getTypeName() |
java.util.List<ClassData.InitInfoVariable> |
getVariablesToInit()
|
boolean |
hasFields()
|
private java.lang.String |
indent(int recursion)
Generates an indentation, used inside writeStructureClass(BufferedWriter, int) |
boolean |
isAmbiguousnessMethod(java.lang.String sNameJava)
tests whether the method is ambiguous. |
boolean |
isBasedOnObject()
|
boolean |
isExternal()
Returns true if the class isn't known in Java2C context. |
boolean |
isFinalizeNeed()
Returns true if the finalize is need but it is not written in Java. |
boolean |
isInterface()
Returns true if it is an interface. |
(package private) boolean |
isneed_Y()
|
(package private) boolean |
isneed_YP()
|
boolean |
isPrimitiveType()
Returns true if it is a primitive type without any own elements. |
boolean |
isString()
Returns true if the type is 'String'. |
boolean |
isToTranslate()
Returns false any time, because all informations are ready to use here. |
(package private) int |
matchedToTypeSrc(ClassData src)
Checks whether the src matches to this class with or without type casting. |
(package private) void |
need_Y()
Returns true if the ClassData represents an Array type. |
(package private) void |
need_YP()
|
void |
needFinalize()
Sets the finalize bit. |
(package private) void |
relinquishParseResult()
relinquishes the parse result, because it is processed. |
void |
reportContent(Report console,
int reportlevel)
|
Method |
searchMethod(java.lang.String sNameJavaP,
java.util.List<CCodeData> paramsTypeCheck,
boolean strict,
java.lang.String[] sPathMtbl)
Searches a method with the given Java name and all argument types. |
(package private) ClassData.MethodOverrideCheck |
searchOverrideableMethod(java.lang.String sMethodNameJava,
FieldData[] argTypes)
searches whether a method found in the first pass of a translated class is already declared in an super class or interface of this class. |
(package private) void |
setBodyForFinalize(ZbnfParseResultItem zbnfFinalizeMethod)
Sets the body for the finalize method. |
void |
setClassData(ClassData data)
|
private void |
stop()
Helper method for debugging. |
void |
testAndSetAmbiguousnessOfMethod(java.lang.String sNameJava)
Tests whether a method is registered, registers it or set it to ambiguous if it exists already. |
java.lang.String |
toString()
Helpfull for debugging in eclipse. |
void |
writeStructureClass(java.io.BufferedWriter out,
int recursion)
Writes the structure data of the class in file.stc. |
boolean |
xisObject()
|
java.lang.String |
xxxgetRefObjectJc()
returns a String, which describes the access to the ObjectJc-base, or return null, if the class isn't based on any class. |
boolean |
xxxisBasedOnObject()
|
boolean |
xxxisObject()
|
java.lang.String |
xxxtestAndcast(ClassData srcType,
java.lang.String value,
char intension)
tests wether a cast is necessary, if it, returns the casted value. |
(package private) java.lang.String |
xxxwrite_OwnOverrideableMethods()
|
java.lang.String |
xxxxxgetRefObjectJc()
returns a String, which describes the access to the ObjectJc-base, or return null, if the class isn't based on any class. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public final java.lang.String sClassNameC
public final java.lang.String sClassNameJava
public final java.lang.String sArgSensitiveName
public final java.lang.String sPackage
public final java.lang.String sClassNameJavaFullqualified
public final char cVaArgIdent
Z: boolean
B: byte, uint8
C: char
L: Object
D: double
F: float
I: int
J: long
S: short
z: zero terminated string literal
s: StringJc
b: StringBufferJc
x: ExceptionJc
t: OS_TimeStamp
.: unknown
java.lang.Class.getName().
public final java.lang.String sFileName
final GenerateFile fileContainsClass
public final java.lang.String sSourceOfClassData
public final boolean isStaticInstanciated
java2c = staticInstance is found in description of the class.
A class is a static instance if the class should not be created dynamically using garbage collection,
but only in the construction path of the application.
In such classes all final references to final classes (may not be staticInstance itself)
are simple pointers in the C Conversion. Otherwise enhanced references are to be used.
private final java.lang.String sInfo
public final boolean isFinal
public final boolean isNonStaticInner
public final boolean isConstant
public final char creationMode
private final boolean basedOnObject
public final boolean bEmbedded
private final boolean bInterface
public final boolean isAbstract
private boolean bFinalizeNeed
private ZbnfParseResultItem zbnfClass
private final boolean bExternal
private ZbnfParseResultItem zbnfFinalizeMethod
private short bitArrayNeed
need_Y(), isneed_Y() etc.
public final LocalIdents classLevelIdents
public final java.util.List<FieldData> classLevelIdentsOwn
private java.util.List<ClassData> innerClasses
private boolean hasFields
public final java.util.Map<java.lang.String,ClassData> classLevelUsageTypes
private java.util.TreeMap<java.lang.String,ClassData.CastInfo> castableInitializerFromType
#addCastInitializer(ClassData srcType, String cast)
and used in #testAndcast(ClassData srcType, String value, char intension).
private java.util.TreeMap<java.lang.String,ClassData.CastInfo> castableFromType
addCastFromType(ClassData srcType, String cast, String modes)
and at least used in FieldData#testAndcast(CCodeData).
This class provides the info via getCastInfoFromType(String)
The key is the C-typename.
private java.util.TreeMap<java.lang.String,ClassData.CastInfo> castableToType
addCastToType(ClassData srcType, String cast, String modes)
and at least used in FieldData#testAndcast(CCodeData).
This class provides the info via getCastInfoToType(String)
The key is the C-typename.
ClassData.InheritanceInfo inheritanceInfo
private java.util.TreeMap<java.lang.String,java.lang.Object> methods
Method or a List
private java.util.TreeMap<java.lang.String,Method> methodsCname
private java.util.TreeMap<java.lang.String,java.lang.Object> methodsCheckOverriding
ClassData.InheritanceInfo.methodTable reference and the index in the table.
Any occurrence of the same method in nested or parallel interfaces and super classes
is registered only one time here.
If a method is declared in an interface, and also declared in another parallel interface,
than implemented in a super class, it is found here only one time with its unambiguous name
(respecting same name but different parameter types). The unambiguous name is the same
in all occurrences of the same method.
private java.util.List<ClassData.MethodOverrideable> methodsOverrideableNew
inheritanceInfo and there in ClassData.InheritanceInfo.methodTable
of the primary level. A list but not an array is used first to add a unknown amount of methods.
ClassData.InheritanceInfo.methodTable
and in the generated method table in C-code is adequate the order of methods in the java source code.
The order is important if the compiled C-unit is used as part of library, and using C-units
should not be recompiled if inner functionality is changed in the library. The Headerfile contains
and shows this order. It is the same problem like virtual methods in C++.
final java.util.Queue<ClassData.MethodWithZbnfItem> methodsWithZbnf
int nrofConstructor
public final FieldData classTypeInfo
this or a unnamed instance of the class is used as a reference,
this field supplied the necessary instance infos.
It represents the instance as simple forward reference, like this
respectively ythis in C.
typeCodeInfo contains a quasi-FieldData for static access.
final CCodeData thisCodeInfo
final CCodeData ctorCodeInfo
final CCodeData typeCodeInfo
SecondPass.StatementBlock#gen_reference(String[], ZbnfParseResultItem, LocalIdents, CCodeData, char).
final ClassData outerClazz
private final java.util.List<ClassData.InitInfoVariable> variablesToInit
final java.util.List<ClassData.InitInfoVariable> staticVariables
private static final java.lang.String newLineIndent
indent(int)
| Constructor Detail |
|---|
ClassData(java.lang.String sSourceOfClassData,
GenerateFile fileContainsClass,
java.lang.String sFileName,
java.lang.String sPkgJava,
java.lang.String sNameJava,
java.lang.String sNameCP,
java.lang.String sArgSensitiveName,
char cVaArgIdent,
ClassData outerClassData,
ClassData superClassData,
ClassData[] ifcClassData,
ZbnfParseResultItem zbnfClass,
char access,
java.lang.String infos,
char creationMode)
sSourceOfClassData - fileContainsClass - sFileName - sPkgJava - sNameJava - sNameCP - sArgSensitiveName - cVaArgIdent - outerClassData - superClassData - ifcClassData - zbnfClass - infos - intension - Intension of creation, P: primary (file level), C: inner class,
Y: anonymous inner class at class level,
m, b etc: anonymous or not at statement block levelfileLevelIdents -
ClassData(java.lang.String sSourceOfClassData,
java.lang.String sPkgJava,
java.lang.String sNameJava,
java.lang.String sNameC,
java.lang.String sArgSensitiveName,
char cVaArgIdent,
java.lang.String sFileName,
char access,
java.lang.String infos)
| Method Detail |
|---|
public java.util.List<ClassData.InitInfoVariable> getVariablesToInit()
public ClassData getClassData()
getClassData in interface JavaSources.ClassDataOrJavaSrcFileJavaSources.ClassDataOrJavaSrcFile.getClassData()public JavaSrcTreeFile getJavaSrc()
getJavaSrc in interface JavaSources.ClassDataOrJavaSrcFileJavaSources.ClassDataOrJavaSrcFile.getJavaSrc()void setBodyForFinalize(ZbnfParseResultItem zbnfFinalizeMethod)
zbnfFinalizeMethod - ZbnfParseResultItem getBodyForFinalize()
zbnfFinalizeMethod - void need_Y()
boolean isneed_Y()
void need_YP()
boolean isneed_YP()
public void addField(java.lang.String sIdent,
FieldData identInfo)
public FieldData getFieldIdent(java.lang.String name)
name - The name of the field. The field can be local or in super scopes.
public boolean hasFields()
public void addCastInitializerFromType(ClassData srcType,
java.lang.String cast,
java.lang.String modeAccessDstSrc)
srcType - The src type for which the cast is valid.cast - String in form "pre?post". To implement the cast the pre and post part will wrap the value.
public void addCastFromType(ClassData srcType,
java.lang.String cast,
java.lang.String modeAccessDstSrc)
srcType - Type from which the cast is possiblecast - String in form "pre?post". To implement the cast the pre and post part will wrap the value.modeAccessDstSrc - first and second char is modeAccessDst and modeAccessSrc,
typically "**" if both are pointers or "%%" if both are primitives.
Only in special cases the modeAccess is differently
public void addCastToType(ClassData dstType,
java.lang.String cast,
java.lang.String modeAccessDstSrc)
dstType - Type to which the cast is possiblecast - String in form "pre?post". To implement the cast the pre and post part will wrap the value.modeAccessDstSrc - first and second char is modeAccessDst and modeAccessSrc,
typically "**" if both are pointers or "%%" if both are primitives.
Only in special cases the modeAccess is differently
public java.lang.String xxxtestAndcast(ClassData srcType,
java.lang.String value,
char intension)
#addCast(ClassData, String).
That is used to produce the casted return value.
srcType - The type of the valuevalue - The value string.intension - 'i' init-value may be in {...}
public void addMethod(java.lang.String sNameJava,
java.lang.String sNameUnambiguous,
int modifier,
FieldData returnType,
ClassData[] paramsType)
addMethod(String, String, int, org.vishia.java2C.FieldData, org.vishia.java2C.FieldData[])
is called with classTypeInfo.
sNameJava - Name of the method in JavasCName - Name of the method to translate in C. If more than 1 method with the same sNameJava is given,
the sCName should be unambiguous.modifier - Ones of ClassData.Method#modeStatic, ClassData.Method#modeNoThCxtreturnType - The type of return. It isn't a Classdata, but a IdentInfo,
because some additional properties like return by value or reference should be present.paramsType - Array of all argument types. They are given in form of pure types,
because they are taken with standard conventions: simple pointers or simple primitive types.
public void addMethod(java.lang.String sNameJava,
java.lang.String sNameUnambiguous,
FieldData returnType,
ClassData[] paramsType)
addMethod(String, String, int, FieldData, ClassData[])
sNameJava - sCName - returnType - paramsType -
public void addMethod(java.lang.String sNameJava,
java.lang.String sNameUnambiguous,
int modifier,
FieldData returnType)
sNameJava - sCName - modifier - returnType -
final Method addMethod(java.lang.String sMethodNameJava,
java.lang.String sMethodNameUnambiguous,
int modifier,
FieldData retType,
FieldData[] argTypes)
final Method addMethod(java.lang.String sMethodNameJava,
java.lang.String sMethodNameUnambiguous,
java.lang.String sImplementationName,
int modifier,
FieldData retType,
FieldData[] argTypes)
ClassData.InheritanceInfo.methodTable
(aggregation inheritanceInfo) is changed to the name of this method for all overridden methods.
It is possible that more as one overridden method is found, if the same method is defined
in an interface, in more as one parallel inherited interfaces or in more as one nested interfaces or super-classes.
sMethodNameJava - given method-name in Java or ctorO or ctorMsMethodNameUnambiguous - The java name plus argument type designations if the method is ambiguous.argTypes - Array of all argument types with there type modifier.modifier - Contains bits ClassData.Method#modeStatic, ClassData.Method#modeNoThCxt
or ClassData.Method#modeOverrideable. methodsOverrideableNew of this ClassData.
The keyname is ... TODO. The method name is also saved in ClassData.InheritanceInfo.methodTable.
This information is used primary to write out the method table. The names are copied and changed in an inherited class.retType - The type of return. It isn't a Classdata, but a IdentInfo,
because some additional properties like return by value or reference should be present.
private void addMethodToList(Method method)
methods and methodsCname
method -
ClassData.MethodOverrideCheck searchOverrideableMethod(java.lang.String sMethodNameJava,
FieldData[] argTypes)
sMethodNameJava - The method name in JavaargTypes - arg types of the found method.
public void addMethod(Method m)
m - The Method data.public void addEnhancedRefType(java.lang.String sRefType)
sRefType - The referenced type.void addInnerClass(ClassData innerClass)
innerClass - void completeFieldIdentsForInnerClasses()
void completeTypesForInnerClasses()
GenerateFile.runFirstPassFile(ZbnfParseResultItem, String, String, String)
of this class is finished. Then all types of this class, they are the inner classes,
are gathered. All inner classes have to know all the other inner classes too, the inner classes
should be known together. Additional the inner classes should know its outer one as type too.
public void needFinalize()
public void addMtblRefType(java.lang.String sRefType,
char intension)
sRefType - The referenced type.public void testAndSetAmbiguousnessOfMethod(java.lang.String sNameJava)
sNameJava - The method name.public boolean isAmbiguousnessMethod(java.lang.String sNameJava)
sNameJava -
private boolean checkParameterTypesMethod(Method methodTest,
FieldData[] paramsType)
Method getMethodPerCname(java.lang.String sNameC)
public Method searchMethod(java.lang.String sNameJavaP,
java.util.List<CCodeData> paramsTypeCheck,
boolean strict,
java.lang.String[] sPathMtbl)
sNameJavaP - The name in Java.paramsTypeCheck - All argument types. It is tested whether the argument types
are able to cast to the matching types.strict - true then the method is not created if if isn't found. It should be found.sPathMtbl - Starting with "", a seach in a super-class adds the path.
private Method checkParameterMethod(java.lang.Object omethodFound,
java.util.List<CCodeData> paramsTypeCheck)
public java.lang.String getClassCtype_s()
_s. The type name without this extension is useable,
if a C++-wrapper-class of that type is desired.
public java.lang.String getClassNameJava()
public java.lang.String getClassIdentName()
_s or _i on end.
The identification is used as postfix of the static visible class elements.
But the struct type have the additional postfix _s or _i
to to distinguish between its possible C++-class.
public java.lang.String getClassNameJavaFullqualified()
public boolean isPrimitiveType()
classLevelIdents is null.
public boolean isString()
public boolean xxxisObject()
public boolean xisObject()
public boolean isInterface()
public boolean isFinalizeNeed()
public ClassData getSuperClassData()
public ClassData getOuterClass()
public ClassData[] getInterfaces()
public java.lang.String xxxgetRefObjectJc()
public java.lang.String xxxxxgetRefObjectJc()
public boolean isBasedOnObject()
public boolean xxxisBasedOnObject()
public boolean isExternal()
public ClassData.CastInfo getCastInfoFromType(java.lang.String typeSrc)
typeSrc - Name of the source type.
public ClassData.CastInfo getCastInfoToType(java.lang.String typeSrc)
typeSrc - Name of the source type.
public ClassData.CastInfo getCastInitializerFromType(java.lang.String typeSrc)
typeSrc - Name of the source type.
int matchedToTypeSrc(ClassData src)
src - The type to compare
ClassData.CastInfo.kCastAble.ZbnfParseResultItem getParseResult()
void relinquishParseResult()
private java.lang.String indent(int recursion)
writeStructureClass(BufferedWriter, int)
recursion - nesting level
public void reportContent(Report console,
int reportlevel)
public java.lang.String gen_MethodTableDefinitionContent()
public java.lang.String gen_ClassCppDefinitionContent()
private int gen_MethodCpp(java.lang.StringBuilder u,
Method method,
int bitZchar)
java.lang.String genMethodTableContent(ClassData.InheritanceInfo inheritanceInfo,
java.lang.String sClassName,
int indent)
classDataP -
java.lang.String xxxwrite_OwnOverrideableMethods()
private void fillMethodsOverrideable(ClassData.InheritanceInfo inheritanceInfo,
java.lang.String sPathToMtbl,
java.lang.String sPathToBase)
methodsCheckOverriding with the informations given in inheritanceInfo.
This routine is called only after inheritanceInfo is initalized in the constructor of this.
In the picture ...TODO
inheritanceInfo - of the adequate level, this routine is called recursively for all supers and interfaces.public void completeInheritanceWithOwnMethods()
methodsOverrideableNew. It will be written
to inheritanceInfo.ClassData.InheritanceInfo.methodTable.
The order of the given is important for method table Mtbl in C
methodsOverrideableNew and the methodsCheckOverriding were cleared
(set to null) because its content isn't necessary for translation the other classes.
public void completeInheritanceWithListMethods(java.util.List<java.lang.String> methodNames)
inheritanceInfo.ClassData.InheritanceInfo.methodTable.
methodsOverrideableNew and the methodsCheckOverriding were cleared
(set to null) because its content isn't necessary for translation the other classes.
methodNames - List of names with that methods, which are to write in the Inheritanceinfo.
The order is important for method table Mtbl in Cprivate java.lang.String gen_MethodTableSuperStruct()
public java.lang.String toString()
toString in class java.lang.ObjectObject.toString()public LocalIdents getLocalIdents(java.lang.String sClassName)
JavaSources.ClassDataOrJavaSrcFile
getLocalIdents in interface JavaSources.ClassDataOrJavaSrcFilesClassName - Name of the element. Especially if it is a JavaSrcTreeFile,
it may be the name of the public class or another class in the file.
public JavaSrcTreePkg getJavaPkg()
JavaSources.ClassDataOrJavaSrcFile.getJavaPkg()
getJavaPkg in interface JavaSources.ClassDataOrJavaSrcFilepublic java.lang.String getTypeName()
JavaSources.ClassDataOrJavaSrcFile.getTypeName()
getTypeName in interface JavaSources.ClassDataOrJavaSrcFilepublic ConfigSrcPathPkg_ifc.Set getReplaceCinfo()
getReplaceCinfo in interface JavaSources.ClassDataOrJavaSrcFileJavaSources.ClassDataOrJavaSrcFile.getReplaceCinfo()public boolean isToTranslate()
isToTranslate in interface JavaSources.ClassDataOrJavaSrcFileJavaSources.ClassDataOrJavaSrcFile.isToTranslate()
public void writeStructureClass(java.io.BufferedWriter out,
int recursion)
throws java.io.IOException
out - destinationrecursion - nesting level
java.io.IOExceptionpublic void setClassData(ClassData data)
setClassData in interface JavaSources.ClassDataOrJavaSrcFileprivate void stop()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||