<?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="2003/12/aafa606aa4747681a69c32e98e5be8ce"
  from="Pietro Abate &lt;Pietro.Abate@a...&gt;"
  author="Pietro Abate"
  date="2003-12-01T06:21:30"
  subject="[Caml-list] parse &lt;tags&gt;"
  prev="2003/11/8b68d8a294eca1101e0d365b9c162338"
  next="2003/12/cf645abf5fbb4bfeb95e8a52ae1ca918"
  next-in-thread="2003/12/9667851ffcae56aeacb848c4e966dac2"
  prev-thread="2003/11/8b68d8a294eca1101e0d365b9c162338"
  next-thread="2003/12/cf645abf5fbb4bfeb95e8a52ae1ca918"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="[Caml-list] parse &lt;tags&gt;">
<msg 
  url="2003/12/aafa606aa4747681a69c32e98e5be8ce"
  from="Pietro Abate &lt;Pietro.Abate@a...&gt;"
  author="Pietro Abate"
  date="2003-12-01T06:21:30"
  subject="[Caml-list] parse &lt;tags&gt;">
<msg 
  url="2003/12/9667851ffcae56aeacb848c4e966dac2"
  from="Stefano Zacchiroli &lt;zack@b...&gt;"
  author="Stefano Zacchiroli"
  date="2003-12-01T10:22:29"
  subject="Re: [Caml-list] parse &lt;tags&gt;">
</msg>
</msg>
</thread>

<contents>
Hi all,
I'm trying to write a simple parser (below) but I've problems parsing tag-like
keywords. Probably this is a problem related with the lexer. does anybody know
a solution that doesn't imply heavy modifications to the (Genlex) lexer ?

p

code:

#load "camlp4o.cma";;

(* this doesn't work and it's what I want *)
open Genlex;;
let s = "&lt;foo&gt;";;
let flexer = make_lexer [s];;
let s' = flexer (Stream.of_string s);;
let parse_input_line = parser
        [&lt; 'Kwd "&lt;foo&gt;" &gt;] -&gt; Printf.printf "bingo !"
;;
parse_input_line s';;

(* this works, but I want &lt; &gt; !! *)
let s = "foo";;
let flexer = make_lexer [s];;
let s' = flexer (Stream.of_string s);;
let parse_input_line = parser
        [&lt; 'Kwd "foo" &gt;] -&gt; Printf.printf "bingo ?"
;;
parse_input_line s';;

-- 
++ As I grow older, I pay less attention to what men say.
   I just watch what they do. Andrew Carnegie (1835-1919).
++ Please avoid sending me Word or PowerPoint attachments.
   See http://www.fsf.org/philosophy/no-word-attachments.html

-------------------
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>

