source: pyyaml/trunk/lib/yaml/__init__.py @ 132

Revision 132, 860 bytes checked in by xi, 8 years ago (diff)

Emitter is done!!!

Line 
1
2from error import *
3from reader import *
4from scanner import *
5from parser import *
6from composer import *
7from resolver import *
8from constructor import *
9from emitter import *
10
11from tokens import *
12from events import *
13from nodes import *
14
15def parse(data, Reader=Reader, Scanner=Scanner, Parser=Parser):
16    reader = Reader(data)
17    scanner = Scanner(reader)
18    parser = Parser(scanner)
19    return parser
20
21def load(data, Reader=Reader, Scanner=Scanner, Parser=Parser,
22        Composer=Composer, Resolver=Resolver, Constructor=Constructor):
23    reader = Reader(data)
24    scanner = Scanner(reader)
25    parser = Parser(scanner)
26    composer = Composer(parser)
27    resolver = Resolver(composer)
28    constructor = Constructor(resolver)
29    return constructor
30
31def load_document(*args, **kwds):
32    for document in load(*args, **kwds):
33        return document
34
Note: See TracBrowser for help on using the repository browser.