[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Greedy matching in prg2lout
From: |
Jeff Kingston |
Subject: |
Re: Greedy matching in prg2lout |
Date: |
Mon, 03 Mar 2003 08:23:59 +1100 |
On Thu, 27 Feb 2003 09:31:52 +0300 (MSK), Darren Bane wrote:
>
> Hi there,
>
> I'm trying to add support for RSL (the RAISE Specification Language -
> http://www.iist.unu.edu/raise/) to prg2lout. This is somewhat different
> from the other programming languages supported because symbol mode
> should be the default, and there are many more mathematical operators.
>
> One of these is the word 'is', which renders as the equivalence symbol
> (i.e. = with an extra line). I added FixedToken entries for this, and
> it rendered perfectly. However, now _any_ sequence of the characters
> i-s is replaced with equivalence, even identifiers like is_empty and
> is_full.
I think the way to handle this is to tell prg2lout that "is" is a
keyword, and then in file raisef (equivalent of eiffelf etc.) put
a @Case expression into the command for printing keywords:
def @PK right x
{
x @Case {
"is" @Yield @Sym equiv
else @Yield {
... what's there now ...
}
}
}
>From memory I don't think prg2lout itself would have the ability
to do this by itself. There could be something buried in it I
guess, as you say, handling Perl is not easy either. But the
above seems a lot more straightforward anyway.
Jeff Kingston
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: Greedy matching in prg2lout,
Jeff Kingston <=