Processes, switching

This commit is contained in:
Artur Meski
2018-03-28 15:35:48 +01:00
parent 91ccf628f5
commit 179c199ece
3 changed files with 23 additions and 1 deletions

5
rs.cc
View File

@@ -54,6 +54,11 @@ Entity RctSys::getEntityID(std::string name)
return entities_names[name];
}
void RctSys::setCurrentProcess(std::string processName)
{
VERB_LN(2, "Current Process: " << processName);
}
void RctSys::pushReactant(std::string entityName)
{
if (!hasEntity(entityName))

3
rs.hh
View File

@@ -40,6 +40,9 @@ class RctSys
bool hasEntity(std::string entityName);
void addEntity(std::string entityName);
std::string getEntityName(Entity entityID);
void setCurrentProcess(std::string processName);
void pushReactant(std::string entityName);
void pushInhibitor(std::string entityName);
void pushProduct(std::string entityName);

View File

@@ -77,7 +77,7 @@ class rsin_driver;
system:
| OPTIONS LCB options RCB system
| REACTIONS LCB reactions RCB system
| REACTIONS LCB reactionsets RCB system
| INITIALCONTEXTS LCB initstates RCB system
| CONTEXTENTITIES LCB actionentities RCB system
| CONTEXTAUTOMATON LCB ctxaut RCB system
@@ -104,6 +104,20 @@ option:
* REACTIONS
* -------------------------
*/
reactionsets:
| processname LCB reactions RCB SEMICOL
;
processname: IDENTIFIER {
//driver.getReactionSystem()->ctxAutAddState(*$1);
//
// Set the current process name for which we are saving reactions...
//
driver.getReactionSystem()->setCurrentProcess(*$1);
free($1);
}
reactions:
| reactions reaction SEMICOL
;