Changeset ea3eb06 for translator/examples
- Timestamp:
- Nov 22, 2014, 4:51:46 PM (11 years ago)
- Branches:
- ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, string, with_gc
- Children:
- d11f789
- Parents:
- 3c70d38
- Location:
- translator/examples
- Files:
-
- 1 deleted
- 7 edited
-
factorial.c (deleted)
-
forward.c (modified) (1 diff)
-
huge.c (modified) (1 diff)
-
identity.c (modified) (1 diff)
-
new.c (modified) (1 diff)
-
quad.c (modified) (1 diff)
-
test.c (modified) (1 diff)
-
vector_test.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
translator/examples/forward.c
r3c70d38 rea3eb06 7 7 struct q *x; 8 8 9 void f() 10 { 11 *x; 9 void f() { 10 *x; 12 11 } -
translator/examples/huge.c
r3c70d38 rea3eb06 1 int huge (int n, forall (type T) T (*f) (T)) 2 { 3 if (n <= 0) 4 return f(0); 1 int huge( int n, forall( type T ) T (*f)( T ) ) { 2 if ( n <= 0 ) 3 return f( 0 ); 5 4 else 6 return huge (n-1, f(f));5 return huge( n - 1, f( f ) ); 7 6 } -
translator/examples/identity.c
r3c70d38 rea3eb06 1 // './cfa identity.c'2 3 1 extern "C" { 4 2 int printf( const char *fmt, ... ); -
translator/examples/new.c
r3c70d38 rea3eb06 1 // "./cfa-cpp -c new.c"2 3 1 forall( type T ) 4 2 void f( T *t ) { 5 t--;6 *t;7 ++t;8 t += 2;9 t + 2;10 --t;11 t -= 2;12 t - 4;13 t[7];14 7[t];3 t--; 4 *t; 5 ++t; 6 t += 2; 7 t + 2; 8 --t; 9 t -= 2; 10 t - 4; 11 t[7]; 12 7[t]; 15 13 } -
translator/examples/quad.c
r3c70d38 rea3eb06 1 // "./cfa quad.c"2 // "./cfa -CFA quad.c > quad_out.c"3 // "gcc31 -g quad_out.c LibCfa/libcfa.a"4 5 1 extern "C" { 6 2 #include <stdio.h> -
translator/examples/test.c
r3c70d38 rea3eb06 1 // "cfa -c -o test.o test.c"2 // "cfa -CFA test.c > test_out.c"3 // "gcc31 -c test_out.c -o test.o"4 5 1 #include "fstream.h" 6 2 #include "vector_int.h" 7 3 8 int 9 main() 10 { 11 ofstream *sout = ofstream_stdout(); 12 vector_int vec = vector_int_allocate(); 13 int index; 14 switch(1) { 15 case 1: 16 sout << vec[ index ]; 17 } 18 sout << "\n"; 19 return 0; 4 int main() { 5 ofstream *sout = ofstream_stdout(); 6 vector_int vec = vector_int_allocate(); 7 int index; 8 switch(1) { 9 case 1: 10 sout << vec[ index ]; 11 } 12 sout << "\n"; 20 13 } -
translator/examples/vector_test.c
r3c70d38 rea3eb06 1 // "cfa -c -o vector_test.o vector_test.c"2 // "cfa -CFA vector_test.c > vector_test_out.c"3 // "cfa -E vector_test.c > vector_test_out.c"4 // "gcc31 -c vector_test_out.c -o vector_test.o"5 6 1 #include "fstream.h" 7 2 #include "vector_int.h"
Note:
See TracChangeset
for help on using the changeset viewer.