public class FBexpr_FBcl extends FBlock_FBcl
FBlock_FBcl.Blocktype, FBlock_FBcl.WriteFB| Modifier and Type | Field and Description |
|---|---|
protected boolean |
bCastoutput |
boolean |
bFullDTypePropagatedDin |
protected boolean |
bhasInputs |
private char |
cAccess
A char determining the kind of access to this FBexpr:
'~' it is inline in a expression term with only one output
'&' it is inline in an expression term but with some additional outputs necessary as call by reference in C/++.
|
static java.lang.String[] |
cmp2Operators |
private char |
cOp
A char determining the basic function of the expression.
|
static char |
cOpSetExpr |
static char |
cOpTextExpr |
protected DType_FBcl.DtIxmdl |
dTypeAllDin
This is the resulting highest data type of all inputs.
|
static java.lang.String[] |
limitOperators |
Module_FBcl.CreateMdl |
mdlcr |
int |
nrBitTrueFalse
The bit number used in the module's event mask to set result true and false if it is an
StdLibFBlocks_FBcl.fbtExprEv_OFB
-1 if not used. |
private java.lang.String |
sFn
A more complex function given as String, null if not used.
|
static java.lang.String[] |
shiftOperators |
din, dout, doutempty, dTypes, evin, evout, fbt, graphicPos, ixSlice, mdl, port, reference, sizeArrayFB, sOperators, steptime, sVersion, XXXfbPinDst, XXXfbPinSrcgraphicIntPos, name| Constructor and Description |
|---|
FBexpr_FBcl(FBtype_FBcl typeFb,
java.lang.String name,
Module_FBcl.CreateMdl parentModule,
XY_FBcl graphicPos) |
| Modifier and Type | Method and Description |
|---|---|
void |
adjustFBexrFnDtypes()
Adjust the type designations in
sFn for all expressions due to the propagated read pin types. |
char |
cAccess()
Returns the kind of access, see
cAccess |
boolean |
castOutput()
If true, then because of following compatible data type,
the output in the source code generated expression should be casted
to the DType stored on the exprOut.
|
char |
cOp() |
DType_FBcl |
dTypeAllDin()
Returns the effective deterministic DType as highest DType of all inner Din of the FBexpr.
|
DType_FBcl |
dtypeExprOut()
Returns the effective DType of the expression output, the scalar type of one of more FBexpr in one GBlock.
|
DType_FBcl.DtIxmdl |
dtypeIxMdlExprOut()
Gets the data type of the expression output, the scalar type of one of more FBexpr in one GBlock
as reference to a maybe deterministic type with
DType_FBcl.DtIxmdl.ixMdl(). |
char |
getAccess() |
Dout_FBcl |
getFirstDout()
Typical operation to get the only one Dout of an expression.
|
java.lang.String |
getFunction() |
boolean |
hasInputs() |
java.util.List<DinExpr_FBcl> |
iterDinExpr()
Returns an container which contains only the value inputs of this expression.
|
boolean |
setAccess(char cAccess)
Set the
cAccess(). |
void |
setCastOutput(boolean b) |
void |
setDTypeAllDin(DType_FBcl.DtIxmdl dtAllDin) |
void |
setExprPinFromPinsExprFn()
Sets the din[0] with name "expr" content to the
Din_FBcl.sConstant
from the values on all pins on Dinout_FBcl#sOperator and the sFn,
as it was read before with #setOperatorToPins() and maybe after adjustment written back. |
boolean |
setFunction(java.lang.String sFn) |
void |
setHasInputs() |
boolean |
setOperation(char cOp)
Set the
cOp(). |
void |
setOperatorToPins(Prj_FBcl prj)
Prepares the
DinExpr_FBcl.sOperator in that kind which is proper for code generation
following the expression term stored as constant on the first input with name 'expr'. |
din, dinForeach, dout, doutForeach, dtNonArrayFB, dTypes, evin, evin, evout, evout, fbt, getFbPinSrc, getNrofConnin, getNrofConnout, getNrofDin, getNrofDout, getNrofEvin, getNrofEvout, getOut1Properties, getPin, getPinEvInByName, getPinEvOutByName, getPinInByName, getPinOutByName, getSteptime, getSteptimeStr, getTypeFB, isKind, iterEvout, iterEvout, iterPins, ixSlice, kind, kindWhatis, setDtypeInFBlock, setSizeArray, setSliceIndex, sizeArray, sizeArray, toString, typeName, XXXgetConnin, XXXgetConnoutaddGpos, name, setNamepublic static final java.lang.String[] shiftOperators
public static final java.lang.String[] cmp2Operators
public static final java.lang.String[] limitOperators
public final Module_FBcl.CreateMdl mdlcr
private java.lang.String sFn
private char cOp
cOpSetExpr If the FBexpr has only one X input, but maybe also with a DinExpr_FBcl.pinK
cOpTextExpr if the sFn is set by a text in the expression graphic frame itself. It can be a function or a free expression text.
If the expression contains also an aggregation it is used in the expression generation TODO in a special way not implemented yet. 2024-03
DinExpr_FBcl.sOperator contains the name of the element to set.
The expression should have unconditionally an output variable of the proper type.
DinExpr_FBcl.sOperator contains the access text.
Dout_FBcl determines the access.
The Dout_FBcl is one of maybe more members of the FBexpr_FBcl
based on FBlock_FBcl.dout respectively Write_FBlock_FBwr.idxDout
setOperation(char) to see under which condition it is set.public static final char cOpTextExpr
public static final char cOpSetExpr
private char cAccess
public int nrBitTrueFalse
StdLibFBlocks_FBcl.fbtExprEv_OFB
-1 if not used.protected boolean bhasInputs
protected boolean bCastoutput
protected DType_FBcl.DtIxmdl dTypeAllDin
public transient boolean bFullDTypePropagatedDin
public FBexpr_FBcl(FBtype_FBcl typeFb, java.lang.String name, Module_FBcl.CreateMdl parentModule, XY_FBcl graphicPos)
public boolean setOperation(char cOp)
cOp - public char cOp()
public boolean castOutput()
public void setCastOutput(boolean b)
public void setDTypeAllDin(DType_FBcl.DtIxmdl dtAllDin)
public DType_FBcl dTypeAllDin()
dTypeAllDin() it is determined for only the module itself.
It is necessary to have a array of all non deterministic DTypes instead to check it more later, in this operation.public DType_FBcl.DtIxmdl dtypeIxMdlExprOut()
DType_FBcl.DtIxmdl.ixMdl().
It means the DType_FBcl.DtIx_.dt is the non deterministic one if it is non deterministic in the graphic.
Use dtypeExprOut() to get the deterministic type on ready translated graphics in the calling environment.*FBtype_FBcl is not returned.public DType_FBcl dtypeExprOut()
Module_FBcl.dTypeMdl(org.vishia.fbcl.fblock.DType_FBcl.DtIxmdl) if the FBlock_FBcl.mdl is given.public boolean hasInputs()
public void setHasInputs()
public boolean setAccess(char cAccess)
cOp - public char cAccess()
cAccesspublic char getAccess()
public boolean setFunction(java.lang.String sFn)
public java.lang.String getFunction()
public java.util.List<DinExpr_FBcl> iterDinExpr()
DinExpr_FBcl.pinK.
This is for code generation from the inputs.public Dout_FBcl getFirstDout()
FBoper_FBcl or expressions with specific function.FBlock_FBcl.dout is not set, else the first output.public void setOperatorToPins(Prj_FBcl prj)
DinExpr_FBcl.sOperator in that kind which is proper for code generation
following the expression term stored as constant on the first input with name 'expr'.
For example a first "*" is removed in a multiplication term and a first "/" is replaced by "1/" to force a division.
The form for code generation is always: An expression has operators only between its operands, not on first position.
Only for ADD a "+" or "-" is admissible, it is a unary operator for the expression.
See also
DinExpr_FBcl.sOperator for the K pins is missing. detected 2025-05prj - public void setExprPinFromPinsExprFn()
Din_FBcl.sConstant
from the values on all pins on Dinout_FBcl#sOperator and the sFn,
as it was read before with #setOperatorToPins() and maybe after adjustment written back.
The value on din[0] for Din_FBcl.sConstant is important for write out in IEC61499.
The operation setOperatorToPins(Prj_FBcl) is the backward operation,
if 'expr' was read from fbd file in IEC61499 coding.
For internal use the values on Dinout_FBcl#sOperator and the sFn are relevant.
org.vishia.fbcl.readOdg.OdgModule#createExprPins(org.vishia.fbcl.readOdg.OdgGBlock).public void adjustFBexrFnDtypes()
sFn for all expressions due to the propagated read pin types.
#fb instanceof FBexpr_FBclsFn - already read from the original