Hoi,
Heeft er iemand enig idee hoe je een parser opzet in php die php-code zelf kan parsen ?
Het zou al helemaal mooi zijn als het ook nog eens de inhoud van multiline quoted strings (SQL of waarden) in de code intact zou laten.
Alle hulp is welkom, thanx in advance,
Shortwire.
input:
----8<--------------8<----------
$myVar="SELECT
myFieldA,
myFieldB
from MyTable where MyFieldA like \'%ik%\'
;";
----8<--------------8<----------
class MyClassMyFunc {
function MyClassMyFunc($myInp){
return ($myInp++);
}
}
----8<--------------8<----------
output is minimaal:
----8<--------------8<----------
var: $myVar
class: MyClassMyFunc
function: MyClassMyFunc($myInp)
return($myInp++);
----8<--------------8<----------
Heeft er iemand enig idee hoe je een parser opzet in php die php-code zelf kan parsen ?
Het zou al helemaal mooi zijn als het ook nog eens de inhoud van multiline quoted strings (SQL of waarden) in de code intact zou laten.
Alle hulp is welkom, thanx in advance,
Shortwire.
input:
----8<--------------8<----------
$myVar="SELECT
myFieldA,
myFieldB
from MyTable where MyFieldA like \'%ik%\'
;";
----8<--------------8<----------
class MyClassMyFunc {
function MyClassMyFunc($myInp){
return ($myInp++);
}
}
----8<--------------8<----------
output is minimaal:
----8<--------------8<----------
var: $myVar
class: MyClassMyFunc
function: MyClassMyFunc($myInp)
return($myInp++);
----8<--------------8<----------