[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
cpp2html
From: |
Pierre Ancelot |
Subject: |
cpp2html |
Date: |
Wed, 19 Jan 2005 23:31:03 +0100 |
User-agent: |
KMail/1.7.1 |
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
pgpbN9MjDDaEl.pgp
Description: PGP signature
- cpp2html,
Pierre Ancelot <=