Funcoes em pascal
[toypasc.git] / lextest.l
blob9966886e9eb436b10081a625848543362066563c
1 %{
2 #include <stdio.h>
3 %}
5 %%
6 "Integer"               printf("T_INTEGER ");
7 "Var"                   printf("T_VAR ");
8 "Begin"                 printf("T_BEGIN ");
9 "End"                   printf("T_END ");
10 "Procedure"             printf("T_PROCEDURE ");
11 "Function"              printf("T_FUNCTION ");
13 "*"                     printf("T_MULT ");
14 "/"                     printf("T_DIV ");
15 "+"                     printf("T_ADD ");
16 "-"                     printf("T_SUB ");
17 ":="                    printf("T_ATTRIBUTION ");
18 ";"                     printf("T_SEMICOLON ");
19 ":"                     printf("T_COLON ");
20 "."                     printf("T_DOT ");
22 [0-9]+                  printf("NUMBER ");
23 [A-Za-z][A-Za-z0-9]*    printf("IDENTIFIER ");
25 [ \t]+                  /* ignora whitespace */;
26 \n                      printf("\n");