Ignore:
Timestamp:
Jun 29, 2017, 5:09:37 PM (4 years ago)
Author:
Rob Schluntz <rschlunt@…>
Branches:
aaron-thesis, arm-eh, cleanup-dtors, deferred_resn, demangler, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, resolv-new, with_gc
Children:
1abc5ab
Parents:
2a7b3ca (diff), fe5c01d (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:/u/cforall/software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/parser.yy

    r2a7b3ca r949934e  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // cfa.y --
     7// parser.yy --
    88//
    99// Author           : Peter A. Buhr
    1010// Created On       : Sat Sep  1 20:22:55 2001
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Mon Jun 12 12:59:00 2017
    13 // Update Count     : 2402
     12// Last Modified On : Wed Jun 28 22:11:22 2017
     13// Update Count     : 2414
    1414//
    1515
     
    4848#include <cstdio>
    4949#include <stack>
    50 #include "lex.h"
    51 #include "parser.h"
    5250#include "ParseNode.h"
    5351#include "TypedefTable.h"
     
    8886bool forall = false;                                                                    // aggregate have one or more forall qualifiers ?
    8987%}
     88
     89// Types declaration
     90%union
     91{
     92        Token tok;
     93        ParseNode * pn;
     94        ExpressionNode * en;
     95        DeclarationNode * decl;
     96        DeclarationNode::Aggregate aggKey;
     97        DeclarationNode::TypeClass tclass;
     98        StatementNode * sn;
     99        ConstantExpr * constant;
     100        ForCtl * fctl;
     101        LabelNode * label;
     102        InitializerNode * in;
     103        OperKinds op;
     104        std::string * str;
     105        bool flag;
     106}
    90107
    91108//************************* TERMINAL TOKENS ********************************
     
    139156
    140157%token ATassign                                                                                 // @=
    141 
    142 // Types declaration
    143 %union
    144 {
    145         Token tok;
    146         ParseNode * pn;
    147         ExpressionNode * en;
    148         DeclarationNode * decl;
    149         DeclarationNode::Aggregate aggKey;
    150         DeclarationNode::TypeClass tclass;
    151         StatementNode * sn;
    152         ConstantExpr * constant;
    153         ForCtl * fctl;
    154         LabelNode * label;
    155         InitializerNode * in;
    156         OperKinds op;
    157         std::string * str;
    158         bool flag;
    159 }
    160158
    161159%type<tok> identifier  no_attr_identifier  zero_one
     
    959957
    960958handler_clause:
    961         CATCH '(' push push exception_declaration pop ')' compound_statement pop
     959        // TEMPORARY, TEST EXCEPTIONS
     960        CATCH '(' push push INTEGERconstant pop ')' compound_statement pop
     961                { $$ = new StatementNode( build_catch( CatchStmt::Terminate, nullptr, new ExpressionNode( build_constantInteger( *$5 ) ), $8 ) ); }
     962        | handler_clause CATCH '(' push push INTEGERconstant pop ')' compound_statement pop
     963                { $$ = (StatementNode *)$1->set_last( new StatementNode( build_catch( CatchStmt::Terminate, nullptr, new ExpressionNode( build_constantInteger( *$6 ) ), $9 ) ) ); }
     964
     965        | CATCH '(' push push exception_declaration pop ')' compound_statement pop
    962966                { $$ = new StatementNode( build_catch( CatchStmt::Terminate, $5, nullptr, $8 ) ); }
    963967        | handler_clause CATCH '(' push push exception_declaration pop ')' compound_statement pop
Note: See TracChangeset for help on using the changeset viewer.