GithubHelp home page GithubHelp logo

indeyets / syck Goto Github PK

View Code? Open in Web Editor NEW
81.0 12.0 25.0 1.9 MB

swift yaml for ruby, python, perl, etc.

Home Page: http://code.whytheluckystiff.net/syck/

License: Other

PHP 1.98% Lua 2.99% C 58.71% Ruby 28.43% Shell 0.01% Io 0.06% Objective-C 7.81%

syck's Introduction

 

                             . syck .

                         [ version 0.70 ]





INSTALLATION

   ./bootstrap
   ./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 install.rb config
   ruby install.rb setup
   sudo ruby install.rb 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.)

Syck is now included with Ruby (beginning with Ruby 1.8.0.)  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.

   ln -s lib include    # or cp -r lib include
   cd ext/php/
   phpize
   ./configure --with-syck=../..
   make
   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;
    }
  }

For most C developers, it should be a no-brainer to bring
basic YAML serialization to PHP, Tcl, Cocoa, etc.

Instructions for using Syck's API are available in the
README.EXT in this very same directory.

syck's People

Contributors

clarkevans avatar cowlibob avatar damoon avatar groue avatar iamaleksey avatar indeyets avatar remicollet avatar rsms avatar shinh avatar slact avatar th-in-gs avatar tjol avatar wthimbleby avatar xhochy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

syck's Issues

test-yts failing

I am running on ubuntu 12.10 LTS. I have a fresh clone of syck and I am trying to build it. I followed the installation instructions in the readme,

./bootstrap
./configure
make && make check

One test fails during make check. Here is the output,

jdowner@mirkwood:~/repos/syck$ make check
Making check in lib
make[1]: Entering directory /home/jdowner/repos/syck/lib' make[1]: Nothing to be done forcheck'.
make[1]: Leaving directory /home/jdowner/repos/syck/lib' Making check in tests make[1]: Entering directory/home/jdowner/repos/syck/tests'
make check-TESTS
make[2]: Entering directory `/home/jdowner/repos/syck/tests'
....

OK (4 tests)

PASS: test-basic
......

OK (6 tests)

PASS: test-parse
Error at [Line 1, Col 4]: TAB found in your indentation, please remove
Error at [Line 1, Col 4]: syntax error, unexpected $end, expecting YAML_INDENT or YAML_IEND
F..................................................

There was 1 failure:

  1. YtsFoldedScalars_7: expected <30> but was <40>

!!!FAILURES!!!
Runs: 51 Passes: 50 Fails: 1

FAIL: test-yts
..

OK (2 tests)

PASS: test-emit

#1 of 4 tests failed

make[2]: *** [check-TESTS] Error 1
make[2]: Leaving directory /home/jdowner/repos/syck/tests' make[1]: *** [check-am] Error 2 make[1]: Leaving directory/home/jdowner/repos/syck/tests'
make: *** [check-recursive] Error 1

Unit Test Failure

 $ make check
Making check in lib
make[1]: Entering directory `/home/jadams1/git/syck/lib'
make[1]: Nothing to be done for `check'.
make[1]: Leaving directory `/home/jadams1/git/syck/lib'
Making check in tests
make[1]: Entering directory `/home/jadams1/git/syck/tests'
make  check-TESTS
make[2]: Entering directory `/home/jadams1/git/syck/tests'
....

OK (4 tests)

PASS: test-basic
......

OK (6 tests)

PASS: test-parse
Error at [Line 1, Col 4]: TAB found in your indentation, please remove
Error at [Line 1, Col 4]: syntax error, unexpected $end, expecting YAML_INDENT or YAML_IEND
F..................................................

There was 1 failure:
1) YtsFoldedScalars_7: expected <30> but was <40>

!!!FAILURES!!!
Runs: 51 Passes: 50 Fails: 1

FAIL: test-yts
..

OK (2 tests)

PASS: test-emit
===================
1 of 4 tests failed
===================
make[2]: *** [check-TESTS] Error 1
make[2]: Leaving directory `/home/jadams1/git/syck/tests'
make[1]: *** [check-am] Error 2
make[1]: Leaving directory `/home/jadams1/git/syck/tests'
make: *** [check-recursive] Error 1

Compilation fails with newest build tools

With recent updates to the packages gcc, glibc, etc the project cannot be compiled. See attached build log with error.

https://gist.github.com/3169285

Build environment:
Arch Linux
Kernel: Linux 3.4.6-1-ARCH #1 SMP PREEMPT Fri Jul 20 08:21:26 CEST 2012 x86_64 GNU/Linux
gcc: 4.7.1
bison: 2.6
flex: 2.5.36
automake: 1.12.2
autoconf: 2.69
m4: 1.4.16
make: 3.82
glibc: 2.16.0

macports support

