def buildSet(self, command, tokens, index):
        """Build set command to generate goal actions

           set goal to data
           set goal from source

           goal:
              elapsed
              recurred
              [(value, fields) in] absolute
              [(value, fields) in] relativegoal

           data:
              direct

           source:
              indirect

        """
        self.verifyCurrentContext(tokens, index) #currentStore, currentFramer, currentFrame exist

        try:
            kind = tokens[index]

            if kind in ['elapsed', 'recurred']: #simple implicit framer relative goals, direct and indirect,
                index +=1 #eat token
                act, index = self.makeFramerGoal(kind, tokens, index)

            else: #basic goals
                #goal is destination dst
                dstFields, index = self.parseFields(tokens, index)
                dstPath, index = self.parseIndirect(tokens, index)

                #required connective
                connective = tokens[index]
                index += 1

                if connective in ['to', 'with']: #data direct
                    srcData, index = self.parseDirect(tokens, index)

                    act = self.makeGoalDirect(dstPath, dstFields, srcData)

                elif connective in ['by', 'from']: #source indirect
                    srcFields, index = self.parseFields(tokens, index)
                    srcPath, index = self.parseIndirect(tokens, index)

                    act = self.makeGoalIndirect(dstPath, dstFields, srcPath, srcFields)

                else:
                    msg = "ParseError: Building verb '%s'. Unexpected connective '%s'" %\
                        (command, connective)
                    raise excepting.ParseError(msg, tokens, index)

            if not act:
                return False

        except __HOLE__:
            msg = "ParseError: Building verb '%s'. Not enough tokens." % (command,)
            raise excepting.ParseError(msg, tokens, index)

        if index != len(tokens):
            msg = "ParseError: Building verb '%s'. Unused tokens." % (command,)
            raise excepting.ParseError(msg, tokens, index)

        context = self.currentContext
        if context == NATIVE:
            context = ENTER #what is native for this command

        if not self.currentFrame.addByContext(act, context):
            msg = "Error building %s. Bad context '%s'." % (command, context)
            raise excepting.ParseError(msg, tokens, index)

        console.profuse("     Added {0} '{1}' with parms '{2}'\n".format(
            ActionContextNames[context], act.actor, act.parms))

        return True
dataset/ETHPy150Open ioflo/ioflo/ioflo/base/building.py/Builder.buildSet