# ADL.jj parser problem **Category:** [Reference Implementation: Java (archive)](https://discourse.openehr.org/c/reference-implementation-java-archive/154) **Created:** 2011-07-04 11:26 UTC **Views:** 5 **Replies:** 1 **URL:** https://discourse.openehr.org/t/adl-jj-parser-problem/14078 --- ## Post #1 by @Mahdi_Asgari 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 --- ## Post #2 by @system 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 --- **Canonical:** https://discourse.openehr.org/t/adl-jj-parser-problem/14078 **Original content:** https://discourse.openehr.org/t/adl-jj-parser-problem/14078