Class: KipperAntlrErrorListener<TSymbol>
The Error Handler for the Kipper implementation of ANTLRErrorListener
Type parameters
Name |
---|
TSymbol |
Implements
ANTLRErrorListener
<TSymbol
>
Table of contents
Constructors
Properties
Methods
Constructors
constructor
• new KipperAntlrErrorListener<TSymbol
>(logger
, parseStream
)
Type parameters
Name |
---|
TSymbol |
Parameters
Name | Type |
---|---|
logger |
KipperLogger |
parseStream |
KipperFileStream |
Defined in
kipper/core/src/antlr-error-listener.ts:23
Properties
logger
• Readonly
logger: KipperLogger
Defined in
kipper/core/src/antlr-error-listener.ts:19
parseStream
• Readonly
parseStream: KipperFileStream
Defined in
kipper/core/src/antlr-error-listener.ts:21
Methods
getLineOfCode
▸ Protected
getLineOfCode(line
): string
Gets a line of code from the original this.parseStream.
Since
0.4.0
Parameters
Name | Type | Description |
---|---|---|
line |
number |
The line of code to fetch. |
Returns
string
Defined in
kipper/core/src/antlr-error-listener.ts:51
getSourceCode
▸ Protected
getSourceCode(symbol
): undefined
| string
Fetches the source code for the specific CommonToken symbol.
This function returns undefined if CommonToken.inputStream is undefined.
Since
0.4.0
Parameters
Name | Type | Description |
---|---|---|
symbol |
CommonToken |
The token/symbol to check for. |
Returns
undefined
| string
Defined in
kipper/core/src/antlr-error-listener.ts:36
syntaxError
▸ syntaxError<T
>(recognizer
, offendingSymbol
, line
, charPositionInLine
, msg
, e
): void
Default handler for Antlr4 syntax errors.
Type parameters
Name |
---|
T |
Parameters
Name | Type | Description |
---|---|---|
recognizer |
Recognizer <T , any > |
The recognizer which usually represents a KipperParser. |
offendingSymbol |
undefined | T |
The symbol/token that caused the error. In most cases, this is of type CommonToken. |
line |
number |
The line where the syntax error occurred. |
charPositionInLine |
number |
The column where the syntax error occurred. |
msg |
string |
The message generated by Antlr4. |
e |
undefined | RecognitionException |
The exception that was initialised. This may be undefined. |
Returns
void
Implementation of
ANTLRErrorListener.syntaxError
Defined in
kipper/core/src/antlr-error-listener.ts:66