source: branches/pyyaml3000/lib/yaml/__init__.py @ 55

Revision 55, 886 bytes checked in by xi, 8 years ago (diff)

Working on Constructor.

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