TODO 11.1 KB
Newer Older
POTTIER Francois's avatar
POTTIER Francois committed
1 2 3 4 5
* 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
  file. Can this be fixed? Generate more # directives around the application
  node?

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

POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
8
* Set up continuous integration (ci.inria.fr)...
POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
9 10
  Check that Menhir builds (and the test pass)
  with multiple versions of OCaml.
POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
11

POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
12 13 14
* 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
15 16
* Incremental API: expose a function `lookahead` of type `'a env -> token option`.

POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
17 18 19
* 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
20
  See also de Souza Amorim, Steindorfer & Visser.
POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
21

POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
22 23 24 25 26 27 28 29 30 31 32 33 34
* 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
35 36
* 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
37 38
  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
39
    https://sympa.inria.fr/sympa/arc/menhir/2017-05/msg00003.html
POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
40
  (Always parenthesize production groups that share a semantic action?)
POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
41
  (Or just disallow them?)
POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
42

POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
43 44 45
* Allow the generated types (token, etc.) to be annotated with OCaml
  attributes such as [@@deriving show].

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

POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
49 50
* Menhir's Web page should be folded back into the git repo's README.

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

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

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

POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
59
* Contribute ocamlbuild or dune rules for dealing with .messages files.
POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
60

POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
61 62 63
* Does ocamlbuild have support for --only-tokens and --external-tokens?
  If not, contribute it (demos/calc-param).

POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
64 65
* 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
66 67
  Translate them to calls to the Parsing module.
  Document this command.
POTTIER Francois's avatar
POTTIER Francois committed
68

POTTIER Francois's avatar
POTTIER Francois committed
69 70 71 72 73
* 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
74
* Possible extensions to the inspection API:
POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
75
  - offer a way of mapping an initial state (number) back to its nonterminal symbol
POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
76 77 78
  - 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
79
      T.token2terminal, T.token2value offer one direction (token -> xtoken)
POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
80
      the other direction would have to be generated
POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
81

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

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

POTTIER Francois's avatar
POTTIER Francois committed
88 89 90 91 92
* 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
93 94
  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
95 96 97 98
  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
99

100 101 102
* --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
103 104
* 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
105 106
  Or --merge-errors which merges two .messages file,
  recognizing the default message as irrelevant.
POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
107 108
  (Gabriel Scherer.)

POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
109 110 111 112
* 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
113

POTTIER Francois's avatar
POTTIER Francois committed
114 115
* Dans les avantages de Menhir versus ocamlyacc (dans la doc et
  sur la page Web), ajouter le back-end Coq, l'API incrémentale
POTTIER Francois's avatar
POTTIER Francois committed
116
  et l'API d'inspection, les règles anonymes, la gestion fine des
POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
117 118 119
  erreurs de syntaxe... Indiquer qu'avec %inline+symboles paramétrés+règles anonymes
  on va en fait beaucoup plus loin que LR(1), à condition que la grammaire
  après macro-expansion soit encore LR(1).
POTTIER Francois's avatar
POTTIER Francois committed
120

POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
121 122 123 124 125 126 127
* 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").

128
* Pénible que l'API d'inspection ne donne pas accès
129 130
  à 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
131
  devrait alors produire une option. Et le cas Nil du type
132
  stream devrait contenir l'état initial...
POTTIER Francois's avatar
POTTIER Francois committed
133
  attention, car si on lui applique la fonction items, on va
134 135
  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
136 137
  Ou alors, exposer juste le symbole de départ correspondant?
  Mais comment le retrouver?
POTTIER Francois's avatar
POTTIER Francois committed
138

POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
139
* autoriser %token FOO [@unused]
140
  équivalent à --unused-token FOO sur la ligne de commande.
POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
141 142
  Add an analogous mechanism for nonterminals that are known
  to be unreachable.
POTTIER Francois's avatar
POTTIER Francois committed
143

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

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

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
* Add demos/calc-coq to show how the Coq back-end is used.
POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
156

POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
157 158
* 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
159 160 161
  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
162

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

166 167 168
* 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
169 170
  non-terminaux), non? (Jacques-Henri.)

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

174 175 176 177 178
* 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?

179 180 181
* 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
182
  production A -> alpha B beta avec alpha et beta nullables, et regarder
183
  ensuite s'il existe un cycle de productions unité.
184

POTTIER Francois's avatar
POTTIER Francois committed
185
* Permettre une trace avec autre chose que fprintf stderr. Cela permettrait
186 187 188
  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.
189

POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
190 191 192 193
* Offer a way of annotating the generated type definitions ([token],
  ['a terminal], ['a nonterminal], etc.) with OCaml attributes, such
  as [@@deriving show]. (Suggested by Perry Metzger.)

194
* (petit) BUG: --follow-construction n'affiche pas le contenu des états
195 196
  initiaux (r0)

197
* Préserver dirname/ dans les directives #line émises.
198

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

202 203
* é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
204 205
  les deux points ne commence pas par un nombre.

206 207
* si une variable est inutilisée dans une action sémantique, le
  warning est affiché dans le code produit.
208 209 210

* 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
211
  (see e.g. belloeil.mly) (et le reduced_parser.mly d'Adrien Guatto)
POTTIER Francois's avatar
POTTIER Francois committed
212
  (also check the parser.mly sent by Andrej Bauer on 2016/01/21)
POTTIER Francois's avatar
POTTIER Francois committed
213
  Or just give up on explaining the conflict in this case.
214

215 216
* BUG: cutdown.mly

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

POTTIER Francois's avatar
TODO.  
POTTIER Francois committed
221 222
* Ideally, [PartialGrammar] should avoid renaming the parameters of
  a rule, when there is no need to do so. The renamed parameter is
223 224
  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
225 226 227 228 229 230 231 232 233 234 235

* 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
236 237 238 239 240 241 242

* 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?