source: src/tests/TypeGenerator.c@ c2ad3c9

ADT aaron-thesis arm-eh ast-experimental cleanup-dtors ctor deferred_resn demangler enum forall-pointer-decay gc_noraii jacob/cs343-translation jenkins-sandbox memory new-ast new-ast-unique-expr new-env no_list persistent-indexer pthread-emulation qualifiedEnum resolv-new with_gc
Last change on this file since c2ad3c9 was 7ff30d07, checked in by Thierry Delisle <tdelisle@…>, 9 years ago

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

Conflicts:

Makefile.in
aclocal.m4
configure
src/Makefile.in
src/Tests/Context.c
src/driver/Makefile.in
src/examples/Makefile.in
src/examples/ctxts.c
src/examples/esskaykay.c
src/libcfa/Makefile.in

  • Property mode set to 100644
File size: 916 bytes
Line 
1context addable( otype T ) {
2 T ?+?( T,T );
3 T ?=?( T*, T);
4};
5
6otype List1( otype T | addable( T ) ) = struct { T data; List1( T ) *next; } *;
7typedef List1( int ) ListOfIntegers;
8//List1( int ) li;
9ListOfIntegers li;
10int f( List1( int ) ( (*g ))( int ) );
11[int] h( * List1( int ) p ); // new declaration syntax
12
13struct( otype T ) S2 { T i; }; // actual definition
14struct( int ) S3 v1, *p; // expansion and instantiation
15struct( otype T )( int ) S24 { T i; } v2; // actual definition, expansion and instantiation
16struct( otype T )( int ) { T i; } v2; // anonymous actual definition, expansion and instantiation
17
18struct( otype T | addable( T ) ) node { T data; struct( T ) node *next; };
19otype List( otype T ) = struct( T ) node *;
20List( int ) my_list;
21
22otype Complex | addable( Complex );
23
24int main() {
25 (struct( int ) node)my_list;
26}
27
28// Local Variables: //
29// tab-width: 4 //
30// End: //
Note: See TracBrowser for help on using the repository browser.