Advertisement
Guest User

Untitled

a guest
Feb 24th, 2020
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. %X DOCUMENT TITLE CHAPTER
  2. abc [a-zA-Z0-9 ]+
  3. %%
  4. "\\begin{".* {BEGIN DOCUMENT;}
  5. <DOCUMENT>"\\title{" {BEGIN TITLE;}
  6. <TITLE>{abc} {
  7. int i=0;
  8. while(i<yytext[i])
  9. {
  10. if(yytext[i]>=97 && yytext[i]<=122){
  11. printf("%c",yytext[i]-32);
  12. }else{
  13. printf("%c",yytext[i]);
  14. }
  15.  
  16. i++;
  17. }
  18.  
  19. }
  20. <TITLE>"}" {BEGIN 0;}
  21.  
  22. %%
  23. int main()
  24. {
  25. yylex();
  26. return 0;
  27. }
  28.  
  29. int yywrap()
  30. {
  31. return 1;
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement