ET Installation Instructions
- 1. Install JDK 1.6 or above.
- 2. Download Polyglot 2.5 here and install it on your system. Let us assume the root directory for its source code is /polyglot2.5.0-src.
- 3. Install CPLEX (a constraint solver used in our prototype) and update the library path to include the library files. For detailed instruction, please check the CPLEX website.
- 4. Unzip ET source files. All unzipped files will be in a folder called et. Move this directory to polyglot2.5.0-src/src/polyglot/ext, and change directory to that folder.
- 5. (Optional) In the et/compiler/src folder, there is a file named ecm.prop, which is a configuration file for the maximum/minimum frequencies supported on the target platform. The default setting is 1000/300MHz, consistent with the smartphone we benchmarked on. The file is properly annotated should you need to change the default setting.
- 6. (Optional) In the et/compiler/src folder, there is a file named contextSen.prop, which is a configuration file for additional program analysis entry method(s) and their associated parameters. The default setting is the main method. This feature can accommodate the somewhat stylistic way of Android (XML intent based) program bootstrapping and event handling.
- 7. (Optional) Type ant to compile the code. It is only necessary if you made modifications from our source code.
ET Compiler Use Instructions
To compile a program:
- 1. Change directory to polyglot2.5.0-src/src/polyglot/ext/et/bin.
- 2. Run etc YourFileName.et. For multiple files, one can use *.et for instance. (All ET source files end with suffix .et) Note: make sure "ecm.prop" and "contextSen.prop" are always under the directory where you run our system.
ET Syntax Notes
- When mode constants are used as first-class values, please use a hash sign # before the constant. For instance, instead of writing
x = hifi;
one should write
The same applies when mode values appear as mswitch cases. This syntax choice significantly simplifies parsing.