Thanks for taking over the project. I am using Macports to compile syck on Mac OS X and updated the portfile to use your project.

Right now I've got it pointing to the 0.70 "download". Are you interested in having me add an official Portfile to the project so we can keep the Macports community up-to-speed with the latest Syck?

LMK I am glad to contribute.

Alan

syck-0.70.tar.gz download is missing

Josephs-MacBook-Pro:Formula joe$ curl -IL https://cloud.github.com/downloads/indeyets/syck/syck-0.70.tar.gz
curl: (6) Could not resolve host: cloud.github.com

0.70 compilation fails on CentOS 5.4/x86_64 and Mac OS X 10.5 (Leopard/Intel)

I'm trying to compile 0.70 on CentOS 5.4 (x86_64) and make check identifies a failed test.

  1. YtsFoldedScalars_7: expected <30> but was <40>

Turns out the same issue also occurs on OS X 10.5 Leopard/Intel. Compile logs follow.


CentOS:

[compiler@compiler syck-0.70]$ make clean; ./bootstrap ; ./configure; make; make check
Making clean in tests
make[1]: Entering directory /home/compiler/rpmbuild/BUILD/syck-0.70/tests' test -z "test-basic test-parse test-yts test-emit" || rm -f test-basic test-parse test-yts test-emit rm -f *.o make[1]: Leaving directory/home/compiler/rpmbuild/BUILD/syck-0.70/tests'
Making clean in lib
make[1]: Entering directory /home/compiler/rpmbuild/BUILD/syck-0.70/lib' test -z "libsyck.a" || rm -f libsyck.a rm -f *.o make[1]: Leaving directory/home/compiler/rpmbuild/BUILD/syck-0.70/lib'
Making clean in .
make[1]: Entering directory /home/compiler/rpmbuild/BUILD/syck-0.70' make[1]: Nothing to be done forclean-am'.
make[1]: Leaving directory `/home/compiler/rpmbuild/BUILD/syck-0.70'

  • aclocal
  • autoheader
  • autoconf
  • automake --foreign --add-missing --copy
    checking for a BSD-compatible install... /usr/bin/install -c
    checking whether build environment is sane... yes
    checking for gawk... gawk
    checking whether make sets $(MAKE)... yes
    checking for a BSD-compatible install... /usr/bin/install -c
    checking whether ln -s works... yes
    checking for ranlib... ranlib
    checking whether make sets $(MAKE)... (cached) yes
    checking for gawk... (cached) gawk
    checking for style of include used by make... GNU
    checking for gcc... gcc
    checking for C compiler default output file name... a.out
    checking whether the C compiler works... yes
    checking whether we are cross compiling... no
    checking for suffix of executables...
    checking for suffix of object files... o
    checking whether we are using the GNU C compiler... yes
    checking whether gcc accepts -g... yes
    checking for gcc option to accept ANSI C... none needed
    checking dependency style of gcc... gcc3
    checking for flex... flex
    checking for yywrap in -lfl... yes
    checking lex output file root... lex.yy
    checking whether yytext is a pointer... yes
    checking for bison... bison -y
    checking how to run the C preprocessor... gcc -E
    checking for egrep... grep -E
    checking for ANSI C header files... yes
    checking for sys/types.h... yes
    checking for sys/stat.h... yes
    checking for stdlib.h... yes
    checking for string.h... yes
    checking for memory.h... yes
    checking for strings.h... yes
    checking for inttypes.h... yes
    checking for stdint.h... yes
    checking for unistd.h... yes
    checking alloca.h usability... yes
    checking alloca.h presence... yes
    checking for alloca.h... yes
    checking for stdlib.h... (cached) yes
    checking for string.h... (cached) yes
    checking for int... yes
    checking size of int... 4
    checking for long... yes
    checking size of long... 8
    checking for stdlib.h... (cached) yes
    checking for GNU libc compatible malloc... yes
    checking for vprintf... yes
    checking for _doprnt... no
    configure: creating ./config.status
    config.status: creating Makefile
    config.status: creating lib/Makefile
    config.status: creating tests/Makefile
    config.status: creating config.h
    config.status: config.h is unchanged
    config.status: executing depfiles commands
    make all-recursive
    make[1]: Entering directory /home/compiler/rpmbuild/BUILD/syck-0.70' Making all in lib make[2]: Entering directory/home/compiler/rpmbuild/BUILD/syck-0.70/lib'
    if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -fPIC -g -O2 -MT emitter.o -MD -MP -MF ".deps/emitter.Tpo" -c -o emitter.o emitter.c;
    then mv -f ".deps/emitter.Tpo" ".deps/emitter.Po"; else rm -f ".deps/emitter.Tpo"; exit 1; fi
    if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -fPIC -g -O2 -MT handler.o -MD -MP -MF ".deps/handler.Tpo" -c -o handler.o handler.c;
    then mv -f ".deps/handler.Tpo" ".deps/handler.Po"; else rm -f ".deps/handler.Tpo"; exit 1; fi
    if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -fPIC -g -O2 -MT node.o -MD -MP -MF ".deps/node.Tpo" -c -o node.o node.c;
    then mv -f ".deps/node.Tpo" ".deps/node.Po"; else rm -f ".deps/node.Tpo"; exit 1; fi
    if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -fPIC -g -O2 -MT syck.o -MD -MP -MF ".deps/syck.Tpo" -c -o syck.o syck.c;
    then mv -f ".deps/syck.Tpo" ".deps/syck.Po"; else rm -f ".deps/syck.Tpo"; exit 1; fi
    if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -fPIC -g -O2 -MT syck_st.o -MD -MP -MF ".deps/syck_st.Tpo" -c -o syck_st.o syck_st.c;
    then mv -f ".deps/syck_st.Tpo" ".deps/syck_st.Po"; else rm -f ".deps/syck_st.Tpo"; exit 1; fi
    if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -fPIC -g -O2 -MT gram.o -MD -MP -MF ".deps/gram.Tpo" -c -o gram.o gram.c;
    then mv -f ".deps/gram.Tpo" ".deps/gram.Po"; else rm -f ".deps/gram.Tpo"; exit 1; fi
    if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -fPIC -g -O2 -MT bytecode.o -MD -MP -MF ".deps/bytecode.Tpo" -c -o bytecode.o bytecode.c;
    then mv -f ".deps/bytecode.Tpo" ".deps/bytecode.Po"; else rm -f ".deps/bytecode.Tpo"; exit 1; fi
    if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -fPIC -g -O2 -MT yaml2byte.o -MD -MP -MF ".deps/yaml2byte.Tpo" -c -o yaml2byte.o yaml2byte.c;
    then mv -f ".deps/yaml2byte.Tpo" ".deps/yaml2byte.Po"; else rm -f ".deps/yaml2byte.Tpo"; exit 1; fi
    if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -fPIC -g -O2 -MT token.o -MD -MP -MF ".deps/token.Tpo" -c -o token.o token.c;
    then mv -f ".deps/token.Tpo" ".deps/token.Po"; else rm -f ".deps/token.Tpo"; exit 1; fi
    if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -fPIC -g -O2 -MT implicit.o -MD -MP -MF ".deps/implicit.Tpo" -c -o implicit.o implicit.c;
    then mv -f ".deps/implicit.Tpo" ".deps/implicit.Po"; else rm -f ".deps/implicit.Tpo"; exit 1; fi
    rm -f libsyck.a
    ar cru libsyck.a emitter.o handler.o node.o syck.o syck_st.o gram.o bytecode.o yaml2byte.o token.o implicit.o
    ranlib libsyck.a
    make[2]: Leaving directory /home/compiler/rpmbuild/BUILD/syck-0.70/lib' Making all in tests make[2]: Entering directory/home/compiler/rpmbuild/BUILD/syck-0.70/tests'
    if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../lib -g -O2 -MT Basic.o -MD -MP -MF ".deps/Basic.Tpo" -c -o Basic.o Basic.c;
    then mv -f ".deps/Basic.Tpo" ".deps/Basic.Po"; else rm -f ".deps/Basic.Tpo"; exit 1; fi
    if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../lib -g -O2 -MT CuTest.o -MD -MP -MF ".deps/CuTest.Tpo" -c -o CuTest.o CuTest.c;
    then mv -f ".deps/CuTest.Tpo" ".deps/CuTest.Po"; else rm -f ".deps/CuTest.Tpo"; exit 1; fi
    gcc -g -O2 -L../lib -o test-basic Basic.o CuTest.o -lsyck
    if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../lib -g -O2 -MT Parse.o -MD -MP -MF ".deps/Parse.Tpo" -c -o Parse.o Parse.c;
    then mv -f ".deps/Parse.Tpo" ".deps/Parse.Po"; else rm -f ".deps/Parse.Tpo"; exit 1; fi
    gcc -g -O2 -L../lib -o test-parse Parse.o CuTest.o -lsyck
    if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../lib -g -O2 -MT YTS.o -MD -MP -MF ".deps/YTS.Tpo" -c -o YTS.o YTS.c;
    then mv -f ".deps/YTS.Tpo" ".deps/YTS.Po"; else rm -f ".deps/YTS.Tpo"; exit 1; fi
    gcc -g -O2 -L../lib -o test-yts YTS.o CuTest.o -lsyck
    if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../lib -g -O2 -MT Emit.o -MD -MP -MF ".deps/Emit.Tpo" -c -o Emit.o Emit.c;
    then mv -f ".deps/Emit.Tpo" ".deps/Emit.Po"; else rm -f ".deps/Emit.Tpo"; exit 1; fi
    gcc -g -O2 -L../lib -o test-emit Emit.o CuTest.o -lsyck
    make[2]: Leaving directory /home/compiler/rpmbuild/BUILD/syck-0.70/tests' make[2]: Entering directory/home/compiler/rpmbuild/BUILD/syck-0.70'
    make[2]: Leaving directory /home/compiler/rpmbuild/BUILD/syck-0.70' make[1]: Leaving directory/home/compiler/rpmbuild/BUILD/syck-0.70'
    Making check in lib
    make[1]: Entering directory /home/compiler/rpmbuild/BUILD/syck-0.70/lib' make[1]: Nothing to be done forcheck'.
    make[1]: Leaving directory /home/compiler/rpmbuild/BUILD/syck-0.70/lib' Making check in tests make[1]: Entering directory/home/compiler/rpmbuild/BUILD/syck-0.70/tests'
    make check-TESTS
    make[2]: Entering directory `/home/compiler/rpmbuild/BUILD/syck-0.70/tests'
    ....

