<div dir="ltr"><div class="gmail_default" style="font-family:verdana,sans-serif">Thanks Adrian,<br>With </div><div class="gmail_default" style=""><font face="monospace"><b>write data noentry;<br></b></font><font face="verdana, sans-serif">Three variables ie., </font><font face="monospace"><b>json_en_main, json_en_rest_object, json_en_rest_array</b></font><font face="verdana, sans-serif"> are not created anymore. However, the variables </font><font face="monospace"><b>json_error and json_first_final</b></font><font face="verdana, sans-serif"> are still created, and hence GCC still complains. Any remedy for these?</font></div><div class="gmail_default" style=""><font face="verdana, sans-serif"><br></font><font face="monospace"><br>build/json.c:265:18: error: 'json_error' defined but not used [-Werror=unused-const-variable=]<br> static const int json_error = 0;<br> ^~~~~~~~~~<br>build/json.c:264:18: error: 'json_first_final' defined but not used [-Werror=unused-const-variable=]<br> static const int json_first_final = 61;<br> ^~~~~~~~~~~~~~~~<br>cc1: all warnings being treated as errors<br></font><br><br><br><font face="verdana, sans-serif">regards</font></div><div class="gmail_default" style="font-family:verdana,sans-serif">Rajeev<br><br><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Oct 15, 2019 at 4:11 AM Adrian Thurston <<a href="mailto:thurston@colm.net">thurston@colm.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Rajeev,<br>
<br>
Those are entry points you can use during initialization to start <br>
parsing somewhere other than "main". You can also use them to jump to <br>
other parts from action code. To remove them from output use the noentry <br>
write option to the write data command:<br>
<br>
write data noentry;<br>
<br>
Adrian<br>
<br>
On 2019-10-14 15:04, Rajeev Bharol wrote:<br>
> Hi<br>
> I am using ragel 6.10 and it generates following unused variables that<br>
> GCC compiler complains about. Is it a bug.<br>
> <br>
> static const int json_en_rest_array = 12;<br>
> static const int json_en_rest_object = 32;<br>
> static const int json_en_main = 1;<br>
> <br>
> Thanks<br>
> Rajeev<br>
> <br>
> On Fri, Aug 16, 2019 at 10:07 AM Mark Olesen<br>
> <<a href="mailto:Mark.Olesen@esi-group.com" target="_blank">Mark.Olesen@esi-group.com</a>> wrote:<br>
> <br>
>> I've use ragel in a few places already for parsing, but now I'm<br>
>> looking<br>
>> to port over a medium sized chunk of flex/bison. Perhaps going for a<br>
>> <br>
>> ragel/lemon combination.<br>
>> <br>
>> According to the lemon docs<br>
>> (<a href="https://www.hwaci.com/sw/lemon/lemon.html" rel="noreferrer" target="_blank">https://www.hwaci.com/sw/lemon/lemon.html</a>)<br>
>> the parser is the one calling the lexer. But this seems to be the<br>
>> same<br>
>> as ragel would like to be doing: match a pattern, call an action.<br>
>> <br>
>> The few examples of ragel/lemon that I've found (the classic<br>
>> calculator,<br>
>> or a json parser) seem to be handling this by running ragel as the<br>
>> scanner, and calling the lemon parser in its actions.<br>
>> <br>
>> Some other examples I've seen use re2c for the lexing part. This<br>
>> appears<br>
>> to fit better with what lemon expects, but there must be some way to<br>
>> lex<br>
>> a single token and return from ragel I suspect.<br>
>> <br>
>> I would be thankful for ideas.<br>
>> <br>
>> Cheers,<br>
>> /mark<br>
>> _______________________________________________<br>
>> ragel-users mailing list<br>
>> <a href="mailto:ragel-users@colm.net" target="_blank">ragel-users@colm.net</a><br>
>> <a href="http://www.colm.net/cgi-bin/mailman/listinfo/ragel-users" rel="noreferrer" target="_blank">http://www.colm.net/cgi-bin/mailman/listinfo/ragel-users</a><br>
> _______________________________________________<br>
> ragel-users mailing list<br>
> <a href="mailto:ragel-users@colm.net" target="_blank">ragel-users@colm.net</a><br>
> <a href="http://www.colm.net/cgi-bin/mailman/listinfo/ragel-users" rel="noreferrer" target="_blank">http://www.colm.net/cgi-bin/mailman/listinfo/ragel-users</a><br>
<br>
-- <br>
Dr. Adrian D. Thurston<br>
Chief Scientist<br>
Colm Networks<br>
<a href="http://colm.net/" rel="noreferrer" target="_blank">http://colm.net/</a><br>
<br>
_______________________________________________<br>
ragel-users mailing list<br>
<a href="mailto:ragel-users@colm.net" target="_blank">ragel-users@colm.net</a><br>
<a href="http://www.colm.net/cgi-bin/mailman/listinfo/ragel-users" rel="noreferrer" target="_blank">http://www.colm.net/cgi-bin/mailman/listinfo/ragel-users</a><br>
</blockquote></div>