ADTast-experimentalpthread-emulation
Last change
on this file since dc708c1 was
fd54fef,
checked in by Michael Brooks <mlbrooks@…>, 4 years ago
|
Converting the project to use the new syntax for otype, dtype and ttytpe.
Changed prelude (gen), libcfa and test suite to use it. Added a simple deprecation rule of the old syntax to the parser; we might wish to support both syntaxes "officially," like with an extra CLI switch, but this measure should serve as a simple reminder for our team to try the new syntax.
|
-
Property mode set to
100644
|
File size:
874 bytes
|
Rev | Line | |
---|
[fd54fef] | 1 | context addable( T ) { |
---|
[b1d6dd5] | 2 | T ?+?( T,T ); |
---|
| 3 | T ?=?( T*, T); |
---|
| 4 | }; |
---|
| 5 | |
---|
[fd54fef] | 6 | otype List1( T | addable( T ) ) = struct { T data; List1( T ) *next; } *; |
---|
[b1d6dd5] | 7 | typedef List1( int ) ListOfIntegers; |
---|
| 8 | //List1( int ) li; |
---|
| 9 | ListOfIntegers li; |
---|
| 10 | int f( List1( int ) ( (*g ))( int ) ); |
---|
| 11 | [int] h( * List1( int ) p ); // new declaration syntax |
---|
| 12 | |
---|
[fd54fef] | 13 | struct( T ) S2 { T i; }; // actual definition |
---|
[68cd1ce] | 14 | struct( int ) S3 v1, *p; // expansion and instantiation |
---|
[fd54fef] | 15 | struct( T )( int ) S24 { T i; } v2; // actual definition, expansion and instantiation |
---|
| 16 | struct( T )( int ) { T i; } v2; // anonymous actual definition, expansion and instantiation |
---|
[b1d6dd5] | 17 | |
---|
[fd54fef] | 18 | struct( T | addable( T ) ) node { T data; struct( T ) node *next; }; |
---|
| 19 | otype List( T ) = struct( T ) node *; |
---|
[b1d6dd5] | 20 | List( int ) my_list; |
---|
| 21 | |
---|
[55ba7339] | 22 | otype Complex | addable( Complex ); |
---|
[b1d6dd5] | 23 | |
---|
| 24 | int 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.