Initial revision
This commit is contained in:
52
util/ceg/as_parser/table.l
Normal file
52
util/ceg/as_parser/table.l
Normal file
@@ -0,0 +1,52 @@
|
||||
|
||||
ws ([ \t\n]*)
|
||||
arrow ("==>")
|
||||
letter ([a-zA-Z_])
|
||||
digit ([0-9])
|
||||
identifier ({letter}({letter}|{digit})*)
|
||||
|
||||
%start COM CAL CON
|
||||
|
||||
%{
|
||||
|
||||
#include "Lpars.h"
|
||||
#include "decl.h"
|
||||
int special, n_haakjes;
|
||||
|
||||
%}
|
||||
|
||||
|
||||
%%
|
||||
|
||||
"/*" BEGIN COM;
|
||||
<COM>[^\n\*]*"*"+"/" BEGIN 0;
|
||||
<COM>[^\n^\*]*"*"+ ;
|
||||
<COM>[^\n\*]*"\n" ;
|
||||
|
||||
";" return( ';');
|
||||
"." return( '.');
|
||||
"," return( ',');
|
||||
":" return( ':');
|
||||
"@" return( '@');
|
||||
"@if"{ws} return( IF);
|
||||
"@elsif"{ws} return( ELSIF);
|
||||
"@else"{ws} return( ELSE);
|
||||
"@fi"{ws} return( FI);
|
||||
"..." return( MORE);
|
||||
{arrow} return( ARROW);
|
||||
{identifier} return( IDENTIFIER);
|
||||
|
||||
|
||||
"(" { BEGIN CON; n_haakjes = 1; yymore();}
|
||||
<CON>[^()]*"(" { n_haakjes++; yymore();}
|
||||
<CON>[^()]*")" { if ( n_haakjes == 1) {
|
||||
BEGIN 0;
|
||||
return( CONDITION);
|
||||
}
|
||||
else {
|
||||
n_haakjes--;
|
||||
yymore();
|
||||
}
|
||||
}
|
||||
|
||||
{ws} ;
|
||||
Reference in New Issue
Block a user