Hi,
Thanks for your reply. I was interested in an example of how the hook predicates work. For example, if I wished to have a pattern as follows:
The PROPERTY of SUBJECT is OBJECT.
Where PROPERTY, SUBJECT, and OBJECT are atoms and "the", "of", and "is" are keywords, to parse as PRED(SUBJECT,OBJECT); how would that be done?
Mark Green mark(a)antelope.nildram.co.uk
On 15 Sep 2012, at 10:40, Jose F. Morales <jfran(a)clip.dia.fi.upm.es> wrote:
On Thu, Sep 13, 2012 at 4:06 PM, Mark Green <mark(a)antelope.nildram.co.uk> wrote:
Hi,
Is there any example of using the parser control predicates to customize the Ciao grammar?
Hi Mark,
You can customize the Ciao grammar using operator definitions, like in most Prolog systems. This is powerful enough for many purposes. Additionally, the parser has some experimental flags to allow more exotic syntax like array subscript ("A[B]").
It is also possible to plug custom parsers by doing some tricks with the compiler hooks. If you can provide us some concrete example of customization, we could help you with some code and a more precise answer.
Regards
-- Jose (and the Ciao Dev team)