LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-27-2009, 04:52 AM   #1
eljuventino
LQ Newbie
 
Registered: May 2009
Posts: 26
Blog Entries: 1

Rep: Reputation: 15
lex.yy.c


hi everyone!!i'm very happy to be one of the most great linux forums in the world and thanks for all great work that u do here!!

i'm new to linux i have some basic but still newer!!i have a project that i work on!!it's a product that has been installed and compiled in AIX system with xlc compiler!!my job here is to migrate this one to red hat linux entreprise 5 and compile all the makefile with GCC
i'l traying to do the max to find a similarity between xlc and gcc but i'm stuck in this error:


/usr/bin/yacc -d -p Sdl_ /home/oracle/Open2/ps/src_SDLLIB/ps_sdllib_parser.y
sed -f /home/oracle/Open2/ps/src_SDLLIB/change.y /home/oracle/Open2/ps/src_SDLLIB/y.tab.c > /home/oracle/Open2/ps/src_SDLLIB/ps_sdllib_parser.c
sed -f /home/oracle/Open2/ps/src_SDLLIB/change.y /home/oracle/Open2/ps/src_SDLLIB/y.tab.h > /home/oracle/Open2/ps/src_SDLLIB/ps_sdllib_parsertab.h
rm -f /home/oracle/Open2/ps/src_SDLLIB/y.tab.c
rm -f /home/oracle/Open2/ps/src_SDLLIB/y.tab.h
gcc -c -DLINUX -DUNIX_OPSYS -DDEBUG -I/home/oracle/Open2/COMMON/inc -I/home/oracle/Open2/dbg -I. -I/home/oracle/Open2/ps/inc -I/home/oracle/Open2/ps/BOF/inc -I/home/oracle/Open2/ps/inc -I/home/oracle/Open2/com/inc -I/home/oracle/Open2/syu/inc /home/oracle/Open2/ps/src_SDLLIB/ps_sdllib_parser.c
/usr/bin/lex /home/oracle/Open2/ps/src_SDLLIB/ps_sdllib_scanner.l
sed -f /home/oracle/Open2/ps/src_SDLLIB/change /home/oracle/Open2/ps/src_SDLLIB/lex.yy.c > /home/oracle/Open2/ps/src_SDLLIB/ps_sdllib_scanner.c
rm /home/oracle/Open2/ps/src_SDLLIB/lex.yy.c
gcc -c -DLINUX -DUNIX_OPSYS -DDEBUG -I/home/oracle/Open2/COMMON/inc -I/home/oracle/Open2/dbg -I. -I/home/oracle/Open2/ps/inc -I/home/oracle/Open2/ps/BOF/inc -I/home/oracle/Open2/ps/inc -I/home/oracle/Open2/com/inc -I/home/oracle/Open2/syu/inc /home/oracle/Open2/ps/src_SDLLIB/ps_sdllib_scanner.c
lex.yy.c:1712: erreur: expected ‘)’ before ‘=’ token
lex.yy.c:1712: erreur: expected ‘)’ before ‘==’ token
lex.yy.c:1712: erreur: expected ‘)’ before ‘==’ token
make: *** [/home/oracle/Open2/ps/src_SDLLIB/ps_sdllib_scanner.o] Erreur 1

it’s seem that’s my error has somthing with lex.yy.c that i don’t knox what it is .is this a specific file lex.yy.c for linux and another for aix!!
help me figure this out i’m almsot finish the porting and this error slow me down!!
 
Old 07-27-2009, 06:49 AM   #2
cicorino
Member
 
Registered: May 2006
Location: Italy
Distribution: Slackware, Slackware64
Posts: 31

Rep: Reputation: 16
Let me try to find an order:

Your make is simply creating a parser and it's related scanner
by the grammar inside ps_sdllib_parser.y and
by the lexer inside ps_sdllib_scanner.l

The lexer is by default named lex.yy.c, then your (strangely written)
makefile renames it in ps_sdllib_scanner.c

The rules in the makefile try to compile the generated scanner
and give you errors


Since the errors point to lex.yy.c there are many hypotheses:

- the lexer of your system (i.e.: lex) is buggy
- the lexer is not for your system
- your pre-processor is strangely unable to resolve the #line
directives found inside the generated code and gcc points
the errors to the wrong places
- [go on ad libitum...]

Now, in any case just open ps_sdllib_scanner.c and tell us what
is around line 1712.
Maybe tell us more about the program: at least in my
case the only sure name is oracle, then Open2 is unknown,
then SDL for me is simple directmedia layer?!??

Last edited by cicorino; 07-27-2009 at 06:58 AM. Reason: typo: find found found
 
Old 07-27-2009, 07:16 AM   #3
eljuventino
LQ Newbie
 
Registered: May 2009
Posts: 26

Original Poster
Blog Entries: 1

Rep: Reputation: 15
thanks for your explanation althoug i have to search and understand what is a parser and lexer!!anyway that is the line 1712 from ps_sdllib_scanner that u suggest to put it here:


