1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677(*********************************************************************************)(* Higlo *)(* *)(* Copyright (C) 2014-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 Library General Public License for more details. *)(* *)(* You should have received a copy of the GNU Lesser 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 *)(* *)(* *)(*********************************************************************************)openLangletlexeme=Sedlexing.Utf8.lexeme;;letechar=[%sedlex.regexp?'t'|'b'|'n'|'r'|'f'|'\\'|'"'|'\'']letescaped_char=[%sedlex.regexp?'\\',echar]letstring=[%sedlex.regexp?'"',Star(Compl(0x22)|escaped_char),'"']letchar=[%sedlex.regexp?"'",(Compl(0x27)|escaped_char),"'"]letspace=[%sedlex.regexp?Plus(' '|'\n'|'\t'|'\r')]letcomment=[%sedlex.regexp?"/*",Star(Compl(0x2A)|('*',Compl('/'))),"*/"]letkeyword=[%sedlex.regexp?"digraph"|"edge"|"graph"|"subgraph"](* split attribute list because of sedlex bug:
https://github.com/ocaml-community/sedlex/issues/97 *)letattribute=[%sedlex.regexp?"arrowhead"|"arrowsize"|"arrowtail"|"bgcolor"|"center"|"color"|"constraint"]letattribute2=[%sedlex.regexp?"decorateP"|"dir"|"distortion"|"fillcolor"|"fontcolor"|"fontname"|"fontsize"]letattribute3=[%sedlex.regexp?"headclip"|"headlabel"|"height"|"labelangle"|"labeldistance"|"labelfontcolor"|"labelfontname"|"labelfontsize"|"label"|"layers"|"layer"|"margin"|"mclimit"]letattribute4=[%sedlex.regexp?"minlen"|"name"|"nodesep"|"nslimit"|"ordering"|"orientation"|"pagedir"|"page"|"peripheries"|"port_label_distance"|"rankdir"|"ranksep"|"rank"|"ratio"|"regular"]letattribute5=[%sedlex.regexp?"rotate"|"samehead"|"sametail"|"shapefile"|"shape"|"sides"|"size"|"skew"|"style"|"tailclip"|"taillabel"|"URL"|"weight"|"width"]letsymbol=[%sedlex.regexp?"--"|"->"]letmainlexbuf=match%sedlexlexbufwith|space->[Text(lexemelexbuf)]|keyword->[Keyword(0,lexemelexbuf)]|attribute->[Keyword(1,lexemelexbuf)]|attribute2->[Keyword(1,lexemelexbuf)]|attribute3->[Keyword(1,lexemelexbuf)]|attribute4->[Keyword(1,lexemelexbuf)]|attribute5->[Keyword(1,lexemelexbuf)]|string->[String(lexemelexbuf)]|char->[String(lexemelexbuf)]|comment->[Bcomment(lexemelexbuf)]|symbol->[Keyword(2,lexemelexbuf)]|any->[Text(lexemelexbuf)]|eof->[]|_->failwith"Invalid state";;let()=Lang.register_lang"dot"main;;