Beispiel #1
0
void
nsFrameUtil::Tag::ReadAttrs(FILE* aFile)
{
  for (;;) {
    if (!EatWS(aFile)) {
      break;
    }
    int c = getc(aFile);
    if (c < 0) break;
    if (c == '/') {
      if (!EatWS(aFile)) {
        return;
      }
      if (Expect(aFile, '>')) {
        type = openClose;
        break;
      }
    }
    else if (c == '>') {
      break;
    }
    ungetc(c, aFile);
    char* attr = ReadIdent(aFile);
    if ((nsnull == attr) || !EatWS(aFile)) {
      break;
    }
    char* value = nsnull;
    if (Expect(aFile, '=')) {
      value = ReadString(aFile);
      if (nsnull == value) {
        delete [] attr;
        break;
      }
    }
    AddAttr(attr, value);
  }
}
Beispiel #2
0
SimpleFn::SimpleFn(const std::string& str) : m_needsSignal(false) {
  std::stringstream stream(str);
  std::string line;
  while (std::getline(stream, line)) {
    std::stringstream tmp(line);
    EatWS(tmp);
    if (!tmp)
      continue;
    m_exps.push_back(new Exp(tmp));
  }

  for (unsigned i = 0; i < m_exps.size(); i++)
    if (m_exps[i]->UsesSignals())
      RequireSignal();
}
Beispiel #3
0
nsFrameUtil::Tag*
nsFrameUtil::Tag::Parse(FILE* aFile)
{
  if (!EatWS(aFile)) {
    return nsnull;
  }
  if (Expect(aFile, '<')) {
    Tag* tag = new Tag;
    if (Expect(aFile, '/')) {
      tag->type = close;
    }
    else {
      tag->type = open;
    }
    tag->name = ReadIdent(aFile);
    tag->ReadAttrs(aFile);
    return tag;
  }
  return nsnull;
}