int declarationtype = DeclaredSymbol.getDeclarationType(node);
if(declarationtype!=DeclaredSymbol.DECLARATIONTYPE_UNKNOWN) {
for(int i=0;i<node.getChildCount();i++) {
if(node.getChild(i) instanceof ASTidentifier) {
Token tok = node.getChild(i).getFirstToken();
store.addDeclaredSymbol(new DeclaredSymbol(tok.toString(),tok.beginLine,declarationtype));
}
if(node.getChild(i) instanceof ASTidentifier_list) {
for(int j=0;j<node.getChild(i).getChildCount();j++) {
if(node.getChild(i).getChild(j) instanceof ASTidentifier) {
Token tok = node.getChild(i).getChild(j).getFirstToken();
store.addDeclaredSymbol(new DeclaredSymbol(tok.toString(),tok.beginLine,declarationtype));
}
}
}
if(declarationtype==DeclaredSymbol.DECLARATIONTYPE_SUBPROGRAM && node.getChild(i) instanceof ASTsubprogram_specification) {
for(int j=0;j<node.getChild(i).getChildCount();j++) {
if(node.getChild(i).getChild(j) instanceof ASTidentifier) {
Token tok = node.getChild(i).getChild(j).getFirstToken();
store.addDeclaredSymbol(new DeclaredSymbol(tok.toString(),tok.beginLine,declarationtype));
}
}
}
}
}