예제 #1
0
		virtual	void Visit( IqParseNode& node)
		{
			IqParseNode* child = static_cast<IqParseNode*>(
					node.GetInterface(ParseNode_Base))->pChild();
			while(child != NULL)
			{
				child->Accept(*this);
				child = child->pNextSibling();
			}
		}
예제 #2
0
void CqParseTreeViz::visitChildren(T& node)
{
	IqParseNode* child = static_cast<IqParseNode*>(
			node.GetInterface(ParseNode_Base))->pChild();
	while(child != NULL)
	{
		makeEdge(node, *child);
		child->Accept(*this);
		child = child->pNextSibling();
	}
}
예제 #3
0
void CqParseTreeViz::Visit(IqParseNodeTypeCast& node)
{
	setNodeProperty(node, "fillcolor", typeCastColor);
	setNodeProperty(node, "shape", "box");

	IqParseNode* operand = static_cast<IqParseNode*>(
			node.GetInterface(ParseNode_Base))->pChild();

	const char* pstrToType = gVariableTypeNames[node.CastTo() & Type_Mask];
	const char* pstrFromType = gVariableTypeNames[operand->ResType() & Type_Mask];
	setNodeProperty(node, "label", 
			boost::format("%s<-\\n<-%s") % pstrToType % pstrFromType);
	visitChildren(node);
}
예제 #4
0
void CqParseTreeViz::Visit(IqParseNodeShader& node)
{
	setNodeProperty(node, "label", boost::format(
			"{%s shader \\\"%s\\\" | {<args> args | <code> code } }")
			% node.strShaderType() % node.strName());
	setNodeProperty(node, "fillcolor", functionColor);
	setNodeProperty(node, "shape", "record");
	IqParseNode* code = static_cast<IqParseNode*>(
			node.GetInterface(ParseNode_Base))->pChild();
	if(code)
	{
		IqParseNode* args = code->pNextSibling();
		if(args)
		{
			makeEdge(node, *args, "args");
			args->Accept(*this);
		}
		makeEdge(node, *code, "code");
		code->Accept(*this);
	}
}