[Oberon] Syntax-directed program editing

eas lab lab.eas at gmail.com
Mon Jan 18 07:21:39 CET 2016


If you need to manually-craft the syntax-editor for each new language,
it has little value. It must be able to handle any new language after
just being fed the valid syntax data of that language.
Perhaps this depends on the <L, ? LR>-ity of the language's grammar?
I lack knowledge of the theory of language-classes.
---
Looking at Oberon's official syntax, showed me that <StmLst> is at
the top and in the middle of the tree <implied by "recursive descent">. Ie:
Module  =       MODULE ident ";" [ImportList] DeclSeq  [BEGIN StatementSeq] END
 ident ".".
ProcDecl        =       PROCEDURE [Receiver] IdentDef [FormalPars] ";" DeclSeq
[BEGIN StatementSeq] END ident.
------
My simplistic use of <sed in place> to replace ALL instances of the selected
HotNode by it's expansion is bad.
Better that HotNodes are expanded individually
.
And on the DISPLAY [Oberon: TextFrame] and then <Edit.Store>-ed, incrementally.
---
Just look at this by wily.  With the 12-line <source>Display:----------
(* Delete new nodes not needed *)
MODULE ModId;
CONST ConstDcl;
VAR VarDecl;

PROCEDURE ProcId(ArgLst);
  BEGIN |StmLst2
  END ProcId;

BEGIN
 |StmLst2
END ModId.
------------------
If I select the 2nd "|StmLst2" token and midMouse it, the display changes to:-
(* Delete new nodes not needed *)
MODULE ModId;
CONST ConstDcl;
VAR VarDecl;

PROCEDURE ProcId(ArgLst);
  BEGIN |StmLst2
  END ProcId;

BEGIN
  Asgn V:=X;
 While Bool Do;
 IfThenElse;
END ModId.

wily's script-file named "StmLst2" is the 3 lines:---
echo -n " Asgn V:=X;
 While Bool Do;
 IfThenElse;"

The auto-indent editor's facility of wily & ETHO should improve the formatting.
---
This should be easy to translate/implement in ETHO.
NB. KybrdMacros are of little value, without menues.
It's not about resting the fingers.
It is about amplifying your (eyes, brain, memory)system.

== Chris Glur.

! Screw this amerikan gmail system, which like macdonald's foods has the
<To:> parameter pre-determined/locked !


More information about the Oberon mailing list