示例#1
0
bool ixion::regex<T>::matchAt(T const &candidate,TIndex at) {
  LastCandidate = candidate;
  BackrefStack.clear();

  if (ParsedRegex.get() == NULL)
    EX_THROW(regex,ECRE_NOPATTERN)

  if (ParsedRegex->match(BackrefStack,candidate,at)) {
    MatchIndex = at;
    MatchLength = ParsedRegex->subsequentMatchLength();
    return true;
    }
  return false;
  }
示例#2
0
bool ixion::regex<T>::match(T const &candidate,TIndex from) {
  LastCandidate = candidate;
  BackrefStack.clear();

  if (ParsedRegex.get() == NULL)
    EX_THROW(regex,ECRE_NOPATTERN)

  for (TIndex index = from;index < candidate.size();index++)
    if (ParsedRegex->match(BackrefStack,candidate,index)) {
      MatchIndex = index;
      MatchLength = ParsedRegex->subsequentMatchLength();
      return true;
      }
  return false;
  }
示例#3
0
T ixion::regex<T>::backref_stack::get(TIndex number,T const &candidate) const {
  TIndex level = 0,next_index = 0;
  TIndex start;
  TIndex startlevel;
  
  typename internal_stack::const_iterator first = Stack.begin(),last = Stack.end();
  while (first != last) {
    if (first->Type == backref_entry::OPEN) {
      if (number == next_index) {
        start = first->Index;
	startlevel = level;
 	level++;
        break;
        }
      next_index++;
      level++;
      }
    if (first->Type == backref_entry::CLOSE) 
      level--;
    first++;
    }
  
  if (first == last)
    EX_THROW(regex,ECRE_INVBACKREF)

  first++;
    
  while (first != last) {
    if (first->Type == backref_entry::OPEN) 
      level++;
    if (first->Type == backref_entry::CLOSE) {
      level--;
      if (startlevel == level)
        return candidate.substr(start,first->Index - start);
      }
    first++;
    }
  EX_THROW(regex,ECRE_UNBALBACKREF)
  }
示例#4
0
文件: dacfn.cpp 项目: krk/coreclr
// Ideally DacNoImpl and DacError would be marked no-return, but that will require changing a bunch of existing
// code to avoid "unreachable code" warnings. 
void DECLSPEC_NORETURN
DacError_NoRet(HRESULT err)
{
    EX_THROW(HRException, (err));
}
示例#5
0
文件: dacfn.cpp 项目: krk/coreclr
void
DacError(HRESULT err)
{
    EX_THROW(HRException, (err));
}
示例#6
0
文件: dacfn.cpp 项目: krk/coreclr
void
DacNotImpl(void)
{
    EX_THROW(HRException, (E_NOTIMPL));
}