Michael FIG | 2 May 05:35

Jolt2 grammar questions

Hi Ian (since I think you're the only person who can answer),

I'm trying to parameterize a Jolt2 grammar so that it can vary based
on runtime function calls.  What I would like is similar functionality
to OMeta's semantic predicates.

Here's a snippet from the grammar to illustrate the situation:

   // Not necessarily the best syntax, but is chosen to mean that
   // doTrigraphs matches iff [self trigraphsEnabled] evaluates
   // to nonzero.
   doTrigraphs	=? [self trigraphsEnabled]

   // This is a backslash trigraph.
   trigraphBs	= '??/' <- '$\\

   // This matches either a regular backslash, or a trigraph version
   // if [self trigraphsEnabled] evaluates to nonzero.
   backslash	= '\\' | doTrigraphs trigraphBs

BTW, a somewhat related question: what are the '=>' and '<=' grammar
operators?  I tried understanding them, but there are no examples, and
the code was not obvious.

Thanks,

--

-- 
Michael FIG <michael@...> //\
   http://michael.fig.org/    \//

(Continue reading)


Gmane