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

A parser creation exception. More...

Inheritance diagram for PerCederberg.Grammatica.Runtime.ParserCreationException:

Public Types

enum  ErrorType {
  ErrorType.INTERNAL, ErrorType.INVALID_PARSER, ErrorType.INVALID_TOKEN, ErrorType.INVALID_PRODUCTION,
  ErrorType.INFINITE_LOOP, ErrorType.INHERENT_AMBIGUITY
}
 The error type enumeration. More...
 

Public Member Functions

 ParserCreationException (ErrorType type, String info)
 Creates a new parser creation exception. More...
 
 ParserCreationException (ErrorType type, String name, String info)
 Creates a new parser creation exception. More...
 
 ParserCreationException (ErrorType type, String name, String info, ArrayList details)
 Creates a new parser creation exception. More...
 
ErrorType GetErrorType ()
 Returns the error type. More...
 
string GetName ()
 Returns the token or production name. More...
 
string GetInfo ()
 Returns the additional error information. More...
 
string GetDetails ()
 Returns the detailed error information as a string. More...
 
string GetMessage ()
 Returns the error message. More...
 

Properties

ErrorType Type [get]
 The error type property (read-only). More...
 
string Name [get]
 The token or production name property (read-only). More...
 
string Info [get]
 The additional error information property (read-only). More...
 
string Details [get]
 The detailed error information property (read-only). More...
 
override string Message [get]
 The message property (read-only). More...
 

Detailed Description

A parser creation exception.

This exception is used for signalling an error in the token or production patterns, making it impossible to create a working parser or tokenizer.

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.

INVALID_PARSER 

The invalid parser error type is used when the parser as such is invalid.

This error is typically caused by using a parser without any patterns.

INVALID_TOKEN 

The invalid token error type is used when a token pattern is erroneous.

This error is typically caused by an invalid pattern type or an erroneous regular expression.

INVALID_PRODUCTION 

The invalid production error type is used when a production pattern is erroneous.

This error is typically caused by referencing undeclared productions, or violating some other production pattern constraint.

INFINITE_LOOP 

The infinite loop error type is used when an infinite loop has been detected in the grammar.

One of the productions in the loop will be reported.

INHERENT_AMBIGUITY 

The inherent ambiguity error type is used when the set of production patterns (i.e.

the grammar) contains ambiguities that cannot be resolved.

Constructor & Destructor Documentation

PerCederberg.Grammatica.Runtime.ParserCreationException.ParserCreationException ( ErrorType  type,
String  info 
)
inline

Creates a new parser creation exception.

Parameters
typethe parse error type
infothe additional error information
PerCederberg.Grammatica.Runtime.ParserCreationException.ParserCreationException ( ErrorType  type,
String  name,
String  info 
)
inline

Creates a new parser creation exception.

Parameters
typethe parse error type
namethe token or production pattern name
infothe additional error information
PerCederberg.Grammatica.Runtime.ParserCreationException.ParserCreationException ( ErrorType  type,
String  name,
String  info,
ArrayList  details 
)
inline

Creates a new parser creation exception.

Parameters
typethe parse error type
namethe token or production pattern name
infothe additional error information
detailsthe error details list

Member Function Documentation

string PerCederberg.Grammatica.Runtime.ParserCreationException.GetDetails ( )
inline

Returns the detailed error information as a string.

Returns
the detailed error information
See also
Details
Deprecated:
Use the Details property instead.
ErrorType PerCederberg.Grammatica.Runtime.ParserCreationException.GetErrorType ( )
inline

Returns the error type.

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

Returns the additional error information.

Returns
the additional error information
See also
Info
Deprecated:
Use the Info property instead.
string PerCederberg.Grammatica.Runtime.ParserCreationException.GetMessage ( )
inline

Returns the error message.

This message will contain all the information available.

Returns
the error message
See also
Message
Deprecated:
Use the Message property instead.
string PerCederberg.Grammatica.Runtime.ParserCreationException.GetName ( )
inline

Returns the token or production name.

Returns
the token or production name
See also
Name
Deprecated:
Use the Name property instead.

Property Documentation

string PerCederberg.Grammatica.Runtime.ParserCreationException.Details
get

The detailed error information property (read-only).

Since
1.5
string PerCederberg.Grammatica.Runtime.ParserCreationException.Info
get

The additional error information property (read-only).

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

The message property (read-only).

This property contains the detailed exception error message.

string PerCederberg.Grammatica.Runtime.ParserCreationException.Name
get

The token or production name property (read-only).

Since
1.5
ErrorType PerCederberg.Grammatica.Runtime.ParserCreationException.Type
get

The error type property (read-only).

Since
1.5

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