def parseNeedGoal(self, statePath, stateField, tokens, index):
        """Parse required goal

           method must be wrapped in appropriate try excepts
        """
        goalPath = None #default
        goalField = None #default
        direct = False

        goal = tokens[index]
        #parse required goal
        try:
            goal = Convert2StrBoolCoordNum(tokens[index]) #goal is quoted string, boolean, or number
            index += 1 #eat token
            direct = True

        except __HOLE__: #means text is not (quoted string, bool, or number) so indirect
            goalField, index = self.parseField(tokens, index)
            goalPath, index =  self.parseIndirect(tokens, index)

        return (direct, goal, goalPath, goalField, index)
dataset/ETHPy150Open ioflo/ioflo/ioflo/base/building.py/Builder.parseNeedGoal