Formatting
This commit is contained in:
2
Makefile
2
Makefile
@@ -18,7 +18,7 @@ cleanly:
|
|||||||
rm -f *.lex.cc *.lex.o location.hh stack.hh position.hh rsin_parser.cc rsin_parser.hh
|
rm -f *.lex.cc *.lex.o location.hh stack.hh position.hh rsin_parser.cc rsin_parser.hh
|
||||||
|
|
||||||
clean: cleanly
|
clean: cleanly
|
||||||
rm -f *.o main *~ makefile.dep tags
|
rm -f *.o main *.orig *~ makefile.dep tags
|
||||||
|
|
||||||
cleanall: clean
|
cleanall: clean
|
||||||
|
|
||||||
|
|||||||
@@ -73,6 +73,7 @@ void CtxAut::showStates(void)
|
|||||||
{
|
{
|
||||||
cout << "# Context Automaton States:" << endl;
|
cout << "# Context Automaton States:" << endl;
|
||||||
cout << " = Init state: " << getStateName(init_state_id) << endl;
|
cout << " = Init state: " << getStateName(init_state_id) << endl;
|
||||||
|
|
||||||
for (const auto &s : states_ids) {
|
for (const auto &s : states_ids) {
|
||||||
cout << " * " << s << endl;
|
cout << " * " << s << endl;
|
||||||
}
|
}
|
||||||
@@ -88,6 +89,7 @@ void CtxAut::saveCurrentContextSet(Process proc_id)
|
|||||||
if (!parent_rctsys->hasProcess(proc_id)) {
|
if (!parent_rctsys->hasProcess(proc_id)) {
|
||||||
FERROR("No such process: ID=" << proc_id);
|
FERROR("No such process: ID=" << proc_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
tmpProcEntities[proc_id] = tmpEntities;
|
tmpProcEntities[proc_id] = tmpEntities;
|
||||||
tmpEntities.clear();
|
tmpEntities.clear();
|
||||||
}
|
}
|
||||||
@@ -108,6 +110,7 @@ void CtxAut::addTransition(std::string srcStateName, std::string dstStateName)
|
|||||||
void CtxAut::showTransitions(void)
|
void CtxAut::showTransitions(void)
|
||||||
{
|
{
|
||||||
cout << "# Context Automaton Transitions:" << endl;
|
cout << "# Context Automaton Transitions:" << endl;
|
||||||
|
|
||||||
for (const auto &t : transitions) {
|
for (const auto &t : transitions) {
|
||||||
cout << " * [" << getStateName(t.src_state) << " -> " << getStateName(
|
cout << " * [" << getStateName(t.src_state) << " -> " << getStateName(
|
||||||
t.dst_state)
|
t.dst_state)
|
||||||
|
|||||||
11
rs.cc
11
rs.cc
@@ -96,6 +96,7 @@ bool RctSys::hasProcess(Process processID)
|
|||||||
if (processID >= processes_ids.size()) {
|
if (processID >= processes_ids.size()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -104,6 +105,7 @@ Process RctSys::getProcessID(std::string processName)
|
|||||||
if (!hasProcess(processName)) {
|
if (!hasProcess(processName)) {
|
||||||
FERROR("No such process: " << processName);
|
FERROR("No such process: " << processName);
|
||||||
}
|
}
|
||||||
|
|
||||||
return processes_names[processName];
|
return processes_names[processName];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -122,6 +124,7 @@ void RctSys::pushReactant(std::string entityName)
|
|||||||
if (!hasEntity(entityName)) {
|
if (!hasEntity(entityName)) {
|
||||||
addEntity(entityName);
|
addEntity(entityName);
|
||||||
}
|
}
|
||||||
|
|
||||||
tmpReactants.insert(getEntityID(entityName));
|
tmpReactants.insert(getEntityID(entityName));
|
||||||
}
|
}
|
||||||
void RctSys::pushInhibitor(std::string entityName)
|
void RctSys::pushInhibitor(std::string entityName)
|
||||||
@@ -129,6 +132,7 @@ void RctSys::pushInhibitor(std::string entityName)
|
|||||||
if (!hasEntity(entityName)) {
|
if (!hasEntity(entityName)) {
|
||||||
addEntity(entityName);
|
addEntity(entityName);
|
||||||
}
|
}
|
||||||
|
|
||||||
tmpInhibitors.insert(getEntityID(entityName));
|
tmpInhibitors.insert(getEntityID(entityName));
|
||||||
}
|
}
|
||||||
void RctSys::pushProduct(std::string entityName)
|
void RctSys::pushProduct(std::string entityName)
|
||||||
@@ -136,6 +140,7 @@ void RctSys::pushProduct(std::string entityName)
|
|||||||
if (!hasEntity(entityName)) {
|
if (!hasEntity(entityName)) {
|
||||||
addEntity(entityName);
|
addEntity(entityName);
|
||||||
}
|
}
|
||||||
|
|
||||||
tmpProducts.insert(getEntityID(entityName));
|
tmpProducts.insert(getEntityID(entityName));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -179,11 +184,11 @@ std::string RctSys::entitiesToStr(const Entities &entities)
|
|||||||
std::string RctSys::procEntitiesToStr(const EntitiesForProc &procEntities)
|
std::string RctSys::procEntitiesToStr(const EntitiesForProc &procEntities)
|
||||||
{
|
{
|
||||||
std::string s = " ";
|
std::string s = " ";
|
||||||
|
|
||||||
for (auto const &p : procEntities)
|
for (auto const &p : procEntities) {
|
||||||
{
|
|
||||||
s += getProcessName(p.first) + "={" + entitiesToStr(p.second) + "} ";
|
s += getProcessName(p.first) + "={" + entitiesToStr(p.second) + "} ";
|
||||||
}
|
}
|
||||||
|
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
2
rs.hh
2
rs.hh
@@ -93,7 +93,7 @@ class RctSys
|
|||||||
void ctxAutAddTransition(std::string srcStateName, std::string dstStateName);
|
void ctxAutAddTransition(std::string srcStateName, std::string dstStateName);
|
||||||
void ctxAutPushNamedContextEntity(std::string entity_name);
|
void ctxAutPushNamedContextEntity(std::string entity_name);
|
||||||
void ctxAutSaveCurrentContextSet(std::string processName);
|
void ctxAutSaveCurrentContextSet(std::string processName);
|
||||||
|
|
||||||
bool initStatesDefined(void)
|
bool initStatesDefined(void)
|
||||||
{
|
{
|
||||||
return initStates.size() != 0;
|
return initStates.size() != 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user