示例#1
0
// Elaborate the definition of a type.
void
Parser::elaborate_class_definition(Class_decl& d)
{
  struct fn
  {
    Parser& p;
    Class_decl& decl;
    void operator()(Def& d)      { lingo_unhandled(d); }
    void operator()(Class_def& d) { p.elaborate_class_definition(decl, d); }
  };
  apply(d.definition(), fn{*this, d});
}
示例#2
0
// TODO: What if the definition is something other than a typical class 
// definition. If so, we should probably apply that transformation here.
void
Elaborate_classes::class_declaration(Class_decl& decl)
{
  // FIXME: Do something with the metatype.

  // Partition the statements into bases and fields.
  Class_def& def = cast<Class_def>(decl.definition());
  for (Stmt& s : def.statements())
    partition_members(def, s);

  // TODO: By the time this function completes, all compile-time properties
  // of the class must be known (e.g., size, layout, alignment, etc).

  // Recursively analyze members.
  Enter_scope scope(cxt, decl);
  statement_seq(def.statements());
}
示例#3
0
// Elaborate the kind of a type.
void
Parser::elaborate_class_declaration(Class_decl& d)
{
  d.kind_ = &elaborate_type(d.kind());
}