summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0a98f47)
raw | patch | inline | side by side (parent: 0a98f47)
author | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Sat, 16 Sep 2017 15:05:04 +0000 (18:05 +0300) | ||
committer | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Sat, 16 Sep 2017 15:05:04 +0000 (18:05 +0300) |
TextV4/.gitignore | [new file with mode: 0644] | patch | blob |
TextV4/TextV4 | [new file with mode: 0755] | patch | blob |
TextV4/TextV4.obn | [new file with mode: 0644] | patch | blob |
TextV4/make.sh | [new file with mode: 0755] | patch | blob |
TextV4/voc/.gitignore | [new file with mode: 0644] | patch | blob |
TextV4/voc/TextV4Print.Mod | [new file with mode: 0644] | patch | blob |
TextV4/voc/TextV4ToAscii.Mod | [new file with mode: 0644] | patch | blob |
TextV4/voc/TextV4ToText.Mod | [new file with mode: 0644] | patch | blob |
TextV4/voc/make.sh | [new file with mode: 0755] | patch | blob |
diff --git a/TextV4/.gitignore b/TextV4/.gitignore
--- /dev/null
+++ b/TextV4/.gitignore
@@ -0,0 +1,2 @@
+classes
+tmp
diff --git a/TextV4/TextV4 b/TextV4/TextV4
--- /dev/null
+++ b/TextV4/TextV4
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+set -e
+
+DIR=$(dirname "$0")
+PATH="..:$PATH"
+
+java -ea -cp "$DIR/classes" Launcher TextV4.$*
diff --git a/TextV4/TextV4.obn b/TextV4/TextV4.obn
--- /dev/null
+++ b/TextV4/TextV4.obn
@@ -0,0 +1,63 @@
+(** Утилита для ковертирования теггированного текста в ASCII и на оборот **)
+(** TextV4.ToAscii <input file name> <output file name> **)
+(** TextV4.ToText <input file name> <output file name> **)
+(** TextV4.PrintText <input file name> **)
+
+MODULE TextV4;
+
+ IMPORT Oberon, Texts, Files, Out;
+
+ PROCEDURE ToAscii*;
+ VAR
+ f : Files.File;
+ w : Files.Rider;
+ r : Texts.Reader;
+ s : Texts.Scanner;
+ t : Texts.Text;
+ c : CHAR;
+ BEGIN
+ Texts.OpenScanner(s, Oberon.Par.text, Oberon.Par.pos);
+ Texts.Scan(s); NEW(t); Texts.Open(t, s.s); Texts.OpenReader(r, t, 0);
+ Texts.Scan(s); f := Files.New(s.s); Files.Set(w, f, 0);
+ Texts.Read(r, c);
+ IF ~r.eot THEN
+ IF c # 00X THEN IF c = 0DX THEN c := 0AX END; Files.Write(w, c) END;
+ WHILE ~r.eot DO
+ Texts.Read(r, c);
+ IF c # 00X THEN IF c = 0DX THEN c := 0AX END; Files.Write(w, c) END;
+ END;
+ Files.Register(f); Files.Close(f);
+ END;
+ END ToAscii;
+
+ PROCEDURE ToText*;
+ VAR
+ s : Texts.Scanner;
+ t : Texts.Text;
+ BEGIN
+ Texts.OpenScanner(s, Oberon.Par.text, Oberon.Par.pos);
+ Texts.Scan(s); NEW(t); Texts.Open(t, s.s);
+ Texts.Scan(s); Texts.Close(t, s.s);
+ END ToText;
+
+ PROCEDURE Print*;
+ VAR
+ r : Texts.Reader;
+ s : Texts.Scanner;
+ t : Texts.Text;
+ c : CHAR;
+ BEGIN
+ Texts.OpenScanner(s, Oberon.Par.text, Oberon.Par.pos);
+ Texts.Scan(s); NEW(t); Texts.Open(t, s.s); Texts.OpenReader(r, t, 0);
+
+ Texts.Read(r, c);
+ IF ~r.eot THEN
+ IF c # 00X THEN IF c = 0DX THEN Out.Ln; END; Out.Char(c) END;
+ WHILE ~r.eot DO
+ Texts.Read(r, c);
+ IF c # 00X THEN IF c = 0DX THEN Out.Ln; END; Out.Char(c) END;
+ END;
+ END;
+ END Print;
+
+END TextV4.
diff --git a/TextV4/make.sh b/TextV4/make.sh
--- /dev/null
+++ b/TextV4/make.sh
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+set -e
+
+PATH="..:$PATH"
+
+obn-compile.sh -I TextV4 TextV4
diff --git a/TextV4/voc/.gitignore b/TextV4/voc/.gitignore
--- /dev/null
+++ b/TextV4/voc/.gitignore
@@ -0,0 +1,7 @@
+TextV4Print
+TextV4ToAscii
+TextV4ToText
+*.o
+*.sym
+*.h
+*.c
diff --git a/TextV4/voc/TextV4Print.Mod b/TextV4/voc/TextV4Print.Mod
--- /dev/null
@@ -0,0 +1,4 @@
+MODULE TextV4Print;
+IMPORT TextV4;
+BEGIN TextV4.Print
+END TextV4Print.
diff --git a/TextV4/voc/TextV4ToAscii.Mod b/TextV4/voc/TextV4ToAscii.Mod
--- /dev/null
@@ -0,0 +1,4 @@
+MODULE TextV4ToAscii;
+IMPORT TextV4;
+BEGIN TextV4.ToAscii
+END TextV4ToAscii.
diff --git a/TextV4/voc/TextV4ToText.Mod b/TextV4/voc/TextV4ToText.Mod
--- /dev/null
@@ -0,0 +1,4 @@
+MODULE TextV4ToText;
+IMPORT TextV4;
+BEGIN TextV4.ToText
+END TextV4ToText.
diff --git a/TextV4/voc/make.sh b/TextV4/voc/make.sh
--- /dev/null
+++ b/TextV4/voc/make.sh
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+set -e
+
+voc -F ../TextV4.obn TextV4ToAscii.Mod -m TextV4ToText.Mod -m TextV4Print.Mod -m
+rm -f *.o *.sym *.h *.c