summaryrefslogtreecommitdiff
path: root/doc/TODO
blob: c92f4c8fac55899be44d2629e64ab8698868f1fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231

* Some notes on the syntax of this file, making it possible to use todoo-mode.el:

- Items start with "* "
- Sub-items start with "- "
- It should be noted somewhere in the item, who has reported the item
   Suggestion: Add "[who]" at the beginning of the item title
   (then one can use "assign item" in todoo-mode)
- Each item should have a priority
   Suggestion: Add "URGENT", "IMPORTANT" or "WISH" at the beginning of
   the item title
- Sort the items in priority order
   (todoo-mode can move an item up or down)

----------------------------------------------------------------------


* [peb] URGENT: Error messages for syntax errors

   When a syntax error is reported, it should be noted which file it
   is. Otherwise it is impossible to know where the error is 
   (if one uses the -s flag):

   	> i -s Domain/MP3/Domain_MP_Semantics.gf
   	syntax error at line 33 before ve , Proposition ,

   There's no problem with other kinds of errors:

	> i -s Domain/MP3/Domain_MP_Semantics.gf
	checking module Godis_Semantics
	Happened in linearization of userMove :
	product expected instead of {
	  pl : Str 
	}


* [peb] IMPORTANT: Add the -path of a module to daughter modules

   Then the main module does not have to know where all grandchildren are:

   file A.gf:
   abstract A = B ** {...}

   file B.gf:
   --# -path=./resource
   abstract B = Lang ** {...}

   I.e.: the file A.gf should not need to know that B.gf uses the
   resource library.


* [peb] IMPORTANT: incomplete concrete and interfaces

- The following works in GF:

   incomplete concrete TestDI of TestA = open (C=TestCI) in {
     lincat A = TestCI.A ** {p : Str};
     lin f = TestCI.f ** {p = "f"};
         g = TestCI.g ** {p = "g"};
   }

   > i -src TestDE.gf

- BUT, if we exchange "TestCI" for "C" we get an error:

   incomplete concrete TestDI of TestA = open (C=TestCI) in {
     lincat A = C.A ** {p : Str};
     lin f = C.f ** {p = "f"};
         g = C.g ** {p = "g"};
   }

   > i -src TestDE.gf
   compiling TestDE.gf... failed to find C
   OCCURRED IN
   atomic term C given TestCE TestCI TestCE TestDE
   OCCURRED IN
   renaming definition of f
   OCCURRED IN
   renaming module TestDE

- the other modules:

   abstract TestA = {
     cat A;
     fun f, g : A;
   }

   instance TestBE of TestBI = {
     oper hello = "hello";
          bye  = "bye";
   }

   interface TestBI = {
   oper hello : Str;
        bye : Str;
   }

   concrete TestCE of TestA = TestCI with (TestBI = TestBE);

   incomplete concrete TestCI of TestA = open TestBI in {
   lincat A = {s : Str};
   lin f = {s = hello};
       g = {s = bye};
   }

   concrete TestDE of TestA = TestDI with (TestCI = TestCE);

* [peb] IMPORTANT: Missing things in the help command

   > h -printer
   (the flag -printer=cfgm is missing)
   
   > h -cat
   WARNING: invalid option: cat

   > h -lang
   WARNING: invalid option: lang

   > h -language
   WARNING: invalid option: language

   > h -parser
   WARNING: invalid option: parser

   > h -aslkdjaslkdjss
   WARNING: invalid option: aslkdjaslkdjss
   Command not found.
   (it should note: "option not found")

   > h -optimize
   WARNING: invalid option: optimize

   > h -startcat
   WARNING: invalid option: startcat

   > h h
   h, help: h Command?
   (it should also mention "h -option")


* [peb] IMPORTANT: Set GF_LIb-PATH within GF 

   > sf libpath=~/GF/lib


* [peb] IMPORTANT: Set the starting category with "sf"

   > sf startcat=X


* [peb] IMPORTANT: import-flags 

- There are some inconsistencies when importing grammars:
   
   1. when doing "pg -printer=cfg", one must have used "i -conversion=finite",
   since "pg" doesn't care about the flags that are set in the grammar file

   2. when doing "pm -printer=cfgm", one must have set the flag
   "conversion=finite" within the grammar file, since "pm" doesn't
   care about the flags to the import command

   (I guess it's me (peb) who should fix this, but I don't know where
   the different flags reside...)

- Also, it must be decided in what cases flags can override other flags:

   a) in the grammar file, e.g. "flags conversion=finite;"
   b) on the command line, e.g. "> sf conversion=finite"
   c) as argument to a command, e.g. "> i -conversion=finite file.gf"

- A related issue is to decide the scope of flags:

   Some flags are (or should be) local to the module 
   (e.g. -coding and -path) 
   Other flags override daughter flags for daughter modules
   (e.g. -startcat and -conversion)

* [bringert] IMPORTANT: get right startcat flag when printing CFGM
   GF.CFGM.PrintCFGrammar.prCanonAsCFGM currently only gets the startcat
   flag from the top-level concrete module. This might be easier
   to fix if the multi grammar printers had access to more than just
   the CanonGrammar. 

* [peb] WISH: generalizing incomplete concrete 

   I want to be able to open an incomplete concrete module
   inside another incomplete conrete.
   Then I can instantiate both incompletes at the same time.

* [peb] WISH: _tmpi, _tmpo

   The files _tmpi and _tmpo are never removed when quitting GF.
   Further suggestion: put them in /tmp or similar.

   peb: när man använder "|" till ett systemanrop, t.ex:
   pg | ! sort
   så skapas filerna _tmpi och _tmpo. Men de tas aldrig bort.

   peb: Ännu bättre: ta bort filerna efteråt.

   aarne: Sant: när GF quittas (om detta inte sker onormalt).
   Eller när kommandot har kört färdigt (om det terminerar).

   peb: Bäst(?): skapa filerna i /tmp eller liknande.

   aarne: Ibland får man skrivrättighetsproblem - och det är
   inte kul om man måste ange en tmp-path. Och olika
   användare och gf-processer måste ha unika filnamn.
   Och vet inte hur det funkar på windows...

   aarne: Ett till alternativ skulle vara att använda handles
   utan några tmp-filer alls. Men jag har inte hunnit
   ta reda på hur det går till.

   björn: Lite slumpmässiga tankar:
   + man kan använda System.Directory.getTemporaryDirectory, så slipper man iaf bry sig om olika plattformsproblem.
   + sen kan man använda System.IO.openTempFile för att skapa en temporär fil. Den tas dock inte bort när programmet avslutas, så det får man fixa själv.
   + System.Posix.Temp.mkstemp gör nåt liknande, men dokumentationen är dålig.
   + biblioteket HsShellScript har lite funktioner för sånt här, se
   http://www.volker-wysk.de/hsshellscript/apidoc/HsShellScript.html#16


* [peb] WISH: Hierarchic modules

   Suggestion by peb: 
   The module A.B.C is located in the file A/B/C.gf
   
   Main advantage: you no longer need to state "--# -path=..." in
   modules

- How can this be combined with several modules inside one file?