Ignore:
Timestamp:
May 1, 2018, 9:17:06 AM (7 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, with_gc
Children:
1518b39, 7f0001c, 94dea96
Parents:
8a5bdf0
Message:

update evaluation programs

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/papers/general/Paper.tex

    r8a5bdf0 r4c80a75  
    28752875}
    28762876_Bool stack_empty( const stack * s ) {
    2877          return s->head == NULL;
     2877        return s->head == NULL;
    28782878}
    28792879void push_stack( stack * s, void * v ) {
    2880         node * n = malloc(sizeof(node)); /***/
     2880        node * n = malloc( sizeof(node) ); /***/
    28812881        *n = (node){ v, s->head }; /***/
    28822882        s->head = n;
     
    29082908        };
    29092909        struct stack { node(T) * head; };
    2910         void ?{}( stack(T) & s ) { (s.head){ 0 }; }
    2911         void ?{}( stack(T) & s, stack(T) t ) {
     2910        void ?{}( stack(T) & s, stack(T) t ) { // copy
    29122911                node(T) ** cr = &s.head;
    29132912                for ( node(T) * nx = t.head; nx; nx = nx->next ) {
     
    29232922                        nx = cr->next;
    29242923                        ^(*cr){};
    2925                         free(cr);
     2924                        free( cr );
    29262925                }
    29272926                head = 0;
    29282927        }
     2928
    29292929\end{cfa}
    29302930&
    29312931\begin{cfa}[xleftmargin=0pt,aboveskip=0pt,belowskip=0pt]
     2932        void ?{}( stack(T) & s ) { (s.head){ 0 }; }
    29322933        void ^?{}( stack(T) & s) { clear( s ); }
    29332934        stack(T) ?=?( stack(T) & s, stack(T) t ) {
     
    29542955        }
    29552956}
    2956 
    29572957\end{cfa}
    29582958\end{tabular}
     
    30033003                return *this;
    30043004        }
    3005         bool empty() const { return head == nullptr; }
     3005        bool empty() const {
     3006                return head == nullptr;
     3007        }
    30063008        void push( const T & value ) {
    30073009                head = new node{ value, head };  /***/
     
    30153017        }
    30163018};
    3017 
    3018 
    30193019
    30203020\end{cfa}
     
    30663066                return *this;
    30673067        }
    3068         bool empty() const { return head == nullptr; }
     3068        bool empty() const {
     3069                return head == nullptr;
     3070        }
    30693071        void push( const object & value ) {
    30703072                head = new node{ value, head }; /***/
     
    30793081};
    30803082
    3081 
    3082 
    30833083\end{cfa}
    30843084\end{tabular}
Note: See TracChangeset for help on using the changeset viewer.