7 Jan 04:00
Re: C++ parser: segmentation fault using parsing a file twice
From: Luigi Malagò <romalago <at> email.it>
Subject: Re: C++ parser: segmentation fault using parsing a file twice
Newsgroups: gmane.comp.lex.flex.general
Date: 2007-01-07 03:00:10 GMT
Subject: Re: C++ parser: segmentation fault using parsing a file twice
Newsgroups: gmane.comp.lex.flex.general
Date: 2007-01-07 03:00:10 GMT
> hello to everybody,
> i'm new to flex bison and i'm experiencing a strange problem. I have
> wirtten a C++ parser using
> flex 2.5.33-r1 and bison 2.2. I have to parse two different files, with
> the same structure, so i decide to use the same parser twice.
> The problem is that when i parse one file OR the other everything is ok,
> but when i parse both (no matter the order) or when i
> parse one of the two twice, i get a segmentation fault. Using gdm i
> isolated the following code:
>
>
>> void assoc_parser(brianBehaviors *bb) {
>> assocparser_linenumber = 2;
>> // sl = new assoc_list();
>> // s = new assoc();
>> assoc_init();
>> //assocdebug=1;
>> assoc_bbehavior = bb;
>>
>> assoc_v = new variable();
>> printf("ready to parse...\n");
>> assocparse();
>> printf("...parsing done\n");
>> delete assoc_v;
>>
>> assoc_cancel_memory_leaks();
>> }
>>
I just solved the problem. The function assoc_cancel_memory_leaks()
(Continue reading)
RSS Feed