[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: flex input and malloc
From: |
Sylvain Schmitz |
Subject: |
Re: flex input and malloc |
Date: |
Fri, 10 Jun 2005 14:53:10 +0200 |
User-agent: |
Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7) Gecko/20040616 |
jojo wrote:
I want to make a scanner for my microcontroller who is getting
> messages (not longer than 160 chars; example:
> "var1=34.34;var2="test";var3=5"). Those messages are stored in
> a buffer (char buff[160]). The mc should scan and react to this
> messages in doing something and post a message back. My problem
> is that flex is allocating space on heap - well, that works on
> the controller but I didnĀ“t want to do because of less space and
> all problems that can occur with that (memory leaks etc).
> Is there a way to use static memory (array)? Perhaps there are
> other versions of lex who supports this?
I think `yy_scan_buffer` is the answer; see
[http://www.gnu.org/software/flex/manual/html_chapter/flex_12.html#SEC12].
--
Hope that helps,
Sylvain