How to convert from an xrl to an erl file in Elixir

How to convert from an xrl file to an erl file to use on elixir ?

If that file is in src/ directory then mix compile.leex (which is on by default) should do that for you.

Thanks a lot for your reply, but it still did not work.

What is the error you are seeing? Very difficult to help you if you don’t provide any information! Maybe cut and paste what happens when you mix compile.leex ?

1 Like

You can also use the console to do this. This is how I do for some of my files…

iex(1)> :yecc.file 'src/sgf_parser.yrl'
{:ok, 'src/sgf_parser.erl'}
iex(2)> :leex.file 'src/sgf_lexer.xrl' 
{:ok, 'src/sgf_lexer.erl'}
1 Like