help-flex
[Top][All Lists]
Advanced

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

help with -P option and redefining YY_INPUT (bug???)


From: Mark Fonnemann
Subject: help with -P option and redefining YY_INPUT (bug???)
Date: Tue, 25 May 2004 18:23:45 -0700 (PDT)

Hello-

i am trying to build a program with two lexical analyzers, isrman.l and
isrexp.l.
here's how i compile:

flex isrexp.l
flex -Pman isrman.l
gcc main.c lex.yy.c lex.man.c -lfl

isr.h:
--------------------------------------------
int buffer[11];
extern char strbuffer[];

#undef MAN_INPUT
#define MAN_INPUT(yybuffer, result, maximum) { \
result = strlen(strbuffer); \
strncpy(yybuffer, strbuffer, min(result, maximum)); }

int manwrap();

isr.l:
-----------------------------------------------------------
%{
#include "isr.h"
%}

%%

M0000000\n                      { somefunction(); }
M0000001\n                      { anotherfunction(); }

(snip)

.*                              { errorfunction(); }

%%

int manwrap()
{
  return (1);
}

please note i've left out numerous pattern matching lines for sake of brevity.
now, when i run the program it "hangs". here's the gdb bt trace:

Program received signal SIGINT, Interrupt.
0x00c47402 in ?? ()
(gdb) bt
#0  0x00c47402 in ?? ()
#1  0x005b40a3 in __read_nocancel () from /lib/tls/libc.so.6
#2  0x005629d8 in _IO_file_read_internal () from /lib/tls/libc.so.6
#3  0x00561cee in _IO_new_file_underflow () from /lib/tls/libc.so.6
#4  0x0056446d in _IO_default_uflow_internal () from /lib/tls/libc.so.6
#5  0x00564103 in __uflow () from /lib/tls/libc.so.6
#6  0x0055f207 in getc () from /lib/tls/libc.so.6
#7  0x080981ae in yy_get_next_buffer ()
#8  0x08097eb5 in manlex ()
#9  0x080549d7 in doflexing (radical=0x80c36e0, radicand=
      {bit = {1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1}, type = 1}) at project.c:310
#10 0x08050e32 in doAlgorithm (dest_reg=0, srcb_reg=19, exponent_max=1023,
    exponent_min=-1022, exponent_fix=1536)
    at project.c:58
#11 0x080492c0 in main () at project.c:208

can someone please help!! i'm stuck and i do not know what to do next! thanks
for your help in advance, it's very much appreciated...

mark. :-)

p.s. some additional info... i'm using fedora core 2 linux, with kernel,
kernel-2.6.6-1.368, glibc-2.3.3-30, flex-2.5.4a-31.1, and gcc-3.3.3-7.




        
                
__________________________________
Do you Yahoo!?
Friends.  Fun.  Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/ 




reply via email to

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