[erlang-questions] about syntax tools
Thu Aug 11 01:21:48 CEST 2011
erl_scan - the erlang tokeniser which takes charatecters and converts them to tokens.
erl_parse - the erlang parser which parses the tokens and build an AST (abstract syntax tree).
compile - the top-level of the compiler which runs all its passes, the scanner and parser being the first ones.
epp - the erlang pre-processor which uses erl_scan to generate tokens, does all the macro processing and then uses erl_parse to generate the ASTs
io - the top-level interface to the io-system for both input and output
There is no direct overlap in what these modules do, although some do call the others. So there is only one erlang tokeniser, one erlang parser, one erlang macro pre-processor, etc.
----- Original Message -----
> On 08/10/2011 05:54 PM, Andrew Kondratovich wrote:
> > Looking through Erlang sources I have found out that there are many
> > ways
> > to parse and compile the code. In general way there is
> > transformation
> > like Code -> Tokens -> Forms ->...
> > But functions for these transformations can be found in many
> > modules:
> > erl_scan, erl_parse, compile, epp, io - theese are only those that
> > have
> > seen. Functions from that modules often do the same work.
> > What for such variety ?
> All of these modules and their functions exist for specific purposes.
> Can you point out any concrete examples of functions that really do
> same work?
> erlang-questions mailing list
More information about the erlang-questions