Ignore:
Timestamp:
Oct 11, 2011, 5:42:20 PM (9 years ago)
Author:
tranquil
Message:
  • changed implementation of constant indexings with extensible arrays
  • work on ASM completed
  • next: optimizations!
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Deliverables/D2.2/8051-indexed-labels-branch/src/common/costLabel.mli

    r1319 r1357  
    2121type indexing = sexpr list
    2222
    23 type const_indexing = int array
     23type const_indexing
    2424
    25 (** [enter_loop n indexing] is used to update indexing when one is entering a
    26     loop indexed by [n].
    27         The function recycles the same constant indexing *)
    28 val enter_loop : index option -> const_indexing -> unit
     25val const_ind_iter : (int -> unit) -> const_indexing -> unit
    2926
    30 (** [continue_loop n indexing] is used to update indexing when one is continuing a
    31     loop indexed by [n]. *)
    32 val continue_loop : index option -> const_indexing -> unit
     27(** Top of the stack.
     28    @raise [Invalid_argument "non-empty indexing stack"] if argument is empty *)
     29val curr_const_ind : const_indexing list -> const_indexing
     30
     31(** [enter_loop inds n] is used to update the indexing stack [ind] when one
     32    is entering a loop indexed by [n]. Raises [Invalid_argument
     33                "non-empty indexing stack"] if [inds] is empty. *)
     34val enter_loop : const_indexing list -> index -> unit
     35
     36(** [enter_loop_opt inds (Some n)] behaves like [enter_loop inds n], and does
     37    nothing in case of [None].
     38                @see enter_loop *)
     39val enter_loop_opt : const_indexing list -> index option -> unit
     40
     41(** [continue_loop inds n] is used to update the indexing stack [inds] when
     42    one is continuing a loop indexed by [n].
     43                @raise [Invalid_argument "non-empty indexing stack"] if [inds] is empty.
     44                @raise [Invalid_argument "uninitialized loop index"] if the head of
     45                [inds] has no value for [index]. *)
     46val continue_loop : const_indexing list -> index -> unit
     47
     48(** [continue_loop_opt inds (Some n)] behaves like [continue_loop inds n], and
     49    does nothing in case of [None].
     50    @see continue_loop *)
     51val continue_loop_opt : const_indexing list -> index option -> unit
     52
     53(** [new_const_ind inds] pushes a new empty constant indexing on top of the
     54    stack [inds]. *)
     55val new_const_ind : const_indexing list -> const_indexing list
     56
     57(** [forget_const_ind inds] pops and discards the top constant indexing from the
     58    stack [inds].  Raises [Invalid_argument "non-empty indexing stack"] if
     59                [inds] is empty. *)
     60val forget_const_ind : const_indexing list -> const_indexing list
     61
     62
     63 
    3364
    3465(** [empty_indexing] generates an empty indexing *)
     
    4576}
    4677
    47 val apply_const_indexing : const_indexing -> t -> t
    48 
     78(** [apply_const_indexing ind lbl] returns [lbl] where its indexing has been
     79    evaluated in the constant indexing [ind].
     80                @raise  Invalid_argument "constant indexing not enough to be applied" if
     81                [ind] does not contain enough mappings to evaluate [lbl]'s indexing. *)
     82val ev_indexing : const_indexing -> t -> t
    4983
    5084(** [string_of_cost_label pref t] converts an indexed label to a
Note: See TracChangeset for help on using the changeset viewer.