Example #1
0
void DumpVisitor::PutNodeName(const Node &g) const
{
	if (g.GetName().empty())
		Output("%s\n", g.GetTypeName());
	else
		Output("%s - %s\n", g.GetTypeName(), g.GetName().c_str());
}
Example #2
0
void DumpVisitor::PutNodeName(const Node &g) const
{
	if (g.GetName().empty())
		std::cout << g.GetTypeName() << std::endl;
	else
		std::cout << g.GetTypeName() << " - " << g.GetName() << std::endl;
}
Example #3
0
void DumpVisitor::ApplyNode(Node &n)
{
	for(int i=0; i<m_level; i++)
		std::cout << "  ";

	if (n.GetName().empty())
		std::cout << n.GetTypeName() << std::endl;
	else
		std::cout << n.GetTypeName() << " - " << n.GetName() << std::endl;
}
Example #4
0
Node* Parser::PostfixExpr() {
	Node *left = PrimaryExpr();

	if(oper == ROUND_LEFT_BRACKET) {
		if( !simple && symStack->FindVar(left->GetName())->GetSymType() != FUNCTION )
			throw SemanticException(currentToken, "Term not a function");

		Next();
		Node *args = ArgumentExprList();

		if(oper != ROUND_RIGHT_BRACKET)
			throw ParserException(currentToken, "Postfix expression without ')'");

		Next();

		SymbolType type = ( (SymFunction*)( symStack->FindVar(left->GetName()) ) )->GetReturnType();

		return new NodeCall(type, left->GetName(), args);
	}
	if(oper == SQUARE_LEFT_BRACKET) {
		if( !simple && symStack->FindVar(left->GetName())->GetSymType() != ARRAY )
			throw SemanticException(currentToken, "Term not an array");

		Next();
		Node *link = Expression();

		if(oper == SQUARE_RIGHT_BRACKET) {
			Next();
			return new NodeBinary(left, ARRAY_INDEX,  link);
		}
		else throw ParserException(currentToken, "No ']'");
	}
	if(oper == OPER_POINT || oper == OPER_ARROW) {
		TokenValue _oper = oper;
		Next();
		Node *right = PrimaryExpr();
		if(right == NULL)
			throw ParserException(currentToken, "No field");

		return new NodeBinary(left, _oper, right);
	}
	if(oper == OPER_INC || oper == OPER_DEC) {
		TokenValue _oper = oper;
		Next();
		return new NodeUnary(_oper, left);
	}
	return left;
}
Example #5
0
// GetCompilerNode
//------------------------------------------------------------------------------
bool FunctionObjectList::GetCompilerNode( NodeGraph & nodeGraph, const BFFIterator & iter, const AString & compiler, CompilerNode * & compilerNode ) const
{
    Node * cn = nodeGraph.FindNode( compiler );
    compilerNode = nullptr;
    if ( cn != nullptr )
    {
        if ( cn->GetType() == Node::ALIAS_NODE )
        {
            AliasNode * an = cn->CastTo< AliasNode >();
            cn = an->GetAliasedNodes()[ 0 ].GetNode();
        }
        if ( cn->GetType() != Node::COMPILER_NODE )
        {
            Error::Error_1102_UnexpectedType( iter, this, "Compiler", cn->GetName(), cn->GetType(), Node::COMPILER_NODE );
            return false;
        }
        compilerNode = cn->CastTo< CompilerNode >();
    }
    else
    {
        // create a compiler node - don't allow distribution
        // (only explicitly defined compiler nodes can be distributed)
        AStackString<> compilerClean;
        NodeGraph::CleanPath( compiler, compilerClean );
        compilerNode = nodeGraph.CreateCompilerNode( compilerClean );
        VERIFY( compilerNode->GetReflectionInfoV()->SetProperty( compilerNode, "AllowDistribution", false ) );
    }

    return true;
}
Example #6
0
// GetObjectListNodes
//------------------------------------------------------------------------------
bool Function::GetObjectListNodes( const BFFIterator & iter,
                                   const Array< AString > & objectLists,
                                   const char * inputVarName,
                                   Dependencies & nodes ) const
{
    NodeGraph & ng = FBuild::Get().GetDependencyGraph();

	const AString * const  end = objectLists.End();
	for ( const AString * it = objectLists.Begin(); it != end; ++it )
	{
		const AString & objectList = *it;

		// get node for the dir we depend on
		Node * node = ng.FindNode( objectList );
		if ( node == nullptr )
		{
            Error::Error_1104_TargetNotDefined( iter, this, inputVarName, objectList );
            return false;
        }
		else if ( node->GetType() != Node::OBJECT_LIST_NODE )
		{
			Error::Error_1102_UnexpectedType( iter, this, inputVarName, node->GetName(), node->GetType(), Node::OBJECT_LIST_NODE );
			return false;
		}

		nodes.Append( Dependency( node ) );
	}
	return true;
}
Example #7
0
af::Node OutValue::GetNodeOfValue()
{
	if(Root.IsNull())
	{
		throw NoLabelInicialisationException("OutValue: label do not inicialised.");
	}

	TIterator TITER;

	Node vallr;
	TITER.Init(Root, false);
	while (TITER.More())
	{
		Node val = (Node)TITER.Value();
		QString name = val.GetName();
		
		if(name == "Node" || name == "DOF1")
		{
			return val;
		}
		TITER.Next();
	}

	TElement e(Root);
	throw NoExistException("OutValue: Node Of Value do not exists.", e);

	return vallr;
}
Example #8
0
// GetFileNode
//------------------------------------------------------------------------------
bool Function::GetFileNode( const BFFIterator & iter, Node * & fileNode, const char * name, bool required ) const
{
	// get the string containing the node name
	AStackString<> fileNodeName;
	if ( GetString( iter, fileNodeName, name, required ) == false )
	{
		return false;
	}

	// handle not-present
	if ( fileNodeName.IsEmpty() )
	{
		ASSERT( required == false ); // GetString should have managed required string
		fileNode = nullptr;
		return true;
	}

	// get/create the FileNode
	NodeGraph & ng = FBuild::Get().GetDependencyGraph();
	Node * n = ng.FindNode( fileNodeName );
	if ( n == nullptr )
	{
		n = ng.CreateFileNode( fileNodeName );
	}
	else if ( n->IsAFile() == false )
	{
		Error::Error_1103_NotAFile( iter, this, name, n->GetName(), n->GetType() );
		return false;
	}
	fileNode = n;
	return true;
}
Example #9
0
void WizardSkill0::HandleNodeRemoved(StringHash eventType, VariantMap& eventData)
{
	using namespace NodeRemoved;

	Node* nohd = static_cast<Node*>(eventData[P_NODE].GetPtr());

	if (nohd->GetName() != "meteor")
	{
		return;
	}

	Node* fire = nohd->GetChild("fire");

	if (!fire)
	{
		return;
	}

	ParticleEmitter* pe = fire->GetComponent<ParticleEmitter>();

	if (!pe)
	{
		return;
	}

	pe->SetEnabled(false);

	nohd->RemoveAllChildren();
}
void EditorSceneWidget::showObjectMenu()
{
	EditorRoot* pEditorRoot = EditorRoot::Instance();
	if(pEditorRoot->SelectionNodes.empty())
		return;

	MainWindow* mMainWindow = pEditorRoot->GetMainWindow();

	QMenu* contextMenu = new QMenu(this);
	if(pEditorRoot->SelectionNodes.size() == 1)
	{
		Node* pNode = pEditorRoot->SelectionNodes[0];
		contextMenu->setTitle(tr("Object Menu : ") + QString(pNode->GetName().CString()));
	}
	else
	{
		contextMenu->setTitle(tr("Object Count : ") + QString::number(pEditorRoot->SelectionNodes.size()));
	}

	contextMenu->addAction(mMainWindow->renameAction_);
	contextMenu->addSeparator();

	contextMenu->addAction(mMainWindow->copyAction_);
	contextMenu->addAction(mMainWindow->cutAction_);
	contextMenu->addSeparator();

	contextMenu->addAction(mMainWindow->deleteAction_);

	contextMenu->exec(QCursor::pos());
}
Example #11
0
/****************************************************************************************
 PrintInputOrdered
 
 *****************************************************************************************/
