aboutsummaryrefslogtreecommitdiff
path: root/gramlib/grammar.mli
AgeCommit message (Collapse)Author
2021-04-23Relying on the abstract notion of streams with location for parsing.Hugo Herbelin
We also get rid of ploc.ml, now useless, relying a priori on more robust code in lStream.ml for location reporting (see e.g. parse_parsable in grammar.ml).
2020-03-25[gramlib] Don't expose unsafe interfaces to clientsEmilio Jesus Gallego Arias
I'd say this is more of a temporary measure than a long-term plan; IMO we should make the interfaces safe so `Gramlib.Grammar` does provide only one signature.
2020-03-25[pcoq] Inline the exported Gramlib interface instead of exposing it as GEmilio Jesus Gallego Arias
2020-03-25[parsing] Move comments lexer extensions to base lexer interfaceEmilio Jesus Gallego Arias
This makes sense as a step towards a more functional handling of the state.
2020-03-25[gramlib] Remove warning function parameter in favor of standard mechanism.Emilio Jesus Gallego Arias
If we need more fine-tuning we should manage the warnings with the standard Coq mechanism.
2020-03-25[parsing] Move `coq_parsable` custom logic to Grammar.Emilio Jesus Gallego Arias
Latest refactorings allow us to make the signature Coq parser a standard `Grammar.S` one; the only bit needed is to provide the extra capabilities to the `Lexer` signature w.r.t. to comments state. The handling of Lexer state is still a bit ad-hoc, in particular it is global whereas it should be fully attached to the parsable. This may work ok in batch mode but the current behavior may be buggy in the interactive context. This PR doesn't solve that but it is a step towards a more functional solution.
2020-03-25[parsing] Remove extend AST in favor of gramlib constructorsEmilio Jesus Gallego Arias
We remove Coq's wrapper over gramlib's grammar constructors.
2020-03-25[parsing] Make grammar extension type private.Emilio Jesus Gallego Arias
After the gramlib merge and the type-safe interface added to it, the grammar extension type is redundant; we thus make it private as a first step on consolidating it with the one in gramlib's.
2020-02-28[gramlib] Refactor gramlib interface.Emilio Jesus Gallego Arias
This is in preparation for making the Gramlib interface the canonical one; see #11647 . I tried to implement some of the ideas that were floated around in a chat with Pierre-Marie, suggestions / comments are welcome.
2019-08-19[pcoq] Remove unneeded casting operators.Emilio Jesus Gallego Arias
2019-07-29Tentatively providing a localization function to ad-hoc camlp5 parsers.Pierre-Marie Pédrot
2019-03-31Multiple payload types in tokensPierre Roux
Instead of just string (and empty strings for tokens without payload)
2019-03-31[parsing] Split Tok.t into Tok.t and Tok.patternEnrico Tassi
Tokens were having a double role: - the output of the lexer - the items of grammar entries, especially terminals Now tokens are the output of the lexer, and this paves the way for using a richer data type, eg including Loc.t Patterns, as in Plexing.pattern, only represent patterns (for tokens) and now have a bit more structure (eg the wildcard is represented as None, not as "", while a regular pattern for "x" as Some "x")
2019-03-29[parser] initialization based on Loc.t rather than Loc.sourceEnrico Tassi
In this way one can also set the current offsets in a file, useful if you are parsing a Coq fragment within a file instead of a full file starting from the first line.
2018-12-05Remove the lexer field from Gramlib.Pierre-Marie Pédrot
This is useless in the functorial API.
2018-11-30[gramlib] Remove `Ploc.t` in favor of `Loc.t`Emilio Jesus Gallego Arias
The types are identical and we have no more reason for the split. Note the following TODOS: - discrepancy of `Ploc.after` with `CLexer.after` - discrepancy of `Ploc.comments` with `CLexer.comments` - `Ploc.dummy` vs `Loc.t option`
2018-11-27[gramlib] Remove unused function `gram_reinit`.Emilio Jesus Gallego Arias
2018-11-27[gramlib] Minor cleanups:Emilio Jesus Gallego Arias
- remove duplicate type definitions `gram_assoc`, `gram_position`, - make global `warning_verbose` variable into a parameter.
2018-11-23Remove the unsafe API from gramlib.Pierre-Marie Pédrot
2018-11-19[gramlib] Remove unused alias.Emilio Jesus Gallego Arias
No effect on actual code.
2018-11-06Remove the non-functorial interface of camlp5 grammars.Pierre-Marie Pédrot
2018-11-05Remove the Scut constructor from Gramlib.Pierre-Marie Pédrot
This constructor only makes sense in the backtracking mode, that has been removed from our vendored version of camlp5.
2018-11-05Remove the Sflag constructor from Gramlib.Pierre-Marie Pédrot
It is just a wrapper around Sopt. I do not really understand why it is hardwired in the entry AST.
2018-11-05Remove the Sfacto constructor from Gramlib.Pierre-Marie Pédrot
Used by rule factorisation in theory, but appears to be unused in Coq.
2018-11-05Remove the Svala constructor from Gramlib.Pierre-Marie Pédrot
It is only used in strict mode, which makes no sense for Coq grammar.
2018-10-29[gramlib] Cleanup, remove unused parsing infrastructure.Emilio Jesus Gallego Arias
We remove the functional and backtracking parsers as they are not used in Coq.
2018-10-29[camlp5] Automatic conversion from revised syntax + parsersEmilio Jesus Gallego Arias
`for i in *; do camlp5r pr_o.cmo $i > ../gramlib.auto/$i; done`
2018-10-29[gramlib] Original Import from Camlp5 repos.Emilio Jesus Gallego Arias