debugInfo.description = str;
return debugInfo;
}
private void compile(final Variable src) {
final OScope oscope = _structureStack.topScope();
if (src.getKind() == null)
throw new CompilationException(__cmsgs.errVariableDeclMissingType(src.getName()).setSource(src));
if (oscope.getLocalVariable(src.getName()) != null)
throw new CompilationException(__cmsgs.errDuplicateVariableDecl(src.getName()).setSource(src));
if (src.getTypeName() == null) throw new CompilationException(__cmsgs.errUnrecognizedVariableDeclaration(src.getName()));
OVarType varType;
switch (src.getKind()) {
case ELEMENT:
varType = resolveElementType(src.getTypeName());
break;
case MESSAGE:
varType = resolveMessageType(src.getTypeName());
break;
case SCHEMA:
varType = resolveXsdType(src.getTypeName());
break;
default:
throw new CompilationException(__cmsgs.errUnrecognizedVariableDeclaration(src.getName()));
}
OScope.Variable ovar = new OScope.Variable(_oprocess, varType);
ovar.name = src.getName();
ovar.declaringScope = oscope;
ovar.debugInfo = createDebugInfo(src, null);
ovar.extVar = compileExtVar(src);
oscope.addLocalVariable(ovar);
if (__log.isDebugEnabled())
__log.debug("Compiled variable " + ovar);
}