OK (4 tests)

PASS: test-basic
......

OK (6 tests)

PASS: test-parse
Error at [Line 1, Col 4]: TAB found in your indentation, please remove
Error at [Line 1, Col 4]: syntax error, unexpected $end, expecting YAML_INDENT or YAML_IEND
F..................................................

There was 1 failure:

  1. YtsFoldedScalars_7: expected <30> but was <40>

!!!FAILURES!!!
Runs: 51 Passes: 50 Fails: 1

FAIL: test-yts
..

OK (2 tests)

PASS: test-emit

#1 of 4 tests failed

make[2]: *** [check-TESTS] Error 1
make[2]: Leaving directory /home/compiler/rpmbuild/BUILD/syck-0.70/tests' make[1]: *** [check-am] Error 2 make[1]: Leaving directory/home/compiler/rpmbuild/BUILD/syck-0.70/tests'
make: *** [check-recursive] Error 1

[compiler@compiler syck-0.70]$ uname -a
Linux compiler.aresdirect.com 2.6.18-164.15.1.el5 #1 SMP Wed Mar 17 11:30:06 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux
[compiler@compiler syck-0.70]$ gcc -v
Using built-in specs.
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-libgcj-multifile --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --enable-plugin --with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --with-cpu=generic --host=x86_64-redhat-linux
Thread model: posix
gcc version 4.1.2 20080704 (Red Hat 4.1.2-46)

