root / trunk / README

Revision 234, 2.6 kB (checked in by why, 2 years ago)
  • ext/ruby/ext/syck/rubyext.c: go back to using rb_iterate, since trunk always supports the latest version of Ruby.
  • lib/token.re: readable error for TABs in indentation.
  • README: updated PHP instructions, version 0.65.
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1
2 
3
4                             . syck .
5
6                         [ version 0.65 ]
7
8
9
10
11
12INSTALLATION
13
14   ./configure
15   make
16   make check
17   sudo make install
18
19If the unit tests don't pass, notify me immediately.  This distribution
20is tested on FreeBSD and Linux.  I don't release it unless the tests
21pass on those machines.  If tests aren't passing, then that's a problem.
22
23ABOUT
24
25Syck is the Scripters' YAML Cobble-Yourself-a-Parser Kit.  I don't
26much care if the acronym works, as long as the library does!
27
28The whole point of Syck is to make parsing and emitting YAML very
29simple for scripting languages through C bindings.  It doesn't strive
30to be a pull parser or very extendible.  It just is concerned with
31loading a YAML document into a C structure which can be easily
32translated into a scripting language's internal native data type.
33
34RUBY INSTALLATION
35
36You don't need to `make install', but please configure and make libsyck
37as outlined above.
38
39   cd ext/ruby
40   ruby install.rb config
41   ruby install.rb setup
42   sudo ruby install.rb install
43
44Syck works best with Ruby.  Ruby's symbol table is leveraged, as well
45as Ruby's VALUE system.  (You can read more about that below.)
46
47Syck is now included with Ruby (beginning with Ruby 1.8.0.)  Please
48voice your support for Syck/YAML in Ruby distributions on the various
49platforms.
50
51PYTHON INSTALLATION
52
53You'll need to `make install' as described above.
54
55   cd ext/python/
56   python setup.py build
57   sudo python setup.py install
58
59PHP INSTALLATION
60
61You'll need to `make install' as described above.
62
63   ln -s lib include    # or cp -r lib include
64   cd ext/php/
65   phpize
66   ./configure --with-syck=../..
67   make
68   sudo make install
69
70HOW SYCK IS SO GREAT
71
72For example, in Ruby everything evaluates to a VALUE.  I merely
73supply a handler to Syck that will take a SyckNode and transform
74it into a Ruby VALUE.
75
76A simple Ruby YAML::load could be built like so:
77
78  static VALUE
79  YAML_load( VALUE str )
80  {
81    SyckParser* parser;
82    parser = syck_new_parser();
83    syck_parser_handler( parser, YAML_handler );
84    return syck_parse( parser, str );
85  }
86
87  static VALUE
88  YAML_handler( SyckNode* node )
89  {
90    switch( node->kind )
91    {
92      case SYCK_MAP:
93        VALUE key;
94        VALUE h = rb_hash_new();
95        for ( key = node->content[0]; key != null; key++ )
96        {
97          rb_hash_set( h, key, key++ );
98        }
99        return h;
100      break;
101    }
102  }
103
104For most C developers, it should be a no-brainer to bring
105basic YAML serialization to PHP, Tcl, Cocoa, etc.
106
107Instructions for using Syck's API are available in the
108README.EXT in this very same directory.
Note: See TracBrowser for help on using the browser.