|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.vishia.java2C.StatementBlock
public class StatementBlock
This class generates all statements in one block. It is instanciated temporary for any statement block.
| Field Summary | |
|---|---|
int |
blockNestingCnt
The deepness of block nesting. |
private GenerateClass |
genClass
|
private int |
indent
Indentation of the block. |
boolean |
lastWasReturn
Saves, whether the last generated statement is a return. |
LocalIdents |
localIdents
The identifiers valid at this block level. |
private java.util.List<FieldData> |
mtblVariables
If any dynamic call occurs in this statement block without local knowledge of the correct interface type, a helpness variable is created. |
private boolean |
needPtrStringBuilderInThCxt
|
private int |
nrofMTBRef
Counter for "_mtbl8_9" of this block. |
private int |
nrofNew
The number of call of new in this blockStatment. |
private int |
nrofPersistentStrings
|
private int |
nrofStringBufForConcat
Counter for "_temp" + nrofStringBufForConcat of this block. |
private int |
nrofTempRefForConcat
Counter for "_temp" + nrofTempRefForConcat of this block. |
(package private) StatementBlock |
parent
The parent statement block. |
private SecondPass |
secondpass
|
private java.util.LinkedList<java.lang.Integer> |
sizesStringBufferConcat
|
private int |
sizeStringBuilderInStack
If set >0, a StringBuilderJc-instance with this direct buffer size should be generate in this block-level. |
private java.util.LinkedList<FieldData> |
tempRef
|
| Constructor Summary | |
|---|---|
StatementBlock(GenerateClass genClass,
LocalIdents parentLocalIdents,
boolean bClassLevel,
int indent)
|
|
StatementBlock(StatementBlock parent)
|
|
| Method Summary | |
|---|---|
(package private) java.util.List<CCodeData> |
gatherActParams(ZbnfParseResultItem zbnfMethod,
ZbnfParseResultItem zbnfDescription,
java.lang.String sMethodNameJava)
|
java.lang.String |
gen_ActivateGarbageCollection(int indent,
boolean bRet,
CCodeData cCodeReturn)
generates the statement for activateGarbageCollectorAccess_BlockHeapJc(). |
(package private) java.lang.String |
gen_AssignCheckCast(CCodeData leftVariable,
java.lang.String sAssignOperatorC,
CCodeData value)
Generates the assignment with check of necessity of cast. |
java.lang.String |
gen_assignment(ZbnfParseResultItem zbnfAssignment,
ZbnfParseResultItem zbnfDescription,
int indent,
LocalIdents localIdents,
char intension)
generates an assignment-statement from given parse result item < statement>. |
(package private) java.lang.String |
gen_assignValue(CCodeData leftVariable,
java.lang.String sAssignOperatorC,
ClassData[] typeValue,
ZbnfParseResultItem zbnfValue,
ZbnfParseResultItem zbnfDescription,
int indent,
LocalIdents localIdents,
char intension)
|
(package private) CCodeData |
gen_ConcatenatedStrings(java.lang.String sFirstString,
ClassData firstType,
char firstModeAccess,
java.util.Iterator<ZbnfParseResultItem> iterZbnf,
ZbnfParseResultItem zbnfDescription,
java.lang.String sStringBuilderToUse,
LocalIdents localIdents,
char xxxintension)
This routine generates an concatenated String. |
(package private) CCodeData |
gen_InternalMethodCall(ZbnfParseResultItem zbnfMethod,
ZbnfParseResultItem zbnfDescription,
java.lang.String sMethodNameJava,
ClassData declaringClass,
CCodeData envInstance,
java.lang.String sNewObject)
generates either a new or a simple method call. |
java.lang.String |
gen_newArray(ZbnfParseResultItem zbnfNewArray,
ClassData[] retTypeValue,
LocalIdents idents,
FieldData variable)
generates the expression for a new Type[...] expression. |
java.lang.String |
gen_newObj()
Returns a new identifier for a newObject. |
private CCodeData |
gen_newObject(ZbnfParseResultItem zbnfNewObject,
CCodeData referenceP)
generates the expression for a new Type(...) expression. |
(package private) java.lang.String |
gen_NewObjReferences(int indent)
Generates all variables which are used for newObject ( new operator). |
(package private) java.lang.String |
gen_persistringVarDefinitions(int indent)
Generates all StringJc-variables which are used to build persistent Strings. |
java.lang.String |
gen_persistringVariable()
Returns a new identifier for a persistent String. |
(package private) CCodeData |
gen_reference(java.lang.String[] concatenatedReference,
ZbnfParseResultItem zbnfReferenceP,
ZbnfParseResultItem zbnfDescription,
LocalIdents localIdentsParent,
CCodeData envClassCode,
char intension)
generates an reference to a variable or method call from parse result < reference>. |
private java.lang.String |
gen_returnStatement(ZbnfParseResultItem itemStatement,
ZbnfParseResultItem zbnfDescription,
FieldData typeReturn)
generates a return statement. |
private CCodeData |
gen_simpleMethodCall(ZbnfParseResultItem zbnfMethod,
ZbnfParseResultItem zbnfDescription,
CCodeData envInstance,
LocalIdents localIdents,
boolean maybeNonPersistent,
char intension)
generates a simple method call. |
CCodeData |
gen_simpleValue(ZbnfParseResultItem zbnfItem,
ZbnfParseResultItem zbnfDescription,
LocalIdents localIdents,
boolean maybeNonPersistent,
char intension,
boolean bRefNeed)
generates the code for ZBNF-< simpleValue>. |
(package private) java.lang.String |
gen_StackSize(ZbnfParseResultItem zbnfDescription)
|
java.lang.String |
gen_statement(ZbnfParseResultItem parent,
int indent,
LocalIdents localIdents,
FieldData typeReturn,
char intension)
generates a statement from given parse result item < statement>. |
java.lang.String |
gen_StringAssignment(int indent,
CCodeData leftValue,
java.lang.String sAssignOperatorC,
ZbnfParseResultItem zbnfValue,
ZbnfParseResultItem zbnfDescription,
LocalIdents localIdents,
char intension)
Generates an assignment to a String. |
(package private) java.lang.String |
gen_synchronizedBlock(ZbnfParseResultItem zbnfSync,
FieldData typeReturn,
int indent)
|
(package private) java.lang.String |
gen_TempRefs(int indent)
Generates all variables which are used for temporary references for concatenation-disentangle. |
java.lang.String |
gen_tempString()
Counts the #nrof and returns the name of a reference for new Objects. |
(package private) java.lang.String |
gen_TempStringBufferReferences(int indent)
Generates all variables which are used for new statements. |
java.lang.String |
gen_throwNew(ZbnfParseResultItem zbnfThrowNew,
ZbnfParseResultItem zbnfDescription,
LocalIdents localIdents,
FieldData typeReturn)
generates the expression for a |
java.lang.String |
gen_try_statement(ZbnfParseResultItem zbnfThrowNew,
int indent,
LocalIdents localIdents)
generates the expression for a < try_Statment> . |
CCodeData |
gen_value(ZbnfParseResultItem parent,
ZbnfParseResultItem zbnfDescription,
boolean maybeNonPersistent,
char intension)
generates the expression to get a value. |
java.lang.String |
gen_value(ZbnfParseResultItem parent,
ZbnfParseResultItem zbnfDescription,
ClassData[] retType,
LocalIdents localIdents,
boolean maybeNonPersistent,
char intension)
|
CCodeData |
gen_variableAccess(ZbnfParseResultItem itemVariable,
ZbnfParseResultItem zbnfDescription,
LocalIdents localIdents,
char intension,
CCodeData cCodeReferenceInput)
generates an access to a value in a variable or a using of a variable as left value. |
(package private) java.lang.String |
gen_VariableDefWithSimpleInitValue(FieldData variable,
ZbnfParseResultItem zbnfInitAssignment)
Generates the definition of variable with its initialization. |
java.lang.String |
gen_VariableInitAssignment(ZbnfParseResultItem zbnfVariableDefinition,
int indent)
generates the initial assignments to variables. |
(package private) java.lang.String |
genInitEmbeddedInstance(ZbnfParseResultItem zbnfNewObject,
ZbnfParseResultItem zbnfDescription,
FieldData fieldInfo,
java.lang.String sCCodeInstance,
int indent)
|
private java.lang.String |
genTemp_mtblRef(FieldData typeMtb,
CCodeData ref)
Generates a new identifier for a _mtbl8_9-variable and fills it with the given value. |
(package private) void |
stop()
|
private java.lang.String |
tempRefForConcat(FieldData src)
Generates a new identifier for a _temp8_9-variable and fills it with the given value. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private final GenerateClass genClass
private final SecondPass secondpass
private int nrofNew
new in this blockStatment.
The call of new is counted, generates some special statements in C.
private int nrofPersistentStrings
private java.util.LinkedList<FieldData> tempRef
private int nrofTempRefForConcat
"_temp" + nrofTempRefForConcat of this block.
private int nrofStringBufForConcat
"_temp" + nrofStringBufForConcat of this block.
private int nrofMTBRef
"_mtbl8_9" of this block.
private int sizeStringBuilderInStack
private boolean needPtrStringBuilderInThCxt
private java.util.LinkedList<java.lang.Integer> sizesStringBufferConcat
private final int indent
public final int blockNestingCnt
public boolean lastWasReturn
public LocalIdents localIdents
private java.util.List<FieldData> mtblVariables
final StatementBlock parent
| Constructor Detail |
|---|
StatementBlock(StatementBlock parent)
StatementBlock(GenerateClass genClass,
LocalIdents parentLocalIdents,
boolean bClassLevel,
int indent)
| Method Detail |
|---|
public java.lang.String gen_newObj()
nrofNew thereby.
java.lang.String gen_NewObjReferences(int indent)
new operator).
indent - indentation.
public java.lang.String gen_persistringVariable()
nrofPersistentStrings thereby.
java.lang.String gen_persistringVarDefinitions(int indent)
indent - indentation.
public java.lang.String gen_tempString()
#nrof and returns the name of a reference for new Objects.
java.lang.String gen_TempStringBufferReferences(int indent)
indent - indentation.
private final java.lang.String tempRefForConcat(FieldData src)
src - the type which should stores in the refmodeDef - 'n':_new8_9 created '&':_mtb8_9 else:_temp8_9
private final java.lang.String genTemp_mtblRef(FieldData typeMtb,
CCodeData ref)
ref - the value which should stores in the ref
java.lang.String gen_TempRefs(int indent)
indent - indentation.
public java.lang.String gen_ActivateGarbageCollection(int indent,
boolean bRet,
CCodeData cCodeReturn)
activateGarbageCollectorAccess_BlockHeapJc().
This is placed on end of a statement block or before an return-statement,
if inside new-statements are generated.
indent - number of indentations. 2 spaces per indentation are produced.
public java.lang.String gen_statement(ZbnfParseResultItem parent,
int indent,
LocalIdents localIdents,
FieldData typeReturn,
char intension)
throws java.text.ParseException,
java.io.FileNotFoundException,
java.lang.IllegalArgumentException,
java.io.IOException,
java.lang.IllegalAccessException,
java.lang.InstantiationException
get_description(ZbnfParseResultItem)
gen_assignment(ZbnfParseResultItem, int indent, LocalIdents) is be called immediate.
gen_statementBlock(ZbnfParseResultItem, int indent, LocalIdents)
is be called immediate with a new instance of StatementBlock.
gen_value(ZbnfParseResultItem, LocalIdents, char).
As well as the condition occupies more as one line in Java, in C it is written yet in one line.
Typically it is a suitable behavior. But if the condition expression is complex,
it is not so ideal in C. The reason for this behavior: The parser ignore new lines,
all are white spaces. The C-code is correct, but possibly not ideal readable. It is a good style
for writing comprehensible code separating a complex expressions in smaller parts.
To divide a conditional expression in smaller parts, some local boolean variable may be used.
It is anyhow effective at machine level.
if(...) in the same line.
But typically it is a statement block, and will be written in extra lines with the correct indentation.
else if(...) is given in Java, the if(...) after else
is a simple statement. Therefore it was be produced as else if(...) also in C.
It can be understand as a chain of if.
StacktraceJc.
The gen_ActivateGarbageCollection(int) is called
because the statement block may contain one or some new-Statements.
gen_simpleValue(ZbnfParseResultItem, LocalIdents, char intension)
is called with intension='m'. The methodcall is translated like a simple value,
it is syntactically the same. (void-value).
gen_throwNew(ZbnfParseResultItem, LocalIdents) is be called.
break is generated.
It are the same relations in Java likewise in C.
parent - The ZBNF parse result item which is a < statement>indent - Number of nesting level of the block to generate indentations of a line.localIdents - The indentation of the block: TODO use it as class element.typeReturn - The return type of the superior method if it contains a return statement.intension - Intension of call: 'c'-constructor body, 'm'-method body, 'b'-internal block, 'z'-part of if, while etc., 'f'-finalize body.
java.text.ParseException
java.lang.InstantiationException
java.lang.IllegalAccessException
java.io.IOException
java.lang.IllegalArgumentException
java.io.FileNotFoundException
private java.lang.String gen_returnStatement(ZbnfParseResultItem itemStatement,
ZbnfParseResultItem zbnfDescription,
FieldData typeReturn)
throws java.io.FileNotFoundException,
java.lang.IllegalArgumentException,
java.text.ParseException,
java.io.IOException,
java.lang.IllegalAccessException,
java.lang.InstantiationException
itemStatement - zbnfDescription - typeReturn -
java.io.FileNotFoundException
java.lang.IllegalArgumentException
java.text.ParseException
java.io.IOException
java.lang.IllegalAccessException
java.lang.InstantiationException
java.lang.String gen_synchronizedBlock(ZbnfParseResultItem zbnfSync,
FieldData typeReturn,
int indent)
throws java.io.FileNotFoundException,
java.lang.IllegalArgumentException,
java.text.ParseException,
java.io.IOException,
java.lang.IllegalAccessException,
java.lang.InstantiationException
java.io.FileNotFoundException
java.lang.IllegalArgumentException
java.text.ParseException
java.io.IOException
java.lang.IllegalAccessException
java.lang.InstantiationException
java.lang.String genInitEmbeddedInstance(ZbnfParseResultItem zbnfNewObject,
ZbnfParseResultItem zbnfDescription,
FieldData fieldInfo,
java.lang.String sCCodeInstance,
int indent)
throws java.text.ParseException,
java.io.FileNotFoundException,
java.lang.IllegalArgumentException,
java.io.IOException,
java.lang.IllegalAccessException,
java.lang.InstantiationException
java.text.ParseException
java.io.FileNotFoundException
java.lang.IllegalArgumentException
java.io.IOException
java.lang.IllegalAccessException
java.lang.InstantiationException
public java.lang.String gen_assignment(ZbnfParseResultItem zbnfAssignment,
ZbnfParseResultItem zbnfDescription,
int indent,
LocalIdents localIdents,
char intension)
throws java.text.ParseException,
java.io.FileNotFoundException,
java.lang.IllegalArgumentException,
java.io.IOException,
java.lang.IllegalAccessException,
java.lang.InstantiationException
gen_variable(ZbnfParseResultItem, LocalIdents , char intension, LocalIdents.IdentInfos[] retIdentInfo)
with intension='='. The argument retIdentInfo is a call by returned reference.
The returned object contains informations about the kind of the left-value variable,
especially if it is an enhanced reference.
gen_value(ZbnfParseResultItem, LocalIdents, char intension)
with intension='e'.
clearBackRefJc(variable)
is produced before the new reference is set to it, and setBackRefJc(variable)
after it is set. This subroutines implement the necessities of Garbage Collection for that enhanced references.
zbnfAssignment - The ZBNF parse result item which is a < assignment>indent - Number of nesting level of the block to generate indentations of a line.localIdents - The indentation of the block: TODO use it as class element.intension - Intension of call: 'c'-constructor body, 'm'-method body, 'b'-internal block, 'z'-part of if, while etc., 'f'-finalize body.
java.text.ParseException
java.lang.InstantiationException
java.lang.IllegalAccessException
java.io.IOException
java.lang.IllegalArgumentException
java.io.FileNotFoundException
java.lang.String gen_assignValue(CCodeData leftVariable,
java.lang.String sAssignOperatorC,
ClassData[] typeValue,
ZbnfParseResultItem zbnfValue,
ZbnfParseResultItem zbnfDescription,
int indent,
LocalIdents localIdents,
char intension)
throws java.io.FileNotFoundException,
java.lang.IllegalArgumentException,
java.text.ParseException,
java.io.IOException,
java.lang.IllegalAccessException,
java.lang.InstantiationException
leftVariable - sAssignOperatorC - typeValue - zbnfValue - zbnfDescription - indent - localIdents - intension -
java.io.FileNotFoundException
java.lang.IllegalArgumentException
java.text.ParseException
java.io.IOException
java.lang.IllegalAccessException
java.lang.InstantiationException
java.lang.String gen_AssignCheckCast(CCodeData leftVariable,
java.lang.String sAssignOperatorC,
CCodeData value)
leftVariable - The destination variable with name, type etc.sAssignOperatorC - The operator, mostly "=", maybe "+=" etc.value - The right value with name, type etc.
public java.lang.String gen_StringAssignment(int indent,
CCodeData leftValue,
java.lang.String sAssignOperatorC,
ZbnfParseResultItem zbnfValue,
ZbnfParseResultItem zbnfDescription,
LocalIdents localIdents,
char intension)
throws java.text.ParseException,
java.io.FileNotFoundException,
java.lang.IllegalArgumentException,
java.io.IOException,
java.lang.IllegalAccessException,
java.lang.InstantiationException
indent - sVariableC - typeLeftValue - sAssignOperatorC - sValueC - typeValue - intension - Intension of call: 'c'-constructor body, 'm'-method body, 'b'-internal block, 'z'-part of if, while etc., 'f'-finalize body.
java.text.ParseException
java.lang.InstantiationException
java.lang.IllegalAccessException
java.io.IOException
java.lang.IllegalArgumentException
java.io.FileNotFoundException
public CCodeData gen_variableAccess(ZbnfParseResultItem itemVariable,
ZbnfParseResultItem zbnfDescription,
LocalIdents localIdents,
char intension,
CCodeData cCodeReferenceInput)
throws java.text.ParseException,
java.io.FileNotFoundException,
java.lang.IllegalArgumentException,
java.io.IOException,
java.lang.IllegalAccessException,
java.lang.InstantiationException
ythis-> is written before.
ythis->super. is written before.
ythis->outer-> is written before.
-> or .,
depended on the reference kind. It may be an embedded struct.
The LocalIdents of the referencing object are used to desire it.
REFJc(variable) is generated to get the stored reference as value.
REFJc(variable) is a Macro to get the reference pointer inside an enhanced referende.
Especially if it is left value, the code of enhanced reference itself is generated.
itemVariable - The ZBNF parse result item of the < ?variable>-semantic.
It is a part of a simpleValue-syntax-prescript.localIdents - The Identifier info of the environment.intension - Info about the location respectively cause to call this method.
e-expression R-first reference r-nested reference =:leftvalue ...retIdentInfo - information about the variable in its context.
java.text.ParseException
java.lang.InstantiationException
java.lang.IllegalAccessException
java.io.IOException
java.lang.IllegalArgumentException
java.io.FileNotFoundException
CCodeData gen_reference(java.lang.String[] concatenatedReference,
ZbnfParseResultItem zbnfReferenceP,
ZbnfParseResultItem zbnfDescription,
LocalIdents localIdentsParent,
CCodeData envClassCode,
char intension)
throws java.text.ParseException,
java.io.FileNotFoundException,
java.lang.IllegalArgumentException,
java.io.IOException,
java.lang.IllegalAccessException,
java.lang.InstantiationException
this. is found in Java, designed with < this> in zbnf parse result,
ythis-> is generated.
super. is found in Java, designed with < super> in zbnf parse result,
ythis->super. is generated.
gen_variable(ZbnfParseResultItem, LocalIdents, char intension, FieldData[]).
It follows either by . or -> or the
The type of the variable returned in the FieldData[]
is stored as retIdentInfo and is used to determine if . or ->
follows after the variable. The variable may be an embedded reference,
than . should be following.
The .ref part of an enhanced reference is generated in gen_variable().
gen_simpleMethodCall(ZbnfParseResultItem, String sInstanceRef, FieldData, ClassData, LocalIdents)
is called to produce an call of the method in C. The type of return-value of the method
supplied in the FieldData-arg is used as retIdentInfo.
myRef.itsRef. or
myRef.method().itsRef.. In Java2C.zbnf the references are understand syntactically
as repetition. Therefore here all references are concatenated. The following separator
. or -> is determined always from type of the reference before.
The type-info of the last reference is returned in retInfo.
concatedReference - Part of reference, which are build with concatenated methods in Java.
In the result it is to be write as a expression separated with comma.zbnfReferences - The ZBNF parse result item of the < reference>.localIdents - The Identifier info of the environment.intension - Info about the location respectively cause to call this method.
e-expression R-first reference r-nested reference =:leftvalue ...retIdentInfo - information about the last reference type.
java.text.ParseException
java.lang.InstantiationException
java.lang.IllegalAccessException
java.io.IOException
java.lang.IllegalArgumentException
java.io.FileNotFoundException
public java.lang.String gen_value(ZbnfParseResultItem parent,
ZbnfParseResultItem zbnfDescription,
ClassData[] retType,
LocalIdents localIdents,
boolean maybeNonPersistent,
char intension)
throws java.text.ParseException,
java.io.FileNotFoundException,
java.lang.IllegalArgumentException,
java.io.IOException,
java.lang.IllegalAccessException,
java.lang.InstantiationException
java.text.ParseException
java.io.FileNotFoundException
java.lang.IllegalArgumentException
java.io.IOException
java.lang.IllegalAccessException
java.lang.InstantiationException
public CCodeData gen_value(ZbnfParseResultItem parent,
ZbnfParseResultItem zbnfDescription,
boolean maybeNonPersistent,
char intension)
throws java.text.ParseException,
java.io.FileNotFoundException,
java.lang.IllegalArgumentException,
java.io.IOException,
java.lang.IllegalAccessException,
java.lang.InstantiationException
{ [|< unaryOperator>] < simpleValue?> ? < binaryOperator> }.
Therefore #gen_simpleValue(ZbnfParseResultItem, LocalIdents, char) is called inside.
All components of the < value> are processed in one while-loop because it is stored one after another.
That includes also the [< ?conditional>... construct
in which is this method is called recursively.
parent - The parse result item which has the semantic <...?value>.intension - intension of generating:
java.text.ParseException
java.lang.InstantiationException
java.lang.IllegalAccessException
java.io.IOException
java.lang.IllegalArgumentException
java.io.FileNotFoundException
java.lang.InstantiationException
CCodeData gen_ConcatenatedStrings(java.lang.String sFirstString,
ClassData firstType,
char firstModeAccess,
java.util.Iterator<ZbnfParseResultItem> iterZbnf,
ZbnfParseResultItem zbnfDescription,
java.lang.String sStringBuilderToUse,
LocalIdents localIdents,
char xxxintension)
throws java.text.ParseException,
java.io.FileNotFoundException,
java.lang.IllegalArgumentException,
java.io.IOException,
java.lang.IllegalAccessException,
java.lang.InstantiationException
sFirstString - The first part of String expression found in gen_Value before calling this routine.firstType - The associated type to the sFirstStringfirstModeAccess - iterZbnf - iterator through parse result.zbnfDescription - description parse result of the whole expression (statement)sStringBuilderTmp - A given temporary StringBuilder to use.localIdents - creationMode -
java.text.ParseException
java.io.FileNotFoundException
java.lang.IllegalArgumentException
java.io.IOException
java.lang.IllegalAccessException
java.lang.InstantiationException
public CCodeData gen_simpleValue(ZbnfParseResultItem zbnfItem,
ZbnfParseResultItem zbnfDescription,
LocalIdents localIdents,
boolean maybeNonPersistent,
char intension,
boolean bRefNeed)
throws java.text.ParseException,
java.io.FileNotFoundException,
java.lang.IllegalArgumentException,
java.io.IOException,
java.lang.IllegalAccessException,
java.lang.InstantiationException
#gen_variable(ZbnfParseResultItem, LocalIdents, char, org.vishia.java2C.FieldData[]),
but a < variable> can be more as that, especially a left value. This is not considered here.
this or super.
#gen_newObject(ZbnfParseResultItem, CCodeData, LocalIdents).
#gen_simpleMethodCall(ZbnfParseResultItem, String, org.vishia.java2C.FieldData, LocalIdents)
is called.
zbnfItem - One of the alternatives in simpleValue::=...localIdents - of the environmentintension - calling intension.
java.text.ParseException
java.lang.InstantiationException
java.lang.IllegalAccessException
java.io.IOException
java.lang.IllegalArgumentException
java.io.FileNotFoundException
private CCodeData gen_simpleMethodCall(ZbnfParseResultItem zbnfMethod,
ZbnfParseResultItem zbnfDescription,
CCodeData envInstance,
LocalIdents localIdents,
boolean maybeNonPersistent,
char intension)
throws java.text.ParseException,
java.io.FileNotFoundException,
java.lang.IllegalArgumentException,
java.io.IOException,
java.lang.IllegalAccessException,
java.lang.InstantiationException
#gen_value(ZbnfParseResultItem, ClassData[], LocalIdents, char).
The method-name is built with the Java-method-name, following by the class name as postfix.
In C all methods should have a unique name.
&(ref) is generated if it is an embedded reference.
parent - sInstanceRef - The generated C-Code for the reference to the methods class-instance.
It is the output from #gen_reference(String[], ZbnfParseResultItem, LocalIdents, char, org.vishia.java2C.FieldData[])
For static methods this parameter is null.
If it is a constructor call, this is either the reference to the outer class or null.envInstanceInfo - The type-info of the class from which the method is member of.localIdents - The local identifier of this statement block level used for parameter values.maybeNonPersist - The result is accepted as non-persistent too.
java.text.ParseException
java.lang.InstantiationException
java.lang.IllegalAccessException
java.io.IOException
java.lang.IllegalArgumentException
java.io.FileNotFoundException
java.lang.InstantiationException
CCodeData gen_InternalMethodCall(ZbnfParseResultItem zbnfMethod,
ZbnfParseResultItem zbnfDescription,
java.lang.String sMethodNameJava,
ClassData declaringClass,
CCodeData envInstance,
java.lang.String sNewObject)
throws java.text.ParseException,
java.io.FileNotFoundException,
java.lang.IllegalArgumentException,
java.io.IOException,
java.lang.IllegalAccessException,
java.lang.InstantiationException
#gen_value(ZbnfParseResultItem, ClassData[], LocalIdents, char).
The method-name is built with the Java-method-name, following by the class name as postfix.
In C all methods should have a unique name.
&(ref) is generated if it is an embedded reference.
TODO
zbnfMethod - Zbnf parse result item from simpleMethodCall::=
or newObject::= or [ super ...],
may be null if a default constructor is called.sMethodNameJava - The methodname from JavadeclaringClass - The class where the method should be member of.
Mostly it is the ClassData of the envInstance: CCodeData.identInfo and there
FieldData.typeClazz, but if the super class is accessed, it is the super class of them.envInstance - Type and name of the reference to the instance, from which the method is called.
It is the output from #gen_reference(String[], ZbnfParseResultItem, LocalIdents, char, org.vishia.java2C.FieldData[])
For static methods this parameter is null.sNewObject - If it is a constructor call, the generated C-Code for access the new Object, else null.
it is used as second argument of ctor(...) respectively first argument of ctor(...) if envInstance == null.localIdents - The local identifier of this statement block level used for parameter values.
java.text.ParseException
java.lang.InstantiationException
java.lang.IllegalAccessException
java.io.IOException
java.lang.IllegalArgumentException
java.io.FileNotFoundException
java.lang.InstantiationException
java.util.List<CCodeData> gatherActParams(ZbnfParseResultItem zbnfMethod,
ZbnfParseResultItem zbnfDescription,
java.lang.String sMethodNameJava)
throws java.io.FileNotFoundException,
java.lang.IllegalArgumentException,
java.text.ParseException,
java.io.IOException,
java.lang.IllegalAccessException,
java.lang.InstantiationException
zbnfMethod - zbnfDescription -
java.lang.IllegalAccessException
java.io.IOException
java.text.ParseException
java.lang.IllegalArgumentException
java.io.FileNotFoundException
java.lang.InstantiationException
java.lang.String gen_StackSize(ZbnfParseResultItem zbnfDescription)
throws java.io.FileNotFoundException,
java.lang.IllegalArgumentException,
java.io.IOException,
java.lang.IllegalAccessException,
java.lang.InstantiationException,
java.text.ParseException
java.io.FileNotFoundException
java.lang.IllegalArgumentException
java.io.IOException
java.lang.IllegalAccessException
java.lang.InstantiationException
java.text.ParseException
private CCodeData gen_newObject(ZbnfParseResultItem zbnfNewObject,
CCodeData referenceP)
throws java.text.ParseException,
java.io.FileNotFoundException,
java.lang.IllegalArgumentException,
java.io.IOException,
java.lang.IllegalAccessException,
java.lang.InstantiationException
#gen_statementBlock(ZbnfParseResultItem, int, LocalIdents).
The variable nrofNew is used and incremented for that.
zbnfNewObject - The zbnf parse result item of the < newObject>reference - A reference before .new, used for inner non-static classes, or null for static or first-level classes.idents - The identifier of the environment.
java.text.ParseException
java.lang.InstantiationException
java.lang.IllegalAccessException
java.io.IOException
java.lang.IllegalArgumentException
java.io.FileNotFoundException
public java.lang.String gen_newArray(ZbnfParseResultItem zbnfNewArray,
ClassData[] retTypeValue,
LocalIdents idents,
FieldData variable)
throws java.text.ParseException,
java.io.FileNotFoundException,
java.lang.IllegalArgumentException,
java.io.IOException,
java.lang.IllegalAccessException,
java.lang.InstantiationException
gen_newObj().
The variable nrofNew is used and incremented for that.
zbnfNewArray - The zbnf parse result item of the < newObject>idents - The identifier of the environment.variable - The variable to assign to, or null
java.text.ParseException
java.lang.InstantiationException
java.lang.IllegalAccessException
java.io.IOException
java.lang.IllegalArgumentException
java.io.FileNotFoundException
public java.lang.String gen_try_statement(ZbnfParseResultItem zbnfThrowNew,
int indent,
LocalIdents localIdents)
throws java.text.ParseException,
java.io.FileNotFoundException,
java.lang.IllegalArgumentException,
java.io.IOException,
java.lang.IllegalAccessException,
java.lang.InstantiationException
zbnfThrowNew - localIdents -
java.text.ParseException
java.lang.InstantiationException
java.lang.IllegalAccessException
java.io.IOException
java.lang.IllegalArgumentException
java.io.FileNotFoundException
public java.lang.String gen_throwNew(ZbnfParseResultItem zbnfThrowNew,
ZbnfParseResultItem zbnfDescription,
LocalIdents localIdents,
FieldData typeReturn)
throws java.text.ParseException,
java.io.FileNotFoundException,
java.lang.IllegalArgumentException,
java.io.IOException,
java.lang.IllegalAccessException,
java.lang.InstantiationException
zbnfThrowNew - localIdents -
java.text.ParseException
java.lang.InstantiationException
java.lang.IllegalAccessException
java.io.IOException
java.lang.IllegalArgumentException
java.io.FileNotFoundException
public java.lang.String gen_VariableInitAssignment(ZbnfParseResultItem zbnfVariableDefinition,
int indent)
throws java.text.ParseException,
java.io.FileNotFoundException,
java.lang.IllegalArgumentException,
java.io.IOException,
java.lang.IllegalAccessException,
java.lang.InstantiationException
#gen_statementBlock(ZbnfParseResultItem , int, StatementBlock, ClassData, char)
zbnfVariableDefinition - Item of < variableDefinition>
java.io.IOException
java.text.ParseException
java.lang.InstantiationException
java.lang.IllegalAccessException
java.io.IOException
java.lang.IllegalArgumentException
java.io.FileNotFoundException
java.lang.String gen_VariableDefWithSimpleInitValue(FieldData variable,
ZbnfParseResultItem zbnfInitAssignment)
throws java.text.ParseException,
java.io.FileNotFoundException,
java.lang.IllegalArgumentException,
java.io.IOException,
java.lang.IllegalAccessException,
java.lang.InstantiationException
variable - zbnfInitAssignment -
java.text.ParseException
java.io.FileNotFoundException
java.lang.IllegalArgumentException
java.io.IOException
java.lang.IllegalAccessException
java.lang.InstantiationExceptionvoid stop()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||