static int input()/*voici la ligne 1712*/
#endif
{
int c;

*yy_c_buf_p = yy_hold_char;

if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
{
/* yy_c_buf_p now points to the character we want to return.
* If this occurs *before* the EOB characters, then it's a
* valid NUL; if not, then we've hit the end of the buffer.
*/
if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
/* This was really a NUL. */
*yy_c_buf_p = '\0';

to explain more my situation oracle is the directory that i created to put oracle and also put the product that i wil port!!Open it's the directory that contain all the .c and makjefile for all modules my assignement is to port just the module /ps.
i hope that i'm clear now!!
 
Old 07-27-2009, 09:05 AM   #4
cicorino
Member
 
Registered: May 2006
Location: Italy
Distribution: Slackware, Slackware64
Posts: 31

Rep: Reputation: 16
I'm not sure: it looks like it is a problem with the installed 'lex'...
...but I can't believe that it is possible.

I don't use fedora, so I don't know if v5 is old or not, please check.

Please report the output of 'lex --version' and, if you wish/can, then
post both 'ps_sdllib_scanner.l' and 'ps_sdllib_parser.y' because
the parser usually generates an header file that is used by the scanner.

If you can, then post also the whole ps_sdllib_scanner.c
and we'll try to see the details of your problem.
 
Old 07-27-2009, 09:56 AM   #5
eljuventino
LQ Newbie
 
Registered: May 2009
Posts: 26

Original Poster
Blog Entries: 1

Rep: Reputation: 15
for the version of lex :
lex version 2.5.4

the code for this file is tooooooooooo long i can't post it all here it contains more than 65000 character
for the file ps_sdllib_scanner.l ::

%{

/*
-------------------------------------------------------------------------------
Project: ePost/Open 2

File Name: ps_sdllib_scanner.l

Subsystem: PS
Library: SDLLIB

Description: lex file containing the lexical definitions for the service data
lines profile.

Author: Giusti Marco

Created: February, 18 1997
-------------------------------------------------------------------------------

Modification History

Revision Date Who Modified Description
02/03/98 Freccia Envelope window rotation and font handling
added. Total tokes added
08/01/99 T.A. Jensen Added stamp_price rule
26/04/99 H.Feldthaus Porting (Redefin. of yylval)
-------------------------------------------------------------------------------
*/



/*=============================================================================
DEFINITIONS SECTION
===========================================================================*/


/*-----------------------------------------------------------------------------
INCLUSIONS
---------------------------------------------------------------------------*/

#include <string.h>

#ifndef PS_SDLLIB_DATA_H
#include "ps_sdllib_data.h"
#endif

#include "ps_sdllib_parsertab.h"
#ifdef sun
/* hlf yylval refined */
# define yylval Sdl_lval
#endif



/*-----------------------------------------------------------------------------
MACROS
---------------------------------------------------------------------------*/

#undef input
#define input() (((yytchar=yysptr>yysbuf?U(*--yysptr):LexBuffer_Get_Char())==10?(yylineno++,yytchar):yytchar)==EOF?0:yytchar)


/*-----------------------------------------------------------------------------
VARIABLES
---------------------------------------------------------------------------*/

static char *ps_sdllib_scanner_l="@(#) ps_sdllib_scanner.l $Revsion:$";
static int string_len;


/*-----------------------------------------------------------------------------
SUBROUTINES DECLARATIONS
---------------------------------------------------------------------------*/

int yywrap(void);

%}


/*---------------------------------------------------------------------------*/
/* ABBREVIATIONS */
/*---------------------------------------------------------------------------*/

space [ \t\n]
ascii_char [^\n]
comment #{ascii_char}*
string \"[^\"\n]*\"
digit [0-9]
number -?{digit}+
float -?{digit}+\.{digit}+
brace_open \{
brace_close \}
comma \,
other [^ \t\n{},]



/*===========================================================================*/
/* RULES SECTION */
/*===========================================================================*/

%%

{space} { /* no actions */ }
{comment} { /* no actions */ }

{string} { string_len = yyleng - 2;
yylval.str_val = (char*) malloc(string_len + 1);
strncpy(yylval.str_val, &(yytext[1]), string_len);
yylval.str_val[string_len] = '\0';
return STRING_TOK; }

{number} { yylval.long_val = atol(yytext);
return NUMBER_TOK; }

{brace_open} { return BRACE_OPEN_TOK; }
{brace_close} { return BRACE_CLOSE_TOK; }
{comma} { return COMMA_TOK; }
{float} { yylval.float_val = atoff(yytext);
return FLOAT_TOK; }
mm { return MM_TOK; }
pels { return PEL_TOK; }
font { return FONT_TOK; }
time_format { return TIME_FORMAT_TOK; }
ascii { return ASCII_TOK; }
ebcdic { return EBCDIC_TOK; }
rotation { return ROTATION_TOK; }
sdl_group { return SDL_GROUP_TOK; }
page_group { return PAGE_GROUP_TOK; }
env_win { return ENV_WIN_TOK; }
sdl_row { return SDL_ROW_TOK; }
x { return X_TOK; }
y { return Y_TOK; }
customer_batch { return CUSTOMER_BATCH_TOK; }
tot_letters_in_batch { return TOT_LETTERS_IN_BATCH_TOK; }
receiving_time { return RECEIVING_TIME_TOK; }
receiving_site { return RECEIVING_SITE_TOK; }
comment_line { return COMMENT_LINE_TOK; }
routing_site { return ROUTING_SITE_TOK;}
ms_mailbag_id { return MS_MAILBAG_ID_TOK;}
ps_mailbag_id { return PS_MAILBAG_ID_TOK;}
printing_number { return PRINTING_NUMBER_TOK;}
creation_time { return CREATION_TIME_TOK; }
building_site { return BUILDING_SITE_TOK; }
prog_letter_in_mailbag { return PROG_LETTER_IN_MAILBAG_TOK; }
prog_page_in_mailbag { return PROG_PAGE_IN_MAILBAG_TOK; }
prog_sheet_in_mailbag { return PROG_SHEET_IN_MAILBAG_TOK; }
tot_letters_in_mailbag { return TOT_LETTERS_IN_MAILBAG_TOK; }
tot_pages_in_mailbag { return TOT_PAGES_IN_MAILBAG_TOK; }
tot_sheets_in_mailbag { return TOT_SHEETS_IN_MAILBAG_TOK; }
prog_letter_in_file { return PROG_LETTER_IN_FILE_TOK; }
prog_page_in_file { return PROG_PAGE_IN_FILE_TOK; }
prog_sheet_in_file { return PROG_SHEET_IN_FILE_TOK; }
tot_letters_in_file { return TOT_LETTERS_IN_FILE_TOK; }
tot_pages_in_file { return TOT_PAGES_IN_FILE_TOK; }
tot_sheets_in_file { return TOT_SHEETS_IN_FILE_TOK; }
prog_page_in_letter { return PROG_PAGE_IN_LETTER_TOK; }
prog_sheet_in_letter { return PROG_SHEET_IN_LETTER_TOK; }
tot_pages_in_letter { return TOT_PAGES_IN_LETTER_TOK; }
tot_sheets_in_letter { return TOT_SHEETS_IN_LETTER_TOK; }
front_or_back { return FRONT_OR_BACK_TOK; }
original_or_copy { return ORIGINAL_OR_COPY_TOK; }
reprint_or_1stprint { return REPRINT_OR_1STPRINT_TOK; }
letter_class { return LETTER_CLASS_TOK; }
number_of_copies { return NUMBER_OF_COPIES_TOK; }
customer_number { return CUSTOMER_NUMBER_TOK; }
stamp_price { return STAMP_PRICE_TOK; }
tot_group_in_mailbag { return TOT_GROUPS_IN_MAILBAG_TOK; }
group_id { return GROUP_ID_TOK; }
recipient_id { return RECIPIENT_ID_TOK; }
tot_letters_in_group { return TOT_LETTERS_IN_GROUP_TOK; }
tot_sheets_in_group { return TOT_SHEETS_IN_GROUP_TOK; }
tot_pages_in_group { return TOT_PAGES_IN_GROUP_TOK; }
letter_in_group { return LETTER_IN_GROUP_TOK; }
sheet_in_group { return SHEET_IN_GROUP_TOK; }
page_in_group { return PAGE_IN_GROUP_TOK; }

{other} { return ERROR_TOK; }

%%



/*=============================================================================
SUBROUTINES SECTION
===========================================================================*/

int yywrap(void)
{
return 1;
}

Last edited by eljuventino; 07-27-2009 at 10:08 AM.
 
Old 07-27-2009, 09:59 AM   #6
eljuventino
LQ Newbie
 
Registered: May 2009
Posts: 26

Original Poster
Blog Entries: 1

Rep: Reputation: 15
for the file ps_sdllib_parser.y :

%{


/*-----------------------------------------------------------------------------
INCLUSIONS
---------------------------------------------------------------------------*/
#include <stdbool.h>
#ifndef PS_SDLLIB_DATA_H
#include "ps_sdllib_data.h"
#endif

#include <su_loglib.h>


/*-----------------------------------------------------------------------------
VARIABLES
---------------------------------------------------------------------------*/
static char *sdllib_parser_y="@(#) ps_sdllib_parser.y $Revision: 2.2 $";

/* pointer to service data lines profile structure(to be filled by the parser)*/
static Sdl_Profile *curr_sdl_profile_ptr;

static Sdl_Pars_Err_Type yyerror_type;

static bool check;

static Sdl_Err_Code sdl_err;

/* it keeps track of errors to avoid an anomalous behaviour of the parser */
static bool error_occurrence;

/* pointers to the current data structure that is being filled */
static Row_Sdl *curr_row_sdl_ptr;
static Page_Sdl *curr_page_sdl_ptr;

/* flag indicating if envelope window command or sdl group command is being
parsed */
static bool env_win_flag = FALSE;

extern int Sdl_lineno;

/*-----------------------------------------------------------------------------
INTERNAL SUBROUTINES DECLARATIONS
---------------------------------------------------------------------------*/

void Sdl_error(const char *s);

Sdl_Pars_Err_Type yy_sdl_load_profile(unsigned char *raw_sdl_profile,
Sdl_Profile *sdl_profile, int * error_line);

%}


/*-----------------------------------------------------------------------------
TOKENS
---------------------------------------------------------------------------*/

%union
{
long long_val;
float float_val;
short short_val;
char *str_val;
Font font_val;
Sdl_Info sdlinfo_val;
Row_Sdl row_val;
Page_Sdl page_val;
Sdl_Type sdltype_val;
Coordinates coord_val;
List list_val;
}

%token BRACE_OPEN_TOK BRACE_CLOSE_TOK COMMA_TOK FONT_TOK ASCII_TOK EBCDIC_TOK ROTATION_TOK PEL_TOK MM_TOK FLOAT_TOK
SDL_GROUP_TOK PAGE_GROUP_TOK ENV_WIN_TOK SDL_ROW_TOK X_TOK Y_TOK TIME_FORMAT_TOK
CUSTOMER_BATCH_TOK TOT_LETTERS_IN_BATCH_TOK
RECEIVING_TIME_TOK RECEIVING_SITE_TOK
COMMENT_LINE_TOK CREATION_TIME_TOK
BUILDING_SITE_TOK ROUTING_SITE_TOK MS_MAILBAG_ID_TOK PS_MAILBAG_ID_TOK
PRINTING_NUMBER_TOK STAMP_PRICE_TOK
PROG_LETTER_IN_MAILBAG_TOK PROG_PAGE_IN_MAILBAG_TOK
PROG_SHEET_IN_MAILBAG_TOK
TOT_LETTERS_IN_MAILBAG_TOK TOT_PAGES_IN_MAILBAG_TOK
TOT_SHEETS_IN_MAILBAG_TOK
PROG_LETTER_IN_FILE_TOK PROG_PAGE_IN_FILE_TOK
PROG_SHEET_IN_FILE_TOK
TOT_LETTERS_IN_FILE_TOK TOT_PAGES_IN_FILE_TOK
TOT_SHEETS_IN_FILE_TOK
PROG_PAGE_IN_LETTER_TOK
PROG_SHEET_IN_LETTER_TOK TOT_PAGES_IN_LETTER_TOK
TOT_SHEETS_IN_LETTER_TOK FRONT_OR_BACK_TOK ORIGINAL_OR_COPY_TOK
REPRINT_OR_1STPRINT_TOK LETTER_CLASS_TOK NUMBER_OF_COPIES_TOK
CUSTOMER_NUMBER_TOK ERROR_TOK
TOT_GROUPS_IN_MAILBAG_TOK
GROUP_ID_TOK
RECIPIENT_ID_TOK
TOT_LETTERS_IN_GROUP_TOK
TOT_SHEETS_IN_GROUP_TOK
TOT_PAGES_IN_GROUP_TOK
LETTER_IN_GROUP_TOK
SHEET_IN_GROUP_TOK
PAGE_IN_GROUP_TOK

%token <long_val> NUMBER_TOK
%token <float_val> FLOAT_TOK
%token <str_val> STRING_TOK

%type <str_val> font_name time_format label local_string_1 local_string_2
%type <long_val> field_width
%type <font_val> font_cmd
%type <short_val> rotation_cmd ascii_ebcdic unit
%type <list_val> sdl_group_cmd page_list sdl_row_list sdl_list
%type <page_val> page
%type <row_val> sdl_row
%type <coord_val> sdl_coord
%type <sdlinfo_val> sdl
%type <sdltype_val> sdl_type_1 sdl_type_2

%start profile

%%



/*=============================================================================
RULES SECTION
===========================================================================*/

profile : command_list

command_list : command1 | command1 command2
;

command1 : sdl_group_cmd
;

command2 : env_win_cmd
;

sdl_group_cmd : SDL_GROUP_TOK
{
env_win_flag = FALSE;
curr_sdl_profile_ptr->env_win_configured = FALSE;
yyerror_type = YYSDL_ERR_SDLGROUPCMD;
}
BRACE_OPEN_TOK
{
yyerror_type = YYSDL_ERR_FONTNF;
}
font_cmd rotation_cmd
{
curr_sdl_profile_ptr->page_font = $5;
curr_sdl_profile_ptr->page_rotation = $6;
yyerror_type = YYSDL_ERR_ENVWINNF;
}
page_list BRACE_CLOSE_TOK
{
yyerror_type = YYSDL_ERR_ENVWINNF;
}
;

font_cmd : FONT_TOK
{
yyerror_type = YYSDL_ERR_FONTCMD;
}
font_name ascii_ebcdic
{
check = CheckAndAssign_String($$.name,
(unsigned char *)$3,
FONT_NAME_LEN);
if (check == FALSE)
{
yyerror_type = YYSDL_ERR_STRLEN;
Sdl_error(NULL);
return;
}
$$.ascii = $4;
yyerror_type = YYSDL_ERR_ROTATIONNF;
}
;

font_name : STRING_TOK
{
$$ = $1;
}
;

ascii_ebcdic : ASCII_TOK
{
$$ = 1;
}
| EBCDIC_TOK
{
$$ = 0;
}
| { $$ = 1; }
;

rotation_cmd : ROTATION_TOK
{
yyerror_type = YYSDL_ERR_ROTATIONCMD;
}
NUMBER_TOK
{
if (($3 != 0) &&
($3 != 90) &&
($3 != 180) &&
($3 != 270) &&
($3 != 360) &&
($3 != -90) &&
($3 != -180) &&
($3 != -270) )
{
yyerror_type = YYSDL_ERR_ROTATIONVAL;
Sdl_error(NULL);
return;
}

$$ = $3;

yyerror_type = YYSDL_ERR_PAGEGROUPNF;
}

page_list : page
{
if (env_win_flag == TRUE)
{
sdl_err =SdlProfile_EnvWinAdd_PageSdl(curr_sdl_profile_ptr, &$1);
if (sdl_err != SDL_OK)
{
yyerror_type = sdl_err;
Sdl_error(NULL);
return;
}
}
else
{
sdl_err =SdlProfile_Add_PageSdl(curr_sdl_profile_ptr, &$1);
if (sdl_err != SDL_OK)
{
yyerror_type = sdl_err;
Sdl_error(NULL);
return;
}
}
}
| page_list page
{
if (env_win_flag == TRUE)
{
sdl_err =SdlProfile_EnvWinAdd_PageSdl(curr_sdl_profile_ptr, &$2);
if (sdl_err != SDL_OK)
{
yyerror_type = sdl_err;
Sdl_error(NULL);
return;
}
}
else
{
sdl_err = SdlProfile_Add_PageSdl(curr_sdl_profile_ptr,
&$2);
if (sdl_err != SDL_OK)
{
yyerror_type = sdl_err;
Sdl_error(NULL);
return;
}
}
}
;

page : PAGE_GROUP_TOK
{
sdl_err = PageSdl_Create(&curr_page_sdl_ptr);
if (sdl_err != SDL_OK)
{
yyerror_type = sdl_err;
Sdl_error(NULL);
return;
}

sdl_err = PageSdl_Init(curr_page_sdl_ptr);
if (sdl_err != SDL_OK)
{
yyerror_type = sdl_err;
Sdl_error(NULL);
return;
}
yyerror_type = YYSDL_ERR_PAGEGROUPCMD;

}
BRACE_OPEN_TOK
{
yyerror_type = YYSDL_ERR_SDLROWNF;
}
sdl_row_list BRACE_CLOSE_TOK
{
$$ = *curr_page_sdl_ptr;
PageSdl_Destroy(curr_page_sdl_ptr);
yyerror_type = YYSDL_ERR_PAGEGROUPLST;
}

row_header : font_cmd
{
curr_row_sdl_ptr->row_font = $1;
}

| font_cmd rotation_cmd
{
curr_row_sdl_ptr->row_font = $1;
curr_row_sdl_ptr->row_rotation = $2;
}

| rotation_cmd
{
curr_row_sdl_ptr->row_rotation = $1;
}
|
;

sdl_row_list : sdl_row
{
sdl_err = PageSdl_Add_RowSdl(curr_page_sdl_ptr, &$1);
if (sdl_err != SDL_OK)
{
yyerror_type = sdl_err;
Sdl_error(NULL);
return;
}
}

| sdl_row_list sdl_row
{
sdl_err = PageSdl_Add_RowSdl(curr_page_sdl_ptr, &$2);
if (sdl_err != SDL_OK)
{
yyerror_type = sdl_err;
Sdl_error(NULL);
return;
}
}
;

sdl_row : SDL_ROW_TOK
{
sdl_err = RowSdl_Create(&curr_row_sdl_ptr);
if (sdl_err != SDL_OK)
{
yyerror_type = sdl_err;
Sdl_error(NULL);
return;
}

sdl_err = RowSdl_Init(curr_row_sdl_ptr);
if (sdl_err != SDL_OK)
{
yyerror_type = sdl_err;
Sdl_error(NULL);
return;
}
if (env_win_flag == TRUE)
{
curr_row_sdl_ptr->row_rotation = curr_sdl_profile_ptr->env_win_rotation;
}
else
{
curr_row_sdl_ptr->row_rotation = curr_sdl_profile_ptr->page_rotation;

}

yyerror_type = YYSDL_ERR_SDLROWCMD;
}

sdl_coord row_header BRACE_OPEN_TOK
{
yyerror_type = YYSDL_ERR_INFONF;
}
sdl_list BRACE_CLOSE_TOK
{
$$ = *curr_row_sdl_ptr;
$$.coord = $3;
RowSdl_Destroy(curr_row_sdl_ptr);
yyerror_type = YYSDL_ERR_SDLROWLST;
}
;

sdl_coord : X_TOK NUMBER_TOK COMMA_TOK Y_TOK NUMBER_TOK unit
{
$$.x = (unsigned int) $2;
$$.minor_x=0;
$$.y = (unsigned int) $5;
$$.minor_y=0;
$$.unit_base= (unsigned int) $6;
yyerror_type=YYSDL_ERR_INFOCMD;
}
| X_TOK FLOAT_TOK COMMA_TOK Y_TOK FLOAT_TOK unit
{
if (!$6)
{
yyerror_type = YYSDL_ERR_INFOCMD;
Sdl_error(NULL);
return;
}
$$.x = (unsigned int) $2;
$$.minor_x = (unsigned int)(($2 - $$.x)*1000);
$$.y = (unsigned int) $5;
$$.minor_y = (unsigned int)(($5 - $$.y)*1000);
$$.unit_base= (unsigned int)$6;

}
| X_TOK FLOAT_TOK COMMA_TOK Y_TOK NUMBER_TOK unit
{
if (!$6)
{
yyerror_type = YYSDL_ERR_INFOCMD;
Sdl_error(NULL);
return;
}
$$.x = (unsigned int) $2;
$$.minor_x = (unsigned int)(($2 - $$.x)*1000);
$$.y = (unsigned int) $5;
$$.minor_y = 0;
$$.unit_base= (unsigned int)$6;

}
| X_TOK NUMBER_TOK COMMA_TOK Y_TOK FLOAT_TOK unit
{
if (!$6)
{
yyerror_type = YYSDL_ERR_INFOCMD;
Sdl_error(NULL);
return;
}
$$.x = (unsigned int) $2;
$$.minor_x=0;
$$.y = (unsigned int) $5;
$$.minor_y = (unsigned int)(($5 - $$.y)*1000);
$$.unit_base= (unsigned int) $6;

}
;


unit : MM_TOK
{
$$ = 1;
}
| PEL_TOK
{
$$ = 0;
}
| { $$ = 0; }
;

env_win_cmd : ENV_WIN_TOK
{
env_win_flag = TRUE;
curr_sdl_profile_ptr->env_win_configured = TRUE;
yyerror_type = YYSDL_ERR_ENVWINCMD;
}
BRACE_OPEN_TOK
{
yyerror_type = YYSDL_ERR_FONTNF;
}
font_cmd rotation_cmd
{
curr_sdl_profile_ptr->env_win_font = $5;
curr_sdl_profile_ptr->env_win_rotation = $6;
yyerror_type = YYSDL_ERR_NOTEOF;
}
page_list BRACE_CLOSE_TOK
{
yyerror_type = YYSDL_ERR_NOTEOF;
}
;

sdl_list : sdl
{
sdl_err = RowSdl_Add_SdlInfo(curr_row_sdl_ptr, &$1);
if (sdl_err != SDL_OK)
{
yyerror_type = sdl_err;
Sdl_error(NULL);
return;
}
}
| sdl_list sdl
{
sdl_err = RowSdl_Add_SdlInfo(curr_row_sdl_ptr, &$2);
if (sdl_err != SDL_OK)
{
yyerror_type = sdl_err;
Sdl_error(NULL);
return;
}
}
;

sdl :sdl_type_1
{
yyerror_type = YYSDL_ERR_INFOCMD;
}
label field_width time_format
{
/*SdlInfo_Reset(&$$);*/

$$.type = (Sdl_Type) $1;

check = CheckAndAssign_String($$.label,
(unsigned char *)$3,
SDL_LABEL_LEN);
if (check == FALSE)
{
yyerror_type = YYSDL_ERR_STRLEN;
Sdl_error(NULL);
return;
}

$$.field_width = (unsigned int) $4;
if ($$.type != CREATION_TIME && $$.type != RECEIVING_TIME && strcmp($5,""))
{
yyerror_type = YYSDL_ERR_INFOCMD;
Sdl_error(NULL);
return;
}
check = CheckAndAssign_String((unsigned char*)$$.time_format, (unsigned char*)$5, MAX_TS_LEN);
if (check == FALSE)
{
yyerror_type = YYSDL_ERR_STRLEN;
Sdl_error(NULL);
return;
}
}
| sdl_type_2
{
yyerror_type = YYSDL_ERR_INFOCMD;
}

local_string_1 local_string_2
{
/*SdlInfo_Reset(&$$);*/

$$.type = (Sdl_Type) $1;
strcpy((char *)$$.label,"");
$$.field_width = 0;

check = CheckAndAssign_String($$.local_string_1,
(unsigned char *)$3,
LOCAL_STRING_LEN);
if (check == FALSE)
{
yyerror_type = YYSDL_ERR_STRLEN;
Sdl_error(NULL);
return;
}

check = CheckAndAssign_String($$.local_string_2,
(unsigned char *)$4,
LOCAL_STRING_LEN);
if (check == FALSE)
{
yyerror_type = YYSDL_ERR_STRLEN;
Sdl_error(NULL);
return;
}
}
;

time_format : TIME_FORMAT_TOK STRING_TOK
{
$$ = $2;
}
| { $$ = (char*)malloc(1);
strcpy($$,"");
}
;

sdl_type_1 : CUSTOMER_BATCH_TOK
{
$$ = CUSTOMER_BATCH;
}
| TOT_LETTERS_IN_BATCH_TOK
{
$$ = TOT_LETTERS_IN_BATCH;
}
| RECEIVING_TIME_TOK
{
$$ = RECEIVING_TIME;
}
| RECEIVING_SITE_TOK
{
$$ = RECEIVING_SITE;
}
| COMMENT_LINE_TOK
{
$$ = COMMENT_LINE;
}
| CREATION_TIME_TOK
{
$$ = CREATION_TIME;
}
| BUILDING_SITE_TOK
{
$$ = BUILDING_SITE;
}
| PROG_LETTER_IN_MAILBAG_TOK
{
$$ = PROG_LETTER_IN_MAILBAG;
}
| PROG_PAGE_IN_MAILBAG_TOK
{
$$ = PROG_PAGE_IN_MAILBAG;
}
| PROG_SHEET_IN_MAILBAG_TOK
{
$$ = PROG_SHEET_IN_MAILBAG;
}
| TOT_LETTERS_IN_MAILBAG_TOK
{
$$ = TOT_LETTERS_IN_MAILBAG;
}
| TOT_PAGES_IN_MAILBAG_TOK
{
$$ = TOT_PAGES_IN_MAILBAG;
}
| TOT_SHEETS_IN_MAILBAG_TOK
{
$$ = TOT_SHEETS_IN_MAILBAG;
}
| PROG_LETTER_IN_FILE_TOK
{
$$ = PROG_LETTER_IN_FILE;
}
| PROG_PAGE_IN_FILE_TOK
{
$$ = PROG_PAGE_IN_FILE;
}
| PROG_SHEET_IN_FILE_TOK
{
$$ = PROG_SHEET_IN_FILE;
}
| TOT_LETTERS_IN_FILE_TOK
{
$$ = SDL_TOT_LETTERS_IN_FILE;
}
| TOT_PAGES_IN_FILE_TOK
{
$$ = SDL_TOT_PAGES_IN_FILE;
}
| TOT_SHEETS_IN_FILE_TOK
{
$$ = SDL_TOT_SHEETS_IN_FILE;
}
| PROG_PAGE_IN_LETTER_TOK
{
$$ = PROG_PAGE_IN_LETTER;
}
| PROG_SHEET_IN_LETTER_TOK
{
$$ = PROG_SHEET_IN_LETTER;
}
| TOT_PAGES_IN_LETTER_TOK
{
$$ = TOT_PAGES_IN_LETTER;
}
| TOT_SHEETS_IN_LETTER_TOK
{
$$ = TOT_SHEETS_IN_LETTER;
}
| ROUTING_SITE_TOK
{
$$ = ROUTING_SITE;
}
| MS_MAILBAG_ID_TOK
{
$$ = MS_MAILBAG_ID;
}
| PS_MAILBAG_ID_TOK
{
$$ = PS_MAILBAG_ID;
}
| PRINTING_NUMBER_TOK
{
$$ = PRINTING_NUMBER;
}
| LETTER_CLASS_TOK
{
$$ = LETTER_CLASS;
}
| NUMBER_OF_COPIES_TOK
{
$$ = NUMBER_OF_COPIES;
}
| CUSTOMER_NUMBER_TOK
{
$$ = CUSTOMER_NUMBER;
}
| STAMP_PRICE_TOK
{
$$ = STAMP_PRICE;
}
| TOT_GROUPS_IN_MAILBAG_TOK
{
$$ = TOT_GROUPS_IN_MAILBAG;
}
| GROUP_ID_TOK
{
$$ = GROUP_ID;
}
| RECIPIENT_ID_TOK
{
$$ = RECIPIENT_ID;
}
| TOT_LETTERS_IN_GROUP_TOK
{
$$ = TOT_LETTERS_IN_GROUP;
}
| TOT_SHEETS_IN_GROUP_TOK
{
$$ = TOT_SHEETS_IN_GROUP;
}
| TOT_PAGES_IN_GROUP_TOK
{
$$ = TOT_PAGES_IN_GROUP;
}
| LETTER_IN_GROUP_TOK
{
$$ = LETTER_IN_GROUP;
}
| SHEET_IN_GROUP_TOK
{
$$ = SHEET_IN_GROUP;
}
| PAGE_IN_GROUP_TOK
{
$$ = PAGE_IN_GROUP;
}

;

sdl_type_2 : FRONT_OR_BACK_TOK
{
$$ = FRONT_OR_BACK;
}
| ORIGINAL_OR_COPY_TOK
{
$$ = ORIGINAL_OR_COPY;
}
| REPRINT_OR_1STPRINT_TOK
{
$$ = REPRINT_OR_1STPRINT;
}
;

label : STRING_TOK
{
$$ = $1;
}
|
{
$$ = (char*)malloc(1);
strcpy($$,"");
}
;

field_width : NUMBER_TOK
{
$$ = $1;
}
|
{
$$ = 0;
}
;

local_string_1 : STRING_TOK
{
$$ = $1;
}
;

local_string_2 : STRING_TOK
{
$$ = $1;
}
;

%%




void Sdl_error(const char *s)
{
set_error_prod_mng(PMNG_CONFIGURATION_ERR);

error_occurrence = TRUE;

switch (yyerror_type)
{
case YYSDL_ERR_STRLEN:
PROFILE_SEND_LOG((__FILE__, __LINE__, SDL_CLASS_ID,
SDL_ERR_STRLEN, LOG_SEV9, "%d", Sdl_lineno));
break;

case YYSDL_ERR_SDLGROUPNF:
PROFILE_SEND_LOG((__FILE__, __LINE__, SDL_CLASS_ID,
SDL_ERR_SDLGROUPNF, LOG_SEV9, "%d", Sdl_lineno));
break;

case YYSDL_ERR_SDLGROUPCMD:
PROFILE_SEND_LOG((__FILE__, __LINE__, SDL_CLASS_ID,
SDL_ERR_SDLGROUPCMD, LOG_SEV9, "%d", Sdl_lineno));
break;

case YYSDL_ERR_FONTNF:
PROFILE_SEND_LOG((__FILE__, __LINE__, SDL_CLASS_ID,
SDL_ERR_FONTNF, LOG_SEV9, "%d", Sdl_lineno));
break;

case YYSDL_ERR_FONTCMD:
PROFILE_SEND_LOG((__FILE__, __LINE__, SDL_CLASS_ID,
SDL_ERR_FONTCMD, LOG_SEV9, "%d", Sdl_lineno));
break;

case YYSDL_ERR_ROTATIONNF:
PROFILE_SEND_LOG((__FILE__, __LINE__, SDL_CLASS_ID,
SDL_ERR_ROTATIONNF, LOG_SEV9, "%d", Sdl_lineno));
break;

case YYSDL_ERR_ROTATIONCMD:
PROFILE_SEND_LOG((__FILE__, __LINE__, SDL_CLASS_ID,
SDL_ERR_ROTATIONCMD, LOG_SEV9, "%d", Sdl_lineno));
break;

...
 
Old 07-27-2009, 10:06 AM   #7
eljuventino
LQ Newbie
 
Registered: May 2009
Posts: 26

Original Poster
Blog Entries: 1

Rep: Reputation: 15
for the file ps_sdllib_scanner.c:

/* A lexical scanner generated by flex*/

/* Scanner skeleton version:
* $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $
*/

#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 5

#include <stdio.h>
#include <unistd.h>


/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
#ifdef c_plusplus
#ifndef __cplusplus
#define __cplusplus
#endif
#endif


#ifdef __cplusplus

#include <stdlib.h>

/* Use prototypes in function declarations. */
#define YY_USE_PROTOS

/* The "const" storage-class-modifier is valid. */
#define YY_USE_CONST

#else /* ! __cplusplus */

#if __STDC__

#define YY_USE_PROTOS
#define YY_USE_CONST

#endif /* __STDC__ */
#endif /* ! __cplusplus */

#ifdef __TURBOC__
#pragma warn -rch
#pragma warn -use
#include <io.h>
#include <stdlib.h>
#define YY_USE_CONST
#define YY_USE_PROTOS
#endif

#ifdef YY_USE_CONST
#define yyconst const
#else
#define yyconst
#endif


#ifdef YY_USE_PROTOS
#define YY_PROTO(proto) proto
#else
#define YY_PROTO(proto) ()
#endif

/* Returned upon end-of-file. */
#define YY_NULL 0

/* Promotes a possibly negative, possibly signed char to an unsigned
* integer for use as an array index. If the signed char is negative,
* we want to instead treat it as an 8-bit unsigned char, hence the
* double cast.
*/
#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)

/* Enter a start condition. This macro really ought to take a parameter,
* but we do it the disgusting crufty way forced on us by the ()-less
* definition of BEGIN.
*/
#define BEGIN yy_start = 1 + 2 *

/* Translate the current start state into a value that can be later handed
* to BEGIN to return to the state. The YYSTATE alias is for lex
* compatibility.
*/
#define YY_START ((yy_start - 1) / 2)
#define YYSTATE YY_START

/* Action number for EOF rule of a given start state. */
#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)

/* Special action meaning "start processing a new file". */
#define YY_NEW_FILE yyrestart( Sdl_in )

#define YY_END_OF_BUFFER_CHAR 0

/* Size of default input buffer. */
#define YY_BUF_SIZE 16384

typedef struct yy_buffer_state *YY_BUFFER_STATE;

extern int yyleng;
extern FILE *Sdl_in, *Sdl_out;

#define EOB_ACT_CONTINUE_SCAN 0
#define EOB_ACT_END_OF_FILE 1
#define EOB_ACT_LAST_MATCH 2

/* The funky do-while in the following #define is used to turn the definition
* int a single C statement (which needs a semi-colon terminator). This
* avoids problems with code like:
*
* if ( condition_holds )
* yyless( 5 );
* else
* do_something_else();
*
* Prior to using the do-while the compiler would get upset at the
* "else" because it interpreted the "if" statement as being all
* done when it reached the ';' after the yyless() call.
*/

/* Return all but the first 'n' matched characters back to the input stream. */

#define yyless(n) \
do \
{ \
/* Undo effects of setting up yytext. */ \
*yy_cp = yy_hold_char; \
YY_RESTORE_YY_MORE_OFFSET \
yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
YY_DO_BEFORE_ACTION; /* set up yytext again */ \
} \
while ( 0 )

#define unput(c) Sdl_unput( c, yytext_ptr )

/* Some routines like yy_flex_realloc() are emitted as static but are
not called by all lexers. This generates warnings in some compilers,
notably GCC. Arrange to suppress these. */
#ifdef __GNUC__
#define YY_MAY_BE_UNUSED __attribute__((unused))
#else
#define YY_MAY_BE_UNUSED
#endif

/* The following is because we cannot portably get our hands on size_t
* (without autoconf's help, which isn't available because we want
* flex-generated scanners to compile on their own).
*/
typedef unsigned int yy_size_t;


struct yy_buffer_state
{
FILE *yy_input_file;

char *yy_ch_buf; /* input buffer */
char *yy_buf_pos; /* current position in input buffer */

/* Size of input buffer in bytes, not including room for EOB
* characters.
*/
yy_size_t yy_buf_size;

/* Number of characters read into yy_ch_buf, not including EOB
* characters.
*/
int yy_n_chars;

/* Whether we "own" the buffer - i.e., we know we created it,
* and can realloc() it to grow it, and should free() it to
* delete it.
*/
int yy_is_our_buffer;

/* Whether this is an "interactive" input source; if so, and
* if we're using stdio for input, then we want to use getc()
* instead of fread(), to make sure we stop fetching input after
* each newline.
*/
int yy_is_interactive;

/* Whether we're considered to be at the beginning of a line.
* If so, '^' rules will be active on the next match, otherwise
* not.
*/
int yy_at_bol;

/* Whether to try to fill the input buffer when we reach the
* end of it.
*/
int yy_fill_buffer;

int yy_buffer_status;
#define YY_BUFFER_NEW 0
#define YY_BUFFER_NORMAL 1
/* When an EOF's been seen but there's still some text to process
* then we mark the buffer as YY_EOF_PENDING, to indicate that we
* shouldn't try reading from the input source any more. We might
* still have a bunch of tokens to match, though, because of
* possible backing-up.
*
* When we actually see the EOF, we change the status to "new"
* (via yyrestart()), so that the user can continue scanning by
* just pointing Sdl_in at a new input file.
*/
#define YY_BUFFER_EOF_PENDING 2
};

static YY_BUFFER_STATE yy_current_buffer = 0;

/* We provide macros for accessing buffer states in case in the
* future we want to put the buffer states in a more general
* "scanner state".
*/
#define YY_CURRENT_BUFFER yy_current_buffer


/* yy_hold_char holds the character lost when yytext is formed. */
static char yy_hold_char;

static int yy_n_chars; /* number of characters read into yy_ch_buf */


int yyleng;

/* Points to current character in buffer. */
static char *yy_c_buf_p = (char *) 0;
static int yy_init = 1; /* whether we need to initialize */
static int yy_start = 0; /* start state number */

/* Flag which is used to allow Sdl_yywrap()'s to do buffer switches
* instead of setting up a fresh Sdl_in. A bit of a hack ...
*/
static int yy_did_buffer_switch_on_eof;

void yyrestart YY_PROTO(( FILE *input_file ));

void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
void yy_load_buffer_state YY_PROTO(( void ));
YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b ));
#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer )

YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size ));
YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str ));
YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len ));

