help-flex
[Top][All Lists]
Advanced

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

Re: cpp2html


From: wlestes
Subject: Re: cpp2html
Date: Wed, 19 Jan 2005 20:41:55 -0500 (EST)
User-agent: SquirrelMail/1.4.3a

Looks like you've got undeclared constants. If you're expecting that flex
will be declaring them, then you need to include the flex-generated header
(or the bison-generated header if you're doing it that way) before
referencing them.

> humm, here's a flex file of a software i would package for debian since
> it's
> on the wishlist. though, i know nothing about flex and i get an error :
>
> ---------------------------------------------------------------------------------------------------------------
>
> x_rm1.lex:19: error: `PREPROCESSORSTATE' undeclared here (not in a
> function)
> x_rm1.lex:20: error: `PREPROCESSORSKIPSTATE' undeclared here (not in a
> function)
> x_rm1.lex:21: error: `COMMANDLINEARGSSTATE' undeclared here (not in a
> function)
> x_rm1.lex:22: error: `COMMANDLINEARGS_2_STATE' undeclared here (not in a
> function)
> x_rm1.lex:23: error: `COMMANDLINEARGS_ERROR_STATE' undeclared here (not in
> a
> function)
> x_rm1.lex:24: error: `DEFDIRECTIVESCANSTATE' undeclared here (not in a
> function)
> x_rm1.lex:25: error: `IFELIFEXPANSIONSTATE' undeclared here (not in a
> function)
> x_rm1.lex:26: error: `MACROEXPANSIONSTATE' undeclared here (not in a
> function)
> x_rm1.lex:27: error: `TEXTTOENDOFLINESTATE' undeclared here (not in a
> function)
> x_rm1.lex:28: error: `LINEDIRECTIVESTATE' undeclared here (not in a
> function)
> x_rm1.lex:29: error: `INCLUDEFILESTATE' undeclared here (not in a
> function)
> x_rm1.lex:30: error: `INCLUDEFILENAMESTATE' undeclared here (not in a
> function)
> x_rm1.lex:31: error: `INCLUDEFILEHEADERSTATE' undeclared here (not in a
> function)
> x_rm1.lex:32: error: `EXPRESSIONSTATE' undeclared here (not in a function)
> make[1]: *** [cpp2html-lex.yy_.o] Error 1
> make[1]: Leaving directory `/home/pierre/tmp/cpp/cpp2html-1.0.5'
> make: *** [all] Error 2
> address@hidden:~/tmp/cpp/cpp2html-1.0.5$
>
>
>
> ---------------------------------------------------------------------------------------------------------------
>
>
> The file is here :
>
>
>
> ---------------------------------------------------------------------------------------------------------------
>
>
> /*BEGIN decl DELIMITER*/
> %x PREPROCESSORSTATE
> %x PREPROCESSORSKIPSTATE
> %x COMMANDLINEARGSSTATE
> %x COMMANDLINEARGS_2_STATE
> %x COMMANDLINEARGS_ERROR_STATE
> %x DEFDIRECTIVESCANSTATE
> %x IFELIFEXPANSIONSTATE
> %x MACROEXPANSIONSTATE
> %x TEXTTOENDOFLINESTATE
> %x LINEDIRECTIVESTATE
> %x INCLUDEFILESTATE
> %x INCLUDEFILENAMESTATE
> %x INCLUDEFILEHEADERSTATE
> %x EXPRESSIONSTATE
>
>
> %{
> int preprocessorstate=PREPROCESSORSTATE;
> int preprocessorskipstate=PREPROCESSORSKIPSTATE;
> int commandlineargsstate=COMMANDLINEARGSSTATE;
> int commandlineargs_2_state=COMMANDLINEARGS_2_STATE;
> int commandlineargs_error_state=COMMANDLINEARGS_ERROR_STATE;
> int defdirectivescanstate=DEFDIRECTIVESCANSTATE;
> int ifelifexpansionstate=IFELIFEXPANSIONSTATE;
> int macroexpansionstate=MACROEXPANSIONSTATE;
> int texttoendoflinestate=TEXTTOENDOFLINESTATE;
> int linedirectivestate=LINEDIRECTIVESTATE;
> int includefilestate=INCLUDEFILESTATE;
> int includefilenamestate=INCLUDEFILENAMESTATE;
> int includefileheaderstate=INCLUDEFILEHEADERSTATE;
> int expressionstate=EXPRESSIONSTATE;
>
> %}
>
> /*END decl DELIMITER*/
>
> %option nomain
> %option noyywrap
> %{
> #include "x_io1.h"
> #ifndef FLEX_BEGIN_NEXT_TOKEN
> #define FLEX_BEGIN_NEXT_TOKEN
> #else
> static parser_master_t* mp=NULL;
> //#define change_state (mp->change_state)
> //#define change_pos (mp->change_pos)
> //#define current_text_heap (mp->current_text_heap)
> #endif
> %}
>
>
> %{
> FLEX_DECLARATIONS
> %}
>
>
> /* scanner for a toy Pascal-like language */
>
>
> DIGIT    [0-9]
> /* %% has to be on the beginning of the line !!!*/
>
> %%
>   FLEX_BEGIN(PREPROCESSORSTATE)
> <PREPROCESSORSTATE>(([/][*]([*]+[^*/]|[^*]|[\n])*[*]+[/])|[
> \t])*[#](([/][*]
> ([*]+[^*/]|[^*]|[\n])*[*]+[/])|[ \t])*include[^a-zA-Z0-9$_]   %{
> yyless(yy_leng-1);FLEX_NEW_TERMINAL(PP_TOK_INCLUDEDIRECTIVE);FLEX_INCREASE_POSITION;return
> PP_TOK_INCLUDEDIRECTIVE;
>    %}
>
>
> then, there's a bunch of lines as the last one. it seems the directives
> starting with %x are not handled correctly on the lines starting with
> "int"
> would understand them no ? well, i only need it to compile ok so the user
> will have it... the source of the soft is released at
> http://freshmeat.net/projects/cpp2html/
>
> So if someone's willing to help on it to compile properly... the author
> seems
> to have abandonned it and i can't reach by mail... Anyone please ?
>
> Thanks
>
> Pierre Ancelot
> _______________________________________________
> Help-flex mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/help-flex
>






reply via email to

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