RE: Hi everyone,

2019-02-17 Thread Jannick
On Sun, 17 Feb 2019 18:43:38 +0100, workbe...@gmx.at wrote: > Now a very simple question: i have this lexer.l file: Suggestions for lines you might want to use instead to get things up and running: > [a-zA-Z]{ strcpy(yytext, yyltext); return STRING; } [a-zA-Z]+{ strcpy(yyltext, yytext

RE: Hi everyone,

2019-02-17 Thread Jannick
I think the following should fix the compile errors. Presumably they are prompted by compilers more sensitive nowadays than they were back in the days when this book was written: - lexer.l: remove the declaration enum yytokentype which is shipped by including parser.tab.h - parser.y: add forwar

Re: Hi everyone,

2019-02-17 Thread workbe...@gmx.at
I found the solution, my [a-zA-Z] had not + at the end so he only recognized single characters instead of strings.. now it's working, thank best reagrds! On 17.02.19 19:51, Uxio Prego wrote: What are you feeding? What is happening? What are you expecting instead? On 17 Feb 2019, at 18:43, wo

Re: Hi everyone,

2019-02-17 Thread Uxio Prego
What are you feeding? What is happening? What are you expecting instead? > On 17 Feb 2019, at 18:43, workbe...@gmx.at wrote: > > Now a very simple question: i have this lexer.l file: > > [...] > [a-zA-Z]{ strcpy(yytext, yyltext); return STRING; } > [0-9]+{ yylval = atoi(yytext); ret

Re: Hi everyone,

2019-02-17 Thread workbe...@gmx.at
Now a very simple question: i have this lexer.l file: %{ #include #include enum yytokentype {     NUMBER = 285,     VAL = 292,     ADD = 286,     SUB = 287,     MUL = 288,     DIV = 289,     ABS = 290,     EOL    = 291,     STRING = 292 }; int yylval; char yyltext[256]; %} %% "+"           

Re: Hi everyone,

2019-02-17 Thread Akim Demaille
>> Le 17 févr. 2019 à 14:17, workbe...@gmx.at a écrit : >> >> Is there a way i can put my c source code not inside one the the lexer.l or >> parser.y files ? so i can keep tem separate from the rules ? Two opposite answers: I said: > Le 17 févr. 2019 à 15:49, Akim Demaille a écrit : > > N

Re: Hi everyone,

2019-02-17 Thread Akim Demaille
Hi, >> I can't get i compile and if i get i compile by hand i get errors ... >> please can someone help me out here, >> the book doens't go to much into detail about this topic. Can't help without actual commands and actual error messages. > Le 17 févr. 2019 à 14:17, workbe...@gmx.

Re: Hi everyone,

2019-02-17 Thread Uxio Prego
Yes of course, by inclusion of headers, in a very much common way. You can then manipulate shorter *.y and *.l docs, but this is not going to fix any Bison usage issue you are having. If yours is a serious book, it should have made a small annex stating which versions of Flex and Bison the book ex

Re: Hi everyone,

2019-02-17 Thread workbe...@gmx.at
Is there a way i can put my c source code not inside one the the lexer.l or parser.y files ? so i can keep tem separate from the rules ? best regards! On 17.02.19 13:24, workbe...@gmx.at wrote: For a beginner it's hard to find what i've to write, on what documentation should i refer to ? to o

Re: Hi everyone,

2019-02-17 Thread workbe...@gmx.at
For a beginner it's hard to find what i've to write, on what documentation should i refer to ? to original bison & flex manual respectiveley ? best regards!  On 17.02.19 13:22, workbe...@gmx.at wrote: So my Bison and Flex code is out of date ? On 17.02.19 13:04, Uxio Prego wrote: Hi, revi

Re: Hi everyone,

2019-02-17 Thread workbe...@gmx.at
So my Bison and Flex code is out of date ? On 17.02.19 13:04, Uxio Prego wrote: Hi, review your Makefile, it has errors. Read the Make docs, the basic use is: TARGET: DEPENDENCIES ACTIONS_THAT_USE_DEPENDENCIES_TO_UPDATE_TARGET You might want to try emulating Yacc if the booking

Re: Hi everyone,

2019-02-17 Thread Uxio Prego
Hi, review your Makefile, it has errors. Read the Make docs, the basic use is: TARGET: DEPENDENCIES ACTIONS_THAT_USE_DEPENDENCIES_TO_UPDATE_TARGET You might want to try emulating Yacc if the booking you are using is enough old and in case current Bison could not be able to really foll

Re: Hi everyone,

2019-02-17 Thread workbe...@gmx.at
I've managed to come a bit more forward, now my lexer.l files look like this: %{ #include #include #include "./parser.tab.h" enum yytokentype {     NUMBER = 285,     VAL = 292,     ADD = 286,     SUB = 287,     MUL = 288,     DIV = 289,     ABS = 290,     EOL    = 291 }; int yylval; %} %% "+

Re: Hi everyone,

2019-02-17 Thread workbe...@gmx.at
I've missed to remove some code from the lexer.l file: %{ #include #include #include "./parser.tab.h" enum yytokentype {     NUMBER = 285,     VAL = 292,     ADD = 286,     SUB = 287,     MUL = 288,     DIV = 289,     ABS = 290,     EOL    = 291 }; int yylval; char *value = NULL;

Hi everyone,

2019-02-17 Thread workbe...@gmx.at
i'm new to Flex and Bison and are currently reading the book "Flex and Bison" and have a few troubles understanding things correctly. First of all i've troubles compiling the first example that uses both, Flex and Bison. Flex compilation was easy but with Biton i've troubles, first the exampl