%{
#include <stdio.h>
#include <assert.h>
extern FILE* yyin;
%}
%union{
int* i;
double* d;
char* c;
}
%type <i> a b c d
%type <d> e
%token A B C D E F G H
%%
a:b
{
	assert($$==$1);
	$$=(int*)malloc(sizeof(int));
	printf("%d\n",*$1);
}
|c|d
;
b:e
{
	assert($$=NULL);
	//printf("%d\n",*$$);
	$$=(int*)malloc(sizeof(int));
	*$$=(int)(*($1));
}
;
e:A B C
{
	assert($$==NULL);
	$$=(double*)malloc(sizeof(double));
	*$$=34;
}
;
c:D E F
{
	assert($$==NULL);
	$$=(int*)malloc(sizeof(int));
}
;
d:G
{
	assert($$==NULL);
	$$=(int*)malloc(sizeof(int));
}
;
%%
int yyerror(char* s){
	return 1;
}
int main(){
	yyin=fopen("a","r");
	if(yyparse())
		printf("error\n");
	return 0;
}