static void *yy_flex_alloc YY_PROTO(( yy_size_t ));
static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )) YY_MAY_BE_UNUSED;
static void yy_flex_free YY_PROTO(( void * ));

#define yy_new_buffer yy_create_buffer

#define yy_set_interactive(is_interactive) \
{ \
if ( ! yy_current_buffer ) \
yy_current_buffer = yy_create_buffer( Sdl_in, YY_BUF_SIZE ); \
yy_current_buffer->yy_is_interactive = is_interactive; \
}

#define yy_set_bol(at_bol) \
{ \
if ( ! yy_current_buffer ) \
yy_current_buffer = yy_create_buffer( Sdl_in, YY_BUF_SIZE ); \
yy_current_buffer->yy_at_bol = at_bol; \
}

#define YY_AT_BOL() (yy_current_buffer->yy_at_bol)

typedef unsigned char YY_CHAR;
FILE *Sdl_in = (FILE *) 0, *Sdl_out = (FILE *) 0;
typedef int yy_state_type;
extern char *yytext;
#define yytext_ptr yytext

static yy_state_type yy_get_previous_state YY_PROTO(( void ));
static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
static int yy_get_next_buffer YY_PROTO(( void ));
static void yy_fatal_error YY_PROTO(( yyconst char msg[] ));

