Skip to content

[Implementation] A new Musictype

Radon Co edited this page Dec 18, 2016 · 3 revisions

Musictype is defined using structs.

Related source file for defining the type and its literals.

  1. scanner/parser/ast/sast

  2. analyzer(get_type_from_expr, build_sast_expr)

  3. environment(builtin_types_list)

  4. pprint(string_of_datatype, json_of_expr)

  5. codegen(lltype_of_datatype, get_bind_type (if it's not primitive), codegen_expr, codegen_expr_ref)

  • Note that load_id only loads primitives.
  • There are two strategies in codegen_assign, store and memcpy. For store, it should be primitive. For memcpy, if (codegen_expr_ref lhs) returns ref(datatype), (codegen_expr rhs) returns ref(datatype), and lltype_of_datatype is good to go, codegen_assign just works.
  1. beathoven.h, stdlib.c: implement _str_of_the_datatype() to help debug

Clone this wiki locally