Grammatica
Public Types | Public Member Functions | Properties | List of all members
PerCederberg.Grammatica.Runtime.ParseException Class Reference

A parse exception. More...

Inheritance diagram for PerCederberg.Grammatica.Runtime.ParseException:

Public Types

enum  ErrorType {
  ErrorType.INTERNAL, ErrorType.IO, ErrorType.UNEXPECTED_EOF, ErrorType.UNEXPECTED_CHAR,
  ErrorType.UNEXPECTED_TOKEN, ErrorType.INVALID_TOKEN, ErrorType.ANALYSIS
}
 The error type enumeration. More...
 

Public Member Functions

 ParseException (ErrorType type, string info, int line, int column)
 Creates a new parse exception. More...
 
 ParseException (ErrorType type, string info, ArrayList details, int line, int column)
 Creates a new parse exception. More...
 
ErrorType GetErrorType ()
 Returns the error type. More...
 
string GetInfo ()
 Returns the additional error information. More...
 
ArrayList GetDetails ()
 Returns the additional detailed error information. More...
 
int GetLine ()
 Returns the line number where the error occured. More...
 
int GetColumn ()
 Returns the column number where the error occured. More...
 
string GetMessage ()
 Returns a default error message. More...
 
string GetErrorMessage ()
 Returns the error message. More...
 

Properties

ErrorType Type [get]
 The error type property (read-only). More...
 
string Info [get]
 The additional error information property (read-only). More...
 
ArrayList Details [get]
 The additional detailed error information property (read-only). More...
 
int Line [get]
 The line number property (read-only). More...
 
int Column [get]
 The column number property (read-only). More...
 
override string Message [get]
 The message property (read-only). More...
 
string ErrorMessage [get]
 The error message property (read-only). More...
 

Detailed Description

A parse exception.

Author
Per Cederberg
Version
1.5

Member Enumeration Documentation

The error type enumeration.

Enumerator
INTERNAL 

The internal error type is only used to signal an error that is a result of a bug in the parser or tokenizer code.

IO 

The I/O error type is used for stream I/O errors.

UNEXPECTED_EOF 

The unexpected end of file error type is used when end of file is encountered instead of a valid token.

UNEXPECTED_CHAR 

The unexpected character error type is used when a character is read that isn't handled by one of the token patterns.

UNEXPECTED_TOKEN 

The unexpected token error type is used when another token than the expected one is encountered.

INVALID_TOKEN 

The invalid token error type is used when a token pattern with an error message is matched.

The additional information provided should contain the error message.

ANALYSIS 

The analysis error type is used when an error is encountered in the analysis.

The additional information provided should contain the error message.

Constructor & Destructor Documentation

PerCederberg.Grammatica.Runtime.ParseException.ParseException ( ErrorType  type,
string  info,
int  line,
int  column 
)
inline

Creates a new parse exception.

Parameters
typethe parse error type
infothe additional information
linethe line number, or -1 for unknown
columnthe column number, or -1 for unknown
PerCederberg.Grammatica.Runtime.ParseException.ParseException ( ErrorType  type,
string  info,
ArrayList  details,
int  line,
int  column 
)
inline

Creates a new parse exception.

This constructor is only used to supply the detailed information array, which is only used for expected token errors. The list then contains descriptions of the expected tokens.

Parameters
typethe parse error type
infothe additional information
detailsthe additional detailed information
linethe line number, or -1 for unknown
columnthe column number, or -1 for unknown

Member Function Documentation

int PerCederberg.Grammatica.Runtime.ParseException.GetColumn ( )
inline

Returns the column number where the error occured.

Returns
the column number of the error, or -1 if unknown
See also
Column
Deprecated:
Use the Column property instead.
ArrayList PerCederberg.Grammatica.Runtime.ParseException.GetDetails ( )
inline

Returns the additional detailed error information.

Returns
the additional detailed error information
See also
Details
Deprecated:
Use the Details property instead.
string PerCederberg.Grammatica.Runtime.ParseException.GetErrorMessage ( )
inline

Returns the error message.

This message will contain all the information available, except for the line and column number information.

Returns
the error message
See also
ErrorMessage
Deprecated:
Use the ErrorMessage property instead.
ErrorType PerCederberg.Grammatica.Runtime.ParseException.GetErrorType ( )
inline

Returns the error type.

Returns
the error type
See also
Type
Deprecated:
Use the Type property instead.
string PerCederberg.Grammatica.Runtime.ParseException.GetInfo ( )
inline

Returns the additional error information.

Returns
the additional error information
See also
Info
Deprecated:
Use the Info property instead.
int PerCederberg.Grammatica.Runtime.ParseException.GetLine ( )
inline

Returns the line number where the error occured.

Returns
the line number of the error, or -1 if unknown
See also
Line
Deprecated:
Use the Line property instead.
string PerCederberg.Grammatica.Runtime.ParseException.GetMessage ( )
inline

Returns a default error message.

Returns
a default error message
See also
Message
Deprecated:
Use the Message property instead.

Property Documentation

int PerCederberg.Grammatica.Runtime.ParseException.Column
get

The column number property (read-only).

This is the column number where the error occured, or -1 if unknown.

Since
1.5
ArrayList PerCederberg.Grammatica.Runtime.ParseException.Details
get

The additional detailed error information property (read-only).

Since
1.5
string PerCederberg.Grammatica.Runtime.ParseException.ErrorMessage
get

The error message property (read-only).

This property contains all the information available, except for the line and column number information.

See also
Message
Since
1.5
string PerCederberg.Grammatica.Runtime.ParseException.Info
get

The additional error information property (read-only).

Since
1.5
int PerCederberg.Grammatica.Runtime.ParseException.Line
get

The line number property (read-only).

This is the line number where the error occured, or -1 if unknown.

Since
1.5
override string PerCederberg.Grammatica.Runtime.ParseException.Message
get

The message property (read-only).

This property contains the detailed exception error message, including line and column numbers when available.

See also
ErrorMessage
ErrorType PerCederberg.Grammatica.Runtime.ParseException.Type
get

The error type property (read-only).

Since
1.5

The documentation for this class was generated from the following file: