|
From: | Hans Aberg |
Subject: | Re: List compiling parser not working as expected (help please) |
Date: | Fri, 16 Mar 2007 12:16:24 +0100 |
On 16 Mar 2007, at 06:42, Dustin Robert Kick wrote:
I want this code to simply put some strings into a list structure, but in my test output, the early strings contain all of the strings that are supposed to be separate nodes, as well as characters that the lexer was supposed to only return as tokens, or ignore. Will someone point out what I'm doing wrong with this?
The Flex generated lexer just returns pointers to a buffer, with a temporarily set '\0' terminator, which the will be changed back in later calls to the lexer. So you must copy the strings. This is mentioned in some FAQ.
Hans Aberg
[Prev in Thread] | Current Thread | [Next in Thread] |