/*******************************************************************************
* Copyright (c) 2009 University of Edinburgh.
* All rights reserved. This program and the accompanying materials are made
* available under the terms of the BSD Licence, which accompanies this feature
* and can be downloaded from http://groups.inf.ed.ac.uk/pepa/update/licence.txt
******************************************************************************/
package uk.ac.ed.inf.biopepa.core.compiler;
/**
* A compile-time problem kind
*
* @author mtribast
*
*/
public enum ProblemKind {
INVALID_LOCATION_USE("Invalid use of location definition"), LOCATION_USED_BUT_NOT_DEFINED(
"Location used but not defined"), LOCATION_MUST_BE_SPECIFIED("Location must be specified"), INVALID_NUMBER_OF_LOCATIONS(
"The use of a species in this context can only apply to one location"), VARIABLE_USED_BUT_NOT_DEFINED(
"Variable used but not defined"), INVALID_NUMBER_LITERAL("Invalid number literal. Expected double"), INVALID_OPERATOR_FOR_DOUBLE(
"Invalid operator for double"), FUNCTION_USED_BUT_NOT_DEFINED("Function used but not defined"), EVALUATION_EXCEPTION(
"Evaluation exception"), CIRCULAR_USAGE("Circular usage of variable"), ILLEGAL_PROPERTY(
"Illegal property for this type"), DUPLICATE_USAGE("Duplicate usage of name"), WRONG_NUMBER_OF_ARGUMENTS(
"Function call does not match signature. Wrong number of arguments"), UNSUPPORTED_FUNCTION_USED(
"Unsupported function used"), SPECIES_NOT_DECLARED("Behaviour of a species has not defined"), INVALID_TARGET_COMPONENT(
"Invalid target component"), INVALID_OPERATOR_FOR_REACTION("Invalid operator for reaction"), INVALID_OPERATOR_FOR_TRANSPORT(
"Invalid operator for transportation"), FUNCTIONAL_RATE_USED_BUT_NOT_DECLARED(
"Functional rate used but not declared"), DUPLICATE_ACTION_FOUND("Duplicate action in action set"), EXPECTED_NAME_IN_ACTION_SET(
"Expected name in action set"), MULTIPLE_SYSTEM_EQUATIONS("Only one system equation is allowed"),
NO_SYSTEM_EQUATION ("A system equation must be provided"),
INVALID_LOCATED_NAME_USE("Compartment assignment should appear as part of a prefix or transport definition"),
// Conditions for a well-formed model
MAXIMUM_COUNT_MUST_BE_SPECIFIED("The maximum molecular count must be specified"), ACTION_IN_NON_DECLARED_SPECIES_LOCATION(
"The species for this action has not been declared to exist in location "), STEP_SIZE_MUST_BE_SPECIFIED(
"Step size must be specified"), INITIAL_CONCENTRATION_MUST_BE_SPECIFIED(
"Initial concentration must be specified"), MAXIMUM_NUMBER_OF_LEVELS_MUST_BE_SPECIFIED(
"Maximum number of levels must be specified"), INITIAL_COUNT_GT_MAX(
"Initial molecular count exceeds upper bound"), INITIAL_COUNT_LT_MIN(
"Initial molecular count outwith of lower bound"), // TODO
MAX_LT_MIN("Upper bound is less than lower bound"), MIN_GT_MAX("Lower bound is greater than upper bound"), GTE_ZERO(
"Value must evaluate to an integer greater than or equal to zero"), NON_INTEGER_VALUE(
"Value must evaluate to an integer"), DYNAMIC_VALUE(
"Value cannot rely on dynamic values such as location size or molecular count"), INITIAL_COUNT_LT_ZERO(
"Initial molecular count must evaluate to an integer greater than, or equal to zero"), DUPLICATE_PROPERTY_DEFINITION(
"Duplicate definition of a property"), DUPLICATE_REACTION_FOUND("Duplicate usage of functional rate"), INVALID_TRANSPORTATION_COOPERATION(
"Cannot cooperate over transportation between species"),
// Generated by parser
SYNTAX_ERROR("Syntax error"), INVALID_NUMBER_OF_ARGUMENTS("Invalid number of arguments for function call"), DEFINITION_DECLARED_BUT_NOT_USED(
"Definition declared but not used");
private String message;
ProblemKind(String message) {
this.message = message;
}
public String getMessage() {
return message;
}
public void setMessage(String m){
this.message = m;
}
@Override
public String toString() {
return getMessage();
}
}