On Monday 29 December 2008 15:47:08 Marcus Boerger wrote:
> Hello Rui,
>
>   the end of a c-string is a \0. So all you need is a rule for that \0.
> Remember as documented re2c does not assume anythign about your input.
>
> marcus

I've tried that but re2c chokes on that. This is my test re2c code:

        /*!re2c
        re2c:define:YYCTYPE     = "char";
        re2c:define:YYCURSOR    = p;
        re2c:define:YYMARKER    = q;
        re2c:yyfill:enable      = 0;
        re2c:yych:conversion    = 1;
        re2c:indent:top         = 1;
        "se\0"          {return 1; }
        "sen"   {return 3; }
        .       {return 0; }
        */

>From this code, the re2c output is as follows:

r...@kubuntu:test$ make
re2c main.c.re2c > main.c
re2c: error: line 15, column 14: Illegal octal character code, three octal 
digits are required

I tried to side-step this problem by replacing \0 with a \000 but that doesn't 
catch the null terminator.

Am I doing something wrong or is this a limitation of re2c?


Rui Maciel


------------------------------------------------------------------------------
_______________________________________________
Re2c-general mailing list
Re2c-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/re2c-general

Reply via email to