cvs: ZendEngine2 / zend_compile.c zend_compile.h zend_language_parser.y

From: Date: Sat, 21 Jun 2003 21:56:06 +0000
Subject: cvs: ZendEngine2 / zend_compile.c zend_compile.h zend_language_parser.y
Groups: php.zend-engine.cvs 
Request: Send a blank email to php-zend-engine-cvs+get-1390@lists.php.net to get a copy of this message
helly Sat Jun 21 17:56:06 2003 EDT Modified files: /ZendEngine2 zend_language_parser.y zend_compile.h zend_compile.c Log: Add final classes Index: ZendEngine2/zend_language_parser.y diff -u ZendEngine2/zend_language_parser.y:1.119 ZendEngine2/zend_language_parser.y:1.120 --- ZendEngine2/zend_language_parser.y:1.119 Sun Jun 15 09:58:50 2003 +++ ZendEngine2/zend_language_parser.y Sat Jun 21 17:56:06 2003 @@ -18,7 +18,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_language_parser.y,v 1.119 2003/06/15 13:58:50 stas Exp $ */ +/* $Id: zend_language_parser.y,v 1.120 2003/06/21 21:56:06 helly Exp $ */ /* * LALR shift/reduce conflicts and how they are resolved: @@ -277,6 +277,7 @@ class_entry_type: T_CLASS { $$.u.constant.value.lval = 0; } | T_ABSTRACT T_CLASS { $$.u.constant.value.lval = ZEND_ACC_ABSTRACT_CLASS; } + | T_FINAL T_CLASS { $$.u.constant.value.lval = ZEND_ACC_FINAL_CLASS; } | T_INTERFACE { $$.u.constant.value.lval = ZEND_ACC_INTERFACE; } ; Index: ZendEngine2/zend_compile.h diff -u ZendEngine2/zend_compile.h:1.243 ZendEngine2/zend_compile.h:1.244 --- ZendEngine2/zend_compile.h:1.243 Tue Jun 10 16:03:24 2003 +++ ZendEngine2/zend_compile.h Sat Jun 21 17:56:06 2003 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_compile.h,v 1.243 2003/06/10 20:03:24 imajes Exp $ */ +/* $Id: zend_compile.h,v 1.244 2003/06/21 21:56:06 helly Exp $ */ #ifndef ZEND_COMPILE_H #define ZEND_COMPILE_H @@ -99,6 +99,7 @@ #define ZEND_ACC_FINAL 0x04 #define ZEND_ACC_INTERFACE 0x08 #define ZEND_ACC_ABSTRACT_CLASS 0x10 +#define ZEND_ACC_FINAL_CLASS 0x20 /* The order of those must be kept - public < protected < private */ #define ZEND_ACC_PUBLIC 0x100 Index: ZendEngine2/zend_compile.c diff -u ZendEngine2/zend_compile.c:1.428 ZendEngine2/zend_compile.c:1.429 --- ZendEngine2/zend_compile.c:1.428 Sun Jun 15 09:58:50 2003 +++ ZendEngine2/zend_compile.c Sat Jun 21 17:56:06 2003 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_compile.c,v 1.428 2003/06/15 13:58:50 stas Exp $ */ +/* $Id: zend_compile.c,v 1.429 2003/06/21 21:56:06 helly Exp $ */ #include "zend_language_parser.h" #include "zend.h" @@ -1833,6 +1833,9 @@ if ((ce->ce_flags & ZEND_ACC_INTERFACE) && !(parent_ce->ce_flags & ZEND_ACC_INTERFACE)) { zend_error(E_ERROR, "Interface %s may not inherit from class (%s)", ce->name, parent_ce->name); + } + if (parent_ce->ce_flags & ZEND_ACC_FINAL_CLASS) { + zend_error(E_ERROR, "Class %s may not inherit from final class (%s)", ce->name, parent_ce->name); } ce->parent = parent_ce;

« previous php.zend-engine.cvs (#1390) next »