public InvalidTypeArgumentListException( BCake.Parser.Token token, BCake.Parser.Syntax.Types.GenericClassType classType, IEnumerable <BCake.Parser.Syntax.Types.Type> providedTypes) : base($"Invalid type argument list - the type(s) <{ string.Join(",", providedTypes.Select(t => t.Name)) }> do not match the type parameters of { classType.Name }<{ string.Join(",", classType.GenericTypeParameters.Select(p => p.Name)) }>", token) { }
public InvalidArgumentException( BCake.Parser.Token token, OperatorAttribute.ParameterType expectedType ) : base($"The expression on the left hand side of an assignment operation in invalid - {expectedType} expected", token) { }
public AccessViolationException( BCake.Parser.Token token, BCake.Parser.Syntax.Types.Type member, BCake.Parser.Syntax.Scopes.Scope sourceScope ) : base($"Cannot access {member.Access} symbol \"{member.FullName}\" from current scope due to it's protection level", token) { }
public UndefinedSymbolException( BCake.Parser.Token token, string name, BCake.Parser.Syntax.Scopes.Scope scope ) : base($"Undefined symbol - the symbol \"{name}\" has not been declared in this scope\n\tat scope {scope.FullName}", token) { }
public InvalidTypeArgumentListException(BCake.Parser.Token token, BCake.Parser.Syntax.Types.ClassType classType) : base($"Invalid type argument list - the type { classType.Name } is not generic", token) { }
public DuplicateDeclarationException( BCake.Parser.Token token, BCake.Parser.Syntax.Types.Type member ) : base($"Duplicate declaration - the symbol \"{member.FullName}\" is already defined at {member.DefiningToken.FilePath}({member.DefiningToken.Line},{member.DefiningToken.Column})", token) { }
public DuplicateFunctionDeclarationException( BCake.Parser.Token token, BCake.Parser.Syntax.Types.FunctionType function ) : base($"Duplicate function declaration - an override of \"{function.FullName}\" with the same parameters ({FormatParamList(function.Parameters)}) is already defined at {function.DefiningToken.FilePath}({function.DefiningToken.Line},{function.DefiningToken.Column})", token) { }
public UnexpectedTokenException(BCake.Parser.Token token) : base($"Unexpected token \"{token.Value}\"", token) { }
public InvalidReturnError(BCake.Parser.Token token) : base($"Invalid return statement - there is nothing to return from", token) { }
public TypeException( BCake.Parser.Token token, Type t1, Type t2 ) : base($"The type {t1?.FullName ?? "void"} cannot be implicitly converted to type {t2?.FullName ?? "void"}", token) { }
public TypeException( BCake.Parser.Token token, Type t1, Type t2, Type castTo ) : base($"The type {t1?.FullName ?? "void"} cannot be implicitly converted to type {t2?.FullName ?? "void"}, but an explicit cast exists - you may want to use '{ token.Value } as { castTo.Name }'", token) { }
public Error(string message, BCake.Parser.Token token) : base($"Error in {token.FilePath}({token.Line},{token.Column}): {message}") { }
public RuntimeException(string message, BCake.Parser.Token token) : base($"{token.FilePath}({token.Line},{token.Column}): {message}") { }
public NullReferenceException(Type symbol, BCake.Parser.Token token) : base($"Tried accessing symbol {symbol.Name}, but it is null", token) { }
public OutOfBoundsException(int index, Type symbol, BCake.Parser.Token token) : base($"Index ${index} out of bounds for symbol {symbol.Name}", token) { }
public UnexpectedTypeParameterException(BCake.Parser.Token token) : base($"Unexpected generic type parameter list - only classes can be generic", token) { }
public OutOfBoundsException(int index, object value, BCake.Parser.Token token) : base($"Index ${index} out of bounds for value {value}", token) { }
public EndOfFileException(BCake.Parser.Token token) : base($"Unexpected end of file", token) { }
public RuntimeNode(BCake.Parser.Token token, RuntimeScope scope) { DefiningToken = token; RuntimeScope = scope; }