Skip to content

Instantly share code, notes, and snippets.

@Fcmam5
Last active November 9, 2016 08:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Fcmam5/e004493934400f8ac40f662ff24a8256 to your computer and use it in GitHub Desktop.
Save Fcmam5/e004493934400f8ac40f662ff24a8256 to your computer and use it in GitHub Desktop.
Compilation L3 analyseur syntaxique
%{
#include <stdio.h>
%}
chiffre [0-9]
lettre [a-z]|[A-Z]
%%
{lettre}({chiffre}|{lettre})* {printf("Identifiant reconnu: %s de longuer %d\n", yytext, yyleng);}
({chiffre})+ {printf("Nombre reconnu:");ECHO;printf("\n");}
[^a-z]|[^A-Z]|[^0-9]
%%
int main(){
yylex();
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment