use of org.eclipse.titan.designer.AST.IReferenceChain in project titan.EclipsePlug-ins by eclipse.
the class Octetstring_Value method checkEquality.
@Override
public /**
* {@inheritDoc}
*/
boolean checkEquality(final CompilationTimeStamp timestamp, final IValue other) {
final IReferenceChain referenceChain = ReferenceChain.getInstance(IReferenceChain.CIRCULARREFERENCE, true);
final IValue last = other.getValueRefdLast(timestamp, referenceChain);
referenceChain.release();
return Value_type.OCTETSTRING_VALUE.equals(last.getValuetype()) && value.equals(((Octetstring_Value) last).getValue());
}
use of org.eclipse.titan.designer.AST.IReferenceChain in project titan.EclipsePlug-ins by eclipse.
the class Referenced_Value method evaluateIsbound.
@Override
public /**
* {@inheritDoc}
*/
boolean evaluateIsbound(final CompilationTimeStamp timestamp, final Reference reference, final int actualSubReference) {
final IReferenceChain referenceChain = ReferenceChain.getInstance(IReferenceChain.CIRCULARREFERENCE, true);
final IValue last = getValueRefdLast(CompilationTimeStamp.getBaseTimestamp(), referenceChain);
referenceChain.release();
if (last == this) {
return false;
}
return last.evaluateIsbound(timestamp, reference, actualSubReference);
}
use of org.eclipse.titan.designer.AST.IReferenceChain in project titan.EclipsePlug-ins by eclipse.
the class Referenced_Value method generateCodeInitMandatory.
@Override
public /**
* {@inheritDoc}
*/
StringBuilder generateCodeInitMandatory(final JavaGenData aData, final StringBuilder source, final String name) {
final IReferenceChain referenceChain = ReferenceChain.getInstance(IReferenceChain.CIRCULARREFERENCE, true);
final IValue last = getValueRefdLast(CompilationTimeStamp.getBaseTimestamp(), referenceChain);
referenceChain.release();
if (last == this) {
final ExpressionStruct expression = new ExpressionStruct();
expression.expression.append(name);
expression.expression.append(".assign(");
reference.generateConstRef(aData, expression);
generateCodeExpressionOptionalFieldReference(aData, expression, reference);
expression.expression.append(")");
expression.mergeExpression(source);
return source;
}
// the code generation is based on the referred value
if (last.canGenerateSingleExpression() && myScope.getModuleScope() == last.getMyScope().getModuleScope()) {
// simple substitution for in-line values within the same module
source.append(MessageFormat.format("{0}.assign({1});\n", name, last.generateSingleExpression(aData)));
} else {
// TODO might need initialization see needs_init_precede
// TODO Value.cc:generate_code_init_refd
source.append(MessageFormat.format("{0}.assign({1});\n", name, last.getGenNameOwn(myScope)));
}
return source;
}
use of org.eclipse.titan.designer.AST.IReferenceChain in project titan.EclipsePlug-ins by eclipse.
the class Referenced_Value method evaluateIspresent.
@Override
public /**
* {@inheritDoc}
*/
boolean evaluateIspresent(final CompilationTimeStamp timestamp, final Reference reference, final int actualSubReference) {
final IReferenceChain referenceChain = ReferenceChain.getInstance(IReferenceChain.CIRCULARREFERENCE, true);
final IValue last = getValueRefdLast(CompilationTimeStamp.getBaseTimestamp(), referenceChain);
referenceChain.release();
if (last == this) {
return false;
}
return last.evaluateIspresent(timestamp, reference, actualSubReference);
}
use of org.eclipse.titan.designer.AST.IReferenceChain in project titan.EclipsePlug-ins by eclipse.
the class Referenced_Value method generateSingleExpression.
@Override
public /**
* {@inheritDoc}
*/
StringBuilder generateSingleExpression(final JavaGenData aData) {
final IReferenceChain referenceChain = ReferenceChain.getInstance(IReferenceChain.CIRCULARREFERENCE, true);
final IValue last = getValueRefdLast(CompilationTimeStamp.getBaseTimestamp(), referenceChain);
referenceChain.release();
if (last != this && last.canGenerateSingleExpression() && last.getMyScope().getModuleScope() == myScope.getModuleScope()) {
return last.generateSingleExpression(aData);
}
final ExpressionStruct expression = new ExpressionStruct();
reference.generateConstRef(aData, expression);
return expression.expression;
}
Aggregations