22 if(beforeDot.empty()) {
23 std::stringstream errstr;
24 errstr <<
"mBeforeDot must not be empty." <<std::endl;
25 throw Exception(
"Lr1Configuration::Lr1Configuration", errstr.str(), 1001);
27 if(afterDot.empty()) {
28 std::stringstream errstr;
29 errstr <<
"mAfterDot must not be empty." <<std::endl;
30 throw Exception(
"Lr1Configuration::Lr1Configuration", errstr.str(), 1001);
36 if(
mLhs < other.
Lhs())
return true;
37 if(other.
Lhs() <
mLhs)
return false;
54 return !((*
this < other) || (other < *
this));
58 return ((*
this < other) || (other < *
this));
64 GrammarSymbolVector::const_iterator gsvit;
85 bool CompareConfigSet(
const std::set<Lr1Configuration>& lhs,
const std::set<Lr1Configuration>& rhs){
86 if (lhs.size() < rhs.size())
return true;
87 if (rhs.size() < lhs.size())
return false;
89 std::set<Lr1Configuration>::const_iterator it1, it2;
91 for(it1 = lhs.begin(); it1 != lhs.end(); it1++){
92 if(*it1 < *it2)
return true;
93 if(*it2 < *it1)
return false;
105 if(*lhs.second < *rhs.second)
return true;
106 if(*rhs.second < *lhs.second)
return false;
118 std::set<Lr1Configuration>::const_iterator configit;
119 for(configit = configs.begin(); configit != configs.end(); configit++){
120 if(configit != configs.begin()){
123 s <<
"(" << configit->Str() <<
")";
135 Lr1ConfigurationSetSet::const_iterator setit;
137 for(setit = configSetSet.begin(); setit != configSetSet.end(); setit++){
151 LrmTransitionMap::const_iterator transmapit;
152 std::set<Lr1Configuration>::const_iterator configit;
153 for(transmapit = transitionMap.begin(); transmapit != transitionMap.end(); transmapit++){
154 s <<
"CONFIGURATION SET " <<
ConfigSetToStr(transmapit->first.first) <<
"\n";
155 s <<
" with symbol " << transmapit->first.second->Str() <<
":\n";
176 std::vector<Idx>::const_iterator it1, it2;
179 if(*it1 < *it2)
return true;
180 if(*it2 < *it1)
return false;
188 std::vector<Idx>::const_iterator it;
206 if (
mLhs < other.
Lhs())
return true;
207 if (other.
Lhs() <
mLhs)
return false;
208 if (
mRhs < other.
Rhs())
return true;
246 return mActions.insert(action).second;
256 std::set<Idx>::const_iterator it;
259 s += static_cast<std::ostringstream*>( &(std::ostringstream() << *it) )->str();
261 s +=
", " +
static_cast<std::ostringstream*
>( &(std::ostringstream() << *it) )->str();
268 std::set<Terminal>::const_iterator it;
273 s +=
", " + it->Str();
280 std::set<Lr1ParserAction>::const_iterator it;
285 s += separator + it->Str();
297 s <<
"actions: " <<
StrActions(
"\n") << std::endl;