void NearestNeighborDirectory::PrintInputOrdered( )
{
	while( inputOrderedQueue.empty( ) == false )
	{
		std::cout.precision(17);
		
		Node* currentNodePtr = inputOrderedQueue.front( );
		std::cout<<currentNodePtr->GetName()<<" ";
		int count = 0;
		
		for( NearNeighborList::iterator it = currentNodePtr->m_NearNeighborList.begin( ); 
			it< currentNodePtr->m_NearNeighborList.end( ); 
			++it )
		{
			std::cout<<(*it).Neighbor->GetName( );
			
			if( count < 2 )
			{
				std::cout<<",";
			}
			count++;
		}
		std::cout<<"\n";
		inputOrderedQueue.pop( );
	}
}
Example #12
0
// GetCompilerNode
//------------------------------------------------------------------------------
bool FunctionObjectList::GetCompilerNode( const BFFIterator & iter, const AString & compiler, CompilerNode * & compilerNode ) const
{
	NodeGraph & ng = FBuild::Get().GetDependencyGraph();
	Node * cn = ng.FindNode( compiler );
	compilerNode = nullptr;
	if ( cn != nullptr )
	{
		if ( cn->GetType() == Node::ALIAS_NODE )
		{
			AliasNode * an = cn->CastTo< AliasNode >();
			cn = an->GetAliasedNodes()[ 0 ].GetNode();
		}
		if ( cn->GetType() != Node::COMPILER_NODE )
		{
			Error::Error_1102_UnexpectedType( iter, this, "Compiler", cn->GetName(), cn->GetType(), Node::COMPILER_NODE );
			return false;
		}
		compilerNode = cn->CastTo< CompilerNode >();
	}
	else
	{
		// create a compiler node - don't allow distribution
		// (only explicitly defined compiler nodes can be distributed)
#ifdef USE_NODE_REFLECTION
		compilerNode = ng.CreateCompilerNode( compiler );
        VERIFY( compilerNode->GetReflectionInfoV()->SetProperty( compilerNode, "AllowDistribution", false ) );
#else
		const bool allowDistribution = false;
		compilerNode = ng.CreateCompilerNode( compiler, Dependencies( 0, false ), allowDistribution );
#endif
	}

	return true;
}
Example #13
0
void Navigation::AddOrRemoveObject()
{
    // Raycast and check if we hit a mushroom node. If yes, remove it, if no, create a new one
    Vector3 hitPos;
    Drawable* hitDrawable;
    
    if (Raycast(250.0f, hitPos, hitDrawable))
    {
        // The part of the navigation mesh we must update, which is the world bounding box of the associated
        // drawable component
        BoundingBox updateBox;
        
        Node* hitNode = hitDrawable->GetNode();
        if (hitNode->GetName() == "Mushroom")
        {
            updateBox = hitDrawable->GetWorldBoundingBox();
            hitNode->Remove();
        }
        else
        {
            Node* newNode = CreateMushroom(hitPos);
            updateBox = newNode->GetComponent<StaticModel>()->GetWorldBoundingBox();
        }
        
        // Rebuild part of the navigation mesh, then recalculate path if applicable
        scene_->GetComponent<NavigationMesh>()->Build(updateBox);
        RecalculatePath();
    }
}
void World::FillPortalsWorldWithVisibleObstaclesFrom(World& w)
{
    ResourceCache* cache = context->GetSubsystem<ResourceCache>();

    Material* black = cache->GetResource<Material>("Materials/Black.xml"); // notexture unlit black mat (for override white portals on screen)

    if (black)
        if (w.scene)
        {
            PODVector<Node*> nodes;
            w.scene->GetChildrenWithComponent<StaticModel>(nodes, true);

            for (int i = 0; i < nodes.Size(); i++)
            {
                Node* n = nodes[i];
                if (n)
                {
                    StaticModel* model = n->GetComponent<StaticModel>();
                    if (model)
                    {
                        Node* newNode = scene->CreateChild(n->GetName(), LOCAL);
                        StaticModel* newModel = newNode->CreateComponent<StaticModel>();
                        newModel->SetModel(model->GetModel());
                        newModel->SetMaterial(black);
                        newNode->SetWorldPosition(n->GetWorldPosition());
                        newNode->SetWorldRotation(n->GetWorldRotation());
                        newNode->SetWorldScale(n->GetWorldScale());
                    }

                }
            }

        }
}
Example #15
0
// GetDirectoryNodeList
//------------------------------------------------------------------------------
bool Function::GetDirectoryListNodeList( const BFFIterator & iter,
										 const Array< AString > & paths,
										 const Array< AString > & excludePaths,
                                         const Array< AString > & filesToExclude,
										 bool recurse,
										 const Array< AString > * patterns,
										 const char * inputVarName,
										 Dependencies & nodes ) const
{
	NodeGraph & ng = FBuild::Get().GetDependencyGraph();

	// Handle special case of excluded files beginning with ../
	// Since they can be used seinsibly by matching just the end
	// of a path, assume they are relative to the working dir.
	// TODO:C Move this during bff parsing when everything is using reflection
	Array< AString > filesToExcludeCleaned( filesToExclude.GetSize(), true );
	for ( const AString& file : filesToExclude )
	{
		if ( file.BeginsWith( ".." ) )
		{
			AStackString<> fullPath;
			NodeGraph::CleanPath( file, fullPath );
			filesToExcludeCleaned.Append( fullPath );
		}
		else
		{
			filesToExcludeCleaned.Append( file );
		}
	}

	const AString * const  end = paths.End();
	for ( const AString * it = paths.Begin(); it != end; ++it )
	{
		const AString & path = *it;

		// get node for the dir we depend on
		AStackString<> name;
		DirectoryListNode::FormatName( path, patterns, recurse, excludePaths, filesToExcludeCleaned, name );
		Node * node = ng.FindNode( name );
		if ( node == nullptr )
		{
			node = ng.CreateDirectoryListNode( name,
											   path,
											   patterns,
											   recurse,
											   excludePaths, 
                                               filesToExcludeCleaned );
		}
		else if ( node->GetType() != Node::DIRECTORY_LIST_NODE )
		{
			Error::Error_1102_UnexpectedType( iter, this, inputVarName, node->GetName(), node->GetType(), Node::DIRECTORY_LIST_NODE );
			return false;
		}

		nodes.Append( Dependency( node ) );
	}
	return true;
}
Example #16
0
// DoDynamicDependencies
//------------------------------------------------------------------------------
/*virtual*/ bool CSNode::DoDynamicDependencies( bool UNUSED( forceClean ) )
{
	ASSERT( m_DynamicDependencies.GetSize() == 0 );

	NodeGraph & ng = FBuild::Get().GetDependencyGraph();

	// preallocate a reasonable amount of space
	m_DynamicDependencies.SetCapacity( m_StaticDependencies.GetSize() );

	// convert static deps to dynamic deps
	// (ignore the extra refs here)
	size_t numDeps = m_StaticDependencies.GetSize() - m_ExtraRefs.GetSize();
	for ( size_t i=0; i<numDeps; ++i ) 
	{
		Node * n = m_StaticDependencies[ i ].GetNode();

		if ( n->IsAFile() )
		{
			m_DynamicDependencies.Append( Dependency( n ) );
			continue;
		}

		if ( n->GetType() == Node::DIRECTORY_LIST_NODE )
		{
			// get the list of files
			DirectoryListNode * dln = n->CastTo< DirectoryListNode >();
			const Array< FileIO::FileInfo > & files = dln->GetFiles();
			m_DynamicDependencies.SetCapacity( m_DynamicDependencies.GetSize() + files.GetSize() );
			for ( Array< FileIO::FileInfo >::Iter fIt = files.Begin();
					fIt != files.End();
					fIt++ )
			{
				// Create the file node (or find an existing one)
				Node * sn = ng.FindNode( fIt->m_Name );
				if ( sn == nullptr )
				{
					sn = ng.CreateFileNode( fIt->m_Name );
				}
				else if ( sn->IsAFile() == false )
				{
					FLOG_ERROR( "CSAssembly() .CompilerInputFile '%s' is not a FileNode (type: %s)", n->GetName().Get(), n->GetTypeName() );
					return false;
				}

				m_DynamicDependencies.Append( Dependency( sn ) );
			}
			continue;
		}

		FLOG_ERROR( "'%s' is not a supported node type (type: %s)", n->GetName().Get(), n->GetTypeName() );
		return false;
	}

	return true;
}
Example #17
0
unsigned AnimationState::GetTrackIndex(const ea::string& name) const
{
    for (unsigned i = 0; i < stateTracks_.size(); ++i)
    {
        Node* node = stateTracks_[i].node_;
        if (node && node->GetName() == name)
            return i;
    }

    return M_MAX_UNSIGNED;
}
Example #18
0
Node* Parser::FunctionArgument() {
	Symbol *type = TypeSpec();

	if(type != NULL) {
		Node *init = InitDeclarator(type);
		if(init == NULL)
			throw ParserException(currentToken, "Function argument list without arguments");

		return new NodeLocalVar(init->GetName());
	}
	return NULL;
}
Example #19
0
Node* Parser::FunctionDefinitionStmt() {
	Symbol *type = TypeSpec();

	if(type != NULL) {
		Node *name = Declarator(type);

		if(name != NULL) {
			if(oper != ROUND_LEFT_BRACKET) {
				if(oper == SEMICOLON) {
					Next();
					return name;
				}
				if(oper == OPER_ASSIGN) {
					Next();
					Node *node = new NodeBinary(name, OPER_ASSIGN, Initialiser());

					if(oper == SEMICOLON) {
						Next();
						return node;
					}
					if(oper == COMMA) {
						Next();
						return new NodeStmt("(,)", node, InitDeclaratorList(type));
					}
				}
				if(oper == COMMA) {
					Next();
					return new NodeStmt("(,)", name, InitDeclaratorList(type));
				}
			}
			SymTable *table = new SymTable();
			symStack->Push(table);

			Next();
			Node* args = FunctionArgumentList();

			if(oper != ROUND_RIGHT_BRACKET)
				throw ParserException(currentToken, "Function definition without ')'");

			Next();
			Node *stmt = CompoundStmt();

			if(stmt == NULL)
				throw ParserException(currentToken, "Function definition without statement");

			symStack->Pop();
			symStack->GetTopTable()->AddVar(new SymFunction(type, name->GetName()));

			return new NodeFunc(table, type, name, args, stmt);
		}
	}
	return NULL;
}
Example #20
0
bool CloneNode()
{
    Node *srcNode = new Node();
    srcNode->SetName("Tested Node");
    
    Node *dstNullNode = dynamic_cast<Node *>(srcNode->Clone());
    
    Node *dstNode = NULL;
    dstNode = dynamic_cast<Node *>(srcNode->Clone(dstNode));
    
	if(dstNode && dstNullNode)
	{
		bool compareResult = (dstNode->GetName() == dstNullNode->GetName());
		SafeRelease(srcNode);
		SafeRelease(dstNode);
		SafeRelease(dstNullNode);
		
		return compareResult;
	}

    return false;
}
Example #21
0
Symbol* Parser::TypeSpec() {
	Node *str = StructSpec();

	if(str != NULL) {
		symStack->AddType(new SymTypeStruct(str->GetName()));
	}
	if(str == NULL && symStack->TypeAt(text)) {
		string _oper = text;
		Next();
		return symStack->FindType(_oper);
	}
	return NULL;
}
bool NodeExecutor::DevRun(void * graph_handle)
{
	NodeContext * context=reinterpret_cast<NodeContext *>(graph_handle);
	Subgraph * graph=context->optimized_graph;
	Node * node;

	unsigned int i;
	for(i=0;i<graph->seq_nodes.size();i++)
	{
		node=graph->seq_nodes[i];
		node->SetNodeIndex(i);

		if(node->ExistAttr("DEV_RUN"))
			break;
	}

	if(i== graph->seq_nodes.size())
		return true;

	//set callback

	auto f=std::bind(&NodeExecutor::OnNodeDone,this,context,std::placeholders::_1,
			std::placeholders::_2);

	backend_dev_->SetNodeDoneHook(context->dev_context,dev_node_cb_t(f));

	std::cout<<"Run graph: "<<graph->GetName()<<" from node: "<<node->GetName()<<"\n";

	if(worker_)
	{
		//push the node to worker
		NodeTask task;
		task.dev_context=context->dev_context;
		task.node=node;

		std::vector<NodeTask> list;

		list.emplace_back(task);

		worker_->PushTask(list);

		return true;
	}
	else
	{
		return backend_dev_->Run(context->dev_context,node);
	}
}
Example #23
0
void Node::_UpdateAllChildren(double time_diff) {
    mIsUpdatingAfterChange = (time_diff == 0);

    for(auto iter = mChildren.begin(); iter != mChildren.end(); ++iter) {
        if(iter->second->mDeathMark) {
            //Kill it if the death mark is set.
            Node* node = iter->second;
            iter--;
            QString name = node->GetName();
            RemoveChildNode(name);
        }
        else {
            iter->second->OnUpdate(time_diff);
        }
    }

    mIsUpdatingAfterChange = false;
}
Example #24
0
//=================================================================================
bool Node::Find( List& nodeList, const std::string& name, bool useIndex /*= false*/ ) const
{
	if( useIndex )
	{
		// Try to find a valid index beginning at this node.
		Index** index = 0;
		const Node* node = this;
		do
		{
			index = &node->index;
			if( *index && ( *index )->IsValid() )
				break;
			node = node->parent;
		}
		while( node );

		// If no valid index was found, make one at this node.
		if( !*index || !( *index )->IsValid() )
		{
			index = &this->index;
			if( !*index )
				*index = new Index();
			( *index )->Rebuild( this );
		}

		// Now use the index to perform the search.
		return ( *index )->Lookup( nodeList, name );
	}
	
	// Go do a linear search.
	nodeList.clear();
	List subTreeList;
	const_cast< Node* >( this )->MakeNodeList( subTreeList );
	for( List::iterator iter = subTreeList.begin(); iter != subTreeList.end(); iter++ )
	{
		Node* node = *iter;
		if( node->GetName() == name )
			nodeList.push_back( node );
	}

	if( nodeList.size() > 0 )
		return true;
	return false;
}
void Urho3DTemplate::AddOrRemoveObject()
{
    //Raycast and check if we hit a mushroom node. If yes, remove it, if no create a new one
    Vector3 hitPos;
    Drawable* hitDrawable;

    if (RayCast(250.0f, hitPos, hitDrawable))
    {
        Node* hitNode = hitDrawable->GetNode();
        if (hitNode->GetName() == "Mushroom")
        {
            hitNode->Remove();
        }
        else
        {
            CreateMushroom(hitPos);
        }
    }
}
Example #26
0
void FindNodeVisitor::ApplyNode(Node &n)
{
	if (m_criteria == MATCH_NAME_STARTSWITH) {
		if (!n.GetName().empty() && starts_with(n.GetName(), m_string.c_str()))
			m_results.push_back(&n);
	} else if (m_criteria == MATCH_NAME_ENDSWITH ) {
		if (!n.GetName().empty() && ends_with(n.GetName(), m_string.c_str()))
			m_results.push_back(&n);
	} else {
		if (!n.GetName().empty() && n.GetName() == m_string)
			m_results.push_back(&n);
	}

	n.Traverse(*this);
}
Example #27
0
void BigBot::HandleHit(StringHash eventType, VariantMap& eventData)
{
	using namespace AnimationTrigger;

	// нод который прислали
	Node* otherNode = (Node*)eventData[P_DATA].GetVoidPtr();
	
	if (otherNode == NULL) return;

	// найдем с таким же именем в моделе
	Node* childNode = GetNode()->GetChild(otherNode->GetName(), true);

	// если это один и тот же нод, значит сообщение нам 
	if (childNode == otherNode)
	if (animState_ != BigBotAIState::ANI_HITED)
	if (animState_ != BigBotAIState::ANI_HITED_IDLE)
	{
		// change to hit anim
		ChangeState(states[BigBotAIState::ANI_HITED]);
	}
}
Example #28
0
// GetFileNode
//------------------------------------------------------------------------------
bool Function::GetFileNode( NodeGraph & nodeGraph,
							const BFFIterator & iter,
                            const AString & file,
                            const char * inputVarName,
                            Dependencies & nodes ) const
{
	// get node for the dir we depend on
	Node * node = nodeGraph.FindNode( file );
	if ( node == nullptr )
	{
		node = nodeGraph.CreateFileNode( file );
    }
	else if ( node->IsAFile() == false )
	{
		Error::Error_1005_UnsupportedNodeType( iter, this, inputVarName, node->GetName(), node->GetType() );
		return false;
	}

	nodes.Append( Dependency( node ) );
	return true;
}
Example #29
0
// ResolveVCXProject
//------------------------------------------------------------------------------
VCXProjectNode * FunctionSLN::ResolveVCXProject( const BFFIterator & iter, const AString & projectName ) const
{
	// Find the Node
    NodeGraph & ng = FBuild::Get().GetDependencyGraph();
    Node * node = ng.FindNode( projectName );
    if ( node == nullptr )
    {
        Error::Error_1104_TargetNotDefined( iter, this, ".Projects", projectName );
        return nullptr;
    }
	
    VCXProjectNode * project = ResolveVCXProjectRecurse( node );
    if ( project )
	{
		return project;
	}

    // don't know how to handle this type of node
    Error::Error_1005_UnsupportedNodeType( iter, this, ".Projects", node->GetName(), node->GetType() );
	return nullptr;
}
Example #30
0
// GetDirectoryNodeList
//------------------------------------------------------------------------------
bool Function::GetDirectoryListNodeList( const BFFIterator & iter,
										 const Array< AString > & paths,
										 const Array< AString > & excludePaths,
                                         const Array< AString > & filesToExclude,
										 bool recurse,
										 const AString & pattern,
										 const char * inputVarName,
										 Dependencies & nodes ) const
{
	NodeGraph & ng = FBuild::Get().GetDependencyGraph();

	const AString * const  end = paths.End();
	for ( const AString * it = paths.Begin(); it != end; ++it )
	{
		const AString & path = *it;

		// get node for the dir we depend on
		AStackString<> name;
		DirectoryListNode::FormatName( path, pattern, recurse, excludePaths, filesToExclude, name );
		Node * node = ng.FindNode( name );
		if ( node == nullptr )
		{
			node = ng.CreateDirectoryListNode( name,
											   path,
											   pattern,
											   recurse,
											   excludePaths, 
                                               filesToExclude );
		}
		else if ( node->GetType() != Node::DIRECTORY_LIST_NODE )
		{
			Error::Error_1102_UnexpectedType( iter, this, inputVarName, node->GetName(), node->GetType(), Node::DIRECTORY_LIST_NODE );
			return false;
		}

		nodes.Append( Dependency( node ) );
	}
	return true;
}