SHARE
TWEET

Untitled

a guest Sep 19th, 2017 146 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. %{
  2.  #include "pseudo.tab.h"
  3. %}
  4.  
  5. %option noyywrap
  6.  
  7. /* sectiune DEFINITII */
  8. CIFRA [0-9]
  9. ID [a-zA-Z][A-Za-z0-9]*
  10. SIR_CARACTERE ["][^\"]*["]
  11. INCLUDE "#include "
  12. %%
  13. {CIFRA}+ {
  14.             yylval.dint=atoi(yytext);
  15.             return NUMAR_INTREG;
  16. }
  17. {CIFRA}+"."+{CIFRA}+ {
  18.             yylval.dreal=atof(yytext);
  19.             return NUMAR_REAL;
  20. }
  21. start return START;
  22. stop return STOP;
  23. afiseaza return AFISEAZA;
  24. citeste return CITESTE;
  25. intreg return INTREG;
  26. real return REAL;
  27. caracter return SIRC;
  28. pentru return PENTRU;
  29. executa return EXECUTA;
  30. cattimp return CATTIMP;
  31. daca return DACA;
  32. atunci return ATUNCI;
  33. altfel return ALTFEL;
  34. radical return RADICAL;
  35. putere return PUTERE;
  36. absolut return ABSOLUT;
  37. cos return COS;
  38. structura return STRUCT;
  39. sin return SIN;
  40. tan return TAN;
  41. schimba return SWITCH;
  42. cazul return CASE;
  43. "<"|"=="|">"|">="|"<="|"!=" return OPERANDCOND;
  44. {SIR_CARACTERE} return SIR_CARACTERE;
  45. {INCLUDE} return INCLUDEE;
  46. {ID} return VARIABILA;
  47.  
  48. [ \t] /* ignora (spatiu + tab) */
  49. \n        return yytext[0];
  50. .         return yytext[0];
  51.  
  52. %%
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top