OS X:

[antbox:/tmp/syck-0.70] mhughes% make check
Making check in lib
make[1]: Nothing to be done for `check'.
Making check in tests
make check-TESTS
....

OK (4 tests)

PASS: test-basic
......

OK (6 tests)

PASS: test-parse
Error at [Line 1, Col 4]: TAB found in your indentation, please remove
Error at [Line 1, Col 4]: syntax error, unexpected $end, expecting YAML_INDENT or YAML_IEND
F..................................................

There was 1 failure:

  1. YtsFoldedScalars_7: expected <30> but was <40>

!!!FAILURES!!!
Runs: 51 Passes: 50 Fails: 1

FAIL: test-yts
..

OK (2 tests)

PASS: test-emit

#1 of 4 tests failed

make[2]: *** [check-TESTS] Error 1
make[1]: *** [check-am] Error 2
make: *** [check-recursive] Error 1

[antbox:/tmp/syck-0.70] mhughes% uname -a ; gcc -v
Darwin antbox 9.8.0 Darwin Kernel Version 9.8.0: Wed Jul 15 16:55:01 PDT 2009; root:xnu-1228.15.41/RELEASE_I386 i386
Using built-in specs.
Target: i686-apple-darwin9
Configured with: /var/tmp/gcc/gcc-5484
1/src/configure --disable-checking -enable-werror --prefix=/usr --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^.-]*$/s/$/-4.0/ --with-gxx-include-dir=/include/c++/4.0.0 --with-slibdir=/usr/lib --build=i686-apple-darwin9 --with-arch=apple --with-tune=generic --host=i686-apple-darwin9 --target=i686-apple-darwin9
Thread model: posix
gcc version 4.0.1 (Apple Inc. build 5484)

wrong license title

Hi!

I noticed that in the COPYING file, it is indicated that the files are licensed under the BSD or D&R license. However, the text below the title "BSD License" is that of the Expat (former MIT) license. Given that most of the projects of why the luck stiff were licensed under this MIT/Expat license, should we consider that the license to use is Expat instead of BSD?

Best regards,

Cédric

Make a release

As noted by josegonzalez/homebrew-php#330, a new release may fix that users issue.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.