Skip to content

Commit

Permalink
grammar for named ordered lists and for nominated states
Browse files Browse the repository at this point in the history
  • Loading branch information
StoneCypher committed Sep 26, 2017
1 parent ed78d31 commit 9c9d052
Show file tree
Hide file tree
Showing 9 changed files with 93 additions and 29 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
@@ -1,3 +1,4 @@
* [[`ed78d312f1`](https://github.com/StoneCypher/jssm/commit/ed78d312f1)] - package bumps (John Haugeland)
* [[`a6a0748357`](https://github.com/StoneCypher/jssm/commit/a6a0748357)] - machine_language (John Haugeland)
* [[`b20fc79410`](https://github.com/StoneCypher/jssm/commit/b20fc79410)] - Update README.md (John Haugeland)
* [[`cf7fccd062`](https://github.com/StoneCypher/jssm/commit/cf7fccd062)] - readme improvements (John Haugeland)
Expand Down
4 changes: 2 additions & 2 deletions build/jssm-dot.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/jssm.es5.cjs.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/jssm.es5.cjs.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/jssm.es5.cjs.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/jssm.es5.cjs.min.js

Large diffs are not rendered by default.

109 changes: 86 additions & 23 deletions src/js/jssm-dot.peg
Expand Up @@ -5,10 +5,66 @@ Document


GvizShape
= "square"
/ "rectangle"
/ "circle"

= "box"
/ "polygon"
/ "ellipse"
/ "oval"
/ "circle"
/ "point"
/ "egg"
/ "triangle"
/ "plaintext"
/ "plain"
/ "diamond"
/ "trapezium"
/ "parallelogram"
/ "house"
/ "pentagon"
/ "hexagon"
/ "septagon"
/ "octagon"
/ "doublecircle"
/ "doubleoctagon"
/ "tripleoctagon"
/ "invtriangle"
/ "invtrapezium"
/ "invhouse"
/ "Mdiamond"
/ "Msquare"
/ "Mcircle"
/ "rect"
/ "rectangle"
/ "square"
/ "star"
/ "none"
/ "underline"
/ "cylinder"
/ "note"
/ "tab"
/ "folder"
/ "box3d"
/ "component"
/ "promoter"
/ "cds"
/ "terminator"
/ "utr"
/ "primersite"
/ "restrictionsite"
/ "fivepoverhang"
/ "threepoverhang"
/ "noverhang"
/ "assembly"
/ "signature"
/ "insulator"
/ "ribosite"
/ "rnastab"
/ "proteasesite"
/ "proteinstab"
/ "rpromoter"
/ "rarrow"
/ "larrow"
/ "lpromoter"
/ "record"


ForwardLightArrow "forward light arrow ->"
Expand Down Expand Up @@ -180,25 +236,6 @@ AtomFirstLetter
AtomLetter
= [0-9a-zA-Z\.\+\=\_\^\(\)\*\&\$\#\@\!\?\,\x80-\uFFFF]

/*

ControlCharacters
= [\x00-\x1F\x7F]

NotAtom
= [ -=~<>:{}%\\\[\]]

LeadingSigils
= [@~#&(]

AtomFirstLetter
= !(ControlCharacters / Sigils / NotAtom) ch:. { return ch; }

AtomLetter
= !(ControlCharacters / NotAtom) ch:. { return ch; }

*/

Atom "atom"
= firstletter:AtomFirstLetter text:AtomLetter* {
return firstletter + ((text || []).join(''));
Expand Down Expand Up @@ -668,8 +705,34 @@ MachineAttribute "machine attribute"




SdSingleEdgeColor "single edge color"
= WS? "edge_color" WS? ":" WS? value:Color WS? ";" WS? { return {key:'single_edge_color', value:value}; }

StateDeclarationItems
= SdSingleEdgeColor

StateDeclarationDesc
= "{" WS? items:StateDeclarationItems+ WS? "}" { return items; }

StateDeclaration
= WS? state_name:Label WS? ":" WS? decl_desc:StateDeclarationDesc WS? ";" { return {key:'state_declaration', name: state_name, value:decl_desc}; }




NamedList
= WS? "&" WS? list_name:Label WS? ":" WS? contents:LabelOrLabelList WS? ";" {
return { key:'named_list', name:list_name, value:contents };
}




Term
= Exp
/ StateDeclaration
/ NamedList
/ MachineAttribute
/ Config

Expand Down
Empty file added src/js/tests/named lists.js
Empty file.
Empty file.

0 comments on commit 9c9d052

Please sign in to comment.