Efene Command Line Interface¶
If you plan to use efene for a project we recommend you to use the rebar3 plugin or if you prefer the efene plugin for erlang.mk.
This tool is useful for troubleshooting and for learning more about efene.
The tool can be generated by running:
It will output a file called efene in the current directory, you can put it in your bin folder or wherever you prefer.
To see the help run efene without arguments:
$ efene Usage: efene rawlex <file>: print raw lex tokens efene lex <file>: print lex tokens after normalization efene ast <file>: print efene abstract syntax tree efene erlast <file>: print erlang abstract syntax tree (absform) efene mod <file>: print erlang absform with module attributes efene erl <file>: print erlang code for <file> efene erl2ast <file.erl>: print erlang absform <file.erl> efene beam <file> [<outdir>]: compile <file> to beam bytecode to <outdir> efene pprint <file>: pretty print code from <file> (experimental)
rawlex, lex, ast, erlast, mod print intermediate representations used during efene compilation.
beam and erl are the two output alternatives.
rawlex is the result of the lexing stage, lex is the result of processing the rawlex stage to normalize it and make it easier to parse, the next stage is ast which is the efene abstract syntax tree, which then is translated to erlast which is the erlang abstract syntax tree, it’s then enriched with module level attributes in the mod stage after this point it’s compiled to beam bytecode if the beam option is used or translated to erlang if the erl option is used.
The remaining options are pprint which takes an efene file as input and does pretty printing on it (this option is experimental), the erl2ast option is used to print the erlang abstrac syntax tree for an erlang module, this is normally used during development to compare outputs for efene and erlang modules.