Ecrire Input File pour Flex
zitou20
Messages postés
9
Date d'inscription
Statut
Membre
Dernière intervention
-
zitou20 Messages postés 9 Date d'inscription Statut Membre Dernière intervention -
zitou20 Messages postés 9 Date d'inscription Statut Membre Dernière intervention -
Bonjour,
j'ai jamais utilisé Flex.J'ai téléchargé Flex à partir de ce lien https://sourceforge.net/projects/flex/files/ et je veut écrire ce code comme un exemple ,où je doit l'écrire ?
/*
* Sample Scanner1:
* Description: Replace the string "username" from standard input
* with the user's login name (e.g. lgao)
* Usage: (1) $ flex sample1.lex
* (2) $ gcc lex.yy.c -lfl
* (3) $ ./a.out
* stdin> username
* stdin> Ctrl-D
* Question: What is the purpose of '%{' and '%}'?
* What else could be included in this section?
*/
%{
/* need this for the call to getlogin() below */
#include <unistd.h>
%}
%%
username printf("%s\n", getlogin());
%%
main()
{
yylex();
}
j'ai jamais utilisé Flex.J'ai téléchargé Flex à partir de ce lien https://sourceforge.net/projects/flex/files/ et je veut écrire ce code comme un exemple ,où je doit l'écrire ?
/*
* Sample Scanner1:
* Description: Replace the string "username" from standard input
* with the user's login name (e.g. lgao)
* Usage: (1) $ flex sample1.lex
* (2) $ gcc lex.yy.c -lfl
* (3) $ ./a.out
* stdin> username
* stdin> Ctrl-D
* Question: What is the purpose of '%{' and '%}'?
* What else could be included in this section?
*/
%{
/* need this for the call to getlogin() below */
#include <unistd.h>
%}
%%
username printf("%s\n", getlogin());
%%
main()
{
yylex();
}
A voir également:
- Ecrire Input File pour Flex
- .Bin file - Guide
- Host file - Guide
- .Dat file - Guide
- Ecrire en gras sur whatsapp - Guide
- Application pour écrire les chiffre en lettre - Télécharger - Outils professionnels
2 réponses
http://www.flexx.fr/forum/topic375.html
https://www.google.ca/?gws_rd=ssl#q=flex%20ecrire%20dans%20un%20fichier
https://www.google.ca/?gws_rd=ssl#q=flex%20ecrire%20dans%20un%20fichier