Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Parser/parser.yy

    r9335ecc rca78437  
    55// file "LICENCE" distributed with Cforall.
    66//
    7 // parser.yy --
     7// cfa.y --
    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 : Wed Jun 28 22:11:22 2017
    13 // Update Count     : 2414
     12// Last Modified On : Mon Jun 12 12:59:00 2017
     13// Update Count     : 2402
    1414//
    1515
     
    4848#include <cstdio>
    4949#include <stack>
     50#include "lex.h"
     51#include "parser.h"
    5052#include "ParseNode.h"
    5153#include "TypedefTable.h"
     
    8688bool forall = false;                                                                    // aggregate have one or more forall qualifiers ?
    8789%}
    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 }
    10790
    10891//************************* TERMINAL TOKENS ********************************
     
    156139
    157140%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}
    158160
    159161%type<tok> identifier  no_attr_identifier  zero_one
     
    957959
    958960handler_clause:
    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
     961        CATCH '(' push push exception_declaration pop ')' compound_statement pop
    966962                { $$ = new StatementNode( build_catch( CatchStmt::Terminate, $5, nullptr, $8 ) ); }
    967963        | handler_clause CATCH '(' push push exception_declaration pop ')' compound_statement pop
Note: See TracChangeset for help on using the changeset viewer.