diff options
Diffstat (limited to 'doc')
| -rw-r--r-- | doc/TODO | 297 |
1 files changed, 157 insertions, 140 deletions
@@ -1,19 +1,30 @@ -TODO in GF implementation -(P=Peter, A=Aarne, B=Björn) + +* 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) ---------------------------------------------------------------------- -URGENT -*(P) Felmeddelanden +* [peb] URGENT: Error messages for syntax errors -När det rapporteras syntaxfel bör det skrivas ut vilken fil det rör sig om. -Annars är det omöjligt att veta var felet ligger om man använder flaggan -s: + 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 , + > i -s Domain/MP3/Domain_MP_Semantics.gf + syntax error at line 33 before ve , Proposition , -Andra sorters fel är det inget problem med: + There's no problem with other kinds of errors: > i -s Domain/MP3/Domain_MP_Semantics.gf checking module Godis_Semantics @@ -23,190 +34,196 @@ Andra sorters fel är det inget problem med: } -*(P) Hjälpkommandot +* [peb] IMPORTANT: Add the -path of a module to daughter modules -> h -printer -(där saknas -printer=cfgm) + Then the main module does not have to know where all grandchildren are: -> h -cat -WARNING: invalid option: cat + file A.gf: + abstract A = B ** {...} -> h -lang -WARNING: invalid option: lang + file B.gf: + --# -path=./resource + abstract B = Lang ** {...} -> h -language -WARNING: invalid option: language + I.e.: the file A.gf should not need to know that B.gf uses the + resource library. -> h -parser -WARNING: invalid option: parser -> h -aslkdjaslkdjss -WARNING: invalid option: aslkdjaslkdjss -Command not found. -(det borde stå: "option not found") +* [peb] IMPORTANT: incomplete concrete and interfaces -> h -optimize -WARNING: invalid option: optimize +- The following works in GF: -> h -startcat -WARNING: invalid option: startcat + 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"}; + } -> h h -h, help: h Command? -(det borde även stå om h -option) + > i -src TestDE.gf +- BUT, if we exchange "TestCI" for "C" we get an error: -*(P) En moduls -path adderas till dottermodulerna, -så slipper huvudmodulen veta var alla barnbarn ligger: + 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"}; + } -fil A.hs: -abstract A = B ** {...} + > 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 -fil B.hs: ---# -path=./resource -abstract B = Lang ** {...} +- the other modules: -Alltså: filen A.hs ska inte behöva veta att B.hs använder sig av resource. + abstract TestA = { + cat A; + fun f, g : A; + } + instance TestBE of TestBI = { + oper hello = "hello"; + bye = "bye"; + } -*(P) Möjlighet att sätta GF_LIB_PATH inuti GF, t.ex. med: + interface TestBI = { + oper hello : Str; + bye : Str; + } -> sf libpath=... + 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}; + } -*(P) Möjlighet att sätta startkategorin för en grammatik med sf: + concrete TestDE of TestA = TestDI with (TestCI = TestCE); -> sf startcat=X +* [peb] IMPORTANT: Missing things in the help command + > h -printer + (the flag -printer=cfgm is missing) + + > h -cat + WARNING: invalid option: cat -*(P) import-flaggor: + > h -lang + WARNING: invalid option: lang -när man gör "pg -printer=cfg", måste man ha gjort "i -conversion=finite", -"pg" bryr sig inte om vilka flaggor som sätts i grammatikfilen + > h -language + WARNING: invalid option: language -när man gör "pm -printer=cfgm", måste flaggan "conversion=finite" vara satt i grammatikfilen, -"pm" bryr sig inte om ifall man har gjort "i -conversion=finite" + > h -parser + WARNING: invalid option: parser -det är väl jag (Peter) som borde fixa detta, men jag vet inte var de olika flaggorna ligger + > h -aslkdjaslkdjss + WARNING: invalid option: aslkdjaslkdjss + Command not found. + (it should note: "option not found") -och det måste bestämmas vilka flaggor som har företräde: -- i grammatikfilen, med "flags conversion=finite" -- på kommandoraden, med "sf conversion=finite" -- till ett kommmande, med "i -conversion=finite fil.gf" + > h -optimize + WARNING: invalid option: optimize + > h -startcat + WARNING: invalid option: startcat ----------------------------------------------------------------------- -NOT SO URGENT + > 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 -*(P) incomplete concrete +* [peb] IMPORTANT: import-flags -- följande funkar i GF: +- 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 -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"}; -} + 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 -src TestDE.gf -- compiling TestBI.gf... wrote file TestBI.gfr 110 msec - wrote file TestBI.gfc 110 msec -- compiling TestBE.gf... wrote file TestBE.gfr 120 msec - wrote file TestBE.gfc 120 msec -- compiling TestA.gf... wrote file TestA.gfc 120 msec -- compiling TestCI.gf... wrote file TestCI.gfc 130 msec -- compiling TestCE.gf... wrote file TestCE.gfc 140 msec -- compiling TestDI.gf... wrote file TestDI.gfc 140 msec -- compiling TestDE.gf... wrote file TestDE.gfc 150 msec + (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: -- MEN, om man byter ut "TestCI" mot "C" blir det fel: + 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" -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"}; -} +- A related issue is to decide the scope of flags: -> i -src TestDE.gf -- compiling TestBI.gf... wrote file TestBI.gfr 170 msec - wrote file TestBI.gfc 170 msec -- compiling TestBE.gf... wrote file TestBE.gfr 170 msec - wrote file TestBE.gfc 180 msec -- compiling TestA.gf... wrote file TestA.gfc 190 msec -- compiling TestCI.gf... wrote file TestCI.gfc 200 msec -- compiling TestCE.gf... wrote file TestCE.gfc 200 msec -- compiling TestDI.gf... wrote file TestDI.gfc 200 msec -- 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 + 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) +* [peb] WISH: generalizing incomplete concrete -- de övriga modulerna: + 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. -abstract TestA = { -cat A; -fun f, g : A; -} +* [peb] WISH: _tmpi, _tmpo -instance TestBE of TestBI = { -oper hello = "hello"; - bye = "bye"; -} + The files _tmpi and _tmpo are never removed when quitting GF. + Further suggestion: put them in /tmp or similar. -interface TestBI = { -oper hello : Str; - bye : Str; -} + peb: när man använder "|" till ett systemanrop, t.ex: + pg | ! sort + så skapas filerna _tmpi och _tmpo. Men de tas aldrig bort. -concrete TestCE of TestA = TestCI with (TestBI = TestBE); + peb: Ännu bättre: ta bort filerna efteråt. -incomplete concrete TestCI of TestA = open TestBI in { -lincat A = {s : Str}; -lin f = {s = hello}; - g = {s = bye}; -} + aarne: Sant: när GF quittas (om detta inte sker onormalt). + Eller när kommandot har kört färdigt (om det terminerar). -concrete TestDE of TestA = TestDI with (TestCI = TestCE); + 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... -*(P) _tmpi, _tmpo + 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. -P: när man använder "|" till ett systemanrop, t.ex: -pg | ! sort -så skapas filerna _tmpi och _tmpo. Men de tas aldrig bort. + 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 -P: Ännu bättre: ta bort filerna efteråt. -A: Sant: när GF quittas (om detta inte sker onormalt). -Eller när kommandot har kört färdigt (om det terminerar). +* [peb] WISH: Hierarchic modules -P: Bäst(?): skapa filerna i /tmp eller liknande. + 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 -A: 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... +- How can this be combined with several modules inside one file? -A: 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. -B: 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 - - -*(P) Hierarkiska moduler -P: Förslag: A.B.C ligger i filen A/B/C.gf -Största fördelen: man slipper ange --# -path=... |
