Exemple #1
0
    start='mailbox_or_url_list',
    errorlog=log,
    tabmodule='mailbox_or_url_list_parsetab',
    debug=False,
    write_tables=False)

# Interactive prompt for easy debugging
if __name__ == '__main__':
    while True:
        try:
            s = raw_input('\nflanker> ')
        except KeyboardInterrupt:
            break
        except EOFError:
            break
        if s == '': continue

        print('\nTokens list:\n')
        lexer.input(s)
        while True:
            tok = lexer.token()
            if not tok:
                break
            print(tok)

        print('\nParsing behavior:\n')
        result = mailbox_or_url_list_parser.parse(s, debug=log)

        print('\nResult:\n')
        print(result)
Exemple #2
0
log.debug('building mailbox_or_url_list parser')
mailbox_or_url_list_parser = yacc.yacc(start='mailbox_or_url_list',
                                       errorlog=log,
                                       tabmodule='mailbox_or_url_list_parsetab')


# Interactive prompt for easy debugging
if __name__ == '__main__':
    while True:
        try:
            s = raw_input('\nflanker> ')
        except KeyboardInterrupt:
            break
        except EOFError:
            break
        if s == '': continue

        print('\nTokens list:\n')
        lexer.input(s)
        while True:
            tok = lexer.token()
            if not tok:
                break
            print(tok)

        print('\nParsing behavior:\n')
        result = mailbox_or_url_list_parser.parse(s, debug=log)

        print('\nResult:\n')
        print(result)