Changeset 565acf59 for src


Ignore:
Timestamp:
Feb 12, 2021, 12:27:38 PM (5 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
eb24cec0
Parents:
da3963a (diff), 52f6250 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

Location:
src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/parser.yy

    rda3963a r565acf59  
    1010// Created On       : Sat Sep  1 20:22:55 2001
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Jan 26 11:18:19 2021
    13 // Update Count     : 4674
     12// Last Modified On : Wed Feb  3 18:30:12 2021
     13// Update Count     : 4700
    1414//
    1515
     
    4141
    4242%{
    43 #define YYDEBUG_LEXER_TEXT (yylval)                                             // lexer loads this up each time
     43#define YYDEBUG_LEXER_TEXT( yylval )                                    // lexer loads this up each time
    4444#define YYDEBUG 1                                                                               // get the pretty debugging code to compile
    4545#define YYERROR_VERBOSE                                                                 // more information in syntax errors
     
    187187        ConstantExpr * constant = dynamic_cast<ConstantExpr *>(type->expr.get());
    188188        if ( constant && (constant->get_constant()->get_value() == "0" || constant->get_constant()->get_value() == "1") ) {
    189         type = new ExpressionNode( new CastExpr( maybeMoveBuild<Expression>(type), new BasicType( Type::Qualifiers(), BasicType::SignedInt ) ) );
     189                type = new ExpressionNode( new CastExpr( maybeMoveBuild<Expression>(type), new BasicType( Type::Qualifiers(), BasicType::SignedInt ) ) );
    190190        } // if
    191191        return new ForCtrl(
     
    618618postfix_expression:
    619619        primary_expression
     620        | postfix_expression '[' assignment_expression ',' comma_expression ']'
     621                // { $$ = new ExpressionNode( build_binary_val( OperKinds::Index, $1, new ExpressionNode( build_binary_val( OperKinds::Index, $3, $5 ) ) ) ); }
     622                { SemanticError( yylloc, "New array subscript is currently unimplemented." ); $$ = nullptr; }
    620623        | postfix_expression '[' assignment_expression ']'
    621624                // CFA, comma_expression disallowed in this context because it results in a common user error: subscripting a
     
    12471250                { $$ = new StatementNode( build_computedgoto( $3 ) ); }
    12481251                // A semantic check is required to ensure fallthru appears only in the body of a choose statement.
    1249     | fall_through_name ';'                                                             // CFA
     1252        | fall_through_name ';'                                                         // CFA
    12501253                { $$ = new StatementNode( build_branch( BranchStmt::FallThrough ) ); }
    1251     | fall_through_name identifier_or_type_name ';'             // CFA
     1254        | fall_through_name identifier_or_type_name ';'         // CFA
    12521255                { $$ = new StatementNode( build_branch( $2, BranchStmt::FallThrough ) ); }
    12531256        | fall_through_name DEFAULT ';'                                         // CFA
     
    17391742
    17401743enum_specifier_nobody:                                                                  // type specifier - {...}
    1741                 // Preclude SUE declarations in restricted scopes:
    1742                 //
    1743                 //    int f( struct S { int i; } s1, Struct S s2 ) { struct S s3; ... }
    1744                 //
    1745                 // because it is impossible to call f due to name equivalence.
     1744                // Preclude SUE declarations in restricted scopes (see type_specifier_nobody)
    17461745        basic_type_specifier
    17471746        | sue_type_specifier_nobody
     
    24612460                {
    24622461                        typedefTable.addToScope( *$2, TYPEDEFname, "9" );
    2463                         if ( $1 == TypeDecl::Otype ) { SemanticError( yylloc, "otype keyword is deprecated" ); }
    2464                         if ( $1 == TypeDecl::Dtype ) { SemanticError( yylloc, "dtype keyword is deprecated" ); }
    2465                         if ( $1 == TypeDecl::Ttype ) { SemanticError( yylloc, "ttype keyword is deprecated" ); }
     2462                        if ( $1 == TypeDecl::Otype ) { SemanticError( yylloc, "otype keyword is deprecated, use T " ); }
     2463                        if ( $1 == TypeDecl::Dtype ) { SemanticError( yylloc, "dtype keyword is deprecated, use T &" ); }
     2464                        if ( $1 == TypeDecl::Ttype ) { SemanticError( yylloc, "ttype keyword is deprecated, use T ..." ); }
    24662465                }
    24672466          type_initializer_opt assertion_list_opt
     
    31913190        | '[' ']' multi_array_dimension
    31923191                { $$ = DeclarationNode::newArray( 0, 0, false )->addArray( $3 ); }
     3192        | '[' push assignment_expression pop ',' comma_expression ']'
     3193                { $$ = DeclarationNode::newArray( $3, 0, false )->addArray( DeclarationNode::newArray( $6, 0, false ) ); }
     3194                // { SemanticError( yylloc, "New array dimension is currently unimplemented." ); $$ = nullptr; }
    31933195        | multi_array_dimension
    31943196        ;
  • src/main.cc

    rda3963a r565acf59  
    99// Author           : Peter Buhr and Rob Schluntz
    1010// Created On       : Fri May 15 23:12:02 2015
    11 // Last Modified By : Andrew Beach
    12 // Last Modified On : Mon Dec  7 15:29:00 2020
    13 // Update Count     : 639
     11// Last Modified By : Peter A. Buhr
     12// Last Modified On : Mon Feb  8 21:10:16 2021
     13// Update Count     : 642
    1414//
    1515
     
    492492
    493493static const char * description[] = {
    494         "diagnostic color: never, always, or auto.",            // -c
     494        "diagnostic color: never, always, auto",                        // -c
    495495        "wait for gdb to attach",                                                       // -g
    496         "print help message",                                                           // -h
     496        "print translator help message",                                        // -h
    497497        "generate libcfa.c",                                                            // -l
    498498        "generate line marks",                                                          // -L
     
    500500        "do not generate line marks",                                           // -N
    501501        "do not read prelude",                                                          // -n
    502         "generate prototypes for prelude functions",            // -p
     502        "do not generate prelude prototypes => prelude not printed", // -p
    503503        "only print deterministic output",                  // -d
    504504        "Use the old-ast",                                                                      // -O
     
    506506        "print",                                                                                        // -P
    507507        "<directory> prelude directory for debug/nodebug",      // no flag
    508         "<option-list> enable profiling information:\n          counters,heap,time,all,none", // -S
     508        "<option-list> enable profiling information: counters, heap, time, all, none", // -S
    509509        "building cfa standard lib",                                            // -t
    510510        "",                                                                                                     // -w
Note: See TracChangeset for help on using the changeset viewer.