Reply To: Why does BridgePoint grammar allow ? as rval

homepage Forums BridgePoint/xtUML Usage and Training Why does BridgePoint grammar allow ? as rval Reply To: Why does BridgePoint grammar allow ? as rval

#5799
Lee Riemenschneider
Participant

In this discussion, a workaround was shown for how to create an out-of-scope unassigned inst_ref variable. The QMARK seems to be what was put into OAL for this purpose with any type of data variable.

The problem with inst_ref is the QMARK variable can’t be used inside a select, so a workaround must still be used.
ref = ?;
if (true)
select object instance foo of BAR;
ref = foo;
end if;
if (empty ref)
end if;

Verifier should probably support the QMARK. MC-3020 seemed to handle it OK in an experiment I ran.

In a discussion yesterday, Levi and I surmised that the proper handling of no assignment should be a default value for the type.
e.g.,
ref = ?;
if (false)
select object instance foo of BAR;
ref = foo;
end if;
ref will be empty here due to no assignment.