Args:
            lexfile (str): Flex file to be parsed
        Returns:
            DFA: A dfa automaton

def yyparse(self, lexfile):
        """
        Args:
            lexfile (str): Flex file to be parsed
        Returns:
            DFA: A dfa automaton
        """
        temp = tempfile.gettempdir()
        self.outfile = temp+'/'+''.join(
            random.choice(
                string.ascii_uppercase + string.digits) for _ in range(5)) + '_lex.yy.c'
        self._create_automaton_from_regex(lexfile)
        states_num, delta = self._create_delta()
        states = self._create_states(states_num)
        accepted_states = self._read_accept_states()
        if self.alphabet != []:
            alphabet = self.alphabet
        else:
            alphabet = createalphabet()
        mma = DFA(alphabet)
        for state in states:
            if state != 0:
                for char in alphabet:
                    nextstate = delta(state, char)
                    mma.add_arc(state - 1, nextstate - 1, char)
                if state in accepted_states:
                    mma[state - 1].final = True
        if os.path.exists(self.outfile):
            os.remove(self.outfile)
        return mma