AS3 Alchemy port of "Yet Another JSON Library - A Portable JSON parsing and serialization library in ANSI C"
C Shell
Pull request Compare This branch is 20 commits ahead, 156 commits behind lloyd:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
as3
lib
reformatter
src
test
verify
yajl
.gitignore
BUILDING
BUILDING.win32
CMakeLists.txt
COPYING
ChangeLog
README.md
Rakefile
SPROUT_VERSION
TODO
YAJLDoc.cmake
api
configure

README.md

yajl for ActionScript 3

(we need a flashy name)

This is just a quick hack to bring one of the nicest JSON-parsers yajl to ActionScript 3.
The currently available JSON-Parser from the corelib wasn't what I expected and definitely not crash-proof. So I decided to hack yajl to ActionScript 3 through alchemy.

This quick hack is inspired by the reformatter (included in the original source) and Brian Mario's yajl-ruby.

Compilation

Sorry, no swc yet.
You have to make sure, that your ALCHEMY_HOME environment variable is set correctly before running any of the following commands. You have to build the swc yourself by running

rake lib

to build libyajl.a, followed by

rake swc

to build the AS3-Binding

This places the yajl.swc into build/

Usage

Currently there is just one simple function:

decode(str : String) : *

Example

import cmodule.yajl.CLibInit;

public function decodeJSON(str : String) : * {
  var yajl : Object = CLibInit().init();
  return yajl.decode(str);
}

TODO

Encoding! Handling of Numbers, Boolean and Null-Values. Testing.