<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE message PUBLIC
  "-//MLarc//DTD MLarc output files//EN"
  "../../mlarc.dtd"[
  <!ATTLIST message
    listname CDATA #REQUIRED
    title CDATA #REQUIRED
  >
]>

  <?xml-stylesheet href="../../mlarc.xsl" type="text/xsl"?>


<message 
  url="2002/07/316f5665c4bbfc2e4bf31a06c0c857dd"
  from="Xavier Leroy &lt;xavier.leroy@i...&gt;"
  author="Xavier Leroy"
  date="2002-07-01T11:45:57"
  subject="Re: [Caml-list] ocamllex -- ambiguous regex"
  prev="2002/07/66928f1dd90ed297772796293dc5a75a"
  next="2002/07/87429c8e87bb44cbfc3f6c736a3a28a3"
  prev-in-thread="2002/06/e9a6d33e33959415317173b861f43ad8"
  next-in-thread="2002/06/181648455419d768a30f38cc4160f9ed"
  prev-thread="2002/04/b4cafabd229129bbd9c7ab0515990abd"
  next-thread="2002/04/a9631f853979f70cb049388b2c67dbd1"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="[Caml-list] Stack Overflow... (recursion in try-statement)">
<msg 
  url="2002/04/603f43731b1f4dae2ce3979b8f805525"
  from="Oliver Bandel &lt;oliver@f...&gt;"
  author="Oliver Bandel"
  date="2002-04-23T21:50:09"
  subject="[Caml-list] Stack Overflow... (recursion in try-statement)">
<msg 
  url="2002/04/0418444d72f7f2e4e178957d01a8a65d"
  from="Will Benton &lt;willb@c...&gt;"
  author="Will Benton"
  date="2002-04-23T22:24:54"
  subject="Re: [Caml-list] Stack Overflow... (recursion in try-statement)">
</msg>
<msg 
  url="2002/04/2113facc76ac4b9ebaf360ff8a845122"
  from="Oliver Bandel &lt;oliver@f...&gt;"
  author="Oliver Bandel"
  date="2002-04-23T22:55:03"
  subject="Re: [Caml-list] Stack Overflow... (recursion in try-statement)">
<msg 
  url="2002/04/56abdda4f9c0fbcdf05caa32ca3d282f"
  from="John Prevost &lt;visigoth@c...&gt;"
  author="John Prevost"
  date="2002-04-24T10:45:47"
  subject="Re: [Caml-list] Stack Overflow... (recursion in try-statement)">
<msg 
  url="2002/05/8d81f4640517786a395b2ae4f120d0d7"
  from="John Max Skaller &lt;skaller@o...&gt;"
  author="John Max Skaller"
  date="2002-05-21T18:34:16"
  subject="[Caml-list] Is CVS version of ocaml faster?">
<msg 
  url="2002/05/ad570df2022e3a494af656ea299ef07c"
  from="Jacques Garrigue &lt;garrigue@k...&gt;"
  author="Jacques Garrigue"
  date="2002-05-22T03:04:06"
  subject="Re: [Caml-list] Is CVS version of ocaml faster?">
<msg 
  url="2002/05/c40c11a8176096d8517bf719a2285e79"
  from="John Max Skaller &lt;skaller@o...&gt;"
  author="John Max Skaller"
  date="2002-05-22T16:29:37"
  subject="Re: [Caml-list] Is CVS version of ocaml faster?">
</msg>
</msg>
</msg>
<msg 
  url="2002/06/e9a6d33e33959415317173b861f43ad8"
  from="John Max Skaller &lt;skaller@o...&gt;"
  author="John Max Skaller"
  date="2002-06-30T17:25:25"
  subject="[Caml-list] ocamllex -- ambiguous regex">
<msg 
  url="2002/07/316f5665c4bbfc2e4bf31a06c0c857dd"
  from="Xavier Leroy &lt;xavier.leroy@i...&gt;"
  author="Xavier Leroy"
  date="2002-07-01T11:45:57"
  subject="Re: [Caml-list] ocamllex -- ambiguous regex">
</msg>
</msg>
<msg 
  url="2002/06/181648455419d768a30f38cc4160f9ed"
  from="John Max Skaller &lt;skaller@o...&gt;"
  author="John Max Skaller"
  date="2002-06-30T17:27:44"
  subject="[Caml-list] Manual broken -- set">
</msg>
</msg>
</msg>
<msg 
  url="2002/04/daeb07628bd6d4f08dd88f8d9fae7896"
  from="Warp &lt;warplayer@f...&gt;"
  author="Warp"
  date="2002-04-24T01:03:07"
  subject="Re: [Caml-list] Stack Overflow... (recursion in try-statement)">
<msg 
  url="2002/04/bc3b1c0674b9c69346e4af4f3ea3dfc6"
  from="Oliver Bandel &lt;oliver@f...&gt;"
  author="Oliver Bandel"
  date="2002-04-24T13:35:08"
  subject="Re: [Caml-list] Stack Overflow... (recursion in try-statement)">
</msg>
</msg>
<msg 
  url="2002/04/ee92cf8dacbda6ae25ce0f35626d2c92"
  from="Alan Schmitt &lt;alan.schmitt@i...&gt;"
  author="Alan Schmitt"
  date="2002-04-24T04:53:05"
  subject="Re: [Caml-list] Stack Overflow... (recursion in try-statement)">
<msg 
  url="2002/04/d353fa1e925a3a937044751ebc56da5f"
  from="Charles Martin &lt;joelisp@y...&gt;"
  author="Charles Martin"
  date="2002-04-24T05:25:01"
  subject="Re: [Caml-list] Stack Overflow... (recursion in try-statement)">
</msg>
<msg 
  url="2002/04/346be0a2f0b9c6c29c39df29b18da24e"
  from="Oliver Bandel &lt;oliver@f...&gt;"
  author="Oliver Bandel"
  date="2002-04-24T13:35:04"
  subject="Re: [Caml-list] Stack Overflow... (recursion in try-statement)">
</msg>
</msg>
<msg 
  url="2002/04/04825ce24a223732807410166314083e"
  from="John Prevost &lt;visigoth@c...&gt;"
  author="John Prevost"
  date="2002-04-24T10:46:00"
  subject="Re: [Caml-list] Stack Overflow... (recursion in try-statement)">
</msg>
</msg>
</thread>

<contents>
&gt; What happens if there is an ambiguous regexp in ocamllex input?
&gt; [The manual doesn't say]

That's an oversight in the manual; thanks for reporting it.
If several regexps match a prefix of the input, the regexp selected is
- the one that matches the longest prefix (so-called "longest match rule")
- in case of tie on prefix length, the regexp that occurs first in the
  source .mll lexer.

For instance:
   "kwd"      { rule 1 }
 | ['a'-'z']+ { rule 2 }

The input "kwdkwd" will trigger rule 2 (longest match), but "kwd01"
will trigger rule 1 (first rule among the two that have longest match).

- Xavier Leroy

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners

</contents>

</message>

