Created
May 11, 2010 03:37
-
-
Save moonpolysoft/396889 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
additive <- multitive "+" additive / multitive ` | |
case Node of | |
Int when is_integer(Int) -> Int; | |
[A, "+", B] -> A + B | |
end | |
`; | |
multitive <- primary "*" Mul:multitive / primary ` | |
case Node of | |
Int when is_integer(Int) -> Int; | |
[A,"*",{'Mul',B}] -> A * B | |
end | |
`; | |
primary <- par:("(" add:additive ")") / dec:Decimal ` | |
case Node of | |
{dec,Int} when is_integer(Int) -> Int; | |
{par,List} -> proplists:get_value(add,List) | |
end | |
`; | |
Decimal <- [0-9]+ `list_to_integer(Node)`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{application, rebar_test, | |
[ | |
{description, ""}, | |
{vsn, "1"}, | |
{modules, [ | |
arithmetic | |
]}, | |
{registered, []}, | |
{applications, [ | |
kernel, | |
stdlib | |
]}, | |
{mod, { myapp_app, []}}, | |
{env, []} | |
]}. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment