ometajs
A object-oriented language for pattern matching
Last updated 9 years ago by indutny .
AS IS · Repository · Bugs · Original npm · Tarball · package.json
$ gnpm install ometajs 
SYNC missed versions from official npm registry.
   ____  __  ___     __            _______
  / __ \/  |/  /__  / /_____ _    / / ___/
 / / / / /|_/ / _ \/ __/ __ `/_  / /\__ \
/ /_/ / /  / /  __/ /_/ /_/ / /_/ /___/ /
\____/_/  /_/\___/\__/\__,_/\____//____/

OMetaJS Build Status

OMetaJS is a JavaScript implementation of OMeta, an object-oriented language for pattern matching.

This is a node.js module for developing and using such pattern matching grammars.

Installation

Installing npm (node package manager)

$ curl http://npmjs.org/install.sh | sh

Installing ometajs

$ [sudo] npm install ometajs -g

Note: If you are using ometajs programmatically you should not install it globally.

$ cd /path/to/your/project
$ npm install ometajs

Usage

Command line

$ ometajs2js --help

Usage:
  ometajs2js [OPTIONS] [ARGS]


Options:
  -h, --help : Help
  -v, --version : Version
  -i INPUT, --input=INPUT : Input file (default: stdin)
  -o OUTPUT, --output=OUTPUT : Output file (default: stdout)
  --root=ROOT : Path to root module (default: ometajs)

ometajs2js will take input *.ometajs file and produce a CommonJS- compatible javascript file.

You may also require('*.ometajs') files directly without compilation. (OMetaJS is patching require.extensions as CoffeeScript does).

Usage as CommonJS module

var ometajs = require('ometajs');

var ast = ometajs.grammars.BSJSParser.matchAll('var x = 1', 'topLevel'),
    code = ometajs.grammars.BSJSTranslator.matchAll([ast], 'trans');

Example grammar

ometa Simple {
  top = [#simple] -> 'ok'
}

More information about OMetaJS syntax.

Use cases

Quickly prototype and buildyour own parser/language. Process/traverse complex AST.

Some projects that are using OMetaJS:

More information

To study OMetaJS or ask questions about its core you can reach out to the original repository author Alessandro Warth or me.

Here is the documented code.

Contributors

Current Tags

  • 4.0.0                                ...           latest (9 years ago)
  • 3.3.1                                ...           stable (11 years ago)

69 Versions

  • 4.0.0                                ...           9 years ago
  • 3.3.8                                ...           10 years ago
  • 3.3.7                                ...           10 years ago
  • 3.3.6                                ...           11 years ago
  • 3.3.5                                ...           11 years ago
  • 3.3.4                                ...           11 years ago
  • 3.3.3                                ...           11 years ago
  • 3.3.2                                ...           11 years ago
  • 3.3.1                                ...           11 years ago
  • 3.3.0                                ...           11 years ago
  • 3.2.4                                ...           12 years ago
  • 3.2.3                                ...           12 years ago
  • 3.2.2                                ...           12 years ago
  • 3.2.1                                ...           12 years ago
  • 3.2.0                                ...           12 years ago
  • 3.1.19                                ...           12 years ago
  • 3.1.18                                ...           12 years ago
  • 3.1.17                                ...           12 years ago
  • 3.1.16                                ...           12 years ago
  • 3.1.15                                ...           12 years ago
  • 3.1.14                                ...           12 years ago
  • 3.1.13                                ...           12 years ago
  • 3.1.12                                ...           12 years ago
  • 3.1.11                                ...           12 years ago
  • 3.1.10                                ...           12 years ago
  • 3.1.9                                ...           12 years ago
  • 3.1.8                                ...           12 years ago
  • 3.1.6                                ...           12 years ago
  • 3.1.5                                ...           12 years ago
  • 3.1.4                                ...           12 years ago
  • 3.1.3                                ...           12 years ago
  • 3.1.2                                ...           12 years ago
  • 3.0.16                                ...           12 years ago
  • 3.0.15                                ...           12 years ago
  • 3.0.14                                ...           12 years ago
  • 3.0.13                                ...           12 years ago
  • 3.0.12                                ...           12 years ago
  • 3.0.11                                ...           13 years ago
  • 3.0.10                                ...           13 years ago
  • 3.0.9                                ...           13 years ago
  • 3.0.8                                ...           13 years ago
  • 3.0.7                                ...           13 years ago
  • 3.0.6                                ...           13 years ago
  • 3.0.5                                ...           13 years ago
  • 3.0.4                                ...           13 years ago
  • 3.0.3                                ...           13 years ago
  • 3.0.2                                ...           13 years ago
  • 3.0.1                                ...           13 years ago
  • 3.0.0                                ...           13 years ago
  • 2.1.10                                ...           13 years ago
  • 2.1.9                                ...           13 years ago
  • 2.1.8-1                                ...           13 years ago
  • 2.1.8                                ...           13 years ago
  • 2.1.7                                ...           13 years ago
  • 2.1.6                                ...           13 years ago
  • 2.1.5                                ...           13 years ago
  • 2.1.4                                ...           13 years ago
  • 2.1.3                                ...           13 years ago
  • 2.1.2                                ...           13 years ago
  • 2.0.10                                ...           13 years ago
  • 2.0.11                                ...           13 years ago
  • 2.0.8                                ...           13 years ago
  • 2.0.7                                ...           13 years ago
  • 2.0.6                                ...           14 years ago
  • 2.0.5                                ...           14 years ago
  • 2.0.4                                ...           14 years ago
  • 2.0.1                                ...           14 years ago
  • 2.0.2                                ...           14 years ago
  • 2.0.3                                ...           14 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (3)
Dev Dependencies (1)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |