}
public OMessageVarType.Part resolvePart(OScope.Variable var, String partname) {
if (!(var.type instanceof OMessageVarType))
throw new CompilationException(__cmsgs.errMessageVariableRequired(var.name));
OMessageVarType msgVarType = (OMessageVarType) var.type;
OMessageVarType.Part part = msgVarType.parts.get(partname);
if (part == null)
throw new CompilationException(__cmsgs.errUndeclaredMessagePart(var.name,
((OMessageVarType) var.type).messageType, partname));
return part;