Skip to content
Snippets Groups Projects
Commit 1134937e authored by mandeca's avatar mandeca :speech_balloon:
Browse files

Makefile

parent 10f58acf
Branches
No related tags found
No related merge requests found
Dusan/_mk 100644 → 100755
File mode changed from 100644 to 100755
This diff is collapsed.
/* A Bison parser, made by GNU Bison 3.0.4. */
/* Bison interface for Yacc-like parsers in C
Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work
under terms of your choice, so long as that work isn't itself a
parser generator using the skeleton or a modified version thereof
as a parser skeleton. Alternatively, if you modify or redistribute
the parser skeleton itself, you may (at your option) remove this
special exception, which will cause the skeleton and the resulting
Bison output files to be licensed under the GNU General Public
License without this special exception.
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */
#ifndef YY_YY_INTER05_H_INCLUDED
# define YY_YY_INTER05_H_INCLUDED
/* Debug traces. */
#ifndef YYDEBUG
# define YYDEBUG 0
#endif
#if YYDEBUG
extern int yydebug;
#endif
/* Token type. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
enum yytokentype
{
OR = 258,
AND = 259,
EQ = 260,
NE = 261,
LE = 262,
GE = 263,
UNOP = 264,
IDENT = 265,
LET = 266,
PRINT = 267,
SIN = 268,
COS = 269,
TAN = 270,
READ = 271,
FLOAT = 272,
STR = 273
};
#endif
/* Value type. */
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
union YYSTYPE
{
#line 32 "inter05.y" /* yacc.c:1909 */
struct sStackType {
/* Flag: identificador del tipo */
unsigned char flag;
/* Unión con el valor del tipo correspondiente */
union {
double vFloat;
char *vStr;
struct ast_s *ast;
} u;
} s; /* Identificador del único campo de yylval **/
#line 86 "inter05.h" /* yacc.c:1909 */
};
typedef union YYSTYPE YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define YYSTYPE_IS_DECLARED 1
#endif
extern YYSTYPE yylval;
int yyparse (void);
#endif /* !YY_YY_INTER05_H_INCLUDED */
......@@ -69,9 +69,9 @@ STRSTART (["]) /* Comienzo de cadena de caracteres: comillas dobles " /**/
%%
{WSPC} ; /* nothing to do, white space */
WSPC ; /* nothing to do, white space */
{IDENT} {
IDENT {
unsigned i = 0;
int r=-1;
char *res;
......@@ -91,13 +91,13 @@ STRSTART (["]) /* Comienzo de cadena de caracteres: comillas dobles " /**/
return IDENT; /* Se devuelve que se ha leído un identificador */
}
{COMSEP} {
COMSEP {
/* Salto de línea: se aumenta el número de línea */
++yylineno; /* yylineno se define aquí (en este fichero) */
return yytext[0]; /* Se devuelve el salto de línea */
}
{DIGITS} {
DIGITS {
/* Se lee el número entero */
long int li;
sscanf(yytext,"%ld",&li);
......@@ -108,7 +108,7 @@ STRSTART (["]) /* Comienzo de cadena de caracteres: comillas dobles " /**/
return FLOAT;
}
{FLOAT} {
FLOAT {
/* Se lee el número decimal */
sscanf(yytext,"%lf",&( yyFloat(yylval) ));
yyFlag(yylval) = fFLOAT;
......@@ -116,7 +116,7 @@ STRSTART (["]) /* Comienzo de cadena de caracteres: comillas dobles " /**/
return FLOAT;
}
{STRSTART} {
STRSTART {
/* Se lee la String */
yyStr(yylval) = readStr();
yyFlag(yylval) = fSTR;
......@@ -124,9 +124,9 @@ STRSTART (["]) /* Comienzo de cadena de caracteres: comillas dobles " /**/
return STR;
}
{OP1} return yytext[0]; /* Se lee el operador aritmético */
OP1 return yytext[0]; /* Se lee el operador aritmético */
{OP2} {
OP2 {
switch (yytext[0]) { /* Se lee el operador lógico */
case '=':
return EQ;
......
This diff is collapsed.
This diff is collapsed.
File added
Makefile 0 → 100644
LIBS=-lm
LEXICAL=lex ac.lex.c
LEX_DEP=ac.l ac.syn.h
SYNTAX=syn ac.syn.c ac.syn.h
SYN_DEP=ac.y
ac: ac.lex.c ac.syn.c
gcc -O3 -o $@ $? symtab.c ast.c $(LIBS)
lex: $(LEX_DEP)
ac.lex.c: $(LEX_DEP)
syn: $(SYN_DEP)
ac.syn.c: $(SYN_DEP)
$(LEXICAL):
lex -o $@ $?
$(SYNTAX):
yacc --defines -o $@ $?
clean:
rm ac ac.lex.c ac.syn.c
......@@ -9,7 +9,10 @@
#include <stdlib.h>
#include <string.h>
#define KWORDSN = 10
#include "autils.h"
#include "ac.syn.h"
#define KWORDSN 10
char *keyWords[KWORDSN] = {
"read"
......@@ -40,6 +43,9 @@ int yywrap(void) { return 1; }
extern char programName[];
static char *readStr();
static void addStr(char **s, unsigned long *len, char c);
%}
/*Letras del alfabeto, minusculas y mayusculas*/
......@@ -81,8 +87,14 @@ COMM ("/*"[.|"\n"]*"*/")
%%
(WSPC | LINE_COMM | COMM) ;
WSPC|LINE_COMM ;
COMM { /*Cuenta las líneas que ocupa el comentario*/
for (int i = 0; i < strlen(yytext); i++)
{
if (yytext[0] == '\n') yylineno++;
}
}
ID {
unsigned i = 0;
......@@ -102,14 +114,14 @@ ID {
return ID;
}
SEPAR { /*Salto de linea*/
++lineNum;
"\n" { /*Salto de linea*/
++yylineno;
return yytext[0];
}
NUMBER { /*Se lee el numero entero y se castea a double*/
long int li;
sscanf(yytext, "%d", &li);
sscanf(yytext, "%ld", &li);
yylval.s.u.real_value = (double)li;
yylval.s.type = REAL_id;
......@@ -149,7 +161,7 @@ OP_LOG {
}
. {
fprintf(stderr, "%s(%d): error -- Caracter inesperado %c\n", programName, lineNum, yytext[0]);
fprintf(stderr, "%s(%d): error -- Caracter inesperado %c\n", programName, yylineno, yytext[0]);
}
%%
......@@ -161,7 +173,7 @@ static void addStr(char **s, unsigned long *len, char c)
buf[1] = '\0';
if (strlen(*s) >= *len) {
char ss[len + 1025];
char *ss = (char *)malloc(sizeof(char) * (*len + 1025));
strcpy(ss, *s);
*s = ss;
*len += 1024;
......@@ -170,10 +182,10 @@ static void addStr(char **s, unsigned long *len, char c)
}
static char *readStr(void)
static char *readStr()
{
int c;
char buff[257];
char *buff = (char *)malloc(sizeof(char) * 257);
unsigned long len = 256;
buff[0] = '\0';
......@@ -181,7 +193,7 @@ static char *readStr(void)
do {
c == input();
if (c < ' ')
fprintf(stderr, "%s(%d): error -- Simbolo no esperado en cadena de caracteres: %c\n", programName, lineNum, c);
fprintf(stderr, "%s(%d): error -- Simbolo no esperado en cadena de caracteres: %c\n", programName, yylineno, c);
if (c == '"') break;
if (c == '\\')
{
......
ac.syn.c 0 → 100644
This diff is collapsed.
ac.syn.h 0 → 100644
/* A Bison parser, made by GNU Bison 3.0.4. */
/* Bison interface for Yacc-like parsers in C
Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work
under terms of your choice, so long as that work isn't itself a
parser generator using the skeleton or a modified version thereof
as a parser skeleton. Alternatively, if you modify or redistribute
the parser skeleton itself, you may (at your option) remove this
special exception, which will cause the skeleton and the resulting
Bison output files to be licensed under the GNU General Public
License without this special exception.
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */
#ifndef YY_YY_AC_SYN_H_INCLUDED
# define YY_YY_AC_SYN_H_INCLUDED
/* Debug traces. */
#ifndef YYDEBUG
# define YYDEBUG 0
#endif
#if YYDEBUG
extern int yydebug;
#endif
/* Token type. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
enum yytokentype
{
EQ = 258,
NE = 259,
LT = 260,
GT = 261,
DIV = 262,
UNARY = 263,
ID = 264,
PRINT = 265,
READ = 266,
SIN = 267,
COS = 268,
TAN = 269,
LN = 270,
FLOAT = 271,
STR = 272,
WHILE = 273,
IF = 274,
ELSE = 275,
DEL_BL_A = 276,
DEL_BL_C = 277
};
#endif
/* Tokens. */
#define EQ 258
#define NE 259
#define LT 260
#define GT 261
#define DIV 262
#define UNARY 263
#define ID 264
#define PRINT 265
#define READ 266
#define SIN 267
#define COS 268
#define TAN 269
#define LN 270
#define FLOAT 271
#define STR 272
#define WHILE 273
#define IF 274
#define ELSE 275
#define DEL_BL_A 276
#define DEL_BL_C 277
/* Value type. */
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
union YYSTYPE
{
#line 25 "ac.y" /* yacc.c:1909 */
struct syn_elem {
unsigned char type; /* Tipo de token */
union { /* Valor útil del token */
double real_value; /* Como número real */
long int_value; /* Como número entero */
char *string; /* Como cadena de caracteres */
struct ast_t *node;
} u;
} s;
#line 110 "ac.syn.h" /* yacc.c:1909 */
};
typedef union YYSTYPE YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define YYSTYPE_IS_DECLARED 1
#endif
extern YYSTYPE yylval;
int yyparse (void);
#endif /* !YY_YY_AC_SYN_H_INCLUDED */
......@@ -10,10 +10,11 @@
#include <stdlib.h>
#include <string.h>
#include "ast.c"
#include "autils.h"
#include "ast.c"
#include "ac.syn.h"
extern int lineNum;
extern int yylineno;
/* Árbol de sintaxis */
static ast_t ast = NULL;
......@@ -28,7 +29,7 @@ static ast_t ast = NULL;
double real_value; /* Como número real */
long int_value; /* Como número entero */
char *string; /* Como cadena de caracteres */
struct ast_s *node;
struct ast_t *node;
} u;
} s;
}
......@@ -45,9 +46,9 @@ static ast_t ast = NULL;
%term PRINT READ SIN COS TAN LN
%token <S> FLOAT
%token <s> STR
%term WHILE IF ELSE
%term WHILE IF ELSE DEL_BL_A DEL_BL_C
%type <s> PROGRAM PROGRAM_ELEMENT SENTENCE EXPR BLOCK
%type <s> PROGRAM BLOCK SENTENCE_GROUP SENTENCE EXPR
%%
......@@ -93,7 +94,7 @@ SENTENCE_GROUP
$$ = $1;
}
/* Grupo de sentencias y una sentencia (recursivo) */
| SENTENCE_GROUP SENTECE '\n'
| SENTENCE_GROUP SENTENCE '\n'
{
$$.type = AST_NODE_id;
$$.U.node = newNode('s', NULL, $2.u.node);
......@@ -264,7 +265,7 @@ char programName[256] = "";
/* Gestión de errores */
int yyerror(char *str)
{
printf("%s(%d): error -- %s\n", programName, lineNum, str);
printf("%s(%d): error -- %s\n", programName, yylineno, str);
return 1;
}
......
......@@ -12,13 +12,13 @@
#include <stdlib.h>
#include <stdio.h>
extern int lineNum;
extern int yylineno;
extern char programName[];
ast_t *newLeafString(unsigned tag, char *str)
{
mallocCheck(ast_t *res, sizeof(ast_t));
res->lineN = (unsigned)lineNum;
res->lineNum = (unsigned)yylineno;
res->tag = tag;
res->u.str = str;
return res;
......@@ -28,7 +28,7 @@ ast_t *newLeafString(unsigned tag, char *str)
ast_t *newLeafNum(unsigned tag, double dval)
{
mallocCheck(ast_t *res, sizeof(ast_t));
res->lineN = (unsigned)lineNum;
res->lineNum = (unsigned)yylineno;
res->tag = tag;
res->u.real = dval;
return res;
......@@ -37,7 +37,7 @@ ast_t *newLeafNum(unsigned tag, double dval)
ast_t *newNode(unsigned tag, ast_t *l, ast_t *r)
{
mallocCheck(ast_t *res, sizeof(ast_t));
res->lineN = (unsigned)lineNum;
res->lineNum = (unsigned)yylineno;
res->tag = tag;
res->u.child.left = l;
res->u.child.right = r;
......
......@@ -10,10 +10,10 @@
/* Tipo "nodo del ast" */
typedef struct ast_s {
unsigned tag;
unsigned lineN;
unsigned lineNum;
union {
struct {
ast_s *left, *right;
ast_t *left, *right;
} child;
char *str;
double real;
......
err 0 → 100644
ac.syn.h:33: bad character: #
ac.syn.h:33: unknown error processing section 1
ac.syn.h:33: unknown error processing section 1
ac.syn.h:33: unknown error processing section 1
ac.syn.h:34: bad character: #
ac.syn.h:34: unknown error processing section 1
ac.syn.h:34: unknown error processing section 1
ac.syn.h:36: bad character: #
ac.syn.h:36: unknown error processing section 1
ac.syn.h:36: unknown error processing section 1
ac.syn.h:37: bad character: #
ac.syn.h:37: unknown error processing section 1
ac.syn.h:37: unknown error processing section 1
ac.syn.h:37: bad character: 0
ac.syn.h:38: bad character: #
ac.syn.h:38: unknown error processing section 1
ac.syn.h:39: bad character: #
ac.syn.h:39: unknown error processing section 1
ac.syn.h:39: unknown error processing section 1
ac.syn.h:41: bad character: #
ac.syn.h:41: unknown error processing section 1
ac.syn.h:44: bad character: #
ac.syn.h:44: unknown error processing section 1
ac.syn.h:44: unknown error processing section 1
ac.syn.h:45: bad character: #
ac.syn.h:45: unknown error processing section 1
ac.syn.h:45: unknown error processing section 1
ac.syn.h:70: bad character: #
ac.syn.h:70: unknown error processing section 1
ac.syn.h:72: bad character: #
ac.syn.h:72: unknown error processing section 1
ac.syn.h:72: unknown error processing section 1
ac.syn.h:72: bad character: 2
ac.syn.h:72: bad character: 5
ac.syn.h:72: bad character: 8
ac.syn.h:73: bad character: #
ac.syn.h:73: unknown error processing section 1
ac.syn.h:73: unknown error processing section 1
ac.syn.h:73: bad character: 2
ac.syn.h:73: bad character: 5
ac.syn.h:73: bad character: 9
ac.syn.h:74: bad character: #
ac.syn.h:74: unknown error processing section 1
ac.syn.h:74: unknown error processing section 1
ac.syn.h:74: bad character: 2
ac.syn.h:74: bad character: 6
ac.syn.h:74: bad character: 0
ac.syn.h:75: bad character: #
ac.syn.h:75: unknown error processing section 1
ac.syn.h:75: unknown error processing section 1
ac.syn.h:75: bad character: 2
ac.syn.h:75: bad character: 6
ac.syn.h:75: bad character: 1
ac.syn.h:76: bad character: #
ac.syn.h:76: unknown error processing section 1
ac.syn.h:76: unknown error processing section 1
ac.syn.h:76: bad character: 2
ac.syn.h:76: bad character: 6
ac.syn.h:76: bad character: 2
ac.syn.h:77: bad character: #
ac.syn.h:77: unknown error processing section 1
ac.syn.h:77: unknown error processing section 1
ac.syn.h:77: bad character: 2
ac.syn.h:77: bad character: 6
ac.syn.h:77: bad character: 3
ac.syn.h:78: bad character: #
ac.syn.h:78: unknown error processing section 1
ac.syn.h:78: unknown error processing section 1
ac.syn.h:78: bad character: 2
ac.syn.h:78: bad character: 6
ac.syn.h:78: bad character: 4
ac.syn.h:79: bad character: #
ac.syn.h:79: unknown error processing section 1
ac.syn.h:79: unknown error processing section 1
ac.syn.h:79: bad character: 2
ac.syn.h:79: bad character: 6
ac.syn.h:79: bad character: 5
ac.syn.h:80: bad character: #
ac.syn.h:80: unknown error processing section 1
ac.syn.h:80: unknown error processing section 1
ac.syn.h:80: bad character: 2
ac.syn.h:80: bad character: 6
ac.syn.h:80: bad character: 6
ac.syn.h:81: bad character: #
ac.syn.h:81: unknown error processing section 1
ac.syn.h:81: unknown error processing section 1
ac.syn.h:81: bad character: 2
ac.syn.h:81: bad character: 6
ac.syn.h:81: bad character: 7
ac.syn.h:82: bad character: #
ac.syn.h:82: unknown error processing section 1
ac.syn.h:82: unknown error processing section 1
ac.syn.h:82: bad character: 2
ac.syn.h:82: bad character: 6
ac.syn.h:82: bad character: 8
ac.syn.h:83: bad character: #
ac.syn.h:83: unknown error processing section 1
ac.syn.h:83: unknown error processing section 1
ac.syn.h:83: bad character: 2
ac.syn.h:83: bad character: 6
ac.syn.h:83: bad character: 9
ac.syn.h:84: bad character: #
ac.syn.h:84: unknown error processing section 1
ac.syn.h:84: unknown error processing section 1
ac.syn.h:84: bad character: 2
ac.syn.h:84: bad character: 7
ac.syn.h:84: bad character: 0
ac.syn.h:85: bad character: #
ac.syn.h:85: unknown error processing section 1
ac.syn.h:85: unknown error processing section 1
ac.syn.h:85: bad character: 2
ac.syn.h:85: bad character: 7
ac.syn.h:85: bad character: 1
ac.syn.h:86: bad character: #
ac.syn.h:86: unknown error processing section 1
ac.syn.h:86: unknown error processing section 1
ac.syn.h:86: bad character: 2
ac.syn.h:86: bad character: 7
ac.syn.h:86: bad character: 2
ac.syn.h:87: bad character: #
ac.syn.h:87: unknown error processing section 1
ac.syn.h:87: unknown error processing section 1
ac.syn.h:87: bad character: 2
ac.syn.h:87: bad character: 7
ac.syn.h:87: bad character: 3
ac.syn.h:88: bad character: #
ac.syn.h:88: unknown error processing section 1
ac.syn.h:88: unknown error processing section 1
ac.syn.h:88: bad character: 2
ac.syn.h:88: bad character: 7
ac.syn.h:88: bad character: 4
ac.syn.h:89: bad character: #
ac.syn.h:89: unknown error processing section 1
ac.syn.h:89: unknown error processing section 1
ac.syn.h:89: bad character: 2
ac.syn.h:89: bad character: 7
ac.syn.h:89: bad character: 5
ac.syn.h:90: bad character: #
ac.syn.h:90: unknown error processing section 1
ac.syn.h:90: unknown error processing section 1
ac.syn.h:90: bad character: 2
ac.syn.h:90: bad character: 7
ac.syn.h:90: bad character: 6
ac.syn.h:91: bad character: #
ac.syn.h:91: unknown error processing section 1
ac.syn.h:91: unknown error processing section 1
ac.syn.h:91: bad character: 2
ac.syn.h:91: bad character: 7
ac.syn.h:91: bad character: 7
ac.syn.h:94: bad character: #
ac.syn.h:94: unknown error processing section 1
ac.syn.h:94: bad character: !
ac.syn.h:94: unknown error processing section 1
ac.syn.h:94: unknown error processing section 1
ac.syn.h:94: bad character: &
ac.syn.h:94: bad character: &
ac.syn.h:94: bad character: !
ac.syn.h:94: unknown error processing section 1
ac.syn.h:94: unknown error processing section 1
ac.syn.h:97: bad character: {
ac.syn.h:1909: bad character: }
ac.syn.h:1909: bad character: ;
ac.syn.h:1912: bad character: #
ac.syn.h:1912: unknown error processing section 1
ac.syn.h:1912: unknown error processing section 1
ac.syn.h:1912: bad character: 1
ac.syn.h:1913: bad character: #
ac.syn.h:1913: unknown error processing section 1
ac.syn.h:1913: unknown error processing section 1
ac.syn.h:1913: bad character: 1
ac.syn.h:1914: bad character: #
ac.syn.h:1914: unknown error processing section 1
ac.syn.h:1917: name defined twice
ac.syn.h:1921: bad character: #
ac.syn.h:1921: unknown error processing section 1
ac.syn.h:1921: bad character: /
ac.syn.h:1921: bad character: *
ac.syn.h:1921: bad character: !
ac.syn.h:1921: unknown error processing section 1
ac.syn.h:1921: bad character: *
ac.syn.h:1921: bad character: /
ac.syn.h:1922: premature EOF
make: *** [ac.lex.c] Error 1
lex 0 → 100644
This diff is collapsed.
......@@ -8,16 +8,16 @@
* TABLA DE SÍMBOLOS PARA EL INTÉRPRETE
*
*/
#include "symtab.h"
#include "autils.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <stdbool.h>
extern int lineNum;
#include "symtab.h"
#include "autils.h"
extern int yylineno;
extern char programName[];
static int size = 256; /* Tamaño de la tabla */
......@@ -121,7 +121,7 @@ symbol get(char *id)
int index = pos(id);
if (index == SYMTAB_NOT_FOUND)
{
fprintf(stderr, "%s(%d) error -- identificador no encotrado: %s\n", programName, lineNum, id);
fprintf(stderr, "%s(%d) error -- identificador no encotrado: %s\n", programName, yylineno, id);
exit(SYMTAB_NOT_FOUND);
}
return symTab[index].value;
......
syn 0 → 100644
This diff is collapsed.
syn.h 0 → 100644
/* A Bison parser, made by GNU Bison 3.0.4. */
/* Bison interface for Yacc-like parsers in C
Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work
under terms of your choice, so long as that work isn't itself a
parser generator using the skeleton or a modified version thereof
as a parser skeleton. Alternatively, if you modify or redistribute
the parser skeleton itself, you may (at your option) remove this
special exception, which will cause the skeleton and the resulting
Bison output files to be licensed under the GNU General Public
License without this special exception.
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */
#ifndef YY_YY_SYN_H_INCLUDED
# define YY_YY_SYN_H_INCLUDED
/* Debug traces. */
#ifndef YYDEBUG
# define YYDEBUG 0
#endif
#if YYDEBUG
extern int yydebug;
#endif
/* Token type. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
enum yytokentype
{
EQ = 258,
NE = 259,
LT = 260,
GT = 261,
DIV = 262,
UNARY = 263,
ID = 264,
PRINT = 265,
READ = 266,
SIN = 267,
COS = 268,
TAN = 269,
LN = 270,
FLOAT = 271,
STR = 272,
WHILE = 273,
IF = 274,
ELSE = 275,
DEL_BL_A = 276,
DEL_BL_C = 277
};
#endif
/* Tokens. */
#define EQ 258
#define NE 259
#define LT 260
#define GT 261
#define DIV 262
#define UNARY 263
#define ID 264
#define PRINT 265
#define READ 266
#define SIN 267
#define COS 268
#define TAN 269
#define LN 270
#define FLOAT 271
#define STR 272
#define WHILE 273
#define IF 274
#define ELSE 275
#define DEL_BL_A 276
#define DEL_BL_C 277
/* Value type. */
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
union YYSTYPE
{
#line 24 "ac.y" /* yacc.c:1909 */
struct syn_elem {
unsigned char type; /* Tipo de token */
union { /* Valor útil del token */
double real_value; /* Como número real */
long int_value; /* Como número entero */
char *string; /* Como cadena de caracteres */
struct ast_s *node;
} u;
} s;
#line 110 "syn.h" /* yacc.c:1909 */
};
typedef union YYSTYPE YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define YYSTYPE_IS_DECLARED 1
#endif
extern YYSTYPE yylval;
int yyparse (void);
#endif /* !YY_YY_SYN_H_INCLUDED */
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment