Read and respond to this message at: https://sourceforge.net/projects/gnuwin32/forums/forum/74807/topic/3520921 By: ubuntu-nathan
Hello, I've downloaded just Bison of the GnuWin32 compiler pack, I've downloaded the setup without sources and all got right when installing, then I tried to test it with the simple rpcalc.y example: [code]/* Reverse polish notation calculator. */ %{ #define YYSTYPE double #include <math.h> %} %token NUM %% /* Grammar rules and actions follow */ input: /* empty */ | input line ; line: '\n' | exp '\n' { printf ("\t%.10g\n", $1); } ; exp: NUM { $$ = $1; } | exp exp '+' { $$ = $1 + $2; } | exp exp '-' { $$ = $1 - $2; } | exp exp '*' { $$ = $1 * $2; } | exp exp '/' { $$ = $1 / $2; } /* Exponentiation */ | exp exp '^' { $$ = pow ($1, $2); } /* Unary minus */ | exp 'n' { $$ = -$1; } ; %% /* Lexical analyzer returns a double floating point number on the stack and the token NUM, or the ASCII character read if not a number. Skips all blanks and tabs, returns 0 for EOF. */ #include <ctype.h> yylex () { int c; /* skip white space */ while ((c = getchar ()) == ' ' || c == '\t') ; /* process numbers */ if (c == '.' || isdigit (c)) { ungetc (c, stdin); scanf ("%lf", &yylval); return NUM; } /* return end-of-file */ if (c == EOF) return 0; /* return single chars */ return c; }[/code] But when I've tried to use bison: [i]C:\> bison rpcalc.y[/i], I just got a lot of garbage: [url]http://nathanpc.pastebin.com/f2fae6710[/url], it's too much big, then I've posted at pastebin. [list] [*]Why is this happening? [*]What I need to do? [*]Have this already happened to you? [/list] Best Regards, Nathan Paulino Campos ______________________________________________________________________ You are receiving this email because you elected to monitor this forum. To stop monitoring this forum, login to SourceForge.net and visit: https://sourceforge.net/projects/gnuwin32/forums/forum/74807/topic/3520921 ------------------------------------------------------------------------------ Throughout its 18-year history, RSA Conference consistently attracts the world's best and brightest in the field, creating opportunities for Conference attendees to learn about information security's most important issues through interactions with peers, luminaries and emerging and established companies. http://p.sf.net/sfu/rsaconf-dev2dev _______________________________________________ GnuWin32-Users mailing list GnuWin32-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gnuwin32-users