// Very simple code to understand how tlcc works #include #define _TLMP_foo struct _F_foo{ #define _F_foo_func1(x) void x func1() virtual _F_foo_func1( )=0; #define _F_foo_func2(x) void x func2() virtual _F_foo_func2( )=0; }; void foo (_F_foo &c) { c.func1(); c.func2(); } #ifndef _TLMP_foo #error TLMP module foo unknown #endif #ifndef _F_foo_func1 #error Unknown logical function func1 for module/class foo #endif #ifndef _F_foo_func2 #error Unknown logical function func2 for module/class foo #endif #line 17 "simple3.tlcc" static void f() { class __sc_tests_simple3_tlcc1: public _F_foo{ public: __sc_tests_simple3_tlcc1 () { } _F_foo_func1( ) { #line 21 "simple3.tlcc" printf ("This is f::func1\n"); } // #line 23 "simple3.tlcc" _F_foo_func2( ) { #line 24 "simple3.tlcc" printf ("This is f::func2\n"); } // #line 26 "simple3.tlcc" }; static __sc_tests_simple3_tlcc1 _scopeobj1; #line 20 "simple3.tlcc" ::foo(_scopeobj1); #line 27 "simple3.tlcc" } #line 29 "simple3.tlcc" #ifndef _TLMP_foo #error TLMP module foo unknown #endif #ifndef _F_foo_func1 #error Unknown logical function func1 for module/class foo #endif #ifndef _F_foo_func2 #error Unknown logical function func2 for module/class foo #endif #line 30 "simple3.tlcc" int main() { class __sc_tests_simple3_tlcc2: public _F_foo{ public: __sc_tests_simple3_tlcc2 () { } _F_foo_func1( ) { #line 34 "simple3.tlcc" printf ("This is func1\n"); f(); } // #line 37 "simple3.tlcc" _F_foo_func2( ) { #line 38 "simple3.tlcc" printf ("This is func2\n"); } // #line 40 "simple3.tlcc" }; static __sc_tests_simple3_tlcc2 _scopeobj2; #line 33 "simple3.tlcc" ::foo(_scopeobj2); #line 41 "simple3.tlcc" return 0; } #line 44 "simple3.tlcc"