December 2009
4 posts
4 tags
Orderly.js Web Version
I’ve commited a minified, dependency-free version* of orderly.js for use on the web. It introduces an orderly object, with parse and compile methods.
Usage is straight forward:
<script src="orderly.js"></script>
<script>
var orderlySource = "array {};";
var jsonSchemaSource = orderly.compile(orderlySource);
var jsonSchemaObject =...
7 tags
Jison: An API for creating parsers in JavaScript
Bottom-up parsing
When you hear of someone writing a parser, it is usually of the top-down, recursive descent variety. Visualizing the source as an abstract syntax tree (AST), this means the parser tries to match the root, and by doing so, may recursively try to match branches and stems of the AST as it works its way down.
Bottom-up parsing is different:
Bottom-up parsing (also known...
8 tags
Orderly.js: Orderly to JSONSchema Compiler
Orderly is a textual format for describing JSON. Orderly can be compiled into JSONSchema. It is designed to be easy to read and write.
I decided to give Jison a real-world spin by creating an Orderly to JSONSchema compiler for JavaScript. After about three days, interspersed with lots of eating and family vists, I have a working implementation, which I call Orderly.js.
Usage
var orderly =...
6 tags
Stay parsey, my friends.
I hinted on twitter that I was implementing some kind of compiler in JavaScript. It was a project I began to help study for a compilers course I was taking, which also gave me an opportunity to earn extra credit. Though, really, I just thought it was a friggen cool thing to implement. I ended up focusing on the compiler front-end to create a parser generator, which I call Jison.
Anyway, the...