string FunctionCallNodeProcessor::getParameterName(GNode *node) { GNode* paNameNode = globalASTTreePointer->findNodeByIndex(node->getProperty("name")->mNodeProperty); if(paNameNode->getTreeCode()=="identifier_node") { if(paNameNode->getProperty("strg")!=NULL) { return paNameNode->getProperty("strg")->mStringProperty; } } return ""; }
void StructProcessor::processStructNode(GNode* node,StructAdaptor& structAdaptor) throw (Error) { if(node->getTreeCode()!="record_type") { throw Error(); } GNode* fieldNode = globalASTTreePointer->findNodeByIndex(node->getProperty("flds")->mNodeProperty); while(fieldNode->getTreeCode()!="type_decl") { if(fieldNode->getTreeCode()=="field_decl") { processFieldDecl(fieldNode,structAdaptor); } else if(fieldNode->getTreeCode()=="var_decl") { processVarDecl(fieldNode,structAdaptor); } else { throw Error(); } fieldNode = globalASTTreePointer->findNodeByIndex(fieldNode->getProperty("chan")->mNodeProperty); } }
int StructProcessor::getFieldSize(GNode* node) { GNode* sizeNode = globalASTTreePointer->findNodeByIndex(node->getProperty("size")->mNodeProperty); return Util::stringToInt(sizeNode->getProperty("low")->mStringProperty); }
string StructProcessor::getFieldName(GNode* node) { GNode* idNode = globalASTTreePointer->findNodeByIndex(node->getProperty("name")->mNodeProperty); return idNode->getProperty("strg")->mStringProperty; }