2021-06-08 09:37:38 +01:00
|
|
|
module compiler.parsing.exceptions;
|
|
|
|
|
2021-06-08 09:45:14 +01:00
|
|
|
import compiler.parsing.core;
|
|
|
|
import compiler.lexer;
|
|
|
|
import misc.exceptions;
|
|
|
|
import compiler.symbols.check;
|
|
|
|
import compiler.symbols.data;
|
|
|
|
import compiler.lexer : Token;
|
|
|
|
|
2021-06-08 09:37:38 +01:00
|
|
|
public class ParserException : TError
|
|
|
|
{
|
2021-06-08 09:38:46 +01:00
|
|
|
private Parser parser;
|
2021-06-08 09:37:38 +01:00
|
|
|
|
2021-06-08 09:38:46 +01:00
|
|
|
this(Parser parser)
|
|
|
|
{
|
2021-06-08 09:45:14 +01:00
|
|
|
super("");
|
2021-06-08 09:38:46 +01:00
|
|
|
this.parser = parser;
|
2021-06-08 09:37:38 +01:00
|
|
|
}
|
2021-06-08 09:38:46 +01:00
|
|
|
|
|
|
|
|
2021-06-08 09:37:38 +01:00
|
|
|
}
|
|
|
|
|
2021-06-08 09:37:43 +01:00
|
|
|
public final class SyntaxError : ParserException
|
|
|
|
{
|
|
|
|
private SymbolType expected;
|
|
|
|
private SymbolType provided;
|
|
|
|
|
2021-06-08 09:38:46 +01:00
|
|
|
this(Parser parser, SymbolType expected, SymbolType provided)
|
2021-06-08 09:37:43 +01:00
|
|
|
{
|
2021-06-08 09:38:46 +01:00
|
|
|
super(parser);
|
2021-06-08 09:37:43 +01:00
|
|
|
this.expected = expected;
|
|
|
|
this.provided = provided;
|
|
|
|
}
|
|
|
|
}
|