source: pyyaml/branches/working-on-emitter/lib/yaml/__init__.py @ 122

Revision 122, 861 bytes checked in by xi, 9 years ago (diff)

Add a skeleton of the emitter.

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 *
[51]9
[122]10from emitter import *
11
[51]12from tokens import *
13from events import *
[55]14from nodes import *
[51]15
16def parse(data, Reader=Reader, Scanner=Scanner, Parser=Parser):
17    reader = Reader(data)
18    scanner = Scanner(reader)
19    parser = Parser(scanner)
[55]20    return parser
[51]21
[55]22def load(data, Reader=Reader, Scanner=Scanner, Parser=Parser,
23        Composer=Composer, Resolver=Resolver, Constructor=Constructor):
[53]24    reader = Reader(data)
25    scanner = Scanner(reader)
26    parser = Parser(scanner)
27    composer = Composer(parser)
28    resolver = Resolver(composer)
[55]29    constructor = Constructor(resolver)
30    return constructor
[53]31
[55]32def load_document(*args, **kwds):
33    for document in load(*args, **kwds):
34        return document
[53]35
Note: See TracBrowser for help on using the repository browser.