Re: [Parser-devel] [token.c] A new functionality
Status: Beta
Brought to you by:
jineshkj
From: Jinesh K J <jin...@gm...> - 2006-10-04 09:32:29
|
On 10/4/06, Noam Postavsky <npo...@uw...> wrote: > Jinesh K J wrote: > >> Ok, I uploaded my first attempt, but I'm wondering whether the input > >> always has '[' and ']'? Can there be stuff outside the brackets? eg > >> @[group 1] hello@ -> @group 1@ > > If anything comes outside the box, let us ignore that. What do you > > say? Could there be a better way? > > > Well, that is consistent with gettoken's behaviour, although if I was > writing a config file and left it invalid I would at least want to be > warned about it... Yes. Its true. But we are writing a library. We cannot print any error or warning message by ourselves. The best way I think is to set the some global status variable. Even a call-back method won't be that harmful, I believe. > > Also, note that I've updated the test cases. > right, I've updated getgroup to pass them. I'm getting some fatal error. Can u go through them. Its given below: [jinesh@jinesh np]$ ./a.out Testing gettoken() VERIFIED : < > VERIFIED : <> VERIFIED : <Hello> VERIFIED : < Hello > VERIFIED : < Hello World > VERIFIED : < "Hello" World> VERIFIED : < "Hello World" > VERIFIED : < " Hello World " > VERIFIED : < "Hello \" World " > VERIFIED : < 'Hello' World> VERIFIED : < 'Hello World' > VERIFIED : < ' Hello World ' > VERIFIED : < 'Hello \' World ' > VERIFIED : < " Hello ' World " > VERIFIED : < ' Hello " World ' > VERIFIED : < " Hello \\ World " > VERIFIED : < ' Hello \\ World ' > VERIFIED : < " Hello World "Pista > VERIFIED : < " Hello World ""Pista" > VERIFIED : < " Hello World " "Pista" > VERIFIED : < Pista" Hello World " > VERIFIED : < " " > VERIFIED : < "" > VERIFIED : < " \z " > VERIFIED : < \ > VERIFIED : < " \ " > VERIFIED : <hello\ world> VERIFIED : <hello\" world"> VERIFIED : <"hello world > Testing puttoken() VERIFIED : <Hello> VERIFIED : < Hello > VERIFIED : <Hello World> VERIFIED : < Hello World > VERIFIED : <Hello " World > VERIFIED : <Hello ' World > VERIFIED : < Hello \ World > VERIFIED : < > VERIFIED : <> VERIFIED : < z > VERIFIED : <\> VERIFIED : < \ > VERIFIED : <hello\> VERIFIED : <hello"> Testing getgroup() VERIFIED : < [] > *** glibc detected *** ./a.out: munmap_chunk(): invalid pointer: 0x0804933e *** ======= Backtrace: ========= /lib/libc.so.6(__libc_free+0x179)[0x4cb744f0] ./a.out[0x80490c9] ./a.out[0x8049226] /lib/libc.so.6(__libc_start_main+0xdc)[0x4cb22724] ./a.out[0x80485f1] ======= Memory map: ======== 08048000-0804a000 r-xp 00000000 03:02 1481 /home/jinesh/work/parser/branches/np/a.out 0804a000-0804b000 rw-p 00001000 03:02 1481 /home/jinesh/work/parser/branches/np/a.out 0804b000-0806c000 rw-p 0804b000 00:00 0 [heap] 4509c000-450a7000 r-xp 00000000 03:03 1240382 /lib/libgcc_s-4.1.1-20060525.so.1 450a7000-450a8000 rw-p 0000a000 03:03 1240382 /lib/libgcc_s-4.1.1-20060525.so.1 4caf0000-4cb09000 r-xp 00000000 03:03 1240355 /lib/ld-2.4.so 4cb09000-4cb0a000 r--p 00018000 03:03 1240355 /lib/ld-2.4.so 4cb0a000-4cb0b000 rw-p 00019000 03:03 1240355 /lib/ld-2.4.so 4cb0d000-4cc3a000 r-xp 00000000 03:03 1240359 /lib/libc-2.4.so 4cc3a000-4cc3c000 r--p 0012d000 03:03 1240359 /lib/libc-2.4.so 4cc3c000-4cc3d000 rw-p 0012f000 03:03 1240359 /lib/libc-2.4.so 4cc3d000-4cc40000 rw-p 4cc3d000 00:00 0 b7f09000-b7f0a000 rw-p b7f09000 00:00 0 b7f28000-b7f2a000 rw-p b7f28000 00:00 0 b7f2a000-b7f2b000 r-xp b7f2a000 00:00 0 [vdso] bffc1000-bffd7000 rw-p bffc1000 00:00 0 [stack] Aborted -------- Regards, Jinesh. |