Skip to content

antlr-ng Tool Class Hierarchy / index / ErrorManager

Class: ErrorManager

A class to take care of individual Issues. It can notify registered listeners about incomming messages and ensures proper formatting of the messages.

Constructors

Constructor

ts
new ErrorManager(): ErrorManager;

Returns

ErrorManager

Properties

errors

ts
errors: number = 0;

errorTypes

ts
errorTypes: Set<IssueCode>;

All errors that have been generated


warnings

ts
warnings: number = 0;

Methods

addListener()

ts
addListener(tl): void;

Parameters

tl

ToolListener

Returns

void


configure()

ts
configure(formatOptions): void;

Parameters

formatOptions

IToolMessageOptions

Returns

void


emit()

ts
emit(msg): void;

Parameters

msg

Issue

Returns

void


error()

ts
error(msg): void;

Parameters

msg

Issue

Returns

void


formatWantsSingleLineMessage()

ts
formatWantsSingleLineMessage(): boolean;

Returns

boolean


grammarError()

ts
grammarError(
   errorType, 
   fileName, 
   position, 
   arg?, 
   arg2?, 
   arg3?): void;

Parameters

errorType

IssueCode

fileName

string

position

null | { column: number; line: number; }

arg?

unknown

arg2?

unknown

arg3?

unknown

Returns

void


info()

ts
info(msg): void;

Parameters

msg

string

Returns

void


removeListener()

ts
removeListener(tl): void;

Parameters

tl

ToolListener

Returns

void


removeListeners()

ts
removeListeners(): void;

Returns

void


syntaxError()

ts
syntaxError(
   errorType, 
   fileName, 
   line, 
   column, 
   antlrException?, 
   arg?, 
   arg2?): void;

Parameters

errorType

IssueCode

fileName

string

line

number

column

number

antlrException?

RecognitionException

arg?

unknown

arg2?

unknown

Returns

void


toolError()

ts
toolError(
   errorType, 
   e?, 
   arg?, 
   arg2?, 
   arg3?): void;

Raise a predefined message with some number of parameters with no position information.

Parameters

errorType

IssueCode

The identifier of the issue.

e?

Error

arg?

unknown

arg2?

unknown

arg3?

unknown

Returns

void


warning()

ts
warning(msg): void;

Parameters

msg

Issue

Returns

void


fatalInternalError()

ts
static fatalInternalError(error, e): void;

Parameters

error

string

e

Error

Returns

void


internalError()

ts
static internalError(error, e?): void;

Parameters

error

string

e?

Error

Returns

void