Package org.apache.sysds.parser.dml
Class CustomErrorListener
- java.lang.Object
- 
- org.antlr.v4.runtime.BaseErrorListener
- 
- org.apache.sysds.parser.dml.CustomErrorListener
 
 
- 
- All Implemented Interfaces:
- org.antlr.v4.runtime.ANTLRErrorListener
 
 public class CustomErrorListener extends org.antlr.v4.runtime.BaseErrorListener
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description classCustomErrorListener.ParseIssueA parse issue (such as an parse error or a parse warning).static classCustomErrorListener.ParseIssueTypeParse issues can be syntax errors, validation errors, and validation warnings.
 - 
Constructor SummaryConstructors Constructor Description CustomErrorListener()
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static StringgenerateParseIssuesMessage(String scriptString, List<CustomErrorListener.ParseIssue> parseIssues)Generate a message displaying information about the parse issues that occurred.StringgetCurrentFileName()List<CustomErrorListener.ParseIssue>getParseIssues()Obtain the list of parse issues.booleanisAtLeastOneError()booleanisAtLeastOneWarning()voidsetAtLeastOneError(boolean atleastOneError)voidsetAtLeastOneWarning(boolean atLeastOneWarning)voidsetCurrentFileName(String currentFilePath)voidsetParseIssues(List<CustomErrorListener.ParseIssue> parseIssues)Set the list of parse issues.voidsyntaxError(org.antlr.v4.runtime.Recognizer<?,?> recognizer, Object offendingSymbol, int line, int charPositionInLine, String msg, org.antlr.v4.runtime.RecognitionException e)Syntax error occurred.voidunsetCurrentFileName()voidvalidationError(int line, int charPositionInLine, String msg)Validation error occurred.voidvalidationError(ParseInfo parseInfo, String msg)voidvalidationWarning(int line, int charPositionInLine, String msg)Validation warning occurred.
 
- 
- 
- 
Method Detail- 
setCurrentFileNamepublic void setCurrentFileName(String currentFilePath) 
 - 
getCurrentFileNamepublic String getCurrentFileName() 
 - 
unsetCurrentFileNamepublic void unsetCurrentFileName() 
 - 
validationErrorpublic void validationError(int line, int charPositionInLine, String msg)Validation error occurred. Add the error to the list of parse issues.- Parameters:
- line- Line number where error was detected
- charPositionInLine- Character position where error was detected
- msg- Message describing the nature of the validation error
 
 - 
validationWarningpublic void validationWarning(int line, int charPositionInLine, String msg)Validation warning occurred. Add the warning to the list of parse issues.- Parameters:
- line- Line number where warning was detected
- charPositionInLine- Character position where warning was detected
- msg- Message describing the nature of the validation warning
 
 - 
syntaxErrorpublic void syntaxError(org.antlr.v4.runtime.Recognizer<?,?> recognizer, Object offendingSymbol, int line, int charPositionInLine, String msg, org.antlr.v4.runtime.RecognitionException e)Syntax error occurred. Add the error to the list of parse issues.- Specified by:
- syntaxErrorin interface- org.antlr.v4.runtime.ANTLRErrorListener
- Overrides:
- syntaxErrorin class- org.antlr.v4.runtime.BaseErrorListener
 
 - 
isAtLeastOneErrorpublic boolean isAtLeastOneError() 
 - 
setAtLeastOneErrorpublic void setAtLeastOneError(boolean atleastOneError) 
 - 
isAtLeastOneWarningpublic boolean isAtLeastOneWarning() 
 - 
setAtLeastOneWarningpublic void setAtLeastOneWarning(boolean atLeastOneWarning) 
 - 
getParseIssuespublic List<CustomErrorListener.ParseIssue> getParseIssues() Obtain the list of parse issues.- Returns:
- The list of parse issues.
 
 - 
setParseIssuespublic void setParseIssues(List<CustomErrorListener.ParseIssue> parseIssues) Set the list of parse issues.- Parameters:
- parseIssues- The list of parse issues.
 
 - 
generateParseIssuesMessagepublic static String generateParseIssuesMessage(String scriptString, List<CustomErrorListener.ParseIssue> parseIssues) Generate a message displaying information about the parse issues that occurred.- Parameters:
- scriptString- The DML or PYDML script string.
- parseIssues- The list of parse issues.
- Returns:
- String representing the list of parse issues.
 
 
- 
 
-