1234567891011121314151617181920212223242526272829303132333435363738394041424344(************************************************************************)(* * The Coq Proof Assistant / The Coq Development Team *)(* v * Copyright INRIA, CNRS and contributors *)(* <O___,, * (see version control and CREDITS file for authors & dates) *)(* \VV/ **************************************************************)(* // * This file is distributed under the terms of the *)(* * GNU Lesser General Public License Version 2.1 *)(* * (see LICENSE file for the text of the license) *)(************************************************************************)openPpopenCErrorsopenUtilopenNotation(* Register the grammar of notation for parsing and printing
(also register the parsing rule if not onlyprinting) *)letnotation_grammar_map=Summary.ref~name:"notation_grammar_map"NotationMap.emptyletdeclare_notation_grammarntnrule=trylet_=NotationMap.findntn!notation_grammar_mapinanomaly(str"Notation "++pr_notationntn++str" is already assigned a grammar.")withNot_found->notation_grammar_map:=NotationMap.addntnrule!notation_grammar_mapletgrammar_of_notationntn=NotationMap.findntn!notation_grammar_mapletnotation_subentries_map=Summary.ref~name:"notation_subentries_map"NotationMap.emptyletdeclare_notation_subentriesntnentries=trylet_=NotationMap.findntn!notation_grammar_mapinanomaly(str"Notation "++pr_notationntn++str" is already assigned a grammar.")withNot_found->notation_subentries_map:=NotationMap.addntnentries!notation_subentries_mapletsubentries_of_notationntn=NotationMap.findntn!notation_subentries_mapletget_defined_notations()=NotationSet.elements@@NotationMap.domain!notation_grammar_map