pascalabcnet/Parsers/KuMir-gppg-Parser/KuMir00ParserTools.cs
AlexanderZemlyak d5e9994ff2
Revert pascal language moving to language plugins (#3175)
* Return Parsers folder with standard parsers and move SyntaxTreeConverters back to Core

* Rename PascalLanguage project to PascalABCLanguageInfo

* Fix pascal dll loading
2024-07-02 16:10:50 +03:00

26 lines
987 B
C#

using System.Collections.Generic;
using PascalABCCompiler.SyntaxTree;
using PascalABCCompiler.Errors;
using QUT.Gppg;
namespace PascalABCCompiler.KuMir00Parser
{
// Класс глобальных описаний и статических методов
// для использования различными подсистемами парсера
public static class PT // PT - parser tools
{
public static List<Error> Errors;
//public static int max_errors;
public static string CurrentFileName;
public static SourceContext ToSourceContext(LexLocation loc)
{
if (loc != null)
return new SourceContext(loc.StartLine, loc.StartColumn + 1, loc.EndLine, loc.EndColumn);
return null;
}
public static void AddError(string message, LexLocation loc)
{
Errors.Add(new SyntaxError(message, CurrentFileName, ToSourceContext(loc), null));
}
}
}