TODO 10.9 KB
Newer Older
POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
1 2 3
* Makefile: in [make data], the message "TIMEOUT after 60 seconds."
  should be printed only if the exit code is 124.

POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
4 5
* Allow %type declarations to appear in the rule section.

6 7 8 9
* generate-printers should not be a demo but a tool,
  and should be installed.
  It would solve issue #6.

POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
10 11 12
* Allow the generated types (token, etc.) to be annotated with OCaml
  attributes such as [@@deriving show].
  The only question is how to do this most elegantly: in the .mly file
13
  (with what syntax?) or via the command line. (Issue #6.) (See also above.)
POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
14

POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
15 16
* Add a simple demo of the new syntax-error-reporting mechanism.

POTTIER Francois's avatar
POTTIER Francois committed
17 18
* A drawback of point-free semantic actions: if the application of the OCaml
  identifier to the tuple is ill-typed, then we get a type error in the mock
POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
19
  file. Can this be fixed? Generate # directives around the application node.
POTTIER Francois's avatar
POTTIER Francois committed
20

POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
21 22
* OCaml warnings about unused variables can be reported in the mock file.

POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
23 24 25
* Add a command line option to control how "MenhirLib" should be named in the
  generated code. (Suggested by Gabriel Scherer.)

POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
26 27
* Incremental API: expose a function `lookahead` of type `'a env -> token option`.

POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
28 29 30
* Think about implementing Adams and Might's technique for intersecting
  a grammar with a tree automaton. (As a preprocessing step. Think about
  the interaction with parameterized symbols and with %inline.)
POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
31
  See also de Souza Amorim, Steindorfer & Visser.
POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
32

POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
33 34 35 36 37 38 39 40 41 42 43 44 45
* Work of Frédéric on concrete syntax trees.
  - Produce a definition of the specific type of CSTs for this grammar.
    (Before expansion.)
  - Produce a grammar where the semantic actions build CSTs.
  - Define a generic (internal) type of CSTs and
    produce a function that maps generic CSTs to specific CSTs.
  - "Uninliner" : map CSTs for the expanded grammar
    back to CSTs for the source grammar?
  - "Unparsing" : map an arbitrary CST to one that can be printed
    and re-parsed identically, while inserting a minimal number of
    "parentheses". Ideally, with a static guarantee of success,
    and in linear time.

POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
46 47
* allow a rule of the form "foo == bar" as sugar for "foo: bar { $1 }"?
  (Allow parameters. Allow several alternatives on the right-hand side,
POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
48 49
  as long as each alternative has length 1.) (Frédéric Bour.)
  (Gabriel Scherer, "A suggestion for a more expressive production syntax.")
POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
50
    https://sympa.inria.fr/sympa/arc/menhir/2017-05/msg00003.html
POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
51
  (Always parenthesize production groups that share a semantic action?)
POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
52
  (Or just disallow them?)
POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
53

POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
54 55
* Send CompCert pull request using the new API (current_state_number)
  and MenhirLib.ErrorReports where possible.
POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
56

POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
57
* Move more of ErrorReports from CompCert to MenhirLib.
POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
58
  In [show], might want to apply [shorten] to the output of [f].
POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
59

POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
60 61 62
* Clean up the calc-inspection demo, which uses an undocumented/unfinished
  approach to error reporting.

POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
63
* clean up this TODO file! and use gitlab issues for known bugs?
POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
64

POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
65 66
* Complete the implementation of --only-preprocess-for-ocamlyacc.
  Currently, the position keywords ($startpos, etc.) are not supported.
POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
67 68
  Translate them to calls to the Parsing module.
  Document this command.
POTTIER Francois's avatar
POTTIER Francois committed
69

POTTIER Francois's avatar
POTTIER Francois committed
70 71 72 73 74
* The documentation says not to use _i,
  but --only-preprocess produces it.
  Should we avoid producing it?
  Should we check that it is not used?

POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
75
* Possible extensions to the inspection API:
POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
76
  - offer a way of mapping an initial state (number) back to its nonterminal symbol
POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
77 78 79
  - expose the number of states (useful for memoisation).
  - expose the number of productions.
  - expose an isomorphism between token and xtoken = exists 'a. ('a terminal * 'a)
POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
80
      T.token2terminal, T.token2value offer one direction (token -> xtoken)
POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
81
      the other direction would have to be generated
POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
82

POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
83 84 85
* explain how to simulate inherited attributes in the manual
  (cf. post by David Chemouil on mailing list)

86 87 88
* Look for "artificial dependency" and remove them.
  Make sure every module is explicitly called.

POTTIER Francois's avatar
POTTIER Francois committed
89 90 91 92 93
* If the right-hand side of a production provably generates the empty
  language, remove this production. (Must remove it explicitly, otherwise
  we lose the property that errors are detected as early as possible.
  Also, this avoids triggering the detection of epsilon-cycles, which
  assumes that all symbols are inhabited.)
POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
94 95
  Currently we warn about nonterminals that generate the empty language.
  Maybe we need a %void annotation when this is intended?
POTTIER Francois's avatar
POTTIER Francois committed
96 97 98 99
  Document this trick: the empty language can be defined by "void: void"
  and can be used as an actual parameter in parameterized definitions.
  This allows making extensible definitions and instantiating them with
  "no extension".
POTTIER Francois's avatar
POTTIER Francois committed
100

101 102 103
* --compile-errors could warn about messages wider than 80 columns
                   could also warn statically about out-of-range $i?

POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
104 105
* Implement --copy-errors to copy error messages from one .messages
  file to another (for those states that exist in both files).
POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
106 107
  Or --merge-errors which merges two .messages file,
  recognizing the default message as irrelevant.
POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
108 109
  (Gabriel Scherer.)

POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
110 111 112 113
* Add a facility to produce a set of *valid* sentences that reach *every*
  (reachable) state of the automaton. Also, a set of valid sentences that
  exercise *every* production. This could be useful in regression testing,
  says Frédéric Bour.
POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
114

POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
115 116 117 118 119 120 121
* Document the fact that (ocaml)yacc and Menhir do not have the same
  behavior concerning default reductions (one performs the default
  reduction *before* calling the lexer, the other does it the other
  way around). The difference is observable only when the semantic
  action has a side effect which influences the lexer (i.e., only
  when there is a "lexer hack").

122
* Pénible que l'API d'inspection ne donne pas accès
123 124
  à l'état courant lorsque la pile est vide (état initial donc).
  Pourrait-on exposer cet état? Polymorphe? incoming_symbol
POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
125
  devrait alors produire une option. Et le cas Nil du type
126
  stream devrait contenir l'état initial...
POTTIER Francois's avatar
POTTIER Francois committed
127
  attention, car si on lui applique la fonction items, on va
128 129
  obtenir un item spécial S' -> S # qui va poser problème.
  Exposer l'état initial avec un type différent lr1initial?
POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
130 131
  Ou alors, exposer juste le symbole de départ correspondant?
  Mais comment le retrouver?
POTTIER Francois's avatar
POTTIER Francois committed
132

POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
133
* autoriser %token FOO [@unused]
134
  équivalent à --unused-token FOO sur la ligne de commande.
POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
135 136
  Add an analogous mechanism for nonterminals that are known
  to be unreachable.
POTTIER Francois's avatar
POTTIER Francois committed
137

138
* Produce well-chosen (predictable) names for anonymous rules?
POTTIER Francois's avatar
POTTIER Francois committed
139

140 141
* Standard library: add more list forms (left-recursive lists,
  flexible lists, etc.)
POTTIER Francois's avatar
POTTIER Francois committed
142

POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
143 144 145 146 147 148
* Standard library: might wish to add epsilon (which recognizes
  the empty string and produces a unit value), nil (which
  recognizes the empty string and produces an empty list), etc.
  However, they would need to be marked %unreachable
  (i.e., do not warn if they are unreachable).

POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
149
* Define [print_checkpoint].
POTTIER Francois's avatar
POTTIER Francois committed
150
  Define a printer that shows the states in the stack.
POTTIER Francois's avatar
POTTIER Francois committed
151

POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
152 153 154
* Documenter la différence de philosophie avec Denny & Malloy à propos
  des conflits (cf. email à Laurence Tratt).

POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
155 156
* allow the user to choose the type of "source code intervals" that are stored
  in the stack (instead of imposing a pair of locations, $startpos and $endpos)
POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
157 158 159
  and to choose how intervals are combined. See Frédéric's branch:
  https://gitlab.inria.fr/fpottier/menhir/tree/fred-abstract-locations
  See also Frédéric's email to François entitled "Menhir avec $loc" (26/07/2018).
POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
160

POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
161 162 163
* write a specialized version of PackedIntArray.get to the .ml file,
  for added performance. (Suggested by Frédéric Bour.)

164 165 166
* On pourrait rendre moins restrictif le critère qui garantit la terminaison
  de l'expansion des non-terminaux paramétrés. Il suffirait de vérifier que
  les paramètres effectifs sont toujours des atomes (symboles terminaux ou
167 168
  non-terminaux), non? (Jacques-Henri.)

169
* Reconnaître les directives # n "foo" dans le fichier .mly et en tenir
POTTIER Francois's avatar
POTTIER Francois committed
170 171
  compte dans les locations.

172 173 174 175 176
* BUG: message de Valentin Gatien-Baron du 09/01/2010: le bug de --explain
  est-il bien le bug connu? peut-on le corriger? ne suffirait-il pas de
  passer sous silence les conflits qui ont lieu dans une partie inaccessible
  de l'automate?

177 178 179
* Implémenter un test de détection de boucles. Si la grammaire contient une
  boucle, elle est infiniment ambiguë. Pour le test, calculer tous les
  nullables, ajouter une production unité A -> B dès qu'il existe une
180
  production A -> alpha B beta avec alpha et beta nullables, et regarder
181
  ensuite s'il existe un cycle de productions unité.
182

POTTIER Francois's avatar
POTTIER Francois committed
183
* Permettre une trace avec autre chose que fprintf stderr. Cela permettrait
184 185 186
  au programmeur (par exemple) de décider à runtime s'il veut afficher ou
  non la trace. (En mode --trace.) Et si possible, donner accès depuis
  l'extérieur à la fonction print_token qui est engendrée.
187

188
* Préserver dirname/ dans les directives #line émises.
189

190 191
* BUG: Boris (1.- bouclage parser sur une entrée erronée 2.- une lecture
  trop loin dans le stream, également liée à error).
192

193 194
* éviter "Warning: 22 conflicts ..." car emacs prend "Warning" pour un
  nom de fichier; d'après Damien, il devrait suffire que la phrase après
195 196
  les deux points ne commence pas par un nombre.

197 198
* si une variable est inutilisée dans une action sémantique, le
  warning est affiché dans le code produit.
199 200 201

* BUG: solving a shift/reduce conflict in favor of reduction can
  cut a path that was required in order to explain another conflict.
POTTIER Francois's avatar
POTTIER Francois committed
202
  (see e.g. belloeil.mly) (et le reduced_parser.mly d'Adrien Guatto)
POTTIER Francois's avatar
POTTIER Francois committed
203
  (also check the parser.mly sent by Andrej Bauer on 2016/01/21)
POTTIER Francois's avatar
POTTIER Francois committed
204
  Or just give up on explaining the conflict in this case.
205 206

* dans le dump de l'automate, rajouter les transitions qui ont
POTTIER Francois's avatar
POTTIER Francois committed
207
  ete supprimees par resolution de conflits. Afficher aussi les
208
  réductions par défaut?
POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
209

POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
210 211
* Ideally, [PartialGrammar] should avoid renaming the parameters of
  a rule, when there is no need to do so. The renamed parameter is
212 213
  visible in sort unification error messages and in messages about
  duplicate formal parameters (test/bad/duplicate-formal.mly).
POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
214 215 216 217 218 219 220 221 222 223 224

* Create a clean functor out of LRijkstra.
  - Must use Cmly_api instead of Grammar
    (or must cleanly document its minimum requirements)
  - Must not perform any side effects
  - Must produce reachability information about pairs (s, z)
  On top of that, implement a GRAMMAR -> GRAMMAR transformation
  that removes all "don't care" entries in the reduction table.
  Then, implement partition refinement for a union of n GRAMMARs (?)
  as a way of testing whether two LR(1) automata (whose LR(0) skeleta
  are identical) are equivalent.
POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
225 226 227 228 229 230 231

* Quand on est dans un état d'erreur et qu'on tente une réduction
  (car elle est activée dans l'état courant), si l'action sémantique
  fait $syntaxerror, on va apparemment boucler (on rattrape l'exception
  et on se retrouve en mode gestion d'erreur dans le même état; cf. bug
  rapporté par Gabriel Scherer sur la grammaire d'OCaml, OCaml 0007847).
  On pourrait détecter ce cas et le traiter spécialement?
POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
232 233 234 235 236

* The use of `--external-tokens` is perhaps unsafe. If the external type
  `token` is out of sync with the `%token` declarations in the grammar,
  then the type error might go unnoticed (due to Obj.magic?) and result
  in a hard crash.