help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Hi everyone,


From: Uxio Prego
Subject: Re: Hi everyone,
Date: Sun, 17 Feb 2019 19:51:27 +0100

What are you feeding?
What is happening?
What are you expecting instead?

> On 17 Feb 2019, at 18:43, address@hidden <address@hidden> 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); return NUMBER; }
> [...]
> 
> On 17.02.19 15:53, Akim Demaille wrote:
>> 
>>>> Le 17 févr. 2019 à 14:17, address@hidden <address@hidden> 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 <address@hidden> a écrit :
>>> 
>>> No, sorry.  There are several approaches to parsing, one which is fully 
>>> declarative and your rules are "pure".  That's not the case of Flex/Bison: 
>>> you must define rules with actions.  Yet you should keep your action simple 
>>> and move complex processing into functions.
>> Uxio said:
>> 
>>> Le 17 févr. 2019 à 15:46, Uxio Prego <address@hidden> a écrit :
>>> 
>>> 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.
>> And of course Uxio is right.  You can put the function you depend upon in 
>> other compilation units (i.e., other *.c files).  What I meant is: Flex and 
>> Bison are useless if you don't *call* code from your actions.
> 
> _______________________________________________
> address@hidden https://lists.gnu.org/mailman/listinfo/help-bison




reply via email to

[Prev in Thread] Current Thread [Next in Thread]