Package com.valgolang.errorhandling.semanticerror

Functions

array2DDimensionError
Link copied to clipboard
fun array2DDimensionError(ctx: ParserRuleContext)
2D array dimension error
breakOrContinueOutsideLoopError
Link copied to clipboard
fun breakOrContinueOutsideLoopError(action: String, ctx: ParserRuleContext)
Break or continue outside loop error
fun dataStructureInternalTypeNotPrimitiveError(internalType: Type, ctx: ParserRuleContext)
Data structure internal type internalType not primitive error
declareAssignError
Link copied to clipboard
fun declareAssignError(identifier: String, rhsType: Type, lhsType: Type, ctx: ParserRuleContext)
Error for assigning expression of type rhsType to variable identifier with type lhsType, where rhsType and lhsType are different
forLoopIdentifierBeingReassignedError
Link copied to clipboard
fun forLoopIdentifierBeingReassignedError(identifier: String, ctx: ParserRuleContext)
For loop identifier being reassigned error
forLoopRangeNotNumberOrChar
Link copied to clipboard
fun forLoopRangeNotNumberOrChar(startType: String, endType: String, ctx: ParserRuleContext)
For loop range expressions not number or char
forLoopRangeUpdateNotNumber
Link copied to clipboard
fun forLoopRangeUpdateNotNumber(actual: String, ctx: ParserRuleContext)
For loop range update expression not number
globalReturnError
Link copied to clipboard
fun globalReturnError(ctx: ParserRuleContext)
Global return error
incompatibleArrayDimension
Link copied to clipboard
fun incompatibleArrayDimension(arrayDimension: Int, ctx: ParserRuleContext)
Incompatible array dimension, where arrayDimension greater than 2
fun incompatibleArrayDimensionWithConstructorArguments(is2D: Boolean, argumentsSize: Int, ctx: ParserRuleContext)
Incompatible array dimension with constructor arguments error Error thrown if: is2D true, argumentsSize !
incompatibleDataStructureInitialisation
Link copied to clipboard
fun incompatibleDataStructureInitialisation(dataStructureType: String, ctx: ParserRuleContext)
Incompatible data structure initialisation
incompatibleFunctionType
Link copied to clipboard
fun incompatibleFunctionType(identifier: String, declared: String, called: String, ctx: ParserRuleContext)
Incompatible function type error, where declared and called do not match
incompatibleOperatorTypeError
Link copied to clipboard
fun incompatibleOperatorTypeError(operator: String, expr1Type: Type, expr2Type: Type? = null, ctx: ParserRuleContext)
Error when operator operator is incompatible with types expr1Type and expr2Type
incompatibleParameterCount
Link copied to clipboard
fun incompatibleParameterCount(identifier: String, declared: Int, called: Int, ctx: ParserRuleContext)
Incompatible parameter count error, where declared and called do not match
incompatibleParameterType
Link copied to clipboard
fun incompatibleParameterType(identifier: String, declared: String, argument: String, ctx: ParserRuleContext)
Incompatible parameter type error, where declared and argument do not match
fun incompatibleTypeFromMultipleFunctionCall(identifier: String, ctx: ParserRuleContext)
Incompatible type from multiple function calls error
inconsistentTypeError
Link copied to clipboard
fun inconsistentTypeError(expected: Type, ctx: ParserRuleContext)
Inconsistent type error, used in data structures where all initialised values must be of the same type expected
incorrectConstructorItemSize
Link copied to clipboard
fun incorrectConstructorItemSize(openConstructorSize: Int, closeConstructorSize: Int, ctx: ParserRuleContext)
Incorrect constructor item size, where openConstructorSize and closeConstructorSize do not match
incorrectLHSForDataStructureElem
Link copied to clipboard
fun incorrectLHSForDataStructureElem(identifier: String, expected: String, actual: Type, ctx: ParserRuleContext)
Error when data structure access performed on variable identifier of type actual, where element assignment cannot be performed
invalidArgumentsForAnnotationError
Link copied to clipboard
fun invalidArgumentsForAnnotationError(annotation: String, ctx: ParserRuleContext)
Invalid arguments for annotation error
maxArrayIndexingExceededError
Link copied to clipboard
fun maxArrayIndexingExceededError(is2DArray: Boolean, indicesSize: Int, ctx: ParserRuleContext)
Max array indexing exceeded error
missingConstructorArgumentsError
Link copied to clipboard
fun missingConstructorArgumentsError(dataStructureType: DataStructureType, expected: Int, actual: Int, ctx: ParserRuleContext)
TODO: Explain properly Missing constructor arguments error
missingReturnError
Link copied to clipboard
fun missingReturnError(function: String, type: String, ctx: ParserRuleContext)
Missing return error in function
nonDataStructureMethodError
Link copied to clipboard
fun nonDataStructureMethodError(identifier: String, ctx: ParserRuleContext)
Error when data structure method applied to variable identifier which is not a data structure
nonNullableAssignedToNull
Link copied to clipboard
fun nonNullableAssignedToNull(type: String, ctx: ParserRuleContext)
Non nullable type assigned to null type
numOfArgsInFunctionCallError
Link copied to clipboard
fun numOfArgsInFunctionCallError(function: String, numArgs: Int, expected: Int, ctx: ParserRuleContext)
Incorrect number of arguments numArgs specified when calling function
numOfArgsInMethodCallError
Link copied to clipboard
fun numOfArgsInMethodCallError(dataStructureType: String, method: String, numArgs: Int, expected: Int, ctx: ParserRuleContext)
Incorrect number of arguments numArgs specified when calling method on a variable of type dataStructureType
redeclarationError
Link copied to clipboard
fun redeclarationError(variable: String, variableType: Type, ctx: ParserRuleContext)
Variable redeclaration error
returnTypeError
Link copied to clipboard
fun returnTypeError(type: String, expectedType: String, ctx: ParserRuleContext)
Return type error, where type does not match expectedType
stringImmutabilityError
Link copied to clipboard
fun stringImmutabilityError(varName: String, ctx: ParserRuleContext)
Error when trying to edit element in string as they are immutable
typeOfArgsInFunctionCallError
Link copied to clipboard
fun typeOfArgsInFunctionCallError(function: String, argType: String, argName: String, expected: String, ctx: ParserRuleContext)
Incorrect type argType of argument argName specified when calling function
typeOfArgsInMethodCallError
Link copied to clipboard
fun typeOfArgsInMethodCallError(dataStructureType: String, method: String, argType: String, argName: String, ctx: ParserRuleContext)
Incorrect type argType of argument argName specified when calling method on a variable of type dataStructureType
unableToInferTypeFromNullType
Link copied to clipboard
fun unableToInferTypeFromNullType(ctx: ParserRuleContext)
Unable to infer type from null type
undeclaredAssignError
Link copied to clipboard
fun undeclaredAssignError(identifier: String, ctx: ParserRuleContext)
Error when value assigned to variable identifier that has not yet been declared
unexpectedExpressionTypeError
Link copied to clipboard
fun unexpectedExpressionTypeError(expected: Set<Type>, actual: Type, ctx: ParserRuleContext)
Unexpected expression type error, where actual is not part of the expected types in expected
unsupportedMethodError
Link copied to clipboard
fun unsupportedMethodError(dataStructureType: String, method: String, ctx: ParserRuleContext)
Error when method other than those specified for dataStructureType is applied
voidTypeDeclarationError
Link copied to clipboard
fun voidTypeDeclarationError(identifier: String, ctx: ParserRuleContext)
Void type declaration error with variable identifier