[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Name clashes in ppml..




-- 
In article <45426@sophia.inria.fr>, brad@cs.adelaide.edu.au (Bradley Alexander) writes:
|> 
|> Hello,
|>       I've decided to start on the creation of a Pretty Printer 
|> for the language which I'm working on (Adl). I'm having problems
|> with the ppml parser..
|> 
|> I define a set of precedence functions at the start of my ppml
|> program. The one that causes trouble starts...
|> 
|> function bop_prec is
|>       bop_prec(*exp where *exp in {or}) = 11;
|>       bop_prec(*exp where *exp in {and}) = 10;
|>                   .
|>                   .
|>                   .
|> end  bop_prec;
|> 
|> The problem is occuring with the "or" and "and" operators (which 
|> I have defined as singletons in the syntax of my language Adl).
.....
|> 
|> But this only suceeded in moving the problem to the definition
|> of the phlya. Is there some way of avoiding this problem without 
|> changing my metal definition (an escape character string perhaps)?

"or" and "and" are PPML keywords, so you have to escape them with a # character
in your PPML specification:

function bop_prec is
       bop_prec(*exp where *exp in {#or}) = 11;
       bop_prec(*exp where *exp in {#and}) = 10;
                   .
                   .
                   .
 end  bop_prec;

----------------------------------------------------------------------
   Laurence Rideau              Laurence.Rideau@sophia.inria.fr  
   INRIA  BP 93 
  06902 Sophia Antipolis CEDEX       93 65 78 04       
----------------------------------------------------------------------