Ignore:
Timestamp:
Jun 19, 2021, 3:53:18 PM (3 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
15f769c
Parents:
6992f95 (diff), c7d8696a (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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/parser.yy

    r6992f95 re319fc5  
    1010// Created On       : Sat Sep  1 20:22:55 2001
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Apr 26 18:41:54 2021
    13 // Update Count     : 4990
     12// Last Modified On : Wed May 19 14:20:36 2021
     13// Update Count     : 5022
    1414//
    1515
     
    287287
    288288// names and constants: lexer differentiates between identifier and typedef names
    289 %token<tok> IDENTIFIER          QUOTED_IDENTIFIER       TYPEDEFname             TYPEGENname
     289%token<tok> IDENTIFIER          QUOTED_IDENTIFIER       TYPEDIMname             TYPEDEFname             TYPEGENname
    290290%token<tok> TIMEOUT                     WOR                                     CATCH                   RECOVER                 CATCHRESUME             FIXUP           FINALLY         // CFA
    291291%token<tok> INTEGERconstant     CHARACTERconstant       STRINGliteral
     
    586586        | quasi_keyword
    587587                { $$ = new ExpressionNode( build_varref( $1 ) ); }
     588        | TYPEDIMname                                                                           // CFA, generic length argument
     589                // { $$ = new ExpressionNode( new TypeExpr( maybeMoveBuildType( DeclarationNode::newFromTypedef( $1 ) ) ) ); }
     590                // { $$ = new ExpressionNode( build_varref( $1 ) ); }
     591                { $$ = new ExpressionNode( build_dimensionref( $1 ) ); }
    588592        | tuple
    589593        | '(' comma_expression ')'
     
    25352539        | '[' identifier_or_type_name ']'
    25362540                {
    2537                         typedefTable.addToScope( *$2, TYPEDEFname, "9" );
    2538                         $$ = DeclarationNode::newTypeParam( TypeDecl::ALtype, $2 );
     2541                        typedefTable.addToScope( *$2, TYPEDIMname, "9" );
     2542                        $$ = DeclarationNode::newTypeParam( TypeDecl::Dimension, $2 );
    25392543                }
    25402544        // | type_specifier identifier_parameter_declarator
     
    25902594                { $$ = new ExpressionNode( new TypeExpr( maybeMoveBuildType( $1 ) ) ); }
    25912595        | assignment_expression
    2592                 { SemanticError( yylloc, toString("Expression generic parameters are currently unimplemented: ", $1->build()) ); $$ = nullptr; }
    25932596        | type_list ',' type
    25942597                { $$ = (ExpressionNode *)($1->set_last( new ExpressionNode( new TypeExpr( maybeMoveBuildType( $3 ) ) ) )); }
    25952598        | type_list ',' assignment_expression
    2596                 { SemanticError( yylloc, toString("Expression generic parameters are currently unimplemented: ", $3->build()) ); $$ = nullptr; }
    2597                 // { $$ = (ExpressionNode *)( $1->set_last( $3 )); }
     2599                { $$ = (ExpressionNode *)( $1->set_last( $3 )); }
    25982600        ;
    25992601
Note: See TracChangeset for help on using the changeset viewer.