Skip to content
Newer
Older
100644 116 lines (81 sloc) 2.67 KB
ee2ccdd @indutny [readme] new readme!
indutny authored Nov 22, 2011
1 ```
2 ____ __ ___ __ _______
3 / __ \/ |/ /__ / /_____ _ / / ___/
4 / / / / /|_/ / _ \/ __/ __ `/_ / /\__ \
5 / /_/ / / / / __/ /_/ /_/ / /_/ /___/ /
6 \____/_/ /_/\___/\__/\__,_/\____//____/
7 ```
3cf249e @veged README!
authored Oct 21, 2010
8
c0da20f @indutny [readme] travis icon
indutny authored Dec 16, 2011
9 ## OMetaJS [![Build Status](https://secure.travis-ci.org/veged/ometa-js.png)](http://travis-ci.org/veged/ometa-js)
3cf249e @veged README!
authored Oct 20, 2010
10
d9211d3 @indutny [readme] small fixes
indutny authored Nov 23, 2011
11 OMetaJS is a JavaScript implementation of the OMeta, an object-oriented language
ee2ccdd @indutny [readme] new readme!
indutny authored Nov 22, 2011
12 for pattern matching.
3cf249e @veged README!
authored Oct 20, 2010
13
d9211d3 @indutny [readme] small fixes
indutny authored Nov 23, 2011
14 This is a *node.js* module for developing and using such pattern matching
ee2ccdd @indutny [readme] new readme!
indutny authored Nov 22, 2011
15 grammars.
16
17 ## Installation
18
19 ### Installing npm (node package manager)
20
21 ``` bash
d9c1aa7 @indutny [readme] fixed commands
indutny authored Nov 22, 2011
22 $ curl http://npmjs.org/install.sh | sh
ee2ccdd @indutny [readme] new readme!
indutny authored Nov 22, 2011
23 ```
24
25 ### Installing ometajs
26
27 ``` bash
28 $ [sudo] npm install ometajs -g
29 ```
30
31 **Note:** If you are using ometajs _programatically_ you should not install
32 it globally.
33
34 ``` bash
35 $ cd /path/to/your/project
d9c1aa7 @indutny [readme] fixed commands
indutny authored Nov 22, 2011
36 $ npm install ometajs
0ff3dd8 @indutny [readme] close bash source listing
indutny authored Nov 22, 2011
37 ```
3cf249e @veged README!
authored Oct 20, 2010
38
39 ## Usage
40
41 ### Command line
42
ee2ccdd @indutny [readme] new readme!
indutny authored Nov 22, 2011
43 ```bash
44 $ ometajs2js --help
45
46 Usage:
47 ometajs2js [OPTIONS] [ARGS]
48
49
50 Options:
51 -h, --help : Help
52 -v, --version : Version
53 -i INPUT, --input=INPUT : Input file (default: stdin)
54 -o OUTPUT, --output=OUTPUT : Output file (default: stdout)
55 --root=ROOT : Path to root module (default: ometajs)
56 ```
57
58 `ometajs2js` will take input `*.ometajs` file and produce [CommonJS][0]
59 compatible javascript file.
3cf249e @veged README!
authored Oct 20, 2010
60
ee2ccdd @indutny [readme] new readme!
indutny authored Nov 22, 2011
61 Also you may `require('*.ometajs')` files directly without compilation.
9187120 @indutny [readme] minor fixes
indutny authored Nov 22, 2011
62 (OmetaJS is patching `require.extensions` as [CoffeeScript][1] does).
3cf249e @veged README!
authored Oct 20, 2010
63
ee2ccdd @indutny [readme] new readme!
indutny authored Nov 22, 2011
64 ### Using as CommonJS module
3cf249e @veged README!
authored Oct 20, 2010
65
ee2ccdd @indutny [readme] new readme!
indutny authored Nov 22, 2011
66 ```javascript
67 var ometajs = require('ometajs');
3cf249e @veged README!
authored Oct 20, 2010
68
ee2ccdd @indutny [readme] new readme!
indutny authored Nov 22, 2011
69 var ast = ometajs.BSJSParser.matchAll('var x = 1', 'topLevel'),
70 code = ometajs.BSJSTranslator.matchAll([ast], 'trans');
71 ```
72 Example
3cf249e @veged README!
authored Oct 20, 2010
73
ee2ccdd @indutny [readme] new readme!
indutny authored Nov 22, 2011
74 ### Example grammar
3cf249e @veged README!
authored Oct 20, 2010
75
ee2ccdd @indutny [readme] new readme!
indutny authored Nov 22, 2011
76 ```javascript
77 ometa Simple {
78 top = [#simple] -> 'ok'
79 }
80 ```
af41ebd @veged
authored Oct 20, 2010
81
9187120 @indutny [readme] minor fixes
indutny authored Nov 22, 2011
82 [More information][5] about OmetaJS syntax.
ee2ccdd @indutny [readme] new readme!
indutny authored Nov 22, 2011
83
84 ### Use cases
85
86 Fast prototyping and building your own parser/language. Processing/traversing
87 complex [AST][2].
88
89 Some projects that are using this:
90
91 - [XJST](http://github.com/veged/xjst)
af41ebd @veged
authored Oct 20, 2010
92 - [ShmakoWiki](http://github.com/veged/shmakowiki/)
93 - [OmetaHighlighter](http://github.com/veged/ometa-highlighter)
ee2ccdd @indutny [readme] new readme!
indutny authored Nov 22, 2011
94
95 ### More information
96
97 To study OmetaJS or ask questions about it's core you can try to reach out
ed47e25 @veged Update README.md
authored Nov 22, 2011
98 [original repository][3] author [Alessandro Warth][4] or me.
ee2ccdd @indutny [readme] new readme!
indutny authored Nov 22, 2011
99
9187120 @indutny [readme] minor fixes
indutny authored Nov 22, 2011
100 Here is [documented code][5].
ee2ccdd @indutny [readme] new readme!
indutny authored Nov 22, 2011
101
b63e0a1 @indutny [readme] added contributors
indutny authored Nov 22, 2011
102 #### Contributors
103
3838a7e @indutny [readme] use list for contributors
indutny authored Nov 22, 2011
104 * [Alessandro Warth][4]
105 * [Takashi Yamamiya](https://github.com/propella)
106 * [Sergey Berezhnoy](https://github.com/veged)
107 * [Nikita Vasilyev](https://github.com/NV)
108 * [Fedor Indutny](https://github.com/indutny)
b63e0a1 @indutny [readme] added contributors
indutny authored Nov 22, 2011
109
449d9e0 @indutny [readme] fixed links
indutny authored Nov 22, 2011
110 [0]: http://www.commonjs.org/
111 [1]: http://coffeescript.org/
112 [2]: http://en.wikipedia.org/wiki/Abstract_syntax_tree
113 [3]: http://www.tinlizzie.org/ometa/
114 [4]: http://github.com/alexwarth
540d2f9 @indutny [readme] fix link to documented source
indutny authored Nov 22, 2011
115 [5]: http://veged.github.com/ometa-js/
Something went wrong with that request. Please try again.