Charles Explorer logo
🇬🇧

Mapping of Dynamic Language Constructs into Static Abstract Syntax Trees

Publication at Faculty of Mathematics and Physics |
2010

Abstract

Software solutions performing automatic code analysis are very important, especially for code assistance capabilities or for extracting semantic metadata from the source code. These methods gather syntactic information from the source code and then in general they provide large set of implying semantics.

With the increased focus on dynamic languages the problem emerges – the whole code semantic is known only at runtime and the analysis has to estimate larger relations. Within the project Phalanger, which is the compiler of the dynamic PHP language into a static environment, we have succeeded with converting most of dynamic constructs into the typical structures used by static code analyzers.

That enables processing of most of dynamic language constructs in the classic static way. Moreover described methods simplifies source code prediction and other relevant tasks.