Skip to content

Instantly share code, notes, and snippets.

@moonpolysoft
Created May 11, 2010 03:37
Show Gist options
  • Save moonpolysoft/396889 to your computer and use it in GitHub Desktop.
Save moonpolysoft/396889 to your computer and use it in GitHub Desktop.
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)`;
{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