Pristine Ack-5.5
[Ack-5.5.git] / util / ceg / as_parser / table.l
1
2 ws              ([ \t]*)
3 arrow           ("==>")
4 letter          ([a-zA-Z_])
5 digit           ([0-9])
6 identifier      ({letter}({letter}|{digit})*)
7
8 %start COM CAL CON
9
10 %{
11
12 #include "Lpars.h"
13 #include "decl.h"
14 int special, n_haakjes;
15 int lineno = 1;
16
17 %}
18
19
20 %%
21
22 "/*"                    BEGIN COM;
23 <COM>[^\n\*]*"*"+"/"    BEGIN 0;
24 <COM>[^\n^\*]*"*"+      ;
25 <COM>[^\n\*]*"\n"       lineno++;
26
27 ";"                     return( ';');
28 "."                     return( '.');
29 ","                     return( ',');
30 ":"                     return( ':');
31 "@"                     return( '@');
32 "@if"{ws}               return( IF);
33 "@elsif"{ws}            return( ELSIF);
34 "@else"{ws}             return( ELSE);
35 "@fi"{ws}               return( FI);
36 "..."                   return( MORE);
37 {arrow}                 return( ARROW);
38 {identifier}            return( IDENTIFIER);
39
40
41 <CON>[^()]*"("          { n_haakjes++; yymore();}
42 "("                     { BEGIN CON; n_haakjes = 1; yymore();}
43 <CON>[^()]*")"          { if ( n_haakjes == 1) {
44                                 BEGIN 0;
45                                 return( CONDITION);
46                           }
47                           else {
48                                 n_haakjes--;
49                                 yymore();
50                           }
51                         }
52
53 {ws}                    ;
54 \n                      lineno++;