/* Done after the current pattern has been matched and before the
* corresponding action - sets up yytext.
*/
#define YY_DO_BEFORE_ACTION \
yytext_ptr = yy_bp; \
yyleng = (int) (yy_cp - yy_bp); \
yy_hold_char = *yy_cp; \
*yy_cp = '\0'; \
yy_c_buf_p = yy_cp;

#define YY_NUM_RULES 66
#define YY_END_OF_BUFFER 67
static yyconst short int yy_accept[528] =
{ 0,
0, 0, 67, 65, 1, 65, 2, 7, 65, 4,
65, 65, 65, 65, 65, 65, 65, 65, 65, 65,
65, 65, 65, 65, 20, 21, 5, 6, 0, 3,
2, 4, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 9, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 8,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 11, 0, 0, 0, 0,

0, 0, 0, 10, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 13, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 14, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 18, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,

0, 0, 0, 0, 0, 19, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 57, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 15, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 16, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 17, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,

0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 55, 12, 0, 0, 0,
0, 0, 26, 0, 0, 0, 0, 52, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
58, 0, 27, 0, 0, 0, 0, 0, 32, 31,
0, 0, 49, 0, 28, 0, 0, 64, 0, 0,
0, 0, 29, 0, 0, 0, 0, 0, 0, 0,
0, 22, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 25, 24, 0, 63, 0, 0, 0, 0,

0, 0, 0, 54, 62, 0, 0, 30, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 53, 50, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 40, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 43, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 41, 0, 0, 0,
0, 0, 0, 0, 0, 61, 0, 0, 44, 0,
0, 0, 39, 0, 45, 0, 0, 0, 51, 0,

0, 42, 0, 0, 47, 0, 60, 0, 0, 0,
34, 46, 0, 56, 23, 59, 0, 37, 48, 0,
0, 35, 0, 38, 33, 36, 0
} ;

