TXT
TXT
TXT
/*
* Stuff enclosed in %{ %} in the first section is copied verbatim to the
* output, so headers and global definitions are placed here to be visible
* to the code in the file. Don't remove anything that was here initially
*/
%option noyywrap
%{
#include <cool-parse.h>
#include <stringtab.h>
#include <utilities.h>
#include <string.h>
int dubina_komentara=0;
int ukupno_ucitano_znakova=0;
int provjeri_duljinu_unesenog_stringa(char zadnje_ucitano[MAX_STR_CONST]);
%}
%x KOMENTAR
%x JEDNOLINIJSKI_KOMENTAR
%x STRING
%x IZADI_IZ_STRINGA_S_GRESKOM
A a|A
B b|B
C c|C
D d|D
E e|E
F f|F
G g|G
H h|H
I i|I
J j|J
K k|K
L l|L
M m|M
N n|N
O o|O
P p|P
Q q|Q
R r|R
S s|S
T t|T
U u|U
V v|V
W w|W
X x|X
Y y|Y
Z z|Z
CIJELI_BROJ [0-9]+
IDENTIFIKATOR [a-zA-Z0-9_]+
IDENTIFIKATOR_OBJEKTA [a-z][a-zA-Z0-9_]*
IDENTIFIKATOR_TIPA [A-Z][a-zA-Z0-9_]*
%%
"!"|"#"|"$"|"%"|"^"|"&"|"_"|">"|"?"|"`"|"["|"]"|"\\"|\||#|#|#|#
{cool_yylval.error_msg=yytext; return ERROR;}
\r\n|\n curr_lineno++;
[ \t\f\v\r]+ {}
<IZADI_IZ_STRINGA_S_GRESKOM>{
\" {BEGIN INITIAL;}
\n { curr_lineno++; BEGIN INITIAL; }
. { }
}
%%