'Parse a primitive regexp.'

def parse_prim(self):

    c = self.get()
    if (c == '.'):
        re = AnyBut('\n')
    elif (c == '^'):
        re = Bol
    elif (c == '$'):
        re = Eol
    elif (c == '('):
        re = self.parse_alt()
        self.expect(')')
    elif (c == '['):
        re = self.parse_charset()
        self.expect(']')
    else:
        if (c == '\\'):
            c = self.get()
        re = Char(c)
    return re