static yyconst int yy_ec[256] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 2, 1, 4, 5, 1, 1, 1, 1, 1,
1, 1, 1, 6, 7, 8, 1, 9, 10, 9,
9, 9, 9, 9, 9, 9, 9, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 11, 1, 12, 13, 14, 15,

16, 17, 18, 19, 20, 1, 21, 22, 23, 24,
25, 26, 1, 27, 28, 29, 30, 31, 32, 33,
34, 1, 35, 1, 36, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,

1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1
} ;

static yyconst int yy_meta[37] =
{ 0,
1, 1, 2, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1
} ;

static yyconst short int yy_base[530] =
{ 0,
0, 0, 545, 546, 546, 540, 0, 546, 28, 31,
515, 512, 17, 30, 21, 514, 524, 22, 509, 511,
37, 35, 37, 37, 546, 546, 546, 546, 533, 546,
0, 59, 49, 522, 515, 511, 517, 504, 517, 499,
505, 503, 502, 497, 546, 514, 501, 503, 504, 499,
50, 509, 47, 42, 497, 502, 505, 493, 486, 67,
494, 491, 489, 499, 481, 494, 497, 478, 482, 475,
475, 480, 489, 483, 484, 471, 474, 479, 473, 58,
468, 482, 464, 481, 475, 467, 473, 477, 467, 471,
469, 455, 458, 462, 449, 546, 451, 453, 462, 465,

460, 455, 463, 546, 444, 461, 459, 450, 443, 448,
438, 446, 61, 436, 438, 452, 63, 546, 442, 437,
440, 436, 444, 437, 445, 444, 427, 433, 425, 427,
62, 430, 64, 429, 417, 427, 422, 425, 420, 416,
417, 430, 429, 422, 411, 421, 424, 416, 410, 404,
407, 415, 546, 406, 404, 408, 416, 404, 414, 412,
396, 398, 397, 404, 407, 399, 395, 396, 399, 385,
388, 394, 386, 378, 389, 382, 382, 381, 376, 386,
387, 384, 390, 376, 372, 546, 371, 382, 73, 383,
370, 372, 368, 381, 373, 361, 371, 372, 374, 362,

361, 373, 359, 371, 351, 546, 356, 352, 351, 347,
347, 359, 358, 362, 350, 360, 359, 358, 546, 346,
343, 354, 348, 353, 333, 344, 350, 331, 343, 342,
345, 338, 326, 329, 546, 325, 326, 340, 330, 326,
322, 331, 318, 316, 316, 323, 313, 70, 328, 328,
328, 320, 326, 311, 309, 307, 309, 316, 320, 301,
311, 317, 316, 299, 305, 546, 306, 309, 310, 310,
293, 308, 290, 297, 292, 295, 302, 283, 300, 283,
292, 298, 294, 280, 546, 281, 275, 277, 283, 291,
290, 67, 280, 288, 269, 270, 280, 266, 274, 265,

272, 280, 261, 273, 265, 258, 263, 271, 256, 256,
262, 256, 269, 249, 255, 266, 252, 255, 254, 253,
252, 256, 260, 253, 243, 546, 546, 243, 255, 241,
244, 247, 546, 246, 247, 247, 238, 546, 233, 242,
230, 241, 228, 240, 232, 240, 226, 234, 219, 224,
546, 218, 546, 215, 233, 223, 231, 217, 546, 546,
221, 223, 546, 208, 546, 217, 211, 546, 219, 210,
80, 222, 546, 216, 215, 201, 203, 205, 203, 82,
215, 546, 198, 198, 207, 196, 194, 209, 199, 202,
205, 84, 546, 546, 190, 546, 203, 203, 193, 185,

195, 198, 91, 546, 546, 181, 174, 546, 93, 185,
177, 185, 184, 187, 190, 174, 180, 102, 177, 173,
168, 176, 175, 167, 177, 180, 546, 546, 171, 178,
173, 159, 165, 164, 156, 164, 163, 160, 169, 160,
152, 166, 161, 146, 146, 152, 151, 147, 142, 150,
147, 148, 546, 151, 153, 149, 135, 141, 138, 148,
131, 137, 133, 137, 546, 130, 139, 141, 137, 122,
122, 128, 133, 126, 120, 134, 546, 129, 131, 114,
130, 127, 124, 109, 116, 546, 110, 124, 546, 109,
118, 120, 546, 119, 546, 113, 103, 117, 546, 110,

108, 546, 100, 111, 546, 105, 546, 95, 109, 106,
546, 546, 99, 546, 546, 546, 100, 546, 546, 93,
80, 546, 66, 546, 546, 546, 546, 62, 54
} ;

