}
}
+void TypeComparer::visit(UnaryExpression &unary)
+{
+ if(UnaryExpression *unary1 = multi_visit(unary))
+ {
+ if(unary1->oper!=unary.oper)
+ r_result = false;
+ else
+ compare(*unary1->expression, *unary.expression);
+ }
+}
+
+void TypeComparer::visit(BinaryExpression &binary)
+{
+ if(BinaryExpression *binary1 = multi_visit(binary))
+ {
+ if(binary1->oper!=binary.oper)
+ r_result = false;
+ else
+ {
+ compare(*binary1->left, *binary.left);
+ if(r_result)
+ compare(*binary1->right, *binary.right);
+ }
+ }
+}
+
+void TypeComparer::visit(TernaryExpression &ternary)
+{
+ if(TernaryExpression *ternary1 = multi_visit(ternary))
+ {
+ if(ternary1->oper!=ternary.oper)
+ r_result = false;
+ else
+ {
+ compare(*ternary1->condition, *ternary.condition);
+ if(r_result)
+ compare(*ternary1->true_expr, *ternary.true_expr);
+ if(r_result)
+ compare(*ternary1->false_expr, *ternary.false_expr);
+ }
+ }
+}
+
void TypeComparer::visit(BasicTypeDeclaration &basic)
{
if(BasicTypeDeclaration *basic1 = multi_visit(basic))
T *multi_visit(T &);
virtual void visit(Literal &);
virtual void visit(VariableReference &);
+ virtual void visit(UnaryExpression &);
+ virtual void visit(BinaryExpression &);
+ virtual void visit(TernaryExpression &);
virtual void visit(BasicTypeDeclaration &);
virtual void visit(ImageTypeDeclaration &);
virtual void visit(StructDeclaration &);