This is an interactive demo. Feel free to play with it and see how Jalangi works. Have fun!
How to play with this interactive demo?
The figure on the right-hand side illustrates the relations between the four online editors.
Target code is the source code to be transformed and analysed.
(Modify this file to see how Jalangi transform different program constructs.)
Transformed code is the target code transformed by Jalangi. It adds hooks (e.g., J$.R for variable read etc.) which invoke functions defined in analysis.js.
(You cannot modify this code, as transformation is Jalangi's job.)
analysis.js is the Jalangi runtime framework code that implements those hooks called in transformed code. Those hooks retain the semantics of the target code and invoke third-party call back functions defined in Third-party plugin.
(You can modify this file but we recommand you do your modification in third-party plugin.)
Third-party plugin is the file written by third-party program analysis developers (that is YOU!!), overriding those predefined APIs allows you to intercept those execution events and do program analysis.
(Modify this file to create whatever program analysis module you want.)
To share your analysis, please send me an email (gongliang13 AT eecs DOT berkeley DOT edu) containing the following three files:
Problem Description (put it in problem.html) is a short description of the problem you are trying to solve and a short description of your analysis.
The content of this file can be a HTML code snippet which will be shown in the same section as you see of this share instruction. You can also put links to your
homepage and related publications in this file.
Target Code (put it in target.js) is the testing code to be transformed and analysed so that it can demonstrate the effectiveness of your analysis.
Your Dynamic Analysis Code (put it in plugin.js) is your analysis code. Please write your analysis code in just one file based on the Template (click the button More Demos -> Empty Template).
I will review your code, give you some feedback and put it here soon. Also please feel free to ask me if you have any question regarding building analysis on top of Jalangi.
This is an interactive tutorial, code is transformed as you type.
To execute the transformed code with Jalangi framework press the Run button or Ctrl-Enter or Cmd-Enter. The transformed code will be executed which invokes hooks in analysis.js, which in turn invokes the third-party analysis module (written by you) defined in third-party plugin.
/* Code of analysis.js */
/* Code of third-party plugin */
Acknowledgements
Esprima, Acorn and
Escodegen for parsing and code generation, and
CodeMirror for the code editor.