Ignore:
Timestamp:
Jan 19, 2021, 8:44:29 PM (3 years ago)
Author:
Michael Brooks <mlbrooks@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
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
  • libcfa/prelude/prelude-gen.cc

    r2f47ea4 rfd54fef  
    159159int main() {
    160160        cout << "# 2 \"prelude.cfa\"  // needed for error messages from this file" << endl;
    161         cout << "trait sized(dtype T) {};" << endl;
     161        cout << "trait sized(T &) {};" << endl;
    162162
    163163        cout << "//////////////////////////" << endl;
     
    264264                for (auto cvq : qualifiersPair) {
    265265                        for (auto is_vol : { "        ", "volatile" }) {
    266                                 cout << "forall(dtype DT) void  ?{}(" << cvq.first << type << " * " << is_vol << " &, " << cvq.second << "DT *);" << endl;
     266                                cout << "forall(DT &) void  ?{}(" << cvq.first << type << " * " << is_vol << " &, " << cvq.second << "DT *);" << endl;
    267267                        }
    268268                }
     
    279279        for (auto cvq : qualifiersSingle) {
    280280                for (auto is_vol : { "        ", "volatile" }) {
    281                         cout << "forall(dtype DT) void  ?{}(" << cvq << "  DT" << " * " << is_vol << " &);" << endl;
     281                        cout << "forall(DT &) void  ?{}(" << cvq << "  DT" << " * " << is_vol << " &);" << endl;
    282282                }
    283283                for (auto is_vol : { "        ", "volatile" }) {
    284                         cout << "forall(dtype DT) void ^?{}(" << cvq << "  DT" << " * " << is_vol << " &);" << endl;
     284                        cout << "forall(DT &) void ^?{}(" << cvq << "  DT" << " * " << is_vol << " &);" << endl;
    285285                }
    286286        }
     
    290290                for (auto is_vol : { "        ", "volatile" }) {
    291291                        for (auto cvq : qualifiersSingle) {
    292                                 cout << "forall(dtype DT) void ?{}( " << cvq << type << " * " << is_vol << " &, zero_t);" << endl;
     292                                cout << "forall(DT &) void ?{}( " << cvq << type << " * " << is_vol << " &, zero_t);" << endl;
    293293                        }
    294294                }
     
    317317        for (auto op : pointerOperators) {
    318318                auto forall = [&op]() {
    319                         cout << "forall(dtype DT" << op.sized << ") ";
     319                        cout << "forall(DT &" << op.sized << ") ";
    320320                };
    321321                for (auto type : { "DT"/*, "void"*/ } ) {
     
    408408        for (auto is_vol : { "        ", "volatile" }) {
    409409                for (auto cvq : qualifiersPair) {
    410                                 cout << "forall(dtype DT) " << cvq.first << "void * ?=?( " << cvq.first << "void * " << is_vol << " &, " << cvq.second << "DT *);" << endl;
     410                                cout << "forall(DT &) " << cvq.first << "void * ?=?( " << cvq.first << "void * " << is_vol << " &, " << cvq.second << "DT *);" << endl;
    411411                }
    412412                for (auto cvq : qualifiersSingle) {
    413                         cout << "forall(dtype DT) " << cvq <<   "  DT * ?=?( " << cvq << "  DT * " << is_vol << " &, zero_t);" << endl;
     413                        cout << "forall(DT &) " << cvq <<   "  DT * ?=?( " << cvq << "  DT * " << is_vol << " &, zero_t);" << endl;
    414414                }
    415415        }
Note: See TracChangeset for help on using the changeset viewer.