def DrtVariableExpression(variable):
 if is_indvar(variable.name):
  return DrtIndividualVariableExpression(variable)
 elif is_funcvar(variable.name):
  return DrtFunctionVariableExpression(variable)
 elif is_eventvar(variable.name):
  return DrtEventVariableExpression(variable)
 else:
  return DrtConstantExpression(variable)

def DrtVariableExpression ( variable ) : if is_indvar ( variable . name ) : return DrtIndividualVariableExpression ( variable ) elif is_funcvar ( variable . name ) : return DrtFunctionVariableExpression ( variable ) elif is_eventvar ( variable . name ) : return DrtEventVariableExpression ( variable ) else : return DrtConstantExpression ( variable )
this is a factory method that instantiates and returns a subtype of drtabstractvariableexpression appropriate for the given variable .