Page Menu
Home
Xreate
Search
Configure Global Search
Log In
Docs
Questions
Repository
Issues
Patches
Internal API
Files
F4000808
dfagraph.h
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Thu, Jul 9, 4:52 AM
Size
2 KB
Mime Type
text/x-c++
Expires
Sat, Jul 11, 4:52 AM (1 d, 3 h)
Engine
blob
Format
Raw Data
Handle
273023
Attached To
rXR Xreate
dfagraph.h
View Options
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* File: dfa.h
* Author: pgess <v.melnychenko@xreate.org>
*
* Created on June 27, 2016, 1:50 PM
*/
#ifndef DFA_H
#define DFA_H
#include "clasplayer.h"
namespace xreate {namespace dfa {
struct SymbolAnonymous {
SymbolAnonymous(unsigned int symbolId): id(symbolId){}
unsigned int id;
std::list<Expression> tags;
ScopePacked scope;
std::list<SymbolPacked> dependencies;
};
struct SymbolInvalid { };
typedef boost::variant<SymbolInvalid, SymbolAnonymous, SymbolPacked> SymbolNode;
/** \brief Holds DFA Analysis report produced by DFAPass */
class DFAGraph: public IAnalysisReport{
friend class VisitorAddTag;
friend class VisitorAddLink;
friend class VisitorGetDependencyConnection;
friend class VisitorSetDependencyConnection;
public:
DFAGraph(ClaspLayer* engine): __clasp(engine){}
SymbolPacked createAnonymousSymbol(const ScopePacked& scope);
void addAnnotation(SymbolNode& identifier, Expression&& tag);
void addConnection(const SymbolPacked& identifierTo, const SymbolNode& identifierFrom, DFGConnection link);
void addDependencyConnection(SymbolNode& identifierTo, SymbolNode& identifierFrom);
bool isConnected(const SymbolPacked& identifierTo, const SymbolPacked& identifierFrom);
void print(std::ostringstream& output) const;
private:
typedef unsigned int EdgeId;
std::vector<std::pair<SymbolPacked, SymbolPacked>> __edges;
std::multimap<SymbolPacked, EdgeId> __outEdges;
std::vector<DFGConnection> __data;
std::multimap<SymbolPacked, Expression> __tags;
std::multimap<SymbolPacked, SymbolPacked> __dependencies;
unsigned int __countAnonymousSymbols=0;
ClaspLayer* __clasp;
};
}} // end of namespace xreate::dfa
#endif /* DFA_H */
Event Timeline
Log In to Comment