+
+bool
+TDictionary::Entry::lastDelimiter(unsigned i) const
+{
+ assert(i < pattern.size());
+ assert(pattern[i].category != TToken::PARAMETER);
+ // a token is the last delimiter if it is the last token
+ // of the pattern or if the next token is a parameter)
+ return i + 1 == pattern.size() || pattern[i + 1].category == TToken::PARAMETER;
+}
+
+unsigned
+TDictionary::Entry::previousParam(unsigned i) const
+{
+ // this method return the position in the pattern of the
+ // parameter placed in a position preceding i.
+ // If no preceding i parameter present, the method return
+ // pattern.size().
+ // To know the position of the last parameter, call this
+ // method with i == pattern.size()
+ unsigned j = i - 1;
+
+ while (pattern[j].category != TToken::PARAMETER)
+ {
+ if (j) j--;
+ else return pattern.size();
+ }
+ return j;
+}