source: translator/examples/array.h@ 91b216b4

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 string with_gc
Last change on this file since 91b216b4 was 51b73452, checked in by Peter A. Buhr <pabuhr@…>, 11 years ago

initial commit

  • Property mode set to 100644
File size: 752 bytes
Line 
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.