caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Error location in Camlp4
@ 2008-04-24 12:47 Sham K
  0 siblings, 0 replies; only message in thread
From: Sham K @ 2008-04-24 12:47 UTC (permalink / raw)
  To: caml-list

[-- Attachment #1: Type: text/plain, Size: 980 bytes --]

Hello Everyone,

I have written a tokenizer (using parser constructs in camlp4) which
tokenizes a character stream of a string. I use this to define a lexer
(using Token.lexer_func_of_parser) as shown in turorials and manuals on
camlp4. Then I make use of EXTEND statements to interpret token stream to
according to  some syntax to build some Abstract syntax tree.

All this works fine. However, whenever there is error I just get
"Stdpp.Exc_located" with no indications of the location of error. (It is
just (_,_) )

The camlp4 manual says that in the action part of rules, a variable loc is
always defined which can be used to raise errors.
But the complier complains that loc is not defined when I try to use loc in
try ... with statements.

Can someone explain how I can print error locations. It works with standard
lexer plexer, but not with my lexer. I do not quite
see what else I should include in my lexer to enable error location
reporting.

Thanks for your time.
Sham

[-- Attachment #2: Type: text/html, Size: 1049 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-04-24 12:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-24 12:47 Error location in Camlp4 Sham K

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).