Ethereum CLL Preprocessor
- Allows you to enter c-like
// This is a comment. val = tx.data other = tx.data // so is this. /* and blocks like so */
Strips empty lines.
Allows you to use c++ preprocessor-like defines
#define STATIC_ADDRESS 1001 contract.storage[STATIC_ADDRESS] = 257
Compiles your code using a branch of the Ethereum CLL Compiler: https://github.com/ethereum/compiler
Allows you to compile just a snippet of code by deliminating the rest of the code with 3-or-more
=signs (handy for debugging, or making reference code / notes)
// This gets processed. foo = 1 + 2 contract.storage = foo ==== // This won't get processed. bar = 3 + 4 contract.storage = bar
Extra Language Benefits
Carries a PoC3 compatible branch of the CLL Compiler as a submodule, which has some modifications.
One of which is it allows you to define functions.
// Define a function. def timesten(multiply): result = multiply * 10 contract.storage = result return result // And call it. contract.storage = timesten(50)
...You can use multiple parameters, too. Such as
def multiparam(foo,bar,quux) and call it like
Right now, it just outputs the compiled code to stdout, and you copy and paste it. All you have to do is call the bash script using your
.cll file location as the first parameter.
To just simply compile a .cll file, call the
compile.sh script like so:
Try it with the included cll file.
If you're looking to "inspect" the compiled EVM3-ASM, you can call it with the
./compile.sh example.cll -i
And if you want to further trace something in that EVM3-ASM, you can add a regex which will point out the lines which match your regex, a la:
./compile.sh example.cll -i -t "JMP$"
Which would match all
JMP instructions, but not
You just have to init the submodules, and update, which will clone the other projects.
[user@host dir]$ git submodule init [user@host dir]$ git submodule update
The submodules it includes are:
- Still more