use of org.eclipse.titan.designer.AST.TTCN3.types.Boolean_Type in project titan.EclipsePlug-ins by eclipse.
the class For_Statement method check.
@Override
public /**
* {@inheritDoc}
*/
void check(final CompilationTimeStamp timestamp) {
if (lastTimeChecked != null && !lastTimeChecked.isLess(timestamp)) {
return;
}
if (definitions != null) {
definitions.check(timestamp);
}
if (initialAssignment != null) {
initialAssignment.check(timestamp);
}
if (finalExpression != null) {
finalExpression.setLoweridToReference(timestamp);
final IValue lastValue = finalExpression.getValueRefdLast(timestamp, Expected_Value_type.EXPECTED_DYNAMIC_VALUE, null);
final Type_type temp = lastValue.getExpressionReturntype(timestamp, Expected_Value_type.EXPECTED_DYNAMIC_VALUE);
switch(temp) {
case TYPE_BOOL:
if (!lastValue.isUnfoldable(timestamp)) {
if (((Boolean_Value) lastValue).getValue()) {
finalExpression.getLocation().reportConfigurableSemanticProblem(Platform.getPreferencesService().getString(ProductConstants.PRODUCT_ID_DESIGNER, PreferenceConstants.REPORTUNNECESSARYCONTROLS, GeneralConstants.WARNING, null), UNNECESSARYCONTROL);
} else {
finalExpression.getLocation().reportConfigurableSemanticProblem(Platform.getPreferencesService().getString(ProductConstants.PRODUCT_ID_DESIGNER, PreferenceConstants.REPORTUNNECESSARYCONTROLS, GeneralConstants.WARNING, null), NEVERREACH);
}
}
break;
default:
location.reportSemanticError(OPERANDERROR);
finalExpression.setIsErroneous(true);
break;
}
if (finalExpression.getMyGovernor() == null) {
finalExpression.setMyGovernor(new Boolean_Type());
}
}
if (stepAssignment != null) {
stepAssignment.check(timestamp);
}
if (statementblock != null) {
statementblock.setMyLaicStmt(null, this);
statementblock.check(timestamp);
// warning for "return" has been removed. Not valid problem
}
lastTimeChecked = timestamp;
}
use of org.eclipse.titan.designer.AST.TTCN3.types.Boolean_Type in project titan.EclipsePlug-ins by eclipse.
the class FieldSetting_Type method check.
@Override
public /**
* {@inheritDoc}
*/
void check(final CompilationTimeStamp timestamp, final FieldSpecification fieldSpecification) {
if (null != lastTimeChecked && !lastTimeChecked.isLess(timestamp)) {
return;
}
if (!Fieldspecification_types.FS_T.equals(fieldSpecification.getFieldSpecificationType())) {
location.reportSemanticError(TYPESETTINGEXPECTED);
type = new Boolean_Type();
type.setIsErroneous(true);
type.setFullNameParent(this);
}
lastTimeChecked = timestamp;
type.check(timestamp);
final IReferenceChain referenceChain = ReferenceChain.getInstance(IReferenceChain.CIRCULARREFERENCE, true);
type.checkRecursions(timestamp, referenceChain);
referenceChain.release();
}
use of org.eclipse.titan.designer.AST.TTCN3.types.Boolean_Type in project titan.EclipsePlug-ins by eclipse.
the class Referenced_Altguard method check.
@Override
public /**
* {@inheritDoc}
*/
void check(final CompilationTimeStamp timestamp) {
if (lastTimeChecked != null && !lastTimeChecked.isLess(timestamp)) {
return;
}
if (expression != null) {
final IValue last = expression.getValueRefdLast(timestamp, Expected_Value_type.EXPECTED_DYNAMIC_VALUE, null);
final Type_type temporalType = last.getExpressionReturntype(timestamp, Expected_Value_type.EXPECTED_DYNAMIC_VALUE);
if (!last.getIsErroneous(timestamp) && !Type_type.TYPE_BOOL.equals(temporalType)) {
last.getLocation().reportSemanticError(BOOLEANEXPECTED);
expression.setIsErroneous(true);
}
if (expression.getMyGovernor() == null) {
expression.setMyGovernor(new Boolean_Type());
}
}
if (reference != null) {
final Assignment assignment = reference.getRefdAssignment(timestamp, true);
if (assignment != null) {
if (Assignment_type.A_ALTSTEP.semanticallyEquals(assignment.getAssignmentType())) {
reference.getMyScope().checkRunsOnScope(timestamp, assignment, reference, "call");
} else {
reference.getLocation().reportSemanticError(MessageFormat.format(ALTSTEPREFERENCEEXPECTED, assignment.getAssignmentName()));
}
}
}
if (statementblock != null) {
statementblock.check(timestamp);
}
lastTimeChecked = timestamp;
}
use of org.eclipse.titan.designer.AST.TTCN3.types.Boolean_Type in project titan.EclipsePlug-ins by eclipse.
the class Operation_Altguard method check.
@Override
public /**
* {@inheritDoc}
*/
void check(final CompilationTimeStamp timestamp) {
if (lastTimeChecked != null && !lastTimeChecked.isLess(timestamp)) {
return;
}
if (expression != null) {
final IValue last = expression.getValueRefdLast(timestamp, Expected_Value_type.EXPECTED_DYNAMIC_VALUE, null);
final Type_type temporalType = last.getExpressionReturntype(timestamp, Expected_Value_type.EXPECTED_DYNAMIC_VALUE);
if (!last.getIsErroneous(timestamp) && !Type_type.TYPE_BOOL.equals(temporalType)) {
last.getLocation().reportSemanticError(BOOLEANEXPECTED);
expression.setIsErroneous(true);
}
if (expression.getMyGovernor() == null) {
expression.setMyGovernor(new Boolean_Type());
}
}
if (statement != null) {
statement.check(timestamp);
}
if (statementblock != null) {
statementblock.check(timestamp);
}
lastTimeChecked = timestamp;
}
use of org.eclipse.titan.designer.AST.TTCN3.types.Boolean_Type in project titan.EclipsePlug-ins by eclipse.
the class While_Statement method check.
@Override
public /**
* {@inheritDoc}
*/
void check(final CompilationTimeStamp timestamp) {
if (lastTimeChecked != null && !lastTimeChecked.isLess(timestamp)) {
return;
}
isInfiniteLoop = false;
if (expression != null) {
final IValue last = expression.getValueRefdLast(timestamp, Expected_Value_type.EXPECTED_DYNAMIC_VALUE, null);
final Type_type temporalType = last.getExpressionReturntype(timestamp, Expected_Value_type.EXPECTED_DYNAMIC_VALUE);
if (!last.getIsErroneous(timestamp)) {
if (!Type_type.TYPE_BOOL.equals(temporalType)) {
last.getLocation().reportSemanticError(BOOLEANEXPECTED);
expression.setIsErroneous(true);
} else if (!expression.isUnfoldable(timestamp)) {
if (!((Boolean_Value) last).getValue()) {
expression.getLocation().reportConfigurableSemanticProblem(Platform.getPreferencesService().getString(ProductConstants.PRODUCT_ID_DESIGNER, PreferenceConstants.REPORTUNNECESSARYCONTROLS, GeneralConstants.WARNING, null), NEVERREACH);
} else if (ReturnStatus_type.RS_NO.equals(hasReturn(timestamp))) {
isInfiniteLoop = true;
location.reportConfigurableSemanticProblem(Platform.getPreferencesService().getString(ProductConstants.PRODUCT_ID_DESIGNER, PreferenceConstants.REPORTINFINITELOOPS, GeneralConstants.WARNING, null), INFINITELOOP);
}
}
if (expression.getMyGovernor() == null) {
expression.setMyGovernor(new Boolean_Type());
}
}
}
if (statementblock != null) {
statementblock.setMyLaicStmt(null, this);
statementblock.check(timestamp);
}
lastTimeChecked = timestamp;
}
Aggregations