NOTE: To use the advanced features of this site you need javascript turned on.

Home Products nTile PtoJ Technical Brief

Technical Brief


The software migrator is composed of two main modules: PHPtoTIL and PHPtoJava. PHP source files are processed by PHPtoTIL and stored in an intermediate representation called TIL (Translation Intermediate Language). TILtoJava then turns this intermediate representation into Java source files, packaged as a Java Enterprise Edition application.

Further detailing the architecture, PHPtoTIL is composed of several submodules, as follows:

  • PHP Parser – processes the source files based on the PHP grammar rules and builds a first version of the TIL representation. From this point on, all work is carried out on this representation.
  • Iterative Processor – the migration is performed in several iterations. Each iteration uses the already gathered information in order to further refine resolving of entities, type inference etc. Most optimizations are implemented here.
  • Iteration Controller – this component monitors iterations and decides when the gathered information can no longer be refined. Control is then transferred to the post-processor.
  • Post-Processor – performs some finishing touches on the intermediate representation, such as collecting translation statistics and finalizing the type inference.

Throughout its operation PHPtoTIL collaborates with an utility module containing the interface of the PHP runtime, in order to have a fully resolved TIL model.

TILtoJava traverses the well-formed TIL representation and translates it into appropriate Java constructions. The Java abstract syntax tree (AST) is built in-memory, then saved as Java source code together with Java EE support classes and XML descriptors. The Java implementation of the runtime is also linked to the final application.