source: translator/prolog.c @ 51b7345

ADTaaron-thesisarm-ehast-experimentalcleanup-dtorsctordeferred_resndemanglerenumforall-pointer-decaygc_noraiijacob/cs343-translationjenkins-sandboxmemorynew-astnew-ast-unique-exprnew-envno_listpersistent-indexerpthread-emulationqualifiedEnumresolv-newstringwith_gc
Last change on this file since 51b7345 was 51b7345, checked in by Peter A. Buhr <pabuhr@…>, 10 years ago

initial commit

  • Property mode set to 100644
File size: 672 bytes
Line 
1// "./cfa prolog.c"
2
3extern "C" { extern int printf( const char *fmt, ... ); }
4
5void printResult( int x ) { printf( "int\n" ); }
6void printResult( double x ) { printf( "double\n" ); }
7void printResult( char * x ) { printf( "char*\n" ); }
8
9void is_arithmetic( int x ) {}
10void is_arithmetic( double x ) {}
11
12void is_integer( int x ) {}
13
14context ArithmeticType( type T )
15{
16  void is_arithmetic( T );
17};
18
19context IntegralType( type T | ArithmeticType( T ) )
20{
21  void is_integer( T );
22};
23
24forall( type T | IntegralType( T ) | { void printResult( T ); } ) void hornclause( T param )
25{
26  printResult( param );
27}
28
29int main()
30{
31  int x;
32  double x;
33  char * x;
34  hornclause( x );
35}
Note: See TracBrowser for help on using the repository browser.