def buildAux(self, command, tokens, index):
        """Parse 'aux' command  for simple, cloned, or conditional aux of forms

           Simple Auxiliary:
              aux framername

           Cloned Auxiliary:
              aux framername as (mine, clonedauxname) [via (main, mine, inode)]


           Simple Conditional Auxiliary:
              aux framername  if [not] need
              aux framername  if [not] need [and [not] need ...]

           Cloned Conditional Auxiliary:
              aux framername as (mine, clonedauxname) [via (main, mine, inode)]
                             if [not] need
              aux framername as (mine, clonedauxname) [via (main, mine, inode)]
                             if [not] need [and [not] need ...]

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

        try:
            needs = []
            aux = None #original
            connective = None
            clone = None
            inode = ''

            aux = tokens[index]
            index +=1 #eat token

            self.verifyName(aux, command, tokens, index)

            while index < len(tokens): #options
                connective = tokens[index]
                index += 1

                if connective == 'as':
                    clone = tokens[index]
                    index += 1

                    self.verifyName(clone, command, tokens, index)

                elif connective == 'via':
                    inode, index = self.parseIndirect(tokens, index, node=True)

                elif connective == 'if':
                    while (index < len(tokens)):
                        act, index = self.makeNeed(tokens, index)
                        if not act:
                            return False # something wrong do not know what
                        needs.append(act)
                        if index < len(tokens):
                            connective = tokens[index]
                            if connective not in ['and']:
                                msg = "ParseError: Building verb '%s'. Bad connective '%s'" % \
                                                        (command, connective)
                                raise excepting.ParseError(msg, tokens, index)
                            index += 1 #otherwise eat token

                else:
                    msg = ("Error building {0}. Invalid connective"
                          " '{1}'.".format(command, connective))
                    raise excepting.ParseError(msg, tokens, index)

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

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

        if clone:
            data = odict(original=aux,
                         clone=clone,
                         schedule=AUX,
                         human=self.currentHuman,
                         count=self.currentCount,
                         inode=inode)
            if clone == 'mine':  # insular clone may not be referenced
                aux = data # create clone when resolve aux can wait until then
            else:  # named clone create clone when resolve framer.moots may be referenced
                self.currentFramer.moots.append(data)  # need to resolve early
                aux = clone # assign aux to clone name as original aux is to be cloned
                # named clones must be resolved before any frames get resolved
                # and are added to the framer.names so they can be referenced

        if needs: #conditional auxiliary suspender preact
            human = ' '.join(tokens) #recreate transition command string for debugging
            #resolve aux link later
            parms = dict(needs = needs, main = 'me', aux = aux, human = human)
            act = acting.Act(   actor='Suspender',
                                registrar=acting.Actor,
                                parms=parms,
                                human=self.currentHuman,
                                count=self.currentCount)

            self.currentFrame.addPreact(act)

            console.profuse("     Added suspender preact,  '{0}', with aux"
                            " {1} needs:\n".format(command, aux))
            for need in needs:
                console.profuse("       {0} with parms = {1}\n".format(need.actor, need.parms))

        else: # Simple auxiliary
            self.currentFrame.addAux(aux) #need to resolve later
            console.profuse("     Added aux framer {0}\n".format(aux))

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