-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #148 from fennecdjay/CompilationStages
Compilation stages
- Loading branch information
Showing
36 changed files
with
471 additions
and
10,131 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#ifndef __GWIONPASS | ||
#define __GWIONPASS | ||
typedef m_bool (*compilation_pass)(Env, Ast); | ||
|
||
ANN void pass_register(const Gwion, const m_str, const compilation_pass); | ||
ANN void pass_default(const Gwion); | ||
ANN m_bool pass_set(const Gwion, const Vector); | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#ifndef __SPECIALID | ||
#define __SPECIALID | ||
|
||
//typedef struct SpecialId_* SpecialId; | ||
struct SpecialId_; | ||
typedef Type (*idck)(const Env, const Exp_Primary*); | ||
typedef Instr (*idem)(const Emitter, const Exp_Primary*); | ||
|
||
struct SpecialId_ { | ||
Type type; | ||
idck ck; | ||
f_instr exec; | ||
idem em; | ||
m_bool is_const; | ||
}; | ||
|
||
#define ID_CHECK(a) ANN Type a(const Env env NUSED, const Exp_Primary* prim NUSED) | ||
#define ID_EMIT(a) ANN Instr a(const Emitter emit NUSED, const Exp_Primary* prim NUSED) | ||
|
||
ANN static inline Type specialid_type(const Env env, | ||
struct SpecialId_ *spid, const Exp_Primary* prim) { | ||
if(spid->is_const) | ||
exp_self(prim)->meta = ae_meta_value; | ||
return spid->type ?: spid->ck(env, prim); | ||
} | ||
|
||
ANN static inline Instr specialid_instr(const Emitter emit, | ||
struct SpecialId_ *spid, const Exp_Primary* prim) { | ||
return spid->exec ? emit_add_instr(emit, spid->exec) : spid->em(emit, prim); | ||
} | ||
|
||
ANN struct SpecialId_* specialid_get(const Gwion, const Symbol); | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.