Implementing the Domain functionality for calculator and input parsing