TODO ==== Caching ------- Rename variable names to prevent interference --------------------------------------------- Using the variable name: {$this} in the template code is dangerous. The template is called via the include method, in the class: . {$this} represents the current object, and can be overwritten. Renaming the (critical) variables used in the template can be a solution. (For example prepend the variable name with _ezc_.) The problem with this solution is that a variable can be used in a literal string: {"My name is $name"}. Therefore the literals should be scanned for variable names, and translated accordingly. Version number -------------- Do we need a version number? To differentiate between other template engines, we rely on the path and template extension. Newer versions of this template engine should be compatible with the older templates. Reducing the amount of private variables in tst_to_ast_transformer.php ---------------------------------------------------------------------- TstToAstTransformer is a visitor pattern. In some cases information needs to be shared among several nodes (functions in the visitor pattern). Private variables are used in that case. Maybe it is possible to reduce this amount of parameters. Having some kind of history of the previous nodes will help. Function typehints ------------------ A few functions (like: array_count() ) have specified what type the method will return. The type is TYPE_VALUE, TYPE_ARRAY, or both. If not specified it assumes that the return type is both, which of course is true, but allows less type checking. Old (outdated) list ------------------- - Create meta-code class which are elements which wrap around real code elements, it has a method to fetch the first real element from its children. this allows optimizer and other code which inspects the code tree to go past these elements. typical meta-code are: - changing run-time options such indentation, spacing, hanging braces etc. - inlining code - add these AST nodes (only if needed for the 1.0 release): * docblock comment /** */ * rest of operators + clone + new + ternary ?: + @ + execution `` * casts * reference * open tag/close tag * class * function * static * interface * abstract class - Operator names need to be consistant, ie. either addition and multiplication or plus and multiply. - Move whitespace removal to root parser while it opens/closes blocks. - Add support for all operators + operands to return a typehint, this can be used to detect type parse-time and to provide type-hints to the transformed code. - Rename ezcParser to ezcParserControl and all references of 'main parser' to 'parser control'. - Added syntax validator class which is invoked when new type, operator and block elements are made. * Check for assignment usage inside an expression, not allowed. * Check for typical mistakes when coming from PHP. o Check for isset() * Check for identifiers which are reserved keywords (by template or PHP): o true, false, and, or - Operators: * The ! operator needs special attention when used together with other operators, see PHP manual for this. !$obj instanceof SomeClass - Uncomment all typehints. - Move nesting check to block class, each block sub-class should be able to override it to allow more complex nesting rules. e.g. {section} {section-else} {/section} - Start cursor for block are 1 off. - Move abstract classes to abstract/ subdir? - Make sure cursor class handles tab characters - Don't expose all variables in element types, instead use methods or magic-properties. - trimBlockLine(s) might not need the $parentBlock parameter. - whitespace trimming object needs to be fetched from the current output context in main parser. CS: - Fix all @param with long texts to use the alternative syntax - Fix @returns -> @return - Fix @inheritdocs for re-implemented functions (if it works). - Fix class descriptions with examples. - Make sure @param blocks are properly aligned compiler: - There should be an 'object' style file generated with information about a template, e.g. related templates and other files.