Esempio n. 1
0
 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)
 {
 }
Esempio n. 3
0
 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)
 {
 }
Esempio n. 4
0
 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)
 {
 }
Esempio n. 5
0
 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)
 {
 }
Esempio n. 10
0
 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)
 {
 }
Esempio n. 11
0
 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)
 {
 }
Esempio n. 12
0
 public Error(string message, BCake.Parser.Token token)
     : base($"Error in {token.FilePath}({token.Line},{token.Column}): {message}")
 {
 }
Esempio n. 13
0
 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)
 {
 }
Esempio n. 15
0
 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)
 {
 }
Esempio n. 17
0
 public OutOfBoundsException(int index, object value, BCake.Parser.Token token)
     : base($"Index ${index} out of bounds for value {value}", token)
 {
 }
Esempio n. 18
0
 public EndOfFileException(BCake.Parser.Token token)
     : base($"Unexpected end of file", token)
 {
 }
Esempio n. 19
0
 public RuntimeNode(BCake.Parser.Token token, RuntimeScope scope)
 {
     DefiningToken = token;
     RuntimeScope  = scope;
 }