<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p>Elegance is not optional.<br>
<br>
The changes you requested have been made to make the wxErlang
scripts <br>
easier on the eyes. However, this is just a temporary band-aid as
I <br>
construct a real solution.<br>
<br>
My problem is I am relying on SublimeText's Syntax Highlighter -to
HTML- package for my Erlang HTML.<br>
The classes that Sublime's Highlighter cooks up are a pitiful
match to Erlang's syntax/lexicon.<br>
It doesn't even distinguish a function_name() correctly.<br>
<br>
</p>
For building HTML scripts, all that needs to be actively
generated/output is the :<br>
— body format class at the top <br>
& wrapped-tokens at the bottom.<br>
<br>
<i> Classes string format:</i><br>
body .n { color: #fb660a; font-weight: bold } /* Keyword
*/ <br>
<br>
<i> Token String Format: </i><br>
<span class="n">module_md5</span><br>
<br>
<br>
I can imagine writing a lexical scanner to do this with two passes.<br>
- One to get the classes to be colored.<br>
- The other to apply the HTML bracket-format.<br>
<p><i>But I want Elegance...</i><br>
What's the best attack strategy if I want to scrape the code to
get real syntax highlighting?<br>
I would like to do this in Erlang, that is, versus the traditional
formal grammar file method.<br>
</p>
<p><br>
· Should I take the AST as input...and do what?...recursively scan
the tuple branches? <br>
{op,1,'-',{call,1,{atom,1,module},[{var,1,'ModuleName'}]}}</p>
I've checked out wrangler_parse, wrangler_syntax_lib & <br>
a good amount of our syntax tools to no avail, maybe I missed
it.<br>
<p><br>
</p>
· Or should I attempt to write functions based around scanning for
unique <br>
tokens patterns, identifying terminal/terminals and compare
adjacent tokens. <br>
I imagine i would have to follow expression reduction priority
here. <br>
Then deducing the token into a given color. <br>
I don't mind wrapping all of Erlang in its own 'grammar logic'.<br>
<br>
<p>Is there a library out there to obtain/explode the AST into
syntactically correct tagged tokens?<br>
</p>
<p><br>
</p>
<p>Cheers,</p>
<p><br>
</p>
<p>Robert C.<br>
<br>
</p>
<br>
<br>
<br>
<div class="moz-cite-prefix">On 1/9/18 6:01 PM, Richard O'Keefe
wrote:<br>
</div>
<blockquote
cite="mid:CABcYAd+hsFOF4YoaZ0d8qMCEssPcd9QWhGjP8qfX--GKNCv+tw@mail.gmail.com"
type="cite">
<div dir="ltr">
<div>
<div>
<div>
<div>
<div>
<div>
<div>
<div>You hero, sir!<br>
<br>
</div>
Except, I looked at <a moz-do-not-send="true"
href="https://scriptculture.com/wxevent.html">https://scriptculture.com/wxevent.html</a><br>
</div>
and it was the reverse of beautiful. In fact, it
was very nearly<br>
</div>
(physically) unreadable. The least important thing,
the line numbers,<br>
</div>
was in brilliant white. The most important thing, the
text, was in<br>
</div>
medium grey against a dark grey or black background, very
poor<br>
</div>
contrast, real eyestrain territory. I am willing to take it
on faith<br>
</div>
that you have made the code, qua code, beautiful.</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On 7 January 2018 at 11:38, Robert
Carbone <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:erlang@scriptculture.com" target="_blank">erlang@scriptculture.com</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Fellow
Erlang-Mailing-Listers:<br>
<br>
Foremost, to this entire community; thank you for being
there, lending advice, and producing an amazing archive of
helpful Erlang content.<br>
As a relative beginner, this treasure trove of information
has been very helpful on numerous occasions.<br>
If you are interested in GUI programming, the following is
sure to start your New Year out on a great note.<br>
<br>
<br>
For quite some time, I have been silently hacking away at
wxErlang.<br>
A few days ago, I have launched an effort to teach wxErlang.<br>
<br>
My short-term goal is to alleviate the
largest-barrier-to-entry for wxErlang.<br>
That is, the documentation is completely-scattered or
non-existent.<br>
<br>
<br>
I have started this endeavor by publishing:<br>
- A diagram of the class-inheritance structure<br>
- Three edited libraries (first of many)<br>
<br>
<br>
— CLASS INHERITANCE DIAGRAM —<br>
<br>
One of the first steps to using wxErlang is to observe the
library in its entirety.<br>
So here it is — Here is a picture of the wxErlang class
structure:<br>
<br>
Page 1: <a moz-do-not-send="true"
href="https://www.scriptculture.com/assets/sc_inherit_class_pg1.jpg"
rel="noreferrer" target="_blank">https://www.scriptculture.com/<wbr>assets/sc_inherit_class_pg1.jp<wbr>g</a><br>
Page 2: <a moz-do-not-send="true"
href="https://www.scriptculture.com/assets/sc_inherit_class_pg2.jpg"
rel="noreferrer" target="_blank">https://www.scriptculture.com/<wbr>assets/sc_inherit_class_pg2.jp<wbr>g</a><br>
<br>
As a chart of inheritance, this 2-page diagram allows you to
visualize what function calls are inherited from upstream
modules. That is, every module below (subclass) can call the
functions of the module above, its 'super class' module.<br>
As reading one module is not enough to gain a complete
picture, having beautiful, legible, readily-readable, source
code documents becomes important.<br>
<br>
<br>
— EDITED WX LIBRARY MODULES —<br>
<br>
When you can sit down and seamlessly absorb what functions
are at your disposal, it is simply fantastic. Your mind is
freed up to think about the code you are about to write or
UI, not straining to interpret the code in front of you.<br>
<br>
I am editing all the libraries by hand and releasing them.<br>
I have started with:<br>
· wxEvent.erl<br>
· wxEvtHandler.erl<br>
· wxWindow.erl<br>
<br>
Having legible wx modules, with the options clearly labeled,
makes wxErlang development not just possible, but efficient
and fun.<br>
I'll continue to release a new library everyday or so until
they are all available.<br>
They can be found at:<br>
<br>
<a moz-do-not-send="true" href="https://scriptculture.com/"
rel="noreferrer" target="_blank">https://scriptculture.com/</a><br>
<br>
My resolution for this year is to bring beautification to
the wxErlang Code Base.<br>
<br>
Cheers,<br>
<br>
Robert C.<br>
<br>
ScriptCulture.com © 2018<br>
Beautiful Erlang Code & Calligraphy<br>
<a moz-do-not-send="true"
href="mailto:wxfeedback@scriptculture.com" target="_blank">wxfeedback@scriptculture.com</a><br>
<br>
<br>
______________________________<wbr>_________________<br>
erlang-questions mailing list<br>
<a moz-do-not-send="true"
href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br>
<a moz-do-not-send="true"
href="http://erlang.org/mailman/listinfo/erlang-questions"
rel="noreferrer" target="_blank">http://erlang.org/mailman/list<wbr>info/erlang-questions</a><br>
</blockquote>
</div>
<br>
</div>
</blockquote>
<br>
</body>
</html>