Skip to content
This repository
tree: 819964aa9f
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 104 lines (71 sloc) 2.434 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103

 

                             . syck .

                         [ version 0.28 ]





INSTALLATION

   ./configure
   make
   make check
   sudo make install

If the unit tests don't pass, notify me immediately. This distribution
is tested on FreeBSD and Linux. I don't release it unless the tests
pass on those machines. If tests aren't passing, then that's a problem.

ABOUT

Syck is the Scripters' YAML Cobble-Yourself-a-Parser Kit. I don't
much care if the acronym works, as long as the library does!

The whole point of Syck is to make parsing and emitting YAML very
simple for scripting languages through C bindings. It doesn't strive
to be a pull parser or very extendible. It just is concerned with
loading a YAML document into a C structure which can be easily
translated into a scripting language's internal native data type.

RUBY INSTALLATION

You don't need to `make install', but please configure and make libsyck
as outlined above.

   cd ext/ruby/
   ruby extconf.rb
   make
   sudo make install

Syck works best with Ruby. Ruby's symbol table is leveraged, as well
as Ruby's VALUE system. (You can read more about that below.)

I'm pushing for Syck to appear in coming Ruby distributions. Please
voice your support for Syck/YAML in Ruby distributions on the various
platforms.

PYTHON INSTALLATION

You'll need to `make install' as described above.

   cd ext/python/
   python setup.py build
   sudo python setup.py install

PHP INSTALLATION

You'll need to `make install' as described above.

   cd ext/php/
   sh make_module.sh
   sudo make install

HOW SYCK IS SO GREAT

For example, in Ruby everything evaluates to a VALUE. I merely
supply a handler to Syck that will take a SyckNode and transform
it into a Ruby VALUE.

A simple Ruby YAML::load could be built like so:

  static VALUE
  YAML_load( VALUE str )
  {
    SyckParser* parser;
    parser = syck_new_parser();
    syck_parser_handler( parser, YAML_handler );
    return syck_parse( parser, str );
  }

  static VALUE
  YAML_handler( SyckNode* node )
  {
    switch( node->kind )
    {
      case SYCK_MAP:
        VALUE key;
        VALUE h = rb_hash_new();
        for ( key = node->content[0]; key != null; key++ )
        {
          rb_hash_set( h, key, key++ );
        }
        return h;
      break;
    }
  }

If I can get this to work then it will be a no-brainer to bring
basic YAML serialization to PHP, Tcl, Cocoa, etc.
  
Something went wrong with that request. Please try again.