<div dir="ltr">Hello Joe -<div><br></div><div> Antlr 4 has an Erlang grammar that might be able to help out, if you are willing to work with Java.</div><div><br></div><div><a href="https://github.com/antlr/grammars-v4/blob/master/erlang/Erlang.g4">https://github.com/antlr/grammars-v4/blob/master/erlang/Erlang.g4</a><br>
</div><div><br></div><div>Cheers -</div><div>Dave</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jan 14, 2014 at 3:14 PM, Joe Armstrong <span dir="ltr"><<a href="mailto:erlang@gmail.com" target="_blank">erlang@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
<br>
Does anybody have a tokeniser for broken erlang code (broken means<br>
unparsable).<br>
<br>
I just want to render variables, atoms strings etc. in different<br>
colors and typefaces.<br>
<br>
So I need a tokeniser that<br>
<br>
- retains everything (comments and all)<br>
- does not do any token conversions (ie 16#abc) is not tokenised<br>
as {int,2748}, but as {integer,"16#abc"}<br>
<br>
It needs to handle broken code in a sensible way - for example if a<br>
string end quote is missing - do something sensible.<br>
<br>
Assuming that what I wants tokenises a string S into a sequence<br>
[{Tag1,S1},{Tag2,S2},...] I'd like S1 ++ S2 ++ ... = S. ie. the tokeniser<br>
should be lossless.<br>
<br>
Cheers<br>
<br>
/Joe<br>
_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
</blockquote></div><br></div>