[climacs-devel] more context-sensitive parsing
Christophe Rhodes
csr21 at cam.ac.uk
Tue Apr 5 20:44:35 UTC 2005
Hi,
In prolog, there are so-called operator directives, of the basic form:
:- op(=@=,100,xfy).
such that this defines a right-associative operator named =@=.
In order to parse the rest of the file properly, it would be good, on
parsing this directive, to alter the parser to recognize this kind of
construct. I have hooks in prolog-syntax.lisp for this -- the
FIND-DEFINED-OPERATOR function -- but given that in principle we could
be visiting several prolog files at once, defined operators should
really be buffer-local. So the logical place to stash information
about such a user-defined operator would be the syntax, I think, but I
don't have access to the syntax from a grammar rule (or do I?)
Any ideas, suggestions? The other possibility, I suppose, is to make
the user do this, maybe through a Climacs command Define Operator.
(This probably isn't the most urgent of issues, but I do have a large
amount of prolog code with many operator definitions, and no other
real code to test my parser against).
Cheers,
Christophe
More information about the climacs-devel
mailing list