Next Previous Contents

7. Appendix 1 - Syntax of pipeline Hazards Description (YACC grammar)


%token PERCENTS COMMA COLON SEMICOLON LEFT_PARENTHESIS RIGHT_PARENTHESIS
       LEFT_BRACKET RIGHT_BRACKET LEFT_ANGLE_BRACKET RIGHT_ANGLE_BRACKET
       PLUS BAR STAR
       LOCAL IMPORT EXPORT EXCLUSION AUTOMATON
       UNIT NOTHING INSTRUCTION RESERVATION 

%token IDENTIFIER NUMBER CODE_INSERTION ADDITIONAL_C_CODE

%start description

%%

description : declaration_part  PERCENTS
              expression_definition_list  ADDITIONAL_C_CODE
            ;

declaration_part :
                 | declaration_part  declaration
                 ;

declaration : identifier_declaration
            | LOCAL  CODE_INSERTION
            | IMPORT  CODE_INSERTION
            | EXPORT  CODE_INSERTION
            ;

identifier_declaration : instruction_declaration
                       | reservation_declaration
                       | unit_declaration
                       | automaton_declaration
                       | exclusion_clause
                       ;

instruction_declaration : INSTRUCTION
                        | instruction_declaration  IDENTIFIER
                        ;

reservation_declaration : RESERVATION
                        | reservation_declaration  IDENTIFIER
                        ;

unit_declaration : UNIT  optional_automaton_identifier
                 | unit_declaration  IDENTIFIER
                 ;

exclusion_clause : EXCLUSION identifier_list COLON identifier_list
                 ;

identifier_list : IDENTIFIER
                | identifier_list IDENTIFIER
                ;

optional_automaton_identifier :
                              | LEFT_ANGLE_BRACKET
                                  IDENTIFIER  RIGHT_ANGLE_BRACKET
                              ;

automaton_declaration : AUTOMATON
                      | automaton_declaration  IDENTIFIER
;

expression_definition_list
   :
   | expression_definition_list  expression_definition
   ;

expression_definition : instruction_or_reservation_identifier_list  COLON 
                        expression  SEMICOLON
                      ;

instruction_or_reservation_identifier_list
  : instruction_or_reservation_identifier
  | instruction_or_reservation_identifier_list
       COMMA  instruction_or_reservation_identifier
  ;

instruction_or_reservation_identifier : IDENTIFIER
                                      ;

expression : expression  expression
           | expression  PLUS  expression
           | expression STAR NUMBER
           | LEFT_PARENTHESIS  expression  RIGHT_PARENTHESIS
           | LEFT_BRACKET  expression  RIGHT_BRACKET
           | expression  BAR  expression
           | unit_or_reservation_identifier
           | NOTHING
           ;

unit_or_reservation_identifier : IDENTIFIER
                               ;


Next Previous Contents