| Revision 82,
374 bytes
checked in by tim, 9 years ago
(diff) |
|
added bnfyaml in experimental
|
| Line | |
|---|
| 1 | """Re-written version of simpleexample for 2.0""" |
|---|
| 2 | from simpleparse.common import numbers, strings, comments |
|---|
| 3 | from simpleparse.parser import Parser |
|---|
| 4 | import pprint |
|---|
| 5 | |
|---|
| 6 | declaration = open('yamltest.bnf','r').read() |
|---|
| 7 | testData = open('datatest.yaml','r').read() |
|---|
| 8 | parser = Parser( declaration, "c_printable" ) |
|---|
| 9 | if __name__ =="__main__": |
|---|
| 10 | pprint.pprint( parser.parse( testData)) |
|---|
Note: See
TracBrowser
for help on using the repository browser.