[This is preliminary documentation and is subject to change.]
Represents either one or a collection of errors.
Declaration Syntax
C# |
public class ErrorToken : Token, IEnumerable<ErrorToken>, IEnumerable
Members
All Members | Constructors | Methods | Properties | ||
Icon | Member | Description |
---|---|---|
ErrorToken(Section, String) | Creates a new ErrorToken with a single error. | |
ErrorToken()()()() | Creates an error token to contain a collection of errors.
| |
Add(Section, String) |
Adds a new error to the collection of errors in this error token.
| |
Add(Section, String, array<Object>[]()[][]) | Adds a new error to the collection of errors in this error token.
| |
AddFrom(ErrorToken) | Consolidates any errors in another ErrorToken into this
ErrorToken. | |
Count | Gets the number of errors in this token. | |
DecimalValue | Gets the value of this token as a decimal number. Must be
overridden in derived classes. (Inherited from Token.) | |
Equals(Object) | (Inherited from Object.) | |
Finalize()()()() |
Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
(Inherited from Object.) | |
FloatingValue | Gets the value of this token as a floating point number. Must be
overridden in derived classes. (Inherited from Token.) | |
GetEnumerator()()()() | Obtains an enumerator for this ErrorToken. | |
GetHashCode()()()() |
Serves as a hash function for a particular type.
(Inherited from Object.) | |
GetType()()()() |
Gets the Type of the current instance.
(Inherited from Object.) | |
HasDecimalValue | Gets whether this token has a decimal value. Must be overridden
in derived classes. (Inherited from Token.) | |
IntegerValue | Gets the value of this token as an integer number. Must be
overridden in derived classes. (Inherited from Token.) | |
MemberwiseClone()()()() |
Creates a shallow copy of the current Object.
(Inherited from Object.) | |
Section | Gets the Section denoting the range of characters
corresponding to this token in the source text. (Inherited from Token.) | |
ToString()()()() | Creates a short string representation of the value of this token
(Overrides Object.ToString()()()().) | |
Value | Gets the value of this error token. This is the error message if
the token contains a single error or "nnn Errors" if it contains a
collection. |
Remarks
ErrorTokens can be produced at any stage of the compilation process - the lexical parse, the syntax parse or the code generation. Each error consists of an error message. If a collection, each is associated with their own contained single ErrorToken. You should always iterate using the enumerator when accessing the error(s) in this token.
If you want to create an ErrorToken containing a list of errors, you must use the zero parameter constructor and then use the Add method, its overload, or the AddFrom method.