static yyconst short int yy_def[530] =
{ 0,
527, 1, 527, 527, 527, 528, 529, 527, 527, 527,
527, 527, 527, 527, 527, 527, 527, 527, 527, 527,
527, 527, 527, 527, 527, 527, 527, 527, 528, 527,
529, 527, 527, 527, 527, 527, 527, 527, 527, 527,
527, 527, 527, 527, 527, 527, 527, 527, 527, 527,
527, 527, 527, 527, 527, 527, 527, 527, 527, 527,
527, 527, 527, 527, 527, 527, 527, 527, 527, 527,
527, 527, 527, 527, 527, 527, 527, 527, 527, 527,
527, 527, 527, 527, 527, 527, 527, 527, 527, 527,
527, 527, 527, 527, 527, 527, 527, 527, 527, 527,

527, 527, 527, 527, 527, 527, 527, 527, 527, 527,
527, 527, 527, 527, 527, 527, 527, 527, 527, 527,
527, 527, 527, 527, 527, 527, 527, 527, 527, 527,
527, 527, 527, 527, 527, 527, 527, 527, 527, 527,
527, 527, 527, 527, 527, 527, 527, 527, 527, 527,
527, 527, 527, 527, 527, 527, 527, 527, 527, 527,
527, 527, 527, 527, 527, 527, 527, 527, 527, 527,
527, 527, 527, 527, 527, 527, 527, 527, 527, 527,
527, 527, 527, 527, 527, 527, 527, 527, 527, 527,
527, 527, 527, 527, 527, 527, 527, 527, 527, 527,

527, 527, 527, 527, 527, 527, 527, 527, 527, 527,
527, 527, 527, 527, 527, 527, 527, 527, 527, 527,
527, 527, 527, 527, 527, 527, 527, 527, 527, 527,
527, 527, 527, 527, 527, 527, 527, 527, 527, 527,
527, 527, 527, 527, 527, 527, 527, 527, 527, 527,
527, 527, 527, 527, 527, 527, 527, 527, 527, 527,
527, 527, 527, 527, 527, 527, 527, 527, 527, 527,
527, 527, 527, 527, 527, 527, 527, 527, 527, 527,
527, 527, 527, 527, 527, 527, 527, 527, 527, 527,
527, 527, 527, 527, 527, 527, 527, 527, 527, 527,

527, 527, 527, 527, 527, 527, 527, 527, 527, 527,
527, 527, 527, 527, 527, 527, 527, 527, 527, 527,
527, 527, 527, 527, 527, 527, 527, 527, 527, 527,
527, 527, 527, 527, 527, 527, 527, 527, 527, 527,
527, 527, 527, 527, 527, 527, 527, 527, 527, 527,
527, 527, 527, 527, 527, 527, 527, 527, 527, 527,
527, 527, 527, 527, 527, 527, 527, 527, 527, 527,
527, 527, 527, 527, 527, 527, 527, 527, 527, 527,
527, 527, 527, 527, 527, 527, 527, 527, 527, 527,
527, 527, 527, 527, 527, 527, 527, 527, 527, 527,

527, 527, 527, 527, 527, 527, 527, 527, 527, 527,
527, 527, 527, 527, 527, 527, 527, 527, 527, 527,
527, 527, 527, 527, 527, 527, 527, 527, 527, 527,
527, 527, 527, 527, 527, 527, 527, 527, 527, 527,
527, 527, 527, 527, 527, 527, 527, 527, 527, 527,
527, 527, 527, 527, 527, 527, 527, 527, 527, 527,
527, 527, 527, 527, 527, 527, 527, 527, 527, 527,
527, 527, 527, 527, 527, 527, 527, 527, 527, 527,
527, 527, 527, 527, 527, 527, 527, 527, 527, 527,
527, 527, 527, 527, 527, 527, 527, 527, 527, 527,

527, 527, 527, 527, 527, 527, 527, 527, 527, 527,
527, 527, 527, 527, 527, 527, 527, 527, 527, 527,
527, 527, 527, 527, 527, 527, 0, 527, 527
} ;
 
