<?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/11/26590f366f401c39cd62b82a784477dd"
  from="Artem Prisyznuk &lt;tema@s...&gt;"
  author="Artem Prisyznuk"
  date="2003-11-04T10:45:48"
  subject="[Caml-list] Right way to determine used syntax ( camlp4 )"
  prev="2003/11/105804fae41a4cd8c283a86811016fc2"
  next="2003/11/a5e3d51ebade36d6991bf4b045e55347"
  next-in-thread="2003/11/a5e3d51ebade36d6991bf4b045e55347"
  prev-thread="2003/11/5bfc54158708ba55850a695ef7c3c554"
  next-thread="2003/11/7d1a89526a373d9c8ad55df4f4d4ad97"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="[Caml-list] Right way to determine used syntax ( camlp4 )">
<msg 
  url="2003/11/26590f366f401c39cd62b82a784477dd"
  from="Artem Prisyznuk &lt;tema@s...&gt;"
  author="Artem Prisyznuk"
  date="2003-11-04T10:45:48"
  subject="[Caml-list] Right way to determine used syntax ( camlp4 )">
<msg 
  url="2003/11/a5e3d51ebade36d6991bf4b045e55347"
  from="Dmitry Lomov &lt;Dmitry.Lomov@i...&gt;"
  author="Dmitry Lomov"
  date="2003-11-04T13:07:24"
  subject="Re: [Caml-list] Right way to determine used syntax ( camlp4 )">
<msg 
  url="2003/11/fd0f1ccee25a666249fd8b99def103b8"
  from="Artem Prisyznuk &lt;tema@s...&gt;"
  author="Artem Prisyznuk"
  date="2003-11-04T14:54:26"
  subject="Re: [Caml-list] Right way to determine used syntax ( camlp4 )">
</msg>
</msg>
</msg>
</thread>

<contents>
Hello,

I write small extension for ocaml. But I have next question.

Grammar entry differ for pa_o.cmo and pa_r.cmo. So in my pa_ module
I want auto determinate which syntax used and apply differ EXTEND
branches for normal syntax and revised syntax. Now I determine which 
syntax
used with next code:

let normal_extend () =
	EXTEND
  	GLOBAL: expr;
	expr: LEVEL "expr1"
	  [[ ..... ]]
         ......
	END;;

let revised_extend () =
	EXTEND
  	GLOBAL: expr;
	expr: LEVEL "top"
	  [[ ..... ]]
         ......
	END;;


let _ =
   try ignore(Grammar.Entry.find Pcaml.expr "expr1"); normal_extend ()
   with Not_found -&gt; revised_extend ();;


It work, but I don't assurance what it's right way.

Any suggestions?

-- 
Artem Prysyznuk
tema@sit.kiev.ua

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

