Package autumn.lang.compiler.errors
Class BasicErrorReporter
java.lang.Object
autumn.lang.compiler.errors.BasicErrorReporter
- All Implemented Interfaces:
IErrorReporter
An instance of this class is an error-reporter that reports errors to a PrintStream.
- Author:
- Mackenzie High
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor.Constructor. -
Method Summary
Modifier and TypeMethodDescriptioncodes()
This method returns a list containing the error-codes that have been reported already.int
This method returns the number of errors that were thus far reported by this reporter.void
reportFailedCheck
(ErrorReport report) This method reports that a static-check failed.reports()
This method returns a list containing the error-reports that have been reported already.void
reportSyntaxError
(URL file, int line, int column) This method reports that the parsing of a module failed.
-
Constructor Details
-
BasicErrorReporter
public BasicErrorReporter()Constructor.This constructor creates an error-reporter that reports errors using STDOUT.
-
BasicErrorReporter
Constructor.- Parameters:
out
- is the stream to report errors to.
-
-
Method Details
-
reportSyntaxError
This method reports that the parsing of a module failed.- Specified by:
reportSyntaxError
in interfaceIErrorReporter
- Parameters:
file
- is the path to the module's file, as supplied to the compiler.line
- is an estimate of where parsing failed within the input.column
- is an estimate of where parsing failed within the input.
-
reportFailedCheck
This method reports that a static-check failed.- Specified by:
reportFailedCheck
in interfaceIErrorReporter
- Parameters:
report
- is a an error-report that describes what went wrong.
-
errorCount
public int errorCount()This method returns the number of errors that were thus far reported by this reporter.- Specified by:
errorCount
in interfaceIErrorReporter
- Returns:
- the number of reported errors.
-
codes
This method returns a list containing the error-codes that have been reported already.- Returns:
- an immutable list containing the reported error-codes.
-
reports
This method returns a list containing the error-reports that have been reported already.- Returns:
- an immutable list containing the reported errors.
-