Parsing System (v0.5)
|
Exception
This includes functionality for when a parsed source contains errors. module goldie.exception This isn't actually a thrown exception. It's just used to represent a single lexing error. string file
int line
int pos
Filename, line number, and "column number" of the error.
Note Goldie's conventions regarding line and column numbers.
string content
The actual piece of source that failed to lex.
readonly property string printableContent
Like content, but with non-printable characters removed.
string toString()
Ready-to-display string representation in the following format:
{file}({line}:{pos}): Syntax Error: '{printableContent}'
module goldie.exception Thrown upon any lexing or parsing error. The lexer and parser used when the error occurred. These can be inspected to obtain more information about the error. Under certain circumstances, either or both of these may be null, so make sure to check for null before using. string msg
Ready-to-display string representation of the error, including
filename (if available) and line and column numbers.
this(string msg)
Constructors.
module goldie.exception module goldie.exception Thrown when the lexer comes across a byte sequence that is invalid Unicode. This may occur if the source contains invalid UTF-8, or if a binary file is parsed by accident.
Constructor.
module goldie.exception Thrown when parsing finds a type of token in a place where the grammar doesn't allow it. For example, in a C-like language, the if in: var1 + if + var2.
Constructor.
module goldie.exception Thrown when parsing reaches the end of the source in a place where the grammar expects more tokens. For example, in a C-like language, a source consisting entirely of: void main() {.
Constructor.
module goldie.exception Thrown when an internal error is detected within Goldie. If you get one of these exceptions (the "msg" string will say something along the lines of "Internal Goldie Error:..."), please file a bug report. module goldie.exception Thrown when a problem occurs loading a CGT language file. StdioException is part of D's standard library. this(string msg="", string lang="", Exception next=null)
Constructor.
module goldie.exception Thrown when Goldie tries to load a CGT language file, but cannot find the file. this(string lang, Exception next=null)
Constructor.
|