source: translator/examples/array.h @ 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: 752 bytes
RevLine 
[51b7345]1#ifndef ARRAY_H
2#define ARRAY_H
3
4#include "iterator.h"
5
6context array( type array_type, type elt_type )
7{
8  lvalue elt_type ?[?]( array_type, int );
9};
10
11context bounded_array( type array_type, type elt_type | array( array_type, elt_type ) )
12{
13  int array_last( array_type );
14};
15
16// implement iterator_for
17
18typedef int array_iterator;
19/// forall( type array_type, elt_type | bounded_array( array_type, elt_type ) )
20/// [ array_iterator begin, array_iterator end ] get_iterators( array_type );
21forall( type array_type, type elt_type | bounded_array( array_type, elt_type ) )
22elt_type *get_begin( array_type );
23forall( type array_type, type elt_type | bounded_array( array_type, elt_type ) )
24elt_type *get_end( array_type );
25
26#endif /* #ifndef ARRAY_H */
Note: See TracBrowser for help on using the repository browser.