[Oberon] Gadgets for SyntaxConstrainedEditor
Thomas Frey
frey at inf.ethz.ch
Sun Mar 6 12:32:00 CET 2005
In the Bluebottle editors as well as in the Oberon Editors you can use a
configurable and parametrizable macro system for writing this kind of
boring code.
try:
NewSource:M<ins>
resulting in:
MODULE NewSource;
END NewSource.
MyProcedure:P<ins>
resulting in:
PROCEDURE MyProcedure;
BEGIN
END MyProcedure;
ObjectExtension:ObjectBase:o<ins>
resulting in:
TYPE
ObjectExtension = OBJECT(ObjectBase)
END ObjectExtension;
where <ins> is the insert key on the keyboard.
There are dozens of predefined macros and it is extensible as well. (See
Tutorial.Text in Bluebottle)
--Thomas
easlab at absamail.co.za wrote:
> Why should we be punished to pick chars off a keyboard, a-la-1965,
> when we could pick structures which are constrained to be syntactically
> correct at each stage of the refinement process ?
>
> eg.
> Pick: 'NewSource' and
> See something like:---
>
>
>>MODULE NewSource;
>>
>>END NewSource.
>
> where the 'cursor' is by default at 'NewSource title', and it's
> possible editing is auto-duplicated at the matching 'END NewSource'.
> I.e the text is constrained to be snytactically correct.
> ------------------------
> Pick: 'Refine' and
> See something like:---
>
>
>>MODULE Sample1;
>>
>>*CONST
>>*TYPE
>>*VAR
>>*PROCEDURE
>>*BEGIN
>>
>>END Sample1.
>
> where the '*<valid selection>s are conveniently available.
> ------------------------
> Pick: 'VAR' and
> See something like:---
>
>
>>MODULE Sample1;
>>
>>VAR ? : <current TypeList> ;
>>
>>END Sample1.
>
> where "?" and <current TypeList> are hi-lit and the cursor is
> appropriately located.
> ------------------------
> ....
> Pick: 'PROCEDURE' and
> See something like:---
>
>
>>MODULE Sample1;
>>
>>VAR i: INTEGER;
>>
>>PROCEDURE <ProcID>;
>> BEGIN
>> END <ProcID>;
>>
>>END Sample1.
>
> where the non-creative input is automated...
> ------------------------
> ....
> Pick: '<Statement>' and
> See something like:---
>
>>...
>>* assignment
>>* ProcedureCall
>>*IfStatement
>>...
>
> ------------------------
> Pick: '* assignment' and
> See something like:---
>
>
>>*<list of currently valid designators> := <Expression>.
>
> ..........
>
> Even IF the concept is only viable for 'toy-sources',
> evolution/refinement could perhaps bootstrap a
> useful tool ?
>
> Reading through Chapter3.Text , Chapter4.Text again, it seems
> that I for one made a big mistake in not devoting effort to build
> fluency to use Gadgets.
>
> It seems that Gadgets would be ideal for such a SyntaxEditor ?
>
> == Chris Glur.
>
> --
> Oberon at lists.inf.ethz.ch mailing list for ETH Oberon and related systems
> https://www.mail.inf.ethz.ch/lists/listinfo/oberon
More information about the Oberon
mailing list