ADL.jj parser problem

Hi dear all

I found ADL parser does not set stringExpression of Assertion while parsing ArchetypeSlot

The codes bellow are my change to fix this problem!

I will happy if anybody have new idea idea!

File: adl.jj

Line: 1399

{

return new Assertion(tag, expression, stringExpression, variables);

}

Change to

{

ExpressionLeaf leftOperand = (ExpressionLeaf)((ExpressionBinaryOperator) expression).getLeftOperand();

ExpressionLeaf rightOperand = (ExpressionLeaf)((ExpressionBinaryOperator) expression).getRightOperand();

OperatorKind operatorKind = ((ExpressionBinaryOperator) expression).getOperator();

stringExpression = leftOperand.getItem().toString();

switch(operatorKind){

case OP_EQ:{stringExpression += " = ";break;}

case OP_NE:{stringExpression += " <> ";break;}

case OP_LE:{stringExpression += " <= ";break;}

case OP_LT:{stringExpression += " < ";break;}

case OP_GE:{stringExpression += " >= ";break;}

case OP_GT:{stringExpression += " > ";break;}

case OP_MATCHES:{stringExpression += " matches ";break;}

}

stringExpression += “{/”+((CString)rightOperand.getItem()).getPattern()+“/}”;

return new Assertion(tag, expression, stringExpression, variables);

}

Mahdi Asgari

Thanks, Mahdi!

I now implemented toString() function in assertion package in AOM so the parser can pick up the string expression from expressionItem during parsing.

Cheers,
Rong