64 lines
755 B
Text
64 lines
755 B
Text
%union {
|
|
int nombre;
|
|
}
|
|
|
|
%token tENTIER
|
|
%token tADD
|
|
%token tSUB
|
|
%token tMUL
|
|
%token tDIV
|
|
|
|
%token tPO
|
|
%token tPF
|
|
%token tAO
|
|
%token tAF
|
|
|
|
%token tERROR
|
|
|
|
%token tPV
|
|
%token tVIRGULE
|
|
%token tAFFECTATION
|
|
%token tEGAL
|
|
%token tDIFF
|
|
%token tLT
|
|
%token tGT
|
|
%token tGTE
|
|
%token tLTE
|
|
%token tMAIN
|
|
%token tINT
|
|
%token tPRINT
|
|
%token tRETURN
|
|
%token tOR
|
|
%token tAND
|
|
%token tIF
|
|
%token tELSE
|
|
%token tWHILE
|
|
%token tCONST
|
|
%token tVAR
|
|
%token tNOT
|
|
|
|
%left tADD
|
|
%left tSUB
|
|
%left tMUL
|
|
%left tDIV
|
|
%right tEGAL
|
|
|
|
|
|
%%
|
|
|
|
Prog : tINT tMAIN tPO tPF Body {printf("Dans main\n");};
|
|
|
|
|
|
Body : tAO Instructions Return tAF ;
|
|
|
|
Instructions : Instruction Instructions | ;
|
|
|
|
Instruction : Print ;
|
|
|
|
Type : tINT | tCONST tINT ;
|
|
|
|
Valeur : tVAR | Affbis ;
|
|
|
|
Affbis : tVAR tAFFECTATION E;
|
|
|
|
Aff : Affbis tPV ;
|