I am trying to write a regex to detect IP addresses and floating point number in re2c (http://re2c.org/). Here is the regex I am using
<SYMBOL> [-+]?[0-9]+[.][0-9]+ { RETURN(FLOAT); }
<SYMBOL> [0-9]{1,3}'.'[0-9]{1,3}'.'[0-9]{1,3}'.'[0-9]{1,3} {RETURN (IPADDR); }
Whenever I compile, it throws error about some YYMARKER being undeclared. But if I use only one of the rules the compilation goes fine. I guess re2c is having trouble with backtracking based regex since both the rules have a large data set with common prefix (for example 192.132 could be starting of both a floating point number as well as ip address).
Here is the command line I am using to first generate the tokenizer file. re2c itself does not throw any error.
re2c -c -o tokenizer.c tokenizer.re
But when i compile the C file i get the following error.
tokenizer.c: In function 'getnext_querytoken':
tokenizer.c:74: error: 'YYMARKER' undeclared (first use in this function)
tokenizer.c:74: error: (Each undeclared identifier is reported only once
tokenizer.c:74: error: for each function it appears in.)
Is there any way I can solve this problem ?