Changeset a32b204 for translator/examples
- Timestamp:
- May 17, 2015, 1:19:35 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:
- 0dd3a2f
- Parents:
- b87a5ed
- Location:
- translator/examples
- Files:
-
- 1 deleted
- 4 edited
-
iostream.c (modified) (1 diff)
-
iterator.c (modified) (1 diff)
-
iterator.h (modified) (1 diff)
-
simplePoly.c (modified) (1 diff)
-
test.c (deleted)
Legend:
- Unmodified
- Added
- Removed
-
translator/examples/iostream.c
rb87a5ed ra32b204 50 50 do { 51 51 is >> &cur; 52 if ( fail( is ) || eof( is ) ) return is;53 } while ( !( cur >= '0' && cur <= '9' ) );52 if ( fail( is ) || eof( is ) ) return is; 53 } while ( !( cur >= '0' && cur <= '9' ) ); 54 54 55 55 // accumulate digits 56 56 *ip = 0; 57 while ( cur >= '0' && cur <= '9' ) {57 while ( cur >= '0' && cur <= '9' ) { 58 58 *ip = *ip * 10 + ( cur - '0' ); 59 59 is >> &cur; 60 if ( fail( is ) || eof( is ) ) return is;60 if ( fail( is ) || eof( is ) ) return is; 61 61 } 62 62 -
translator/examples/iterator.c
rb87a5ed ra32b204 10 10 /// { 11 11 /// iterator_type i; 12 /// for ( i = begin; i != end; ++i ) {12 /// for ( i = begin; i != end; ++i ) { 13 13 /// func( *i ); 14 14 /// } -
translator/examples/iterator.h
rb87a5ed ra32b204 19 19 }; 20 20 21 context iterator_for ( type iterator_type, type collection_type, type elt_type | iterator( iterator_type, elt_type ) ) {21 context iterator_for ( type iterator_type, type collection_type, type elt_type | iterator( iterator_type, elt_type ) ) { 22 22 // [ iterator_type begin, iterator_type end ] get_iterators( collection_type ); 23 23 iterator_type begin( collection_type ); -
translator/examples/simplePoly.c
rb87a5ed ra32b204 13 13 int y; 14 14 double x; 15 // if ( y )15 // if ( y ) 16 16 q( 3, &x ); 17 17 }
Note:
See TracChangeset
for help on using the changeset viewer.