Hi Andi,
i did the next step and changed is_static to fn_flags and added the now
possible plausibility checks. Then i added the function scopes and rewrote
some of the error messages to now contain class or scope names.
Also i corrected your abstract patch. You referenced $1 for is_static
parameter
in the zend_do_begin_function_declaration() call. But that came from terminal
is_static which isn't used for abstract methods. The patch below is an
alternate
version where static member functions can be abstract.
You can download the patch here (14 kB):
http://marcus-boerger.de/php/ext/ze2/ze2-fn-flags.diff.txt
This patch got bigger than i wanted but the next steps will be very small i
hope now.
I also updated the full thing of *my* idea (21 kB):
http://marcus-boerger.de/php/ext/ze2/ze2-f3p.diff.txt
regards
marcus
Index: Zend/zend_language_parser.y
===================================================================
RCS file: /repository/ZendEngine2/zend_language_parser.y,v
retrieving revision 1.77
diff -u -r1.77 zend_language_parser.y
--- Zend/zend_language_parser.y 20 Nov 2002 18:00:23 -0000 1.77
+++ Zend/zend_language_parser.y 23 Nov 2002 18:21:25 -0000
@@ -442,12 +442,12 @@
| is_static T_FUNCTION { $2.u.opline_num = CG(zend_lineno); }
is_reference T_STRING { zend_do_begin_function_declaration(&$2, &$5, 1,
$4.op_type, $1.u.constant.value.lval TSRMLS_CC); } '('
parameter_list ')' '{' inner_statement_list '}' {
zend_do_end_function_declaration(&$2 TSRMLS_CC); }
| T_CLASS T_STRING extends_from '{' {
zend_do_begin_class_declaration(&$1, &$2, &$3 TSRMLS_CC); }
class_statement_list '}' { zend_do_end_class_declaration(&$1 TSRMLS_CC); }
- | T_ABSTRACT T_FUNCTION { $2.u.opline_num = CG(zend_lineno); }
is_reference T_STRING { zend_do_begin_function_declaration(&$2, &$5, 1,
$4.op_type, $1.u.constant.value.lval TSRMLS_CC); } '('
+ | T_ABSTRACT T_FUNCTION { $2.u.opline_num = CG(zend_lineno); }
is_reference T_STRING { zend_do_begin_function_declaration(&$2, &$5, 1,
$4.op_type, FN_ABSTRACT TSRMLS_CC); } '('
parameter_list ')' { zend_do_abstract_method(TSRMLS_C);
zend_do_end_function_declaration(&$2 TSRMLS_CC); }
;
is_static:
- T_STATIC { $$.u.constant.value.lval = 1; }
+ T_STATIC { $$.u.constant.value.lval = FN_IS_STATIC; }
| /* empty */ { $$.u.constant.value.lval = 0; }
;
--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php