in code/library/src/main/kotlin/org/fbme/lib/iec61499/parser/BasicFBTypeConverter.kt [129:153]
override fun extractDeclarationBody(identifier: Identifier?): AlgorithmDeclaration {
checkNotNull(element)
val algorithmDeclaration = factory.createAlgorithmDeclaration(identifier)
ParameterDeclarationConverter.extractAll(this, algorithmDeclaration.temporaryVariables)
val stBodyElement = element.getChild("ST")
if (stBodyElement != null) {
val st = factory.createAlgorithmBody(AlgorithmLanguage.ST)
algorithmDeclaration.body = st
val stText = stBodyElement.getAttributeValue("Text")?.unescapeXML()
if (stText != null) {
stAlgorithmConverter.convert(factory, stFactory, algorithmDeclaration, st, stText)
}
}
val otherBodyElement = element.getChild("Other")
if (otherBodyElement != null) {
val unknown =
factory.createAlgorithmBody(AlgorithmLanguage.unknown(otherBodyElement.getAttributeValue("Language")))
algorithmDeclaration.body = unknown
val text = otherBodyElement.getAttributeValue("Text")?.unescapeXML()
if (text != null) {
unknown.text = text
}
}
return algorithmDeclaration
}