%{
/*
 * gram.y - message definition language
 *
 * Copyright (c) 2009 Cisco and/or its affiliates.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at:
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

extern void yyerror (char *s);
extern int yylex (void);
    
#define YYSTYPE void *
    
void generate (YYSTYPE);
 YYSTYPE add_slist(YYSTYPE, YYSTYPE);
 YYSTYPE add_define(YYSTYPE, YYSTYPE);
 YYSTYPE suppress_version(void);
 YYSTYPE add_defbody(YYSTYPE, YYSTYPE);
 YYSTYPE add_primtype(YYSTYPE, YYSTYPE, YYSTYPE);
 YYSTYPE add_complex(YYSTYPE, YYSTYPE);
 YYSTYPE add_union(YYSTYPE, YYSTYPE);
 YYSTYPE add_scalar_vbl(YYSTYPE);
 YYSTYPE add_vector_vbl(YYSTYPE, YYSTYPE);
 YYSTYPE add_variable_length_vector_vbl(YYSTYPE, YYSTYPE);
 YYSTYPE set_flags(YYSTYPE, YYSTYPE);
%}

%token NAME RPAR LPAR SEMI LBRACK RBRACK NUMBER PRIMTYPE BARF
%token TPACKED DEFINE LCURLY RCURLY STRING UNION
%token HELPER_STRING COMMA 
%token NOVERSION MANUAL_PRINT MANUAL_ENDIAN TYPEONLY DONT_TRACE AUTOREPLY

%%

pgm:	  slist                 {generate ($1);}
          ;

slist:	  slist stmt            {$$ = add_slist ($1, $2);}
        | stmt                  {$$ = $1;}
          ;

stmt:     flist defn            {$$ = set_flags($1, $2);}
        | defn                  {$$ = $1;}
          ;

flist:    flist flag            {$$ = (YYSTYPE)(unsigned long long)
                                     ((unsigned long long) $1 
                                    | (unsigned long long) $2);}
        | flag                  {$$ = $1;}
          ;

flag:   
          MANUAL_PRINT          {$$ = $1;}
        | MANUAL_ENDIAN         {$$ = $1;}
        | DONT_TRACE            {$$ = $1;}
        | TYPEONLY              {$$ = $1;}
        | AUTOREPLY             {$$ = $1;}
          ;

defn:     DEFINE NAME LCURLY defbody RCURLY SEMI 
                                {$$ = add_define($2, $4);}

        | NOVERSION SEMI
                                {$$ = suppress_version();}
          ;

defbody:  defbody onedef        {$$ = add_defbody($1, $2);}
        | onedef                {$$ = $1;}
          ;

onedef:   PRIMTYPE vbl SEMI      {$$ = add_primtype($1, $2, 0);}
        | TPACKED PRIMTYPE vbl SEMI {$$ = add_primtype($1, $2, $3);}
        | NAME vbl SEMI          {$$ = add_complex($1, $2);}
        | UNION NAME LCURLY defbody RCURLY SEMI 
                                 {$$ = add_union($2, $4);}
          ;

vbl:      NAME                      {$$ = add_scalar_vbl($1);}
        | NAME LBRACK NUMBER RBRACK {$$ = add_vector_vbl($1, $3);}
        | NAME LBRACK NAME RBRACK {$$ = add_variable_length_vector_vbl($1, $3);}
          ;
