import lm.lmd; import lm.licenseGnuGPLv2; import tree; extern (C) mode lmdInit(inout stream s); int main(char[][]args) { application a = new application(args, &lmdInit); int result = a.start(); return result; } /* this version of gcctrace uses the code argument as an output buffer */ extern(C) void gcctrace(char[]s, element code) { code.append(new sym(s ~ "; ")); writefln("%15s -> [%s]", s, code.toVal()); } /* code generator procedures for operands - for experiment */ extern(C) element quotes(inout stream s, element code, element x){ // operations that yield a new code value gcctrace("quotes(" ~ x.toVal.toString() ~ ")", code); return code; } extern(C) element quoted(inout stream s, element code, element x){ // operations that yield a new code value gcctrace("quoted(" ~ x.toVal.toString() ~ ")", code); return code; } extern(C) element tyname(inout stream s, element code, element x){ // operations that yield a new code value gcctrace("tyname(" ~ x.toVal.toString() ~ ")", code); return code; } extern(C) element syname(inout stream s, element code, element x){ // operations that yield a new code value gcctrace("syname(" ~ x.toVal.toString() ~ ")", code); return code; } extern(C) element number(inout stream s, element code, element x){ // operations that yield a new code value gcctrace("number(" ~ x.toVal.toString() ~ ")", code); return code; } /* not yet implemented */ extern(C) element notyet(inout stream s, element code){ // operations that yield a new code value gcctrace("not_implemented", code); return code; } /* generalised mod and div operatioms - for experiment */ extern(C) element div_expr(inout stream s, element code){ // operations that yield a new code value gcctrace("div_expr", code); return code; } extern(C) element mod_expr(inout stream s, element code){ // operations that yield a new code value gcctrace("mod_expr", code); return code; }