Skip to content
Snippets Groups Projects
Commit d186d086 authored by albruiz's avatar albruiz
Browse files

Funciona print char

parent 8e7b5b07
No related branches found
No related tags found
1 merge request!1Arbol
......@@ -2,5 +2,9 @@ dusan: inter05.y inter05.l symtab.c stduse.c astree.c
bison --defines -v inter05.y -o inter05.c
flex -o inter05.lex.c inter05.l
gcc inter05.c inter05.lex.c symtab.c stduse.c astree.c -o x_inter05 -lm
debug: inter05.y inter05.l symtab.c stduse.c astree.c
bison --debug --verbose --defines -v inter05.y -o inter05.c
flex -o inter05.lex.c inter05.l
gcc -g inter05.c inter05.lex.c symtab.c stduse.c astree.c -o x_inter05_debug -lm
clean:
rm x_inter05 *output *lex* inter05.h inter05.c inter05.lex.c
rm x_inter05 *output *lex* inter05.h inter05.c inter05.lex.c x_inter05_debug
......@@ -151,8 +151,7 @@ COMMULT (\\\*.*\*\/)
}
{CHAR} {
char caracter = (char) yytext;
yyFlag(yylval) = fCHAR;
sscanf(&yytext[1],"%c",&( yyChar(yylval) ));
return CHAR;
}
......
......@@ -21,6 +21,7 @@
int yylex(void);
extern int yylineno;
int yydebug=1;
FILE *fIn;
......@@ -149,11 +150,11 @@ cuerpo
$$.u.ast = NULL;
}
| '{' cuerpo sentencia ';' '}'
{
{+
$$.flag = fAST;
$$.u.ast = appR(';', $2.u.ast, $3.u.ast);
}
| '{' cuerpo ';' '}'
| '{' cuerpo '}'
{
$$ = $2;
}
......
print("abc");
//var a = 0.0;
print('j');
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment