return struct;
}
private ValueType visitValueType(AST node) {
AST valueNode = node.getFirstChild();
ValueType value = new ValueType();
value.setModule(module);
value.setName(valueNode.toString());
AST memberModifierNode = valueNode.getNextSibling();
while (memberModifierNode != null) {
String memberModifierName = memberModifierNode.toString();
if (!memberModifierName.equals("private") && !memberModifierName.equals("public")) {
if (IDLTokenTypes.PREPROC_DIRECTIVE==memberModifierNode.getType()) {
if (memberModifierName.startsWith("pragma ID ")) {
memberModifierName = memberModifierName.substring(10);
String[] pragma = memberModifierName.split(" ");
if (pragma.length==2 && pragma[0]!=null && pragma[1]!=null && pragma[0].equals(value.getName())) {
pragma[1] = pragma[1].replace('"', ' ');
value.setId(pragma[1].trim());
}
}
} else {
// abstract operation
value.addOperation(visitOperation(memberModifierNode));
}
memberModifierNode = memberModifierNode.getNextSibling();
continue;
}
Member memberType = new Member();
memberType.setModifier(memberModifierName);
AST memberTypeNode = memberModifierNode.getNextSibling();
memberType.setDataType(findDataType(memberTypeNode));
AST memberNode = memberTypeNode.getNextSibling();
memberType.setName(memberNode.toString());
value.addMember(memberType);
memberModifierNode = memberNode.getNextSibling();
}
return value;
}