Files
compiler-the-translators/lexicalStructure.lex
2025-02-11 17:15:54 -05:00

32 lines
664 B
Plaintext

/* Lexical Analysis with Flex (2.6.0) We used some of the code from this manual */
/* so we placed the citation here. */
/* definitions */
%option noyywrap
%{
#include "typedefs.h"
%}
COM ([^*]|\*+[^)*])*
ID [A-Za-z_][0-9A-Za-z_]*
%%
"(*"{COM}"*)" {return COMMENT;}
";" {return SEMI_COLON;}
":" {return COLON;}
"," {return COMMA;}
"->" {return ARROW;}
{ID} {return ID;}
%%
int main(int argc, char *argv[]){
argc--, argv++;
if ( argc > 0 )
yyin = fopen( argv[0], "r" );
else
yyin = stdin;
yylex();
}