Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %{
- #include<stdio.h>
- #include<stdlib.h>
- int suma=0, i=0;
- char pom;
- %}
- CISLA [0-9]
- PRAZDNY [ \t\n\r]
- %%
- ^{CISLA}+{PRAZDNY}+ {suma = yyleng-1;
- for (i=0;i< (suma/2);i++) {
- pom = yytext[i];
- yytext[i] = yytext[suma-i-1];
- yytext[suma-1-i] = pom;
- }
- printf("%s", yytext);
- yyless(yyleng - 1);
- }
- ^{PRAZDNY}+{CISLA}+{PRAZDNY}+ {
- suma = yyleng-1;
- for (i=0;i< (suma/2);i++) {
- pom = yytext[i];
- yytext[i] = yytext[suma-i-1];
- yytext[suma-1-i] = pom;
- }
- printf("%s", yytext);
- yyless(yyleng - 1);
- }
- .
- %%
- main (int argc, char **argv)
- {
- yylex();
- }
Add Comment
Please, Sign In to add comment