Next Previous Contents

6. Appendix 1 - Syntax of SHILKA description file (YACC description)

%token PERCENTS LOCAL IMPORT EXPORT TYPE EQUAL OTHER
%token IDENTIFIER STRING CODE_INSERTION ADDITIONAL_C_CODE
%token NUMBER
%start description

%%

description : declaration_part  PERCENTS
              keyword_definition_list  ADDITIONAL_C_CODE
            ;

declaration_part :
                 | declaration_part  declaration
                 ;

declaration : TYPE IDENTIFIER
            | LOCAL  CODE_INSERTION
            | IMPORT CODE_INSERTION
            | EXPORT CODE_INSERTION
            ;

keyword_definition_list :
                        | keyword_definition_list  keyword_definition
                        ;

keyword_definition : IDENTIFIER optional_name frequency optional_action
                   | STRING EQUAL IDENTIFIER frequency optional_action
                   | OTHER optional_action
                   ;

optional_name :
              | EQUAL IDENTIFIER
              ;

frequency :
          | NUMBER
          ;

optional_action :
                | CODE_INSERTION
                ;


Next Previous Contents