예제 #1
0
파일: parser.cpp 프로젝트: rishi1234/waffle
// Parse a range of tokens.
Tree*
Parser::operator()(Token_iterator f, Token_iterator l) {
  if (f == l)
    return nullptr;
  first = f; 
  last = l;
  current = first; 
  use_diagnostics(diags);
  return parse_program(*this);
}
예제 #2
0
Tokens
Lexer::operator()(File* file, Iterator f, Iterator l) {
  use_diagnostics(diags);

  first = f;
  last = l;
  loc = Location(file);

  while (first != last)
    lex(*this);

  return toks;
}