cvs: functable / funcimp.awk funcparse.awk
| From: | Rasmus Lerdorf | Date: | Tue, 07 Mar 2006 09:54:56 +0000 |
| Subject: | cvs: functable / funcimp.awk funcparse.awk | ||
| Groups: | php.doc.web | ||
| Request: | Send a blank email to doc-web+get-866@lists.php.net to get a copy of this message | ||
rasmus Tue Mar 7 09:54:56 2006 UTC
Modified files:
/functable funcparse.awk funcimp.awk
Log:
A bit more OO support here. Still a ways to go. The SPL stuff is
obfuscated.
http://cvs.php.net/viewcvs.cgi/functable/funcparse.awk?r1=1.3&r2=1.4&diff_format=u
Index: functable/funcparse.awk
diff -u functable/funcparse.awk:1.3 functable/funcparse.awk:1.4
--- functable/funcparse.awk:1.3 Fri Dec 15 11:34:28 2000
+++ functable/funcparse.awk Tue Mar 7 09:54:55 2006
@@ -1,3 +1,6 @@
+function ltrim(s) { sub(/^ */, "", s); return s }
+function rtrim(s) { sub(/ *$/, "", s); return s }
+function trim(s) { return rtrim(ltrim(s)); }
BEGIN { parse=0; FS="[\"(,]"; }
/^.*function_entry.*$/ { parse=1; }
/^.*function_entry.*_class_functions.*$/ { parse=0; }
@@ -16,6 +19,7 @@
/^[[:space:]]*PHP_NAMED_FE/ { if(parse) { print
"'"$2"','F',null,"NR; } }
/^[[:space:]]*PHP_STATIC_FE/ { if(parse) { print
"'"$3"','F',null,"NR; } }
/^[[:space:]]*ZEND_FE/ { if(parse) { print
"'"$2"','F',null,"NR; } }
+/^[[:space:]]*ZEND_ME/ { if(parse) { print
"'"$2"::"trim($3)"','F',null,"NR; } }
/^[[:space:]]*ZEND_FALIAS/ { if(parse) { print
"'"$2"','A','"$3"',"NR; } }
/^[[:space:]]*ZEND_NAMED_FE/ { if(parse) { print
"'"$2"','F',null,"NR; } }
/^[[:space:]]*cybercash_functions/ { if (parse) { print
"'"$2"','F',null,"NR; } }
http://cvs.php.net/viewcvs.cgi/functable/funcimp.awk?r1=1.3&r2=1.4&diff_format=u
Index: functable/funcimp.awk
diff -u functable/funcimp.awk:1.3 functable/funcimp.awk:1.4
--- functable/funcimp.awk:1.3 Tue Mar 7 01:31:12 2006
+++ functable/funcimp.awk Tue Mar 7 09:54:55 2006
@@ -1,7 +1,16 @@
+function ltrim(s) { sub(/^ */, "", s); return s }
+function rtrim(s) { sub(/ *$/, "", s); return s }
+function trim(s) { return rtrim(ltrim(s)); }
BEGIN { FS="[\")(,]"; }
/^[[:space:]]*PHP_FUNCTION/ { print "INSERT INTO funcimp SET
function='"$2"',version='-v-',file='-f-',lineno="NR";";
}
/^[[:space:]]*ZEND_FUNCTION/ { print "INSERT INTO funcimp SET
function='"$2"',version='-v-',file='-f-',lineno="NR";";
}
/^[[:space:]]*ZEND_METHOD/ {
- class_name = sprintf("%s%s::%s",toupper(substr($2,1,1)),substr($2,2,length($2)-1),$3);
+ n = split(substr($2,2,length($2)-1), rem, "_");
+ if(n) cn = rem[1];
+ else cn = substr($2,2,length($2)-1);
+ for(i=2;i<=n;i++) {
+ cn =
sprintf("%s%s%s",cn,toupper(substr(rem[i],1,1)),substr(rem[i],2,length(rem[i])-1));
+ }
+ class_name = sprintf("%s%s::%s",toupper(substr($2,1,1)),cn,trim($3));
print "INSERT INTO funcimp SET
function='"class_name"',version='-v-',file='-f-',lineno="NR";";
}