예제 #1
0
 public override void Visit(UnaryOperatorExpression node)
 {
     var op = MiniJavaInfo.GetOperator(node.Operator);
     var expectedOperandType = _parent._symbolTable.ResolveType(op.OperandType).Type;
     var actualOperandType = node.Operand.Type;
     if (!actualOperandType.IsAssignableTo(expectedOperandType))
     {
         ReportError(
             ErrorTypes.TypeError,
             String.Format("Cannot apply operator {0} on operand of type {1}.",
             node.Operator, actualOperandType.Name), node);
     }
 }
예제 #2
0
 public override void Visit(UnaryOperatorExpression node)
 {
     HandleExpressionOrStatementNode(node);
 }