Sie sind auf Seite 1von 1

%{

#include<stdio.h>
%}
%token ID
%%
exp:exp exp '*'
exp:exp exp '+'
exp:ID
%%
main()
{
printf("enter the expression for the grammar \n S-->SS+ | SS* | a");
yyparse();
printf("valid experession\n");
}
void yyerror()
{
printf("Invalid expression\n");
exit(1);
}

Das könnte Ihnen auch gefallen