Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
* re-entrant CAMLYACC parsers?
@ 1999-08-03 21:45 chet
  1999-08-13 19:52 ` Gerd Stolpmann
  0 siblings, 1 reply; 3+ messages in thread
From: chet @ 1999-08-03 21:45 UTC (permalink / raw)
  To: caml-list


How do most people implement re-entrancy in caml-yacc parsers which
must manipulate side-state?  E.g., if I want to have some hashtable to
store a mapping from name to right-hand-side, which the lexer will
expand dynamically and push back onto the lexbuf (I've enclosed the
code I use to do that -- it looks right, and it works, but I'm not
certain that I got the semantics of Lexing.lexbuf down), it'd be nice
to store that someplace on the stack, so that I don't have to count on
serialization of calls to the parser.

I've thought about hacking Parsing to have an extra slot in the
parsing_env record, of polymorphic type, and then adding some syntax
to the caml-yacc language to fetch that value.

Anybody done anything like this?

--chet--

P.S. I realize I could do this trivially with stream-parsers, but I'd
prefer to write a yacc-parser for efficiency and declarativeness.




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1999-08-22 18:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-08-03 21:45 re-entrant CAMLYACC parsers? chet
1999-08-13 19:52 ` Gerd Stolpmann
1999-08-13 21:18   ` chet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox