Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
alang-grupoa
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package 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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
albruiz
alang-grupoa
Commits
675060ae
Commit
675060ae
authored
Jun 11, 2020
by
marivil
Browse files
Options
Downloads
Patches
Plain Diff
Arreglado core dump
parent
d186d086
No related branches found
No related tags found
1 merge request
!1
Arbol
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
inter05.l
+10
-15
10 additions, 15 deletions
inter05.l
inter05.y
+1
-1
1 addition, 1 deletion
inter05.y
pruebita.c
+2
-2
2 additions, 2 deletions
pruebita.c
with
13 additions
and
18 deletions
inter05.l
+
10
−
15
View file @
675060ae
...
...
@@ -32,7 +32,7 @@ char *keywords[KWLEN] = {
"sin",
"tan",
"var",
"while"
"while"
,
"do"
};
...
...
@@ -53,7 +53,7 @@ unsigned keycodes[KWLEN] = {
TAN,
VAR,
WHILE,
WHILE
DO
};
static void lower(char *s); /* Pasar todas las letras a minúsculas (definida abajo) */
...
...
@@ -93,25 +93,26 @@ CHAR (\'.?\')
COMSIMP (\/\/.*)
COMMULT (\\\*.*\*\/)
%%
{WSPC} ;
{NEWLN} {
yylineno+=1;
}
{WSPC} ;
{COMSEP} {
return yytext[0];
}
{COMSIMP} ;
{COMMULT} ;
{IDENT} {
int i
= 0
;
int i ;
char *res;
lower(yytext); /* Se pasa a minúsculas */
/* Se busca si es palabra una clave */
for (i = 0; i<KWLEN; i++ ){
if (strcmp(keywords[i],yytext)==0) return keycodes[i];
if (strcmp(keywords[i],yytext)==0)
return keycodes[i];
}
/* Si no es una palabra clave */
yyStr(yylval)=sdup(yytext); /* Se copia el identificador leído */
yyFlag(yylval)=fIDENT; /* Se apunta que es un identificador */
...
...
@@ -119,9 +120,6 @@ COMMULT (\\\*.*\*\/)
return IDENT; /* Se devuelve que se ha leído un identificador */
}
{COMSEP} {
return yytext[0];
}
{DIGITS} {
/* Se lee el número entero */
...
...
@@ -252,6 +250,3 @@ static char *readStr(void) {
return buff;
}
/* -- EOF -- */
This diff is collapsed.
Click to expand it.
inter05.y
+
1
−
1
View file @
675060ae
...
...
@@ -150,7 +150,7 @@ cuerpo
$$.u.ast = NULL;
}
| '{' cuerpo sentencia ';' '}'
{
+
{
$$.flag = fAST;
$$.u.ast = appR(';', $2.u.ast, $3.u.ast);
}
...
...
This diff is collapsed.
Click to expand it.
pruebita.c
+
2
−
2
View file @
675060ae
print
(
'j'
);
//
print('j');
var
a
=
0
;
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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