Skip to content

A parser for Sysl specification files based on Chevrotain.

License

Notifications You must be signed in to change notification settings

orlade/sysl-parser

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sysl Parser

A parser for Sysl specification files based on Chevrotain.

npm install --save sysl-parser

Usage

Import as a library:

var Parser = require('sysl-parser');

var content = require('fs').readFileSync('path/to/file.sysl', 'utf-8');

var tokens = Parser.lexer.tokenize(content);
var parser = new Parser(tokens);
parser.modelRule();
// The results of the parsing will be properties of the parser instance.

Run from the command line:

npm install -g sysl-parser
sysl-parser path/to/file.sysl

For example:

$ sysl-parse test/fixtures/model_petshop.sysl 
test/fixtures/model_petshop.sysl is a valid Sysl model!
$ sysl-parse test/fixtures/model_invalid.sysl 
test/fixtures/model_invalid.sysl is not a valid Sysl model:
 - [3:15] MismatchedTokenException: Expecting token of type --> Subset <-- but found --> '=' <--

References

About

A parser for Sysl specification files based on Chevrotain.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published