53 lines
1.9 KiB
Plaintext
53 lines
1.9 KiB
Plaintext
%{
|
|
#include "y.tab.h"
|
|
%}
|
|
|
|
%option noyywrap
|
|
|
|
%%
|
|
"void" return VOID;
|
|
"int" return INT;
|
|
"uint" return UINT;
|
|
"float" return FLOAT;
|
|
"double" return DOUBLE;
|
|
"string" return STRING;
|
|
"bool" return BOOL;
|
|
"struct" return STRUCT;
|
|
"return" return RETURN;
|
|
"static" return STATIC;
|
|
"Reference" return REFERENCE;
|
|
"alloc" return ALLOC;
|
|
"if" return IF;
|
|
"else" return ELSE;
|
|
[0-9]+ return NUMBER;
|
|
[a-zA-Z][a-zA-Z0-9]* return ID;
|
|
\"[a-zA-Z][a-zA-Z0-9]*\" return STRING_LITERAL;
|
|
"+" return PLUS;
|
|
"-" return MINUS;
|
|
"*" return STAR;
|
|
"/" return SLASH;
|
|
"%" return PERCENT;
|
|
"<" return LESS_THAN;
|
|
">" return GREATER_THAN;
|
|
"=" return EQUAL;
|
|
"\"" return QUOTE;
|
|
"!" return BANG;
|
|
"|" return BAR;
|
|
"&" return AMPERSAND;
|
|
"." return POINT;
|
|
"," return COMMA;
|
|
";" return SEMICOLON;
|
|
":" return COLON;
|
|
"?" return QUESTION;
|
|
"(" return LEFT_PAREN;
|
|
")" return RIGHT_PAREN;
|
|
"[" return LEFT_BRACKET;
|
|
"]" return RIGHT_BRACKET;
|
|
"{" return LEFT_BRACE;
|
|
"}" return RIGHT_BRACE;
|
|
"//" return COMMENT;
|
|
" " ;
|
|
"\n" ;
|
|
[ \t] ;
|
|
%%
|