Esempio n. 1
0
def test_parse():
    u'''
    パースしてみましょう
    '''

    parser, to_ast = ebnf.make_parser()

    def check(exp, symbol):

        result = parser(exp)
        
        assert result,children[0].symbol == symbol
        

    check('1', 'INTEGR')
    check('1.1', 'FLOAT')
    check('"aaa"', 'STRING')
    check('()', 'list')
Esempio n. 2
0
def test_make_parser():
    u'''
    パーサ作る
    '''

    ebnf.make_parser()