Ejemplo n.º 1
0
// 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);
}
Ejemplo n.º 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;
}