Giter Club home page Giter Club logo

parse_trans's Introduction

#The parse_trans application#

Authors: Ulf Wiger ([email protected]).

A generic parse transform library This library is intended to simplify the task of writing parse transform modules for Erlang.

#Introduction to parse transforms#

##The simplest transform##

The very simplest transform we can make is one that doesn't change a thing. For convenience, we will at least print the forms. This will enlighten us as to what the forms actually look like.

-module(test_pt).

-export([parse_transform/2]).

parse_transform(Forms, _Options) -> io:fwrite("Forms = pn", [Forms]), Forms.

Trying this with a very simple module:

-module(ex1).
-export([add/2]).

add(X,Y) -> X + Y.

1> c(ex1, [{parse_transform,test_pt}]).
Forms = [{attribute,1,file,{"./ex1.erl",1}},
{attribute,1,module,ex1},
{attribute,2,export,[{add,2}]},
{function,4,add,2,
[{clause,4,
[{var,4,'X'},{var,4,'Y'}],
[],
[{op,5,'+',{var,5,'X'},{var,5,'Y'}}]}]},
{eof,6}]
{ok,ex1}

##transform/4##

...

#Current limitations#

...

##Modules##

ct_expand
exprecs
parse_trans
parse_trans_codegen
parse_trans_mod
parse_trans_pp

parse_trans's People

Contributors

uwiger avatar hyperthunk avatar nox avatar dizzyd avatar joeosborn avatar klajo avatar

Watchers

James Cloos avatar Hao Ruan avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.