In new engine, I'm working with two type of parsers

1) Replace parser, implement with:
$preParsers = array (
            '/\[\$([a-z0-9_]+)\]/i'                    => array( $this,
"parse_vars"),
            '/\[GET\[([a-z0-9]+)\]\]/i'                   => array( $this,
"parse_get"),
            '/\[POST\[([a-z0-9]+)\]\]/i'               => array( $this,
"parse_post"),
            "/\(template\(([a-z0-9_]*)\)template\)/Ui" => array( $this,
"parse_template")) ;
    ..
foreach ( $preParsers as $pattern => $callback ){
            $widget = preg_replace_callback ( $pattern, $callback, $widget);
}
(yes..that its all)


2) recursive parser
  $parsers = array (
            "widget"      => "parse_widget",
            "permissions" => "parse_permissions",
            "view"        => "parse_view",
            "noaiki"      => "parse_noaiki",
            "sql"         => "parse_sql",
            "script"      => "parse_script",
            "t"              => "parse_t",
            "__"          => "parse_translate");
...more complicated.

In two cases i'm working with a structure of data (or near). Some
improvement must be done..but in future it might allow conditional
(=configurable) loading of different parser. A parser is not a extension.
Extensions are NOT recursive. Their receive arguments.

First, i must finish my new engine..but i have in mind this improvement.
_______________________________________________
Mailing list: https://launchpad.net/~aikiframework-devel
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~aikiframework-devel
More help   : https://help.launchpad.net/ListHelp

Reply via email to