'Parse the generated source tokens.'

def parse(self):

    if (self.parsetree is not None):
        return
    self.tokenize()
    try:
        self.parsetree = pydriver.parse_tokens(self.tokens)
    except parse.ParseError as err:
        raise PycodeError('parsing    failed', err)
    encoding = sys.getdefaultencoding()
    comments = self.parsetree.get_prefix()
    for line in comments.splitlines()[:2]:
        match = _coding_re.search(line)
        if (match is not None):
            encoding = match.group(1)
            break
    self.encoding = encoding
