public class GenJava_Statement_JgenMdl
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
(package private) java.util.List<FBlock_JgenMdl> |
blocksProcessed
Current dstBlocks for parts.
|
private java.util.List<FBlock_JgenMdl> |
blocksToProcess
Current dstBlocks for parts.
|
(package private) GenJava_Class_JgenMdl |
clazz |
(package private) java.util.List<FBlock_JgenMdl> |
newBlocksToProcess
New srcBlock for parts which will be stored as dstBlock for previous depending part.
|
Constructor and Description |
---|
GenJava_Statement_JgenMdl(GenJava_Class_JgenMdl clazz) |
Modifier and Type | Method and Description |
---|---|
(package private) void |
addBlockToProcess(FBlock_JgenMdl block)
Add a end block to process
#genOperationPart(boolean) |
(package private) void |
addCheckVector(java.lang.Appendable out,
Connection_FBcl con,
FBlock_JgenMdl stmBlock)
Yet only used for input ports.
|
private void |
addInport(FBlock_Port_JgenMdl inport,
FBlock_JgenMdl stmBlock) |
private GenJava_Class_JgenMdl.ClassVar |
addInterNodeBlock(ConnOut_FBcl outconSrc,
java.lang.String nameOutconSrc,
FBlock_JgenMdl stmBlock)
Registers an Block which's output is an input for an expression and creates an variable for that output..
|
(package private) void |
addNewBlocktoProcess(FBlock_JgenMdl fb) |
private GenJava_Class_JgenMdl.ClassVar |
checkAddInternode(ConnOut_FBcl currOutExpr,
FBlock_JgenMdl currBlock,
Connection_FBcl stmCon,
FBlock_JgenMdl stmBlock)
Checks all
ConnOut_FBcl of a block of a part whether it is connected to an Outport_Block or #addInterNodeBlock(ConnOut_FBcl, FBlock_JgenMdl, boolean) . |
private void |
checkConnectionIntegrity(Connection_FBcl con)
It is only for internal check
|
private void |
genCallOperBlock(java.lang.Appendable out,
Operation_FBlock_JgenMdl opBlock,
FBlock_JgenMdl stmBlock)
Generates code for a found
Operation_FBlock_JgenMdl from a library or sub module. |
private void |
genExpr(FBlock_JgenMdl dst1,
FBlock_JgenMdl stmBlock,
ConnOut_FBcl outconExpr,
int recursiveCount)
Generate an expression backward starting on a given dst1 block.
|
private boolean |
genExprArgs(java.lang.Appendable out,
ConnOut_FBcl currOutExpr,
FBlock_JgenMdl currBlock,
FBlock_JgenMdl stmBlock,
java.lang.String[] sSeparators,
int recursiveCount) |
private void |
genInstance(java.lang.Appendable out,
FBlock_JgenMdl fb) |
private void |
genStatement(FBlock_JgenMdl stmBlock)
Generate a Java-statement from the model which delivers the output(s) of 1 block.
|
(package private) void |
genStatements(java.util.List<FBlock_JgenMdl> parts) |
private void |
XXXregisterUpdateConnection(ConnOut_FBcl outCon) |
private java.util.List<FBlock_JgenMdl> blocksToProcess
java.util.List<FBlock_JgenMdl> newBlocksToProcess
java.util.List<FBlock_JgenMdl> blocksProcessed
final GenJava_Class_JgenMdl clazz
public GenJava_Statement_JgenMdl(GenJava_Class_JgenMdl clazz)
clazz
- blocksInOrder
- it is a composite of GenJava_Class_JgenMdl#blocksInOrder
. Only given here to document that dependency.void addBlockToProcess(FBlock_JgenMdl block)
#genOperationPart(boolean)
block
- void genStatements(java.util.List<FBlock_JgenMdl> parts) throws java.io.IOException
java.io.IOException
private void XXXregisterUpdateConnection(ConnOut_FBcl outCon)
private void genStatement(FBlock_JgenMdl stmBlock) throws java.io.IOException
FBlock_Port_JgenMdl
or any other block for a statement inside a operation.
It stops on Blocks outputs which are connected to other Blocks too (with more as 1 connection).
StatementData_JgenMdl
in its FBlock_JgenMdl.stm
if not done.
StatementData_JgenMdl.javaCode
is expected null, it is aggregated to a StringBuilder for the Java code of this statement.
#genExpr(FBlock_JgenMdl, FBlock_JgenMdl, int)
is invoked for the expression of this part.
FBlock_JgenMdl.stm
StatementData_JgenMdl.javaCode
StringBuilder of the dstBlock for this part.stmBlock
- The block from which the connections are traversed backward, this block is the statement block.java.io.IOException
private void genExpr(FBlock_JgenMdl dst1, FBlock_JgenMdl stmBlock, ConnOut_FBcl outconExpr, int recursiveCount) throws java.io.IOException
GenJava_Class_JgenMdl#intermediateVars
.
..... gain * .....The routine is recursively called for expression arguments if an FB with more as one input is processed or an operation should be called:
...... operation( expression, expression, input).... ..... ( expression + expression - input ) .....The routine stops if an output is reached which is connected to more as one other inputs, one of them is this input. That is an input value for this expression. For that input values a variable in Java is generated which is filled with its appropriate expression.
newBlocksToProcess
via #addEnds(FBlock_JgenMdl, FBlock_JgenMdl)
.
StatementData_JgenMdl#order
which is lesser than the own order from stmBlock argument. That determines the execution order of expressions.
See #addEnds(FBlock_JgenMdl, FBlock_JgenMdl)
and #orderToStart(FBlock_JgenMdl, int, int)
.
newBlocksToProcess
is copied to blocksToProcess
in the calling loop to generate further expressions for the new found Blocks.dst1
- The block from which the expression will be backward generated maybe recursively.outconExpr
- The ConnOut_FBcl
which's value should be supplied by this expression.
It is null for an state block.
If this outCon has more as one inputs, on start of this routine #addInterNodeBlock(ConnOut_FBcl, FBlock_JgenMdl, boolean)
is called but not with bStates.
if the Connection_FBcl#parentBlock
has another output as return value, addInterNodeBlock is invoked too.stmBlock
- The last block of the part, it is the FBlock for the statement.
The first start block for the whole expression with all recursions. It is named 'last' because it is the last or end block for the expression.
The dstBlock will contain the generated Java expression line in FBlock_JgenMdl.stm
and there StatementData_JgenMdl.javaCode
.
The recursively processed blocks do not have an association to FBlock_JgenMdl.stm
because there are inside the expression.bStates
- true if the expression is for input to state variable calculation. Other handling on #addInterNodeBlock(FBlock_JgenMdl, FBlock_JgenMdl, boolean)
recursiveCount
- it is only to detect to much recursions. The complexity is never so far that more as 100 recursions are called.java.io.IOException
private boolean genExprArgs(java.lang.Appendable out, ConnOut_FBcl currOutExpr, FBlock_JgenMdl currBlock, FBlock_JgenMdl stmBlock, java.lang.String[] sSeparators, int recursiveCount) throws java.io.IOException
java.io.IOException
void addCheckVector(java.lang.Appendable out, Connection_FBcl con, FBlock_JgenMdl stmBlock) throws java.io.IOException
out
- con
- stmBlock
- java.io.IOException
private void addInport(FBlock_Port_JgenMdl inport, FBlock_JgenMdl stmBlock)
private void genCallOperBlock(java.lang.Appendable out, Operation_FBlock_JgenMdl opBlock, FBlock_JgenMdl stmBlock) throws java.io.IOException
Operation_FBlock_JgenMdl
from a library or sub module.
Operation_FBlock_JgenMdl.dependingOperBlocks
are regarded to build entries in
opBlock.StatementData_JgenMdl.stms_src
and prevBlock.StatementData_JgenMdl.parts_dst
.
Operation_FBlock_JgenMdl.dependingOperBlocks
are added to the newBlocksToProcess
.
GenJava_Class_JgenMdl#sortBlocksToOperations()
that parts of the depending operations
are recognized via StatementData_JgenMdl.stms_src
for sorted parts.
out
- opBlock
- thats operation should be called. Thats Operation_FBlock_JgenMdl.dependingOperBlocks
should be stored in stmBlock. StatementData_JgenMdl.stms_src
and backjava.io.IOException
private void genInstance(java.lang.Appendable out, FBlock_JgenMdl fb) throws java.io.IOException
java.io.IOException
private GenJava_Class_JgenMdl.ClassVar checkAddInternode(ConnOut_FBcl currOutExpr, FBlock_JgenMdl currBlock, Connection_FBcl stmCon, FBlock_JgenMdl stmBlock) throws java.io.IOException
ConnOut_FBcl
of a block of a part whether it is connected to an Outport_Block or #addInterNodeBlock(ConnOut_FBcl, FBlock_JgenMdl, boolean)
.
Only the first scalar output will not be handled. It is returned.
This routine is called for any part of the operation, for the stmBlock of the part and for all blocks inside a part.
If it is, adds to the #outports
and store this operation in FBlock_Port_JgenMdl#operation
to find this operation on the Outport.outCon
- java.io.IOException
private GenJava_Class_JgenMdl.ClassVar addInterNodeBlock(ConnOut_FBcl outconSrc, java.lang.String nameOutconSrc, FBlock_JgenMdl stmBlock)
#genExpr(FBlock_JgenMdl, FBlock_JgenMdl, int)
for the inputs of the expression.
GenJava_Class_JgenMdl.classVars
.
FBlock_JgenMdl.stm
is aggregated if not done already.
newBlocksToProcess
if it does not contain a Java source code already (Test StatementData_JgenMdl.javaCode
)
and if bStates = false. Therewith the code to process this block will be generated for this operation in the subsequent.
StatementData_JgenMdl.stms_src
is created. The startBlock is added to that list.
With them the input blocks are known for each part (Java expression).
outconSrc
- the used connection from the srcBlock. The block which is the input of an expression, should be register.stmBlock
- The last output block of the expression. It is necessary for execution order. null for InterNode for update variables.java.io.IOException
void addNewBlocktoProcess(FBlock_JgenMdl fb)
private void checkConnectionIntegrity(Connection_FBcl con)
con
-