Discussion:
Would this work for ETHO?
(too old to reply)
n***@gmail.com
2015-09-24 05:05:13 UTC
Permalink
I created an <automatic menu syntax-directed multi-language> writer,
[the next stage after syntax coloring] some months ago, and after
being diverted to urgent problems, couldn't see how to use it, now
that I'm free to continue refining it.

Writing *THIS* will help me SELF-explain how it works?
It uses wily: the public domain version from plan9, copied from ETHO.

Using ETHO terminology:
midMouse = MM = Execute the Command [with name = token-kliked-on].
wily doesn't have ETHO's restriction: that a valid command is <M.P>;
but let's see for ETHO.

So, at the start, the user loads a TextFrame containing only:
START.p

START.p is a command [M.P in ETHO terminology] which:
replaces the textString "START.p" with eg. the 7-lines:
"MODULE ModID;
CONST ConstDecls.p;
VAR VarDecls.p;
PROCEDURE ......
BEGIN
Statements.p
END ModID."

And eg. Statements.p is a command that
replaces the textString "Statements.p" with eg.
" KnownID.p := Expression.p
IF ............
WHILE ............
REPEAT ...........
FOR ...........


END ....
------------------------------
So, essentially kliking any <hot Tokens> replaces it
with it's expansion.

It's a type of syntax directed menu.

Let me get back to wily, and you write an ETHO prototype.

Oh, for ETHO you'd use eg:
x.START , x.ConstDecls , x.Statements ,x.Expression
Unknown
2015-09-24 10:13:44 UTC
Permalink
Post by n***@gmail.com
------------------------------
So, essentially kliking any <hot Tokens> replaces it with it's
expansion.
It's a type of syntax directed menu.
Let me get back to wily, and you write an ETHO prototype.
x.START , x.ConstDecls , x.Statements ,x.Expression
----
You may well say "what's the point of having semi-automated actions,
since I'm fluent in *my* language". Which applies to those who play
the same old familiar melodies [by reflex] and don't want ETHO's
visual/menu-based system to guide them, when they are operating on
the edge of the unknown.

Consider:
<I'm unable to find the example comparing the code of java and
Haskell, as a good reason why one would want to investigate
other languages, without first wasteing effort to be familiar with
their syntax. Ie. to use a syntax directed editor.>

Here's the log of kliking on 4-Hot-Tokens to expand them.
The initial <Template> which I just half-guessed is:--
MODULE Mid;
DecLst
BEGIN StmLst
END Mid.
---------------- and then apparently I first kliked "DecLst"; thus
executing ./DecLst, which did:-
sed -i 's/DecLst/CONST <CLst>;\n VAR <VLst>;\n { ProcDcl }/' SIP
cat SIP
which in ETHO is a simple 3-arg PROC:
FindReplaceTextframe("DecLst",
"CONST <CLst>;\n VAR <VLst>;\n { ProcDcl }",
SIP)
================= 1
MODULE Mid;
CONST <CLst>;
VAR <VLst>;
{ ProcDcl }
BEGIN StmLst
END Mid.
=============== 2
MODULE Mid;
CONST <CLst>;
VAR <VLst>;
{ PROC Pid;
DecLst;
BEGIN StmLst END Pid; }
BEGIN StmLst
END Mid.
==================== 3
MODULE Mid;
CONST <CLst>;
VAR <VLst>;
{ PROC Pid;
DecLst;
BEGIN
Asgn V:=X;
WHILE Bool DO;
IfThenElse END Pid; }
BEGIN
Asgn V:=X;
WHILE Bool DO;
IfThenElse
END Mid.
================= 4
MODULE Mid;
CONST <CLst>;
VAR <VLst>;
{ PROC Pid;
DecLst;
BEGIN
Asgn V:=X;
WHILE Bool DO;
IF Xpn
THEN StmLstS
ELSE StmLstS EndIF
END Pid; }
BEGIN
Asgn V:=X;
WHILE Bool DO;
IF Xpn
THEN StmLstS
ELSE StmLstS EndIF

END Mid.
================ That's what 4 kliks can build !!

You need to improvise my guessed syntax.
That's exactly the point: I don't *WANT* to know the arbitrary,
trivialities of syntax.
y***@z505.com
2015-09-27 19:41:39 UTC
Permalink
Post by Unknown
BEGIN
Asgn V:=X;
WHILE Bool DO;
IF Xpn
THEN StmLstS
ELSE StmLstS EndIF
END Mid.
================ That's what 4 kliks can build !!
You need to improvise my guessed syntax.
That's exactly the point: I don't *WANT* to know the arbitrary,
trivialities of syntax.
I don't get it. Why is Asgn there? Why not go one step further while we are shortening ASSIGN to ASGN and VARIABLE to VAR and CONSTANT to CONST....

BEG
V @= X;
WHL Bool DO;
IF Xpn
THN StmLstS
ELS StmLstS EndIF

END Mid.

ur shrtning Asgn so y u no shortn els and thn, yo? In the Beg of the univrs thr was adam and eve, thn in 2012 the univrs came to an end.
y***@z505.com
2015-09-27 19:46:09 UTC
Permalink
Post by y***@z505.com
ur shrtning Asgn so y u no shortn els and thn, yo?
Loading Image...
Continue reading on narkive:
Loading...