private void ArgumentShouldBeBoolean(SyntaxElement node, IExpression argument)
 {
     if (argument.Type == ErrorType.GetInstance())
         return;
     if (argument.Type.Name != MiniJavaInfo.BoolType)
     {
         ReportError(
             ErrorTypes.TypeError,
             String.Format("Cannot convert expression of type {0} to boolean.",
             argument.Type.Name), node);
     }
 }
Beispiel #2
0
 private ErrorMessage(ErrorTypes type, string message, SyntaxElement node,
     SyntaxElement referencedNode, int row, int col)
 {
     ErrorType = type;
     Content = message;
     ProblemNode = node;
     ReferencedNode = referencedNode;
     Row = row;
     Col = col;
 }
Beispiel #3
0
 public ErrorMessage(ErrorTypes type, string message, SyntaxElement node,
     SyntaxElement referencedNode)
     : this(type, message, node, referencedNode, node.Row, node.Col)
 {
 }
Beispiel #4
0
 public void ReportError(ErrorTypes type, string message,
     SyntaxElement node, SyntaxElement referredNode)
 {
     Errors.Add(new ErrorMessage(type, message, node, referredNode));
 }
Beispiel #5
0
 public bool HasErrorReportForNode(ErrorTypes type, SyntaxElement node)
 {
     return Errors.FindIndex((errMsg) => errMsg.ErrorType == type && errMsg.ProblemNode == node) > -1;
 }
 private void ReportTypeNameError(string typeName, SyntaxElement node)
 {
     ReportError(ErrorTypes.TypeReference,
         String.Format("Unknown type {0}.", typeName), node);
 }
 private void ReportError(ErrorTypes type, string message, SyntaxElement node)
 {
     _errorReporter.ReportError(type, message, node);
     _error = true;
 }
 private void ReportError(ErrorTypes type, string errorMsg, SyntaxElement node,
     SyntaxElement referencedNode = null)
 {
     if (referencedNode == null)
     {
         _parent._errors.ReportError(type, errorMsg, node);
     }
     else
     {
         _parent._errors.ReportError(type, errorMsg, node, referencedNode);
     }
     _checkOK = false;
 }