Example #1
0
void PointerType::fromParseNode(const ParseNode& node) {
	mType = parseType(node, mIsConst);
	SASSERT(mType);

	mSize = node.getIntAttr("size");
	mAlign = node.getIntAttr("align");
}
Example #2
0
void ArrayType::fromParseNode(const ParseNode& node) {
	bool isConst;
	mType = parseType(node, isConst);
	mMin = node.getIntAttr("min");
	mMaxString = node.getAttr("max");
	//mMax = atoi(mMaxString.c_str());
	int res = sscanf(mMaxString.c_str(), "%i", &mMax);
	SASSERT(res == 1);
	mAlign = node.getIntAttr("align");
}
Example #3
0
void Function::fromParseNode(const ParseNode& node) {
	mName = node.getAttr("name");
	mReturns = getParseNodeFromId(node.getAttr("returns"))->base;
	mContext = getParseNodeFromId(node.getAttr("context"))->base;
	mIsExtern = node.getAttr("extern", false) !="";

	for(size_t i = 0; i < node.children.size(); i++) {
		const ParseNode* pn = node.children[i];
		Argument* arg = new Argument();
		arg->fromParseNode(*pn);
		mArguments.push_back(arg);
	}

	mLocation = new Location(node.getIntAttr("line"), (File*)getParseNodeFromId(node.getAttr("file"))->base);

	
	string attributes = node.getAttr("attributes", false);
	if(attributes != "") {
		map<string, string> attrMap;
		System::parseAttributes(attributes, attrMap);
		mRangeExpression = attrMap["range"];
	}
}
Example #4
0
void Typedef::fromParseNode(const ParseNode& node) {
	mName = node.getAttr("name");
	mContext = getParseNodeFromId(node.getAttr("context"))->base;
	mLocation = new Location(node.getIntAttr("line"), (File*)getParseNodeFromId(node.getAttr("file"))->base);
	mType = getParseNodeFromId(node.getAttr("type"))->base;
}