P
Philipp Kraus
Hello,
I must create my own programming language. So I download bison and flex
and install them. I had tested bison with C examples and I can create my files,
but I need C++ code. I'm new at this topic, so I need some examples / help
for create C++ code.
I my testcode I write:
%{
#includes <iostream>
void yyerror (const char *error);
int yylex( void );
%}
%%
expr : ;
%%
int main( void )
{
return yyparse();
}
void yyerror( const char *error )
{
std::cout << error << std::endl;
}
int yylex( void )
{
return -1;
}
If I compile this with bison, I would get an *.c file. How I can
get a *.cpp file?
I hope this thread isn't off-topic.
Thx
Phil
I must create my own programming language. So I download bison and flex
and install them. I had tested bison with C examples and I can create my files,
but I need C++ code. I'm new at this topic, so I need some examples / help
for create C++ code.
I my testcode I write:
%{
#includes <iostream>
void yyerror (const char *error);
int yylex( void );
%}
%%
expr : ;
%%
int main( void )
{
return yyparse();
}
void yyerror( const char *error )
{
std::cout << error << std::endl;
}
int yylex( void )
{
return -1;
}
If I compile this with bison, I would get an *.c file. How I can
get a *.cpp file?
I hope this thread isn't off-topic.
Thx
Phil