12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273(*********************************************************************************)(* OCaml-RDF *)(* *)(* Copyright (C) 2012-2021 Institut National de Recherche en Informatique *)(* et en Automatique. All rights reserved. *)(* *)(* This program is free software; you can redistribute it and/or modify *)(* it under the terms of the GNU Lesser General Public License version *)(* 3 as published by the Free Software Foundation. *)(* *)(* This program is distributed in the hope that it will be useful, *)(* but WITHOUT ANY WARRANTY; without even the implied warranty of *)(* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *)(* GNU General Public License for more details. *)(* *)(* You should have received a copy of the GNU General Public License *)(* along with this program; if not, write to the Free Software *)(* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA *)(* 02111-1307 USA *)(* *)(* Contact: Maxence.Guesdon@inria.fr *)(* *)(*********************************************************************************)(** *)(** This code is adapted from CCSS: file ccss.ml *)exceptionParse_errorofexn*Lexing.positionletnl_char=Uchar.of_char'\n'letupdate_posposstr=letopenLexinginletfposi=function|`Malformedmsg->letexn=Failuremsginraise(Parse_error(exn,pos))|`UcharcwhenUchar.equalcnl_char->letbol=pos.pos_cnumin{poswithpos_lnum=pos.pos_lnum+1;pos_bol=bol;pos_cnum=pos.pos_cnum+1;}|_->{poswithpos_cnum=pos.pos_cnum+1}inUutf.String.fold_utf_8fposstrletupdposlexbuf=update_pospos(Sedlexing.Utf8.lexemelexbuf)letmenhir_with_ulexmenhir_parserlexer?(fname="")lexbuf=letposition=ref{Lexing.pos_fname=fname;pos_lnum=1;pos_bol=0;pos_cnum=0;}inletlexer_maker()=letante_position=!positioninlet(pos,token)=lexer!positionlexbufinposition:=pos;(token,ante_position,!position)inletrevised_parser=MenhirLib.Convert.Simplified.traditional2revisedmenhir_parserintryrevised_parserlexer_makerwithParse_error_ase->raisee|e->raise(Parse_error(e,!position));;