diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1994-11-06 13:35:04 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 1994-11-06 13:35:04 -0200 |
commit | 0a5dce57044b782a211ce53896967b90fb81ce69 (patch) | |
tree | a9ac78e84f3c8717ecd744585b9c6c416e54e635 | |
parent | 8c22057b2ece906d3877363573db39e65de1b1b6 (diff) | |
download | lua-0a5dce57044b782a211ce53896967b90fb81ce69.tar.gz lua-0a5dce57044b782a211ce53896967b90fb81ce69.tar.bz2 lua-0a5dce57044b782a211ce53896967b90fb81ce69.zip |
new opcodes for '>' and '>='
-rw-r--r-- | lua.stx | 6 | ||||
-rw-r--r-- | opcode.h | 5 |
2 files changed, 7 insertions, 4 deletions
@@ -1,6 +1,6 @@ | |||
1 | %{ | 1 | %{ |
2 | 2 | ||
3 | char *rcs_luastx = "$Id: lua.stx,v 3.1 1994/11/02 20:30:53 roberto Exp $"; | 3 | char *rcs_luastx = "$Id: lua.stx,v 3.2 1994/11/03 22:32:42 roberto Exp $"; |
4 | 4 | ||
5 | #include <stdio.h> | 5 | #include <stdio.h> |
6 | #include <stdlib.h> | 6 | #include <stdlib.h> |
@@ -464,10 +464,10 @@ expr1 : expr { if ($1 == 0) code_byte(1); } | |||
464 | expr : '(' expr ')' { $$ = $2; } | 464 | expr : '(' expr ')' { $$ = $2; } |
465 | | expr1 EQ expr1 { code_byte(EQOP); $$ = 1; } | 465 | | expr1 EQ expr1 { code_byte(EQOP); $$ = 1; } |
466 | | expr1 '<' expr1 { code_byte(LTOP); $$ = 1; } | 466 | | expr1 '<' expr1 { code_byte(LTOP); $$ = 1; } |
467 | | expr1 '>' expr1 { code_byte(LEOP); code_byte(NOTOP); $$ = 1; } | 467 | | expr1 '>' expr1 { code_byte(GTOP); $$ = 1; } |
468 | | expr1 NE expr1 { code_byte(EQOP); code_byte(NOTOP); $$ = 1; } | 468 | | expr1 NE expr1 { code_byte(EQOP); code_byte(NOTOP); $$ = 1; } |
469 | | expr1 LE expr1 { code_byte(LEOP); $$ = 1; } | 469 | | expr1 LE expr1 { code_byte(LEOP); $$ = 1; } |
470 | | expr1 GE expr1 { code_byte(LTOP); code_byte(NOTOP); $$ = 1; } | 470 | | expr1 GE expr1 { code_byte(GEOP); $$ = 1; } |
471 | | expr1 '+' expr1 { code_byte(ADDOP); $$ = 1; } | 471 | | expr1 '+' expr1 { code_byte(ADDOP); $$ = 1; } |
472 | | expr1 '-' expr1 { code_byte(SUBOP); $$ = 1; } | 472 | | expr1 '-' expr1 { code_byte(SUBOP); $$ = 1; } |
473 | | expr1 '*' expr1 { code_byte(MULTOP); $$ = 1; } | 473 | | expr1 '*' expr1 { code_byte(MULTOP); $$ = 1; } |
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | ** TeCGraf - PUC-Rio | 2 | ** TeCGraf - PUC-Rio |
3 | ** $Id: opcode.h,v 3.1 1994/11/02 20:30:53 roberto Exp roberto $ | 3 | ** $Id: opcode.h,v 3.2 1994/11/04 10:47:49 roberto Exp $ |
4 | */ | 4 | */ |
5 | 5 | ||
6 | #ifndef opcode_h | 6 | #ifndef opcode_h |
@@ -74,6 +74,8 @@ typedef enum | |||
74 | EQOP, | 74 | EQOP, |
75 | LTOP, | 75 | LTOP, |
76 | LEOP, | 76 | LEOP, |
77 | GTOP, | ||
78 | GEOP, | ||
77 | ADDOP, | 79 | ADDOP, |
78 | SUBOP, | 80 | SUBOP, |
79 | MULTOP, | 81 | MULTOP, |
@@ -159,5 +161,6 @@ char *lua_lasttext (void); /* from "lex.c" module */ | |||
159 | int yylex (void); /* from "lex.c" module */ | 161 | int yylex (void); /* from "lex.c" module */ |
160 | Byte *lua_parse (void); /* from "lua.stx" module */ | 162 | Byte *lua_parse (void); /* from "lua.stx" module */ |
161 | void lua_travstack (void (*fn)(Object *)); | 163 | void lua_travstack (void (*fn)(Object *)); |
164 | void luaI_setfallback (void); | ||
162 | 165 | ||
163 | #endif | 166 | #endif |