From: Petra M. <pe...@cs...> - 2004-03-24 21:18:57
|
Hi, isn't is sufficient to use the Mixfix attribute for this as well? e1 = e2 -> <MemPred Mixfix="true">...</MemPred> e1 \in {e2} -> <MemPred Mixfix="false">...</MemPred> A MemPred is an equality iff Mixfix=="true" and the second (right) expression is a SetExpr (usually the second argument is a relational operator). Do I miss something? (perhaps it is too early to think about this ;-) Petra Mark wrote: > Tim wrote: > >>>I think the way that the parser does it is correct. If you look at rule >>>12.2.10.3, it suggests that e1 = e2 is transformed to e1 \in {e2}, >>>because they are equivalent predicates. Also, I've just realised that >>>this could cause some problems when "unparsing" a tree... how do we know >>>whether the original expression is e1 = e2 or e1 \in {e2}?? Maybe I >>>should add an annotation to the any MemPreds that record it if it is an >>>equals sign? >>> >>> > >I think Tim is right. (looking at 12.2.10.3) > >But he is also right that it is impossible to know how to >'unparse' this back to an equality. > >Also, it seems a bit messy for visitors to figure out that >they are looking at an equality when they see E1 \in {E2} > > >This makes me think that, instead of Mixfix (boolean), MemPred should >have an attribute something like: > > Kind = Infix | Member | Equals > >We need to think about this a bit more before doing anything... > > |