[erlang-questions] Problem parsing Erlang code

Joel Reymont <>
Tue Nov 20 18:05:55 CET 2007


I'm trying to generate Erlang code based on some data in a file. I  
thought I would try to type up the code I want to get to figure out  
what the core should be.

I tried the following at the Erlang prompt but got an error. Any  
suggestions?

Ultimately, I would want to generate the abstract forms by hand,  
filling in values from a file, and pretty-print them. Yes, I can  
generate the Erlang code by concatenating strings but I'd rather not. / 
Lisp macros, oh, how I miss you!/

	Thanks, Joel

---

S = "show({'bicycling' = A, 1010 = B}) -> show_activity(A, B, 4,  
\"bicycling, <10\");".
{ok, Toks, _} = erl_scan:string(S).
{ok, AbsForm} = erl_parse:parse(Toks).

=ERROR REPORT==== 20-Nov-2007::17:00:03 ===
Error in process <0.31.0> with exit value: {{badmatch,{error, 
{999999,erl_parse,["syntax error before: ",[]]}}},[{erl_eval,expr,3}]}

** exited: {{badmatch,{error,{999999,erl_parse,["syntax error before:  
",[]]}}},
             [{erl_eval,expr,3}]} **

--
http://wagerlabs.com








More information about the erlang-questions mailing list