Old 07-28-2009, 05:20 PM   #8
cicorino
Member
 
Registered: May 2006
Location: Italy
Distribution: Slackware, Slackware64
Posts: 31

Rep: Reputation: 16
ok, sorry I'm fullfilled by new projects and my posts will be delayed.

At a first glance your problems raise from the preprocessor define inside the lex file:

#undef input
#define input() (((yytchar=yysptr>yysbuf?U(*--yysptr):LexBuffer_Get_Char())==10?(yylineno++,yytchar):yytchar)==EOF?0:yytchar)


I tried and got similar problems on my platform.
It's really an ugly set of files, can you please post the
/home/oracle/Open2/ps/src_SDLLIB/change.y
and
/home/oracle/Open2/ps/src_SDLLIB/change
files too?
 
Old 07-29-2009, 03:03 AM   #9
eljuventino
LQ Newbie
 
Registered: May 2009
Posts: 26

Original Poster
Blog Entries: 1

Rep: Reputation: 15
really i'm lucky to have someone that help me like this §!really thank u!!

for the file change:


s/yybgin/Sdl_bgin/g
s/yysvec/Sdl_svec/g
s/yyvstop/Sdl_vstop/g
s/yyprevious/Sdl_previous/g
s/yytop/Sdl_top/g
s/yymatch/Sdl_match/g
s/yyextra/Sdl_extra/g
s/yylineno/Sdl_lineno/g
s/yylval/Sdl_lval/g
s/yycrank/Sdl_crank/g
s/yysptr/Sdl_sptr/g
s/yyin/Sdl_in/g
s/yyout/Sdl_out/g
s/yylex/Sdl_lex/g
s/yyunput/Sdl_unput/g
s/yylook/Sdl_look/g
s/yyback/Sdl_back/g
s/yyv/Sdl_yyv/g
s/yys/Sdl_yys/g
s/yywrap/Sdl_yywrap/g
s/yymbcurmax/Sdl_mbcurmax/g
s/__once_yylex/__once_Sdl_lex/g



