2019-07-28 23:53:15 +03:00
|
|
|
// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt)
|
2015-06-01 22:15:17 +03:00
|
|
|
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
2015-05-14 22:35:07 +03:00
|
|
|
using System;
|
|
|
|
|
|
|
|
|
|
using PascalABCCompiler.SemanticTree;
|
|
|
|
|
|
|
|
|
|
using PascalABCCompiler.TreeRealization;
|
|
|
|
|
using PascalABCCompiler.TreeConverter;
|
|
|
|
|
|
|
|
|
|
namespace PascalABCCompiler.TreeConverter
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
public class StringResourcesForWarning
|
|
|
|
|
{
|
|
|
|
|
public static string Get(string key)
|
|
|
|
|
{
|
|
|
|
|
return PascalABCCompiler.StringResources.Get("WARNING_" + key);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static string Get(string key, params object[] values)
|
|
|
|
|
{
|
|
|
|
|
return (string.Format(Get(key), values));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class CompilerWarningWithLocation : Errors.CompilerWarning
|
|
|
|
|
{
|
|
|
|
|
location loc;
|
|
|
|
|
public CompilerWarningWithLocation(location loc)
|
|
|
|
|
{
|
|
|
|
|
this.loc = loc;
|
|
|
|
|
}
|
|
|
|
|
public override SourceLocation SourceLocation
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
if (loc != null)
|
2026-01-17 23:26:40 +03:00
|
|
|
return new SourceLocation(loc.file_name, loc.begin_line_num, loc.begin_column_num, loc.end_line_num, loc.end_column_num);
|
2015-05-14 22:35:07 +03:00
|
|
|
else
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
public class OverrideOrReintroduceExpected : CompilerWarningWithLocation
|
|
|
|
|
{
|
|
|
|
|
public OverrideOrReintroduceExpected(location loc)
|
|
|
|
|
: base(loc)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
public override string ToString()
|
|
|
|
|
{
|
|
|
|
|
return StringResourcesForWarning.Get("OVERRIDE_OR_REINTRODUCE_EXPECTED");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
public class ExtensionOperatorForPrimitiveType : CompilerWarningWithLocation
|
|
|
|
|
{
|
|
|
|
|
public ExtensionOperatorForPrimitiveType(location loc)
|
|
|
|
|
: base(loc)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
public override string ToString()
|
|
|
|
|
{
|
|
|
|
|
return StringResourcesForWarning.Get("");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class OMP_ConstructionNotSupportedNow : CompilerWarningWithLocation
|
|
|
|
|
{
|
|
|
|
|
public OMP_ConstructionNotSupportedNow(location loc)
|
|
|
|
|
: base(loc)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
public override string ToString()
|
|
|
|
|
{
|
|
|
|
|
return "This OMP construction not supported now.";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class OMP_BuildigError : CompilerWarningWithLocation
|
|
|
|
|
{
|
|
|
|
|
Exception _e;
|
|
|
|
|
public OMP_BuildigError(Exception e, location loc)
|
|
|
|
|
: base(e is CompilationErrorWithLocation ? ((CompilationErrorWithLocation)e).loc : loc)
|
|
|
|
|
{
|
|
|
|
|
_e = e;
|
|
|
|
|
}
|
|
|
|
|
public override string ToString()
|
|
|
|
|
{
|
|
|
|
|
return "This OMP construction not builded: " + _e.Message;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|