commit 27ae8432b6125a56b0bb31651de8cebc1b30353f
parent 415ee250b5b544c91157a037a1e3c4a8f0b6cc4c
Author: Roberto Ierusalimschy <roberto@inf.puc-rio.br>
Date: Thu, 21 Dec 1995 14:13:45 -0200
names generated by yacc (starting with "yy") are changed to start with
"luaY_", to avoid name clashes with hosts using yacc.
Diffstat:
3 files changed, 20 insertions(+), 16 deletions(-)
diff --git a/lex.c b/lex.c
@@ -1,10 +1,9 @@
-char *rcs_lex = "$Id: lex.c,v 2.20 1995/10/25 13:05:51 roberto Exp roberto $";
+char *rcs_lex = "$Id: lex.c,v 2.21 1995/11/16 20:46:24 roberto Exp roberto $";
#include <ctype.h>
-#include <stdio.h>
-#include <stdlib.h>
#include <string.h>
+#include <stdio.h>
#include "mem.h"
#include "tree.h"
@@ -144,7 +143,7 @@ static int read_long_string (void)
}
-int yylex (void)
+int luaY_lex (void)
{
float a;
static int linelasttoken = 0;
@@ -176,12 +175,12 @@ int yylex (void)
*yytextLast = 0;
if (lua_strcmp(yytext, "debug") == 0)
{
- yylval.vInt = 1;
+ luaY_lval.vInt = 1;
return DEBUG;
}
else if (lua_strcmp(yytext, "nodebug") == 0)
{
- yylval.vInt = 0;
+ luaY_lval.vInt = 0;
return DEBUG;
}
return WRONGTOKEN;
@@ -203,7 +202,7 @@ int yylex (void)
return WRONGTOKEN;
save_and_next(); /* pass the second ']' */
*(yytextLast-2) = 0; /* erases ']]' */
- yylval.vWord = luaI_findconstantbyname(yytext+2);
+ luaY_lval.vWord = luaI_findconstantbyname(yytext+2);
return STRING;
}
@@ -263,7 +262,7 @@ int yylex (void)
}
next(); /* skip the delimiter */
*yytextLast = 0;
- yylval.vWord = luaI_findconstantbyname(yytext);
+ luaY_lval.vWord = luaI_findconstantbyname(yytext);
return STRING;
}
@@ -286,7 +285,7 @@ int yylex (void)
*yytextLast = 0;
res = findReserved(yytext);
if (res) return res;
- yylval.pNode = lua_constcreate(yytext);
+ luaY_lval.pNode = lua_constcreate(yytext);
return NAME;
}
@@ -327,7 +326,7 @@ fraction:
ea*=ea;
}
}
- yylval.vFloat = a;
+ luaY_lval.vFloat = a;
return NUMBER;
}
diff --git a/makefile b/makefile
@@ -1,4 +1,4 @@
-# $Id: makefile,v 1.15 1995/10/17 18:16:58 roberto Exp roberto $
+# $Id: makefile,v 1.16 1995/11/10 17:56:06 roberto Exp roberto $
#configuration
@@ -47,14 +47,19 @@ lualib.a : $(LIBOBJS)
liblua.so.1.0 : lua.o
ld -o liblua.so.1.0 $(LUAOBJS)
+y.tab.c y.tab.h : lua.stx
+ yacc++ -d lua.stx
-parser.c : lua.stx
- yacc++ -d lua.stx ; mv -f y.tab.c parser.c ; mv -f y.tab.h parser.h
+parser.c : y.tab.c
+ sed -e 's/yy/luaY_/g' y.tab.c > parser.c
+
+parser.h : y.tab.h
+ sed -e 's/yy/luaY_/g' y.tab.h > parser.h
clear :
rcsclean
rm -f *.o
- rm -f parser.c parser.h
+ rm -f parser.c parser.h y.tab.c y.tab.h
co lua.h lualib.h luadebug.h
% : RCS/%,v
diff --git a/opcode.h b/opcode.h
@@ -1,6 +1,6 @@
/*
** TeCGraf - PUC-Rio
-** $Id: opcode.h,v 3.13 1995/10/17 11:58:41 roberto Exp roberto $
+** $Id: opcode.h,v 3.14 1995/10/25 13:05:51 roberto Exp roberto $
*/
#ifndef opcode_h
@@ -146,7 +146,7 @@ char *lua_strdup (char *l);
void lua_setinput (Input fn); /* from "lex.c" module */
char *lua_lasttext (void); /* from "lex.c" module */
-int yylex (void); /* from "lex.c" module */
+int luaY_lex (void); /* from "lex.c" module */
void lua_parse (TFunc *tf); /* from "lua.stx" module */
void luaI_codedebugline (int line); /* from "lua.stx" module */
void lua_travstack (int (*fn)(Object *));