Ejemplo n.º 1
0
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 "";
}
Ejemplo n.º 2
0
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);
	}
}
Ejemplo n.º 3
0
int
StructProcessor::getFieldSize(GNode* node)
{
	GNode* sizeNode = globalASTTreePointer->findNodeByIndex(node->getProperty("size")->mNodeProperty);
	return Util::stringToInt(sizeNode->getProperty("low")->mStringProperty);
}
Ejemplo n.º 4
0
string
StructProcessor::getFieldName(GNode* node)
{
	GNode* idNode = globalASTTreePointer->findNodeByIndex(node->getProperty("name")->mNodeProperty);
	return idNode->getProperty("strg")->mStringProperty;
}