// Synthesize a type from the given parameter. This is used to generate // fake types corresponding to type parameters. Type Builder::make_synthetic_type(Decl& d) { lingo_unimplemented(__func__); // return make<Synthetic_type>(d); }
bool is_similar(Array_type const& a, Array_type const& b) { // TODO: Check for equivalence of the extent before // recursing on the element type. lingo_unimplemented(); }
void Evaluator::elaborate_object(Object_decl const& d) { // FIXME: Implement initialization! Value& v = alloca(d); (void)v; lingo_unimplemented(); }
// Parse a primary type. // // primary-type: // 'void' // 'byte' // 'bool' // 'char' // 'int' // 'float' // 'auto' // id-type // decltype-type // function-type // '( unary-type )' // '{ type-list }' // // FIXME: Design a better integer and FP type suite. Type& Parser::primary_type() { switch (lookahead()) { case void_tok: return on_void_type(accept()); case bool_tok: return on_bool_type(accept()); case int_tok: return on_int_type(accept()); case byte_tok: return on_byte_type(accept()); // TODO: Implement me. case char_tok: lingo_unimplemented("char type"); case float_tok: lingo_unimplemented("float type"); case auto_tok: lingo_unimplemented("auto type"); case decltype_tok: return decltype_type(); case class_tok: return on_class_type(accept()); case coroutine_tok: return on_coroutine_type(accept()); case lparen_tok: { // FIXME: We shouldn't need a tentative parse for this. if (Type* t = match_if(&Parser::function_type)) return *t; return grouped_type(); } case lbrace_tok: return tuple_type(); default: return id_type(); } }
// Create a new auto placeholder type. This creates a new, unique type // parameter and returns its associated type. Note that the type parameter // is unassociated with any context at the point of creation (it's an // unbound, unnamed type variable). Type Builder::make_auto_type() { lingo_unimplemented(__func__); // Name& n = cxt.get_id(); // Type_parm& d = cxt.make_type_parameter(Index {}, n); // return get_auto_type(d); }
// Parse a template parameter. // // template-parameter: // type-template-parameter // value-template-parameter // template-template-parameter Decl& Parser::template_parameter() { switch (lookahead()) { case tk::typename_tok: return type_template_parameter(); case tk::const_tok: return value_template_parameter(); case tk::template_tok: return template_template_parameter(); default: // FIXME: Concepts! lingo_unimplemented("parse constrained-parameter"); } }
Value Evaluator::evaluate_call(Call_expr const& e) { Value v = evaluate(e.function()); Function_decl const& f = *v.get_function(); // Get the function's definition. if (!f.is_definition()) throw Internal_error("function '{}' is not defined", f.name()); // There should probably be a body for the function. // // FIXME: What if the function is = default. How do we determine // what that behavior should be? Synthesize a new kind of defintion // that explicitly performs that behavior? // // TODO: It would be more elegant to simply dispatch on the // definition rather than filter it here. Function_def const* def = as<Function_def>(&f.definition()); if (!def) lingo_unimplemented(); // Each parameter is declared as a local variable within the // function. Enter_frame frame(*this); Expr_list const& args = e.arguments(); Decl_list const& parms = f.parameters(); auto ai = args.begin(); auto pi = parms.begin(); while (ai != args.end() && pi != parms.end()) { Expr const& arg = *ai; Decl const& parm = *pi; // TODO: Parameters are copy-initialized. Reuse initialization // here, insted of this kind of direct storage. Use alloca // and then dispatch to the initializer. store(parm, evaluate(arg)); } // Evaluate the function definition. // // TODO: Check result in case we've thrown an exception. // // FIXME: Failure to evaluate is a translation error, not // an internal error. Value result; Control ctl = evaluate(def->statement(), result); if (ctl != return_ctl) throw Evaluation_error("function evaluation failed"); return result; }
Name& Parser::on_literal_id() { lingo_unimplemented(); }
// TODO: Implement me. Decl& initialize_template_template_parameter(Context& cxt, Template_parm& p, Term& t) { lingo_unimplemented(); }
Enum_type& Builder::get_enum_type(Decl& d) { lingo_unimplemented(); }
Array_type& Builder::get_array_type(Type&, Expr&) { lingo_unimplemented(); }
// Returns a destructor-id for the given type. Destructor_id& Builder::get_destructor_id(Type const& t) { lingo_unimplemented(); }
Req& Parser::on_type_requirement(Expr&) { lingo_unimplemented("on type-req"); }
Value Evaluator::eval(Reference_init const* e) { lingo_unimplemented(); }
// FIXME: This should be calling a function that // default iniitializes the created object. Value Evaluator::eval(Copy_init const* e) { lingo_unimplemented(); }
Expr& operator()(Expr& e) { std::cout << type_str(e) << '\n'; lingo_unimplemented(); }
Type& operator()(Declauto_type& t) { lingo_unimplemented(); }
Req& Parser::on_semantic_requirement(Decl&) { lingo_unimplemented("on semantic-req"); }
Decltype_type& Builder::get_decltype_type(Expr&) { lingo_unimplemented(); }
Req& Parser::on_expression_requirement(Expr&) { lingo_unimplemented("on expression-req"); }
Union_type& Builder::get_union_type(Decl& d) { lingo_unimplemented(); }
Req& Parser::on_basic_requirement(Expr& e) { lingo_unimplemented("requirements"); // return make_basic_requirement(cxt, e); }
Decl& operator()(Decl& d) { lingo_unimplemented(); }
Req& Parser::on_deduction_requirement(Expr& e, Type& t) { lingo_unimplemented("requirements"); // return make_deduction_requirement(cxt, e, t); }
Name& Parser::on_conversion_id() { lingo_unimplemented(); }
Value Evaluator::eval(Method_expr const* e) { lingo_unimplemented(); }
// Returns the declaration for a leading identifier that names // a namespace. Decl& Parser::on_nested_name_specifier(Decl&) { lingo_unimplemented(); }
void Evaluator::eval_init(Reference_init const* e, Value& v) { lingo_unimplemented(); }
Decl& Parser::template_template_parameter() { lingo_unimplemented("parse template-template-parameter"); }
Type& substitute_type(Context& cxt, Array_type& t, Substitution& sub) { lingo_unimplemented(); }