Skip to main content

All Questions

Filter by
Sorted by
Tagged with
0 votes
1 answer
4k views

Undefined reference to `WinMain@16' error when compile with gcc

I'm going to run a simple program constructed with Flex an Bison. Here are my codes. Flex file (calc.l) %{ #include <stdio.h> #include <stdlib.h> #include "tt.tab.h" %} /* %option ...
Dhananjaya's user avatar
13 votes
1 answer
19k views

Meaning of yywrap() in flex

What does this instructions mean in flex (lex) : #define yywrap() 1 and this [ \t]+$ i find it in the code below: (%% [ \t]+ putchar('_'); [ \t]+% %% input "hello world" output "hello_world" )
deep_geek's user avatar
  • 347
15 votes
2 answers
7k views

#error "Must #define __STDC_LIMIT_MACROS before #including Support/DataTypes.h"

I have been trying to follow the tutorial at http://gnuu.org/2009/09/18/writing-your-own-toy-compiler/5/ (using flex, bison and llvm) but when typing the line g++ -o parser parser.cpp tokens.cpp ...
user avatar
10 votes
3 answers
13k views

yylval undefined with flex and bison

I have searched almost every material online. But I am still confused why lexer cannot identify yylval. Here is the case: I have defined a bunch of ADT in node.h and realize them in node.c, my ...
chenrui's user avatar
  • 9,906