Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CompilerbauBlatt2
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Oscar Amaya Mohr
CompilerbauBlatt2
Commits
44f441b5
Commit
44f441b5
authored
2 years ago
by
Oscar Amaya Mohr
Browse files
Options
Downloads
Patches
Plain Diff
Update minako-lexic.l
parent
bb585047
Branches
main
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
minako-lexic.l
+36
-36
36 additions, 36 deletions
minako-lexic.l
with
36 additions
and
36 deletions
minako-lexic.l
+
36
−
36
View file @
44f441b5
...
@@ -13,50 +13,50 @@ void invalid_token() {
...
@@ -13,50 +13,50 @@ void invalid_token() {
%s STRING
%s STRING
BLOCK_COMMENT "/*"((("*"[^/])?)|[^*])*"*/"
BLOCK_COMMENT
"/*"((("*"[^/])?)|[^*])*"*/"
LINE_COMMENT "//".*
LINE_COMMENT
"//".*
INT [0-9]+
INT
[0-9]+
FLOAT [0-9]+"."[0-9]+|"."[0-9]+([eE]([-+])?[0-9]+)?|[0-9]+[eE]([-+])?[0-9]+
FLOAT
[0-9]+"."[0-9]+|"."[0-9]+([eE]([-+])?[0-9]+)?|[0-9]+[eE]([-+])?[0-9]+
ID [[:alpha:]]+[[:alnum:]]*
ID
[[:alpha:]]+[[:alnum:]]*
PUNCTUATION "+"|"-"|"*"|"/"|"="|"("|")"|"{"|"}"|","|";"
PUNCTUATION
"+"|"-"|"*"|"/"|"="|"("|")"|"{"|"}"|","|";"
WHITESPACE [ \t\n\r]
WHITESPACE
[ \t\n\r]
%%
%%
{BLOCK_COMMENT}
{BLOCK_COMMENT}
{LINE_COMMENT}
{LINE_COMMENT}
bool return KW_BOOLEAN;
bool
return KW_BOOLEAN;
do return KW_DO;
do
return KW_DO;
else return KW_ELSE;
else
return KW_ELSE;
float return KW_FLOAT;
float
return KW_FLOAT;
for return KW_FOR;
for
return KW_FOR;
if return KW_IF;
if
return KW_IF;
int return KW_INT;
int
return KW_INT;
printf return KW_PRINTF;
printf
return KW_PRINTF;
return return KW_RETURN;
return
return KW_RETURN;
void return KW_VOID;
void
return KW_VOID;
while return KW_WHILE;
while
return KW_WHILE;
"&&" return AND;
"&&"
return AND;
"||" return OR;
"||"
return OR;
"==" return EQ;
"=="
return EQ;
"!=" return NEQ;
"!="
return NEQ;
">=" return GEQ;
">="
return GEQ;
"<=" return LEQ;
"<="
return LEQ;
">" return GRT;
">"
return GRT;
"<" return LSS;
"<"
return LSS;
{INT} yylval.intValue = atoi(yytext); return CONST_INT;
{INT}
yylval.intValue = atoi(yytext); return CONST_INT;
{FLOAT} yylval.floatValue = atof(yytext); return CONST_FLOAT;
{FLOAT}
yylval.floatValue = atof(yytext); return CONST_FLOAT;
true yylval.intValue = 1; return CONST_BOOLEAN;
true
yylval.intValue = 1; return CONST_BOOLEAN;
false yylval.intValue = 0; return CONST_BOOLEAN;
false
yylval.intValue = 0; return CONST_BOOLEAN;
\" BEGIN(STRING);
\"
BEGIN(STRING);
<STRING>[^\n\"]*/\" yylval.string = yytext; BEGIN(INITIAL); return CONST_STRING;
<STRING>[^\n\"]*/\" yylval.string = yytext; BEGIN(INITIAL); return CONST_STRING;
{ID} yylval.string = yytext; return ID;
{ID}
yylval.string = yytext; return ID;
{PUNCTUATION} return (int)(*yytext);
{PUNCTUATION}
return (int)(*yytext);
{WHITESPACE}
{WHITESPACE}
. invalid_token();
.
invalid_token();
<<EOF>> return EOF;
<<EOF>>
return EOF;
%%
%%
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment