<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def nfa(self):
 """convert the expression into an NFA"""

        finalstate = State(final=True)
        nextstate = finalstate
        for tokenexpr in reversed(self):
            state = tokenexpr.nfa(nextstate)
            nextstate = state
        return NFA(state)