IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Linux Discussion :

gcc et lex.yy.c


Sujet :

Linux

  1. #1
    Membre averti
    Profil pro
    Inscrit en
    Janvier 2009
    Messages
    34
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Janvier 2009
    Messages : 34
    Par défaut gcc et lex.yy.c
    slt!!un grand merci a toute l’équipe de developpez.net pour le grand aide que vous fournissez !!
    il s’agit d’un produit installé et compiler sur une machine AIX avec xlc comme compilateuret ma tache et la migration de ce produit vers une nouvelle plateforme tel que linus red hat etreprise 5 avec gcc comme compilateur .j’ai commencé le travail et j’ai résolu plusieurs problémes maiscelui la j’ai pas trouvez grand chose pour m’aidez a le résoudre :

    /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

    grâce a votre forum je suis a 70% de mon projet j’espère que vous m’aidiez a résoudre cela !!!

  2. #2
    Membre chevronné
    Profil pro
    Inscrit en
    Mai 2007
    Messages
    417
    Détails du profil
    Informations personnelles :
    Âge : 38
    Localisation : France, Loire Atlantique (Pays de la Loire)

    Informations forums :
    Inscription : Mai 2007
    Messages : 417
    Par défaut
    lex.yy.c est un fichier généré, il a été généré sur quelle plateforme ?

    a quoi ressemble les lignes (la ligne meme) qui posent problème (avant et après bien sur)

    tu ne peux pas le regénérer a partir de ton .lex ?

  3. #3
    Membre averti
    Profil pro
    Inscrit en
    Janvier 2009
    Messages
    34
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Janvier 2009
    Messages : 34
    Par défaut
    pour le plateforme je travaille sur linux red hat entreprise 5 .pour lex je crois que je suis nouveau dans ce domaine et ça serai bien si je me documente sur cette partie du lex!!merci quand méme et si vous parviendrez a résoudre mon problème ça serai un grand coup de main !!

  4. #4
    Membre chevronné
    Profil pro
    Inscrit en
    Mai 2007
    Messages
    417
    Détails du profil
    Informations personnelles :
    Âge : 38
    Localisation : France, Loire Atlantique (Pays de la Loire)

    Informations forums :
    Inscription : Mai 2007
    Messages : 417
    Par défaut
    euh tu n as pas trop répondu a mes questions

    ton fichier lex.yy.c a certainement été généré sur ton ancienne plateforme et il faudrait surement le regénérer.


    sinon peux tu afficher les lignes autour de 1712 du fichier lex.yy.c, surtout avant

  5. #5
    Membre averti
    Profil pro
    Inscrit en
    Janvier 2009
    Messages
    34
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Janvier 2009
    Messages : 34
    Par défaut
    voici la ligne concerné:

    static int input()/*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';

  6. #6
    Membre chevronné
    Profil pro
    Inscrit en
    Mai 2007
    Messages
    417
    Détails du profil
    Informations personnelles :
    Âge : 38
    Localisation : France, Loire Atlantique (Pays de la Loire)

    Informations forums :
    Inscription : Mai 2007
    Messages : 417
    Par défaut
    surtout avant ! les lignes suivantes importe peu

  7. #7
    Membre averti
    Profil pro
    Inscrit en
    Janvier 2009
    Messages
    34
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Janvier 2009
    Messages : 34
    Par défaut
    voici ce qui est avant et ce qui est aprés:


    ...
    #ifdef YY_USE_PROTOS
    static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
    #else
    static yy_state_type yy_try_NUL_trans( yy_current_state )
    yy_state_type yy_current_state;
    #endif
    {
    register int yy_is_jam;
    register char *yy_cp = yy_c_buf_p;

    register YY_CHAR yy_c = 1;
    if ( yy_accept[yy_current_state] )
    {
    yy_last_accepting_state = yy_current_state;
    yy_last_accepting_cpos = yy_cp;
    }
    while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
    {
    yy_current_state = (int) yy_def[yy_current_state];
    if ( yy_current_state >= 528 )
    yy_c = yy_meta[(unsigned int) yy_c];
    }
    yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
    yy_is_jam = (yy_current_state == 527);

    return yy_is_jam ? 0 : yy_current_state;
    }


    #ifndef YY_NO_UNPUT
    #ifdef YY_USE_PROTOS
    static void yyunput( int c, register char *yy_bp )
    #else
    static void yyunput( c, yy_bp )
    int c;
    register char *yy_bp;
    #endif
    {
    register char *yy_cp = yy_c_buf_p;

    /* undo effects of setting up yytext */
    *yy_cp = yy_hold_char;

    if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
    { /* need to shift things up to make room */
    /* +2 for EOB chars. */
    register int number_to_move = yy_n_chars + 2;
    register char *dest = &yy_current_buffer->yy_ch_buf[
    yy_current_buffer->yy_buf_size + 2];
    register char *source =
    &yy_current_buffer->yy_ch_buf[number_to_move];

    while ( source > yy_current_buffer->yy_ch_buf )
    *--dest = *--source;

    yy_cp += (int) (dest - source);
    yy_bp += (int) (dest - source);
    yy_current_buffer->yy_n_chars =
    yy_n_chars = yy_current_buffer->yy_buf_size;

    if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
    YY_FATAL_ERROR( "flex scanner push-back overflow" );
    }

    *--yy_cp = (char) c;


    yytext_ptr = yy_bp;
    yy_hold_char = *yy_cp;
    yy_c_buf_p = yy_cp;
    }
    #endif /* ifndef YY_NO_UNPUT */


    #ifndef YY_NO_INPUT
    #ifdef __cplusplus
    static int yyinput()
    #else
    static int input()
    #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';

    else
    { /* need more input */
    int offset = yy_c_buf_p - yytext_ptr;
    ++yy_c_buf_p;

    switch ( yy_get_next_buffer() )
    {
    case EOB_ACT_LAST_MATCH:
    /* This happens because yy_g_n_b()
    * sees that we've accumulated a
    * token and flags that we need to
    * try matching the token before
    * proceeding. But for input(),
    * there's no matching to consider.
    * So convert the EOB_ACT_LAST_MATCH
    * to EOB_ACT_END_OF_FILE.
    */

    /* Reset buffer status. */
    yyrestart( yyin );

    /* fall through */

    ...


    et merciiiiiiiii a ce que vous faites mnt!!vrmt c gentille!!!

  8. #8
    Membre prolifique
    Avatar de Sve@r
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Février 2006
    Messages
    12 845
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Oise (Picardie)

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : Aéronautique - Marine - Espace - Armement

    Informations forums :
    Inscription : Février 2006
    Messages : 12 845
    Billets dans le blog
    1
    Par défaut
    Citation Envoyé par eljuventino Voir le message
    voici ce qui est avant et ce qui est aprés:


    ...
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    #ifdef YY_USE_PROTOS
    static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
    #else
    static yy_state_type yy_try_NUL_trans( yy_current_state )
    yy_state_type yy_current_state;
    #endif
    	{
    	register int yy_is_jam;
    	register char *yy_cp = yy_c_buf_p;
     
    	register YY_CHAR yy_c = 1;
    	if ( yy_accept[yy_current_state] )
    		{
    		yy_last_accepting_state = yy_current_state;
    		yy_last_accepting_cpos = yy_cp;
    		}
    	while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
    		{
    		yy_current_state = (int) yy_def[yy_current_state];
    		if ( yy_current_state >= 528 )
    			yy_c = yy_meta[(unsigned int) yy_c];
    		}
    	yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
    	yy_is_jam = (yy_current_state == 527);
     
    	return yy_is_jam ? 0 : yy_current_state;
    	}
     
     
    #ifndef YY_NO_UNPUT
    #ifdef YY_USE_PROTOS
    static void yyunput( int c, register char *yy_bp )
    #else
    static void yyunput( c, yy_bp )
    int c;
    register char *yy_bp;
    #endif
    	{
    	register char *yy_cp = yy_c_buf_p;
     
    	/* undo effects of setting up yytext */
    	*yy_cp = yy_hold_char;
     
    	if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
    		{ /* need to shift things up to make room */
    		/* +2 for EOB chars. */
    		register int number_to_move = yy_n_chars + 2;
    		register char *dest = &yy_current_buffer->yy_ch_buf[
    					yy_current_buffer->yy_buf_size + 2];
    		register char *source =
    				&yy_current_buffer->yy_ch_buf[number_to_move];
     
    		while ( source > yy_current_buffer->yy_ch_buf )
    			*--dest = *--source;
     
    		yy_cp += (int) (dest - source);
    		yy_bp += (int) (dest - source);
    		yy_current_buffer->yy_n_chars =
    			yy_n_chars = yy_current_buffer->yy_buf_size;
     
    		if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
    			YY_FATAL_ERROR( "flex scanner push-back overflow" );
    		}
     
    	*--yy_cp = (char) c;
     
     
    	yytext_ptr = yy_bp;
    	yy_hold_char = *yy_cp;
    	yy_c_buf_p = yy_cp;
    	}
    #endif	/* ifndef YY_NO_UNPUT */
     
     
    #ifndef YY_NO_INPUT
    #ifdef __cplusplus
    static int yyinput()
    #else
    static int input()
    #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';
     
    		else
    			{ /* need more input */
    			int offset = yy_c_buf_p - yytext_ptr;
    			++yy_c_buf_p;
     
    			switch ( yy_get_next_buffer() )
    				{
    				case EOB_ACT_LAST_MATCH:
    					/* This happens because yy_g_n_b()
    					 * sees that we've accumulated a
    					 * token and flags that we need to
    					 * try matching the token before
    					 * proceeding.  But for input(),
    					 * there's no matching to consider.
    					 * So convert the EOB_ACT_LAST_MATCH
    					 * to EOB_ACT_END_OF_FILE.
    					 */
     
    					/* Reset buffer status. */
    					yyrestart( yyin );
     
    					/* fall through */
    ...


    et merciiiiiiiii a ce que vous faites mnt!!vrmt c gentille!!!

    Ouais nan c'est bon quoi. Déjà le C quand il est écrit par un programmeur il est parfois dégueu, là il est généré et donc totalement immonde. C'est normal, il n'a pas été fait pour être lu !!!
    La solution a déjà été donnée. il te faut le regénérer à partir du ".yy" via lex ou yacc je sais plus trop (ça fait 15 ans que j'ai pas écrit de yacc).

    Eventuellement si tu as le .yy à nous montrer...
    Mon Tutoriel sur la programmation «Python»
    Mon Tutoriel sur la programmation «Shell»
    Sinon il y en a pleins d'autres. N'oubliez pas non plus les différentes faq disponibles sur ce site
    Et on poste ses codes entre balises [code] et [/code]

  9. #9
    Membre averti
    Profil pro
    Inscrit en
    Janvier 2009
    Messages
    34
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Janvier 2009
    Messages : 34
    Par défaut
    merciiiiiii comme méme pour ton aide j'aisserai de se documenter sur lex et yacc et leur compilation et voir les erreurs et aussin vérifié la version du lex!!!
    en tt cas merciiiiiiiiii pour ton aide je vais revenir ici lorsque je réalise tous ce que j'ai cité!!

  10. #10
    Responsable 2D/3D/Jeux


    Avatar de LittleWhite
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Mai 2008
    Messages
    27 155
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Ingénieur développement logiciels

    Informations forums :
    Inscription : Mai 2008
    Messages : 27 155
    Billets dans le blog
    150
    Par défaut
    Bonjour,

    Juste pour dire, que le forum dispose de balise pour codes [ C O D E ] [ / C O D E ] ( sans les espaces ). ( bouton '#' sur le haut )
    Je sais que la coloration n'aurait pas convenu, mais ça aurait été un peu mieux :p pour la lecture
    Vous souhaitez participer à la rubrique 2D/3D/Jeux ? Contactez-moi

    Ma page sur DVP
    Mon Portfolio

    Qui connaît l'erreur, connaît la solution.

Discussions similaires

  1. les .a avec gcc
    Par Groove dans le forum Autres éditeurs
    Réponses: 4
    Dernier message: 31/03/2003, 07h59
  2. gcc et win32
    Par MatRem dans le forum Autres éditeurs
    Réponses: 1
    Dernier message: 16/01/2003, 12h22
  3. getch() avec gcc
    Par Jorus dans le forum Autres éditeurs
    Réponses: 5
    Dernier message: 16/12/2002, 14h47
  4. Réponses: 1
    Dernier message: 13/11/2002, 20h34
  5. [Kylix] gcc et kylix
    Par alexsmadja dans le forum EDI
    Réponses: 1
    Dernier message: 28/05/2002, 10h00

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo