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

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

Emitter is done!!!

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