0.8.8 • Published 4 years ago

sequence-parser v0.8.8

Weekly downloads
164
License
-
Repository
-
Last release
4 years ago

Sequence Parser

Sequence parser is used to parse ZenUML DSL into an abstract syntax tree (AST). It also exposes a few utility methods.

Run cucumber test

We use the cucumber test to generate the specification for the ZenUML DSL. Make sure that the test is written clearly.

Run test

$ yarn run cucumber-js -f json:report/cucumber_report.json
# or use watch
$ watch 'yarn run cucumber-js -f json:report/cucumber_report.json' features

To ignore a folder from watch use --ignoreDirectoryPattern /report/g

Convert the report to HTML

$ node report/index.js
# or use watch
$ watch 'node report/index.js' report

If you are using Intellij Idea, you can use the "Live Edit" plugin to load the generated HTML automatically. Right click the HTML file (in editor) and choose "Debug". Or use CTRL+SHIFT+F9.

Patch the cucumber HTML reporter

The default cucumber-html-reporter does not show the \n character in the generated HTML. Patch the tempates/simple/features.html file with step.name && step.name.replace('\n', '\\n').

Usage of the parser

The latest public / stable version of this parser is published to npm under name sequence-parser (defined in package.json) To use this parser, just import seqParser from 'sequence-parser'.

Exported module

This project generate a UMD library. The exported library name is sequenceParser (defined in webpack.config.js). This, however, does NOT mean you need to name the module as sequenceParser when it is imported or required.

RootContext

Purpose: Get the prog antlr4 context from the given ZenUML DSL Type: function Arguments: code the DSL provided in a string Result: An antlr4 context of theprog node (see sequenceParser.g4 for the definition of prog)

Participants

Purpose: Get all the participants from the given antlr4 context Type: function Arguments: ctx the antlr4 context

Depth

Purpose: Get how many levels fragments (alt / loop) are within the given context Type: function Arguments: ctx the antlr4 context

Development

Build

yarn build runs three yarn commands: 1. generate generates the lexer (sequenceLexer.js) and parser (sequenceParser.js); 1. jest run all the tests in the test folder; 1. webpack to pack up the library and put it in dist/main.js.

  1. I am not able to test the rule with 'ANTLR Preview'? Run yarn generate to re-generate the lexer and parser.

  2. A token is highlighted in the lexer with a warning that it is not recognised. Close the editor and re-open it.

  3. yarn build failed

0.8.8

4 years ago

0.8.7

4 years ago

0.8.6

4 years ago

0.8.5

4 years ago

0.8.4

4 years ago

0.8.3

4 years ago

0.8.2

4 years ago

0.8.1

4 years ago

0.8.0

5 years ago

0.6.2

5 years ago

0.6.1

5 years ago

0.6.0

5 years ago

0.5.14

6 years ago

0.5.13

6 years ago

0.5.12

6 years ago

0.5.11

6 years ago

0.5.10

6 years ago

0.5.9

6 years ago

0.5.8

6 years ago

0.5.6

6 years ago

0.5.5

6 years ago

0.5.3

6 years ago

0.5.2

6 years ago

0.5.1

6 years ago

0.5.0

6 years ago

0.4.10

6 years ago

0.4.9

6 years ago

0.4.8

6 years ago

0.4.6

6 years ago

0.4.4

6 years ago

0.4.3

6 years ago

0.4.2

6 years ago

0.4.1

6 years ago

0.4.0

6 years ago

0.3.8

6 years ago

0.3.6

7 years ago

0.3.5

7 years ago

0.3.3

7 years ago

0.3.2

7 years ago

0.3.1

7 years ago

0.3.0

7 years ago