for the file change.y:

s/yybgin/Sdl_bgin/g
s/yysvec/Sdl_svec/g
s/yyvstop/Sdl_vstop/g
s/yyprevious/Sdl_previous/g
s/yytop/Sdl_top/g
s/yymatch/Sdl_match/g
s/yyextra/Sdl_extra/g
s/yylineno/Sdl_lineno/g
s/yycrank/Sdl_crank/g
s/yysptr/Sdl_sptr/g
s/yyin/Sdl_in/g
s/yyout/Sdl_out/g
s/yylex/Sdl_lex/g
s/yyv/Sdl_yyv/g
s/yys/Sdl_yys/g
s/yymbcurmax/Sdl_mbcurmax/g
s/__once_yylex/__once_Sdl_lex/g
s/yyparse/Sdl_parse/g
s/yyerror/Sdl_error/g
s/yylval/Sdl_lval/g
s/yyval/Sdl_val/g
s/yywrap/Sdl_wrap/g
s/yychar/Sdl_char/g
s/yydebug/Sdl_debug/g
s/yyerrflag/Sdl_errflag/g
s/yynerrs/Sdl_nerrs/g

again thanks a lot for what are u doing with me!!!
 
Old 08-03-2009, 04:43 AM   #10
cicorino
Member
 
Registered: May 2006
Location: Italy
Distribution: Slackware, Slackware64
Posts: 31

Rep: Reputation: 16
_maybe_ you are lucky and you just need to add:
-DYY_NO_INPUT
to the gcc command line used to compile the ps_sdllib_scanner.c,
then cross your fingers and try to go on.
Anyway, please, complain a lot with the people that wrote those files!
 
Old 08-04-2009, 03:12 AM   #11
eljuventino
LQ Newbie
 
Registered: May 2009
Posts: 26

Original Poster
Blog Entries: 1

Rep: Reputation: 15
i don't know how to thank iu man!!u are awesome!!thanks a looooooooooot!!!really i owe u one!!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
does ubuntu have lex and yacc,how to use them?? akshay_jp Linux - Software 4 05-26-2010 06:36 PM
LEX and YACC with C gr33ndata Programming 4 11-18-2007 05:12 PM
lex problem Millenniumman Programming 2 11-06-2006 07:28 PM
Lex and Yacc on Mandrake 9.2.2 Anuradha Linux - Software 0 07-02-2005 03:32 AM
flex your lex chens_83 Linux - General 2 06-02-2002 03:18 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:51 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration