Files
Sheerka-Old/src/core/global_symbols.py
T
kodjo 6cda2686fb Fixed #48 : RelationalExpressionParser: Implement relational operator parser
Fixed #49 : ExpressionParser: Implement ExpressionParser
Fixed #50 : Implement ReteConditionExprVisitor
Fixed #51 : Implement PythonConditionExprVisitor
Fixed #52 : SheerkaConceptManager: I can get and set concept property
2021-03-23 11:35:10 +01:00

82 lines
1.7 KiB
Python

# events
from enum import Enum
EVENT_CONCEPT_PRECEDENCE_MODIFIED = "evt_cp_m"
EVENT_RULE_PRECEDENCE_MODIFIED = "evt_rp_m"
EVENT_CONTEXT_DISPOSED = "evt_ctx_d"
EVENT_USER_INPUT_EVALUATED = "evt_ui_e"
EVENT_CONCEPT_CREATED = "evt_c_c"
EVENT_CONCEPT_DELETED = "evt_c_d"
EVENT_CONCEPT_ID_DELETED = "evt_c_id_d"
EVENT_RULE_CREATED = "evt_r_c"
EVENT_RULE_DELETED = "evt_r_d"
EVENT_RULE_ID_DELETED = "evt_r_id_d"
EVENT_ONTOLOGY_CREATED = "evt_o_c"
EVENT_ONTOLOGY_DELETED = "evt_o_d"
# comparison context
RULE_COMPARISON_CONTEXT = "Rule"
CONCEPT_COMPARISON_CONTEXT = "Sya"
NO_MATCH = "** No Match **"
class CustomType:
def __init__(self, value):
self.value = value
def __repr__(self):
return self.value
def __eq__(self, other):
return isinstance(other, CustomType) and self.value == other.value
def __hash__(self):
return hash(self.value)
class NotInitType(CustomType):
def __init__(self):
super(NotInitType, self).__init__("**NotInit**")
class NotFoundType(CustomType):
def __init__(self):
super(NotFoundType, self).__init__("**NotFound**")
class RemovedType(CustomType):
def __init__(self):
super(RemovedType, self).__init__("**Removed**")
class NoFirstTokenType(CustomType):
def __init__(self):
super(NoFirstTokenType, self).__init__("**NoFirstToken**")
NotInit = NotInitType()
NotFound = NotFoundType()
Removed = RemovedType()
NoFirstToken = NoFirstTokenType()
class ErrorObj:
"""
To indicate that somehow, the underlying object is (or has) an error
"""
pass
CURRENT_OBJ = "__obj"
class SyaAssociativity(Enum):
Left = "left"
Right = "right"
No = "No"
def __repr__(self):
return self.value