Ignore:
Timestamp:
Jan 19, 2021, 8:44:29 PM (12 months ago)
Author:
Michael Brooks <mlbrooks@…>
Branches:
arm-eh, jacob/cs343-translation, master, new-ast-unique-expr
Children:
dafbde8
Parents:
2f47ea4
Message:

Converting the project to use the new syntax for otype, dtype and ttytpe.

Changed prelude (gen), libcfa and test suite to use it. Added a simple deprecation rule of the old syntax to the parser; we might wish to support both syntaxes "officially," like with an extra CLI switch, but this measure should serve as a simple reminder for our team to try the new syntax.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/avltree/avl.h

    r2f47ea4 rfd54fef  
    99// #include <lib.h>
    1010
    11 trait Comparable(otype T) {
     11trait Comparable(T) {
    1212  int ?<?(T, T);
    1313};
    1414
    15 forall(otype T | Comparable(T))
     15forall(T | Comparable(T))
    1616int ?==?(T t1, T t2);
    1717
    18 forall(otype T | Comparable(T))
     18forall(T | Comparable(T))
    1919int ?>?(T t1, T t2);
    2020
     
    4141
    4242// temporary: need forward decl to get around typedef problem
    43 forall(otype K | Comparable(K), otype V)
     43forall(K | Comparable(K), V)
    4444struct tree;
    4545
    46 forall(otype K | Comparable(K), otype V)
     46forall(K | Comparable(K), V)
    4747struct tree {
    4848  K key;
     
    5454};
    5555
    56 forall(otype K | Comparable(K), otype V)
     56forall(K | Comparable(K), V)
    5757void ?{}(tree(K, V) &t, K key, V value);
    5858
    59 forall(otype K | Comparable(K), otype V)
     59forall(K | Comparable(K), V)
    6060void ^?{}(tree(K, V) & t);
    6161
    62 forall(otype K | Comparable(K), otype V)
     62forall(K | Comparable(K), V)
    6363tree(K, V) * create(K key, V value);
    6464
    65 forall(otype K | Comparable(K), otype V)
     65forall(K | Comparable(K), V)
    6666V * find(tree(K, V) * t, K key);
    6767
    68 forall(otype K | Comparable(K), otype V)
     68forall(K | Comparable(K), V)
    6969int empty(tree(K, V) * t);
    7070
    7171// returns the root of the tree
    72 forall(otype K | Comparable(K), otype V)
     72forall(K | Comparable(K), V)
    7373int insert(tree(K, V) ** t, K key, V value);
    7474
    75 forall(otype K | Comparable(K), otype V)
     75forall(K | Comparable(K), V)
    7676int remove(tree(K, V) ** t, K key);
    7777
    78 forall(otype K | Comparable(K), otype V)
     78forall(K | Comparable(K), V)
    7979void copy(tree(K, V) * src, tree(K, V) ** ret);
    8080
    81 forall(otype K | Comparable(K), otype V)
     81forall(K | Comparable(K), V)
    8282void for_each(tree(K, V) * t, void (*func)(V));
    8383
Note: See TracChangeset for help on using the changeset viewer.