Syntax10.Scn.FntKSyntax12i.Scn.FntYSyntax10i.Scn.Fnt   ZParcElemsAlloc;ʭW < Z;ʭ(j ZΗ Z+ 6Syntax12.Scn.Fnt.  Z"V# Z,X8FoldElemsNew8hStampElemsAlloc9 Sep 99. iStyleElemsAlloc  #4Ќև܂paragraph  hʭ  #4Ќև܂paragraph2 j  #4Ќև܂new page   title  6 abstract   table  ieR Ш   +6ևԒҝШϳ;algorithm  Z )\  +6ևϳprogram Z  Zr LogHead  Z-  Z'LineElemsAlloc29 Sep 99InfoElemsAlloc#Syntax10.Scn.Fnt"Title": no title "Author": no name "Abstract": no abstract "Keywords": no keywords "Version": no version "From": 09.09.99 12:34:46 "Until": no date (use StampElems.Insert) "Changes": no changes "Hints": This text can again contain arbitrary text elements! CSyntax10b.Scn.Fnt_!#O'"/\a$Zam L?.|B-(* Automatic.Do EditKeys.Reset ~ EditKeys.Read EditKeys.Text ~ ~ *) (* Search for any of the following: programming mail Internal External Documentation *) (*set hot_key \ #92*) (*built-in functions*) (*taking a parameter*) write (^0) char (^1) font (^2) off (^3) call (^4) arg (^A) exec (^B) param (^C) (*no parameter*) keep (^5) pick (^6) caret (^7) indent (^8) freeze (^9) (*abreviations for built-in function calls*) arg0 ("0" arg) arg1 ("1" arg) arg2 ("2" arg) arg3 ("4" arg) kwrite (keep write) pwrite (pick write) (*some font preset macros*) n ("Syntax10.Scn.Fnt" font) i ("Syntax10i.Scn.Fnt" font) m ("Syntax10m.Scn.Fnt" font) b ("Syntax10b.Scn.Fnt" font) n2 ("Syntax12.Scn.Fnt" font) i2 ("Syntax12i.Scn.Fnt" font) m2 ("Syntax12m.Scn.Fnt" font) b2 ("Syntax12b.Scn.Fnt" font) n4 ("Syntax14.Scn.Fnt" font) i4 ("Syntax14i.Scn.Fnt" font) m4 ("Syntax14m.Scn.Fnt" font) b4 ("Syntax14b.Scn.Fnt" font) mono ("Courier10.Scn.Fnt" font) mono2 ("Courier12.Scn.Fnt" font) bold ("KeyCmds.Bold" call) (*some template macros for special characters*) | ("\" write) (*enable entry of hotkey character*) tab ("9" char) cr ("13" char) qt ("34" char) sp (" " write) = (cr indent) ` (= tab) del ("127" char) lf ("10" char) a` ("" pwrite) a' ("" pwrite) a^ ("" pwrite) a" ("" pwrite) A" ("" pwrite) e` ("" pwrite) e' ("" pwrite) e^ ("" pwrite) e" ("" pwrite) i` ("" pwrite) i' ("i'" pwrite) i^ ("" pwrite) i" ("" pwrite) o` ("" pwrite) o' ("o'" pwrite) o^ ("" pwrite) o" ("" pwrite) O" ("" pwrite) u` ("" pwrite) u' ("u'" pwrite) u^ ("" pwrite) u" ("" pwrite) U" ("" pwrite) c, ("" pwrite) n~ ("" pwrite) alpha ("a" kwrite) beta ("b" kwrite) gamma ("g" kwrite) delta ("d" kwrite) epsilon ("e" kwrite) zeta ("z" kwrite) eta ("h" kwrite) theta ("q" kwrite) iota ("i" kwrite) kappa ("k" kwrite) lambda ("l" kwrite) mu ("m" kwrite) nu ("n" kwrite) xi ("x" kwrite) omikron ("o" kwrite) pi ("p" kwrite) rho ("r" kwrite) sigma ("s" kwrite) tau ("t" kwrite) ypsilon ("u" kwrite) phi ("j" kwrite) chi ("c" kwrite) psi ("y" kwrite) omega ("w" kwrite) leq ("#" kwrite) geq ("3" kwrite) neq ("9" kwrite) approx (";" kwrite) about ("p" kwrite) begc ("h" kwrite) endc ("i" kwrite) begf ("j" kwrite) endf ("k" kwrite) empty ("F" kwrite) reals ("!" kwrite) nats ("" kwrite) elem ("N" kwrite) notelem ("O" kwrite) subset ("M" kwrite) truesubset ("L" kwrite) dot ("7" kwrite) cart ("4" kwrite) power ("C" kwrite) union ("H" kwrite) sect ("G" kwrite) not ("X" kwrite) and ("Y" kwrite) or ("Z" kwrite) xor ("E" kwrite) impl ("^" kwrite) equiv (":" kwrite) arrow ("." kwrite) tarrow ("" kwrite) beg ("" kwrite) box ("" kwrite) end ("" kwrite) all ("R" kwrite) ex ("S" kwrite) qed ("U" kwrite) forall ("(" write all sp caret sp ")" write) exists ("(" write ex sp caret sp ")" write) (*some vertical offset preset macros*) sup ("16" off) sub ("-16" off) norm ("0" off) [ (sup n) ] (sub n) / (norm n2) (*some macros calling Oberon commands*) tool ("System.Open" arg0 param call) d ("StampElems.Insert" call) id ("StampElems.Insert" call) Cn ("EditTools.ChangeStyle ? => ." call) Ci ("EditTools.ChangeStyle ? => i" call) Cb ("EditTools.ChangeStyle ? => b" call) Cm ("EditTools.ChangeStyle ? => m" call) C ("EditTools.ChangeSize ? => 10" call) C2 ("EditTools.ChangeSize ? => 12" call) C4 ("EditTools.ChangeSize ? => 14" call) C6 ("EditTools.ChangeSize ? => 16" call) inc2 ("EditTools.IncSize 2" call) dec2 ("EditTools.IncSize -2" call) , ("Edit.Recall" call) (*some macros to support various text elements*) parc ("Edit.InsertParc @" call) style ("StyleElems.Insert" arg0 param call) fold ("" pwrite caret "" write) ind ("IndentElems.Insert" call) graph ("GraphicElems.Insert" call) pict ("PictElems.Insert Grapes.Pict" call) dialog ("DialogElems.Insert" call) mark ("MarkElems.Insert" call) link ("LinkElems.Insert" call) balloon ("BalloonElems.Insert" call) table ("TableElems.Insert" call) kepler ("KeplerElems.Insert" call) clock ("ClockElems.Insert" call) pop ("PopupElems.Insert" arg0 param call) man ("IconElems.Insert" call) stamp ("StampElems.Insert" call) troup (man man man man man man man man man) army (troup troup troup troup troup troup troup troup troup) line ("LineElems.Insert auto 1" call) line2 ("LineElems.Insert auto 2" call) line4 ("LineElems.Insert auto 4" call) line6 ("LineElems.Insert auto 6" call) dline ("LineElems.Insert auto 1 double" call) dline2 ("LineElems.Insert auto 2 double" call) dline4 ("LineElems.Insert auto 4 double" call) dline6 ("LineElems.Insert auto 6 double" call) tline ("LineElems.Insert tab 1" call) tline2 ("LineElems.Insert tab 2" call) tline4 ("LineElems.Insert tab 4" call) tline6 ("LineElems.Insert tab 6" call) fline ("LineElems.Insert 1" arg0 param call) fline2 ("LineElems.Insert 2" arg0 param call) fline4 ("LineElems.Insert 4" arg0 param call) fline6 ("LineElems.Insert 6" arg0 param call) day ("" write) ctab ("TabElems.Insert 1200" call) (*style element macros*) para ("" write)  para2 (" "write)  newpage ("" write)  title ("" write)  abstract ("" write)  tablepara ("" write)  algorithm ("" write)  program ("" write) loghead ("id1" write caret ": " write)  (*some template macros for programming purposes*) #40 (" (* " write caret " *) " write) (* '(' *) #41 (" (** " write caret " **) " write) (* ')' *) < (tab "(*<< " write caret " *) " write) << (tab "(*<<*) " write) header (" (** " write caret " **) " write cr cr) M ("MODULE " write arg0 write "; (** gh id1" write caret " /   **) IMPORT Texts, Oberon; CONST TYPE VAR PROCEDURE Do*; BEGIN END Do; END " write arg0 write "." write cr cr arg0 write ".Do" write cr) P ("PROCEDURE " write arg0 write caret ";" write = " VAR" write = "BEGIN" write ` = "END " write arg0 write ";" write) P* ("PROCEDURE " write arg0 write "*" write caret ";" write tab "(** **) " write = " VAR" write = "BEGIN" write ` = "END " write arg0 write ";" write) R (arg0 write " = POINTER TO " pwrite arg0 write "Desc;" pwrite = arg0 write "Desc = RECORD" pwrite caret = "END;" pwrite cr) WHILE ("WHILE " write caret " DO" write cr tab cr del "END;" write) REPEAT ("REPEAT " write caret cr "UNTIL ;" write) CASE ("CASE " write caret " OF" write cr "END;" write) LOOP ("LOOP " write lf tab lf del "END;" write) min ("PROCEDURE Min(x, y: INTEGER): INTEGER; BEGIN IF x < y THEN RETURN x ELSE RETURN y END END Min; " write) max ("PROCEDURE Max(x, y: INTEGER): INTEGER; BEGIN IF x > y THEN RETURN x ELSE RETURN y END END Max; " write) int ("INTEGER;" pwrite) lint ("LONGINT;" pwrite) boo ("BOOLEAN;" pwrite) ptr ("= POINTER TO " pwrite) arr ("ARRAY " pwrite caret " OF ;" pwrite) ret ("RETURN " write) RETURN ("RETURN" write) exit ("EXIT " write) EXIT ("EXIT" write) halt ("HALT(" write caret ")" write) HALT ("HALT" write) assert ("ASSERT(" write caret ")" write) ASSERT ("ASSERT" write) ls ("Log.Str(" pwrite qt caret qt "); " pwrite) li ("Log.Int(" pwrite caret "); " pwrite) ll ("Log.Ln; " pwrite) * (freeze bold) - (freeze bold) (* shortcuts *) => (arg0 write " => " write caret arg0 write) -> (=>) > (=>) decode ("Decode.Obj " write caret ".obj" write) adecode ("Decode.Obj " write arg0 write ".obj" write) code ("AsciiCoder.CodeFiles % " write caret "~" write) acode ("AsciiCoder.CodeFiles % " write arg0 write " " write caret "~" write) ren ("System.RenameFiles " write caret "~" write) rename (ren) aren ("System.RenameFiles " write arg0 write " => " write caret arg0 write " ~" write) arename (aren) delete ("System.DeleteFiles " write caret "~" write) adelete ("System.DeleteFiles " write arg0 write " " write caret "~" write) copy ("System.CopyFiles " write caret "~" write) acopy ("System.CopyFiles " write arg0 write " => " write caret arg0 write " ~" write) real ("Calc.Reset" call cr "Calc.Real " write caret) dec ("Calc.Reset" call cr "Calc.Dec " write caret) (*default macro taken when no match found*) (* OTHERWISE ("\" pwrite)*) (*install macro executed after initially loading EditKeys*) INSTALL () (* EditKeys 3.0 Documentation cas 9 May 92 / mh 19 Apr 94 / MK 1 Jun 95 EditKeys.Install installs EditKeys => all viewers with a handler element in the menu frame have now macro facility "Copy Out Tool" for using EditKeys. EditKeys.Definitions EditKeys.Read EditKeys.Text ~ EditKeys.Reset EditKeys.GetKeyCode EditKeys.Definitions opens a viewer and lists all current macro definitions. A selection or a command parameter can be used to restrict the list to definitions with a certain prefix. EditKeys.Read takes a list of files and reads in macro definitions contained therein. If errors are detected, all definitions are deleted. For prototyping macros, it is also possible to have "@" or ":=" as an argument for EditKeys.Read, where @ causes the current selection to be read in, while := takes the text following. (Warning: in both cases the text is parsed to its end.) Upon module load time, the standard macro definition file "EditKeys.Text" is read in. Also, if a macro "INSTALL" is defined, it is invoked. EditKeys.Reset deletes all current macro definitions, resetting the hotkey to its default. EditKeys.GetKeyCode helps to find out the codes of certain keys. Within a text supporting macro keys, entering the hot key causes expansion of the macro entered to the left. To avoid ambiguouties, the longest matching macro name is taken. A macro may have zero or more arguments supplied by the user. If no corresponding definition of a macro is found, a second try is made with the standard macro name "OTHERWISE". (EditKeys.Reset defines "OTHERWISE" to write the default hotkey, i.e. "\".) Syntax of macro definition files for EditKeys. MacroFile = [HotKeyDef] {MacroDef}. HotKeyDef = '\' KeyName. -- sets the macro expansion hot key (default is \) MacroDef = MacroName '(' { MacroName | TextStretch | Command} ')'. MacroName = KeyName | { }. TextStretch = '"' '"'. KeyName = '#' . (Comments and arbitrary white space are allowed between any two terminals. Comments may be nested.) Syntax of macro invocations. MacroInvocation = {Argument ":"} MacroName. Argument = { } | TextStretch. Built-in functions. Text stretches are pushed on a parameter stack when processed. Built-in functions may pop parameter(s) from that stack. ^0 pops a parameter and causes textual insertion. ^1 pops a parameter and inserts the corresponding ascii character. ^2 pops a parameter which must be a font name; presets the named font. ^3 pops a parameter which must be an integer; presets the vertical offset (in 1/64th of font height). ^4 pops a parameter and tries to call it as an Oberon command. ^A pops a parameter which must be an integer; pushs the nth (0 is leftmost one) macro argument ^B pops a parameter which must be a macro name; invokes the named macro ^C pops a parameter and appends it to the parameters used when calling an Oberon command ^5 keeps the font that would have been used w/o macro; presets this font. ^6 picks the font that would have been used w/o macro; forces whole macro to this font. ^7 presets the caret position. ^8 indents the next line according to the last line's indentation. ^9 avoids deletion of the macro, neither inserts characters written by the macro. Remarks. When reading in a macro that has been read in before, the new definition replaces the old one. Cyclic definitions can be constructed this way; a try to process such a definition is prevented. *)