2017-07-15 21:49:08 +02:00
|
|
|
package treerack
|
2017-06-25 17:51:08 +02:00
|
|
|
|
2017-06-26 01:21:46 +02:00
|
|
|
var bootSyntaxDefs = [][]string{{
|
2017-06-25 17:51:08 +02:00
|
|
|
"chars", "space", "alias", " ",
|
|
|
|
}, {
|
|
|
|
"chars", "tab", "alias", "\\t",
|
|
|
|
}, {
|
|
|
|
"chars", "nl", "alias", "\\n",
|
|
|
|
}, {
|
|
|
|
"chars", "backspace", "alias", "\\b",
|
|
|
|
}, {
|
|
|
|
"chars", "formfeed", "alias", "\\f",
|
|
|
|
}, {
|
|
|
|
"chars", "carryreturn", "alias", "\\r",
|
|
|
|
}, {
|
|
|
|
"chars", "verticaltab", "alias", "\\v",
|
|
|
|
}, {
|
|
|
|
"choice",
|
2017-10-29 02:49:54 +02:00
|
|
|
"wschar",
|
2017-06-25 17:51:08 +02:00
|
|
|
"alias",
|
|
|
|
"space",
|
|
|
|
"tab",
|
|
|
|
"nl",
|
|
|
|
"backspace",
|
|
|
|
"formfeed",
|
|
|
|
"carryreturn",
|
|
|
|
"verticaltab",
|
|
|
|
}, {
|
|
|
|
"chars", "open-block-comment", "alias", "/*",
|
|
|
|
}, {
|
|
|
|
"chars", "close-block-comment", "alias", "*/",
|
|
|
|
}, {
|
|
|
|
"chars", "star", "alias", "*",
|
|
|
|
}, {
|
|
|
|
"class", "not-slash", "alias", "^/",
|
|
|
|
}, {
|
|
|
|
"class", "not-star", "alias", "^*",
|
|
|
|
}, {
|
|
|
|
"chars", "double-slash", "alias", "//",
|
|
|
|
}, {
|
|
|
|
"class", "not-nl", "alias", "^\\n",
|
|
|
|
}, {
|
|
|
|
"sequence", "not-block-close", "alias", "star", "not-slash",
|
|
|
|
}, {
|
|
|
|
"choice", "block-comment-char", "alias", "not-block-close", "not-star",
|
|
|
|
}, {
|
2017-06-25 23:38:32 +02:00
|
|
|
"sequence", "block-comment-body", "alias", "block-comment-char:0:-1",
|
2017-06-25 17:51:08 +02:00
|
|
|
}, {
|
|
|
|
"sequence",
|
|
|
|
"block-comment",
|
|
|
|
"alias",
|
|
|
|
"open-block-comment",
|
|
|
|
"block-comment-body",
|
|
|
|
"close-block-comment",
|
|
|
|
}, {
|
2017-06-25 23:38:32 +02:00
|
|
|
"sequence", "not-nls", "alias", "not-nl:0:-1",
|
2017-06-25 17:51:08 +02:00
|
|
|
}, {
|
|
|
|
"sequence", "line-comment", "alias", "double-slash", "not-nls",
|
|
|
|
}, {
|
|
|
|
"choice", "comment-segment", "alias", "block-comment", "line-comment",
|
|
|
|
}, {
|
2017-10-29 02:49:54 +02:00
|
|
|
"sequence", "wss", "alias", "wschar:0:-1",
|
2017-06-25 17:51:08 +02:00
|
|
|
}, {
|
2017-06-25 23:38:32 +02:00
|
|
|
"sequence", "optional-nl", "alias", "nl:0:1",
|
2017-06-25 17:51:08 +02:00
|
|
|
}, {
|
|
|
|
"choice",
|
|
|
|
"ws-no-nl",
|
|
|
|
"alias",
|
|
|
|
"space",
|
|
|
|
"tab",
|
|
|
|
"backspace",
|
|
|
|
"formfeed",
|
|
|
|
"carryreturn",
|
|
|
|
"verticaltab",
|
|
|
|
}, {
|
|
|
|
"sequence",
|
|
|
|
"continue-comment-segment",
|
|
|
|
"alias",
|
|
|
|
"ws-no-nl",
|
|
|
|
"optional-nl",
|
|
|
|
"ws-no-nl",
|
|
|
|
"comment-segment",
|
|
|
|
}, {
|
2017-06-25 23:38:32 +02:00
|
|
|
"sequence", "continue-comment", "alias", "continue-comment-segment:0:-1",
|
2017-06-25 17:51:08 +02:00
|
|
|
}, {
|
|
|
|
"sequence",
|
|
|
|
"comment",
|
|
|
|
"none",
|
|
|
|
"comment-segment",
|
|
|
|
"continue-comment",
|
|
|
|
}, {
|
2017-10-29 02:49:54 +02:00
|
|
|
"choice", "wsc", "alias", "wschar", "comment",
|
2017-06-25 17:51:08 +02:00
|
|
|
}, {
|
2017-06-25 23:38:32 +02:00
|
|
|
"sequence", "wscs", "alias", "wsc:0:-1",
|
2017-06-25 17:51:08 +02:00
|
|
|
}, {
|
|
|
|
"anything", "anything", "alias",
|
|
|
|
}, {
|
|
|
|
"chars", "any-char", "none", ".",
|
|
|
|
}, {
|
|
|
|
"chars", "open-square", "alias", "[",
|
|
|
|
}, {
|
|
|
|
"chars", "close-square", "alias", "]",
|
|
|
|
}, {
|
|
|
|
"chars", "class-not", "none", "^",
|
|
|
|
}, {
|
|
|
|
"chars", "dash", "alias", "-",
|
|
|
|
}, {
|
2017-06-25 23:38:32 +02:00
|
|
|
"sequence", "optional-class-not", "alias", "class-not:0:1",
|
2017-06-25 17:51:08 +02:00
|
|
|
}, {
|
|
|
|
"class", "not-class-control", "alias", "^\\\\\\[\\]\\^\\-",
|
|
|
|
}, {
|
|
|
|
"chars", "escape", "alias", "\\\\",
|
|
|
|
}, {
|
|
|
|
"sequence", "escaped-char", "alias", "escape", "anything",
|
|
|
|
}, {
|
|
|
|
"choice", "class-char", "none", "not-class-control", "escaped-char",
|
|
|
|
}, {
|
|
|
|
"sequence", "char-range", "none", "class-char", "dash", "class-char",
|
|
|
|
}, {
|
|
|
|
"choice", "char-or-range", "alias", "class-char", "char-range",
|
|
|
|
}, {
|
2017-06-25 23:38:32 +02:00
|
|
|
"sequence", "chars-or-ranges", "alias", "char-or-range:0:-1",
|
2017-06-25 17:51:08 +02:00
|
|
|
}, {
|
|
|
|
"sequence", "char-class", "none", "open-square", "optional-class-not", "chars-or-ranges", "close-square",
|
|
|
|
}, {
|
|
|
|
"chars", "double-quote", "alias", "\\\"",
|
|
|
|
}, {
|
|
|
|
"class", "not-char-sequence-control", "alias", "^\\\\\"",
|
|
|
|
}, {
|
|
|
|
"choice", "sequence-char", "none", "not-char-sequence-control", "escaped-char",
|
|
|
|
}, {
|
2017-06-25 23:38:32 +02:00
|
|
|
"sequence", "char-sequence-chars", "alias", "sequence-char:0:-1",
|
2017-06-25 17:51:08 +02:00
|
|
|
}, {
|
|
|
|
"sequence", "char-sequence", "none", "double-quote", "char-sequence-chars", "double-quote",
|
|
|
|
}, {
|
|
|
|
"choice", "terminal", "alias", "any-char", "char-class", "char-sequence",
|
|
|
|
}, {
|
2017-10-31 21:53:09 +01:00
|
|
|
"class", "symbol-char", "alias", symbolChars,
|
2017-06-25 17:51:08 +02:00
|
|
|
}, {
|
2017-06-25 23:38:32 +02:00
|
|
|
"sequence", "symbol-chars", "alias", "symbol-char:1:-1",
|
2017-06-25 17:51:08 +02:00
|
|
|
}, {
|
|
|
|
"sequence", "symbol", "none", "symbol-chars",
|
|
|
|
}, {
|
|
|
|
"chars", "open-paren", "alias", "(",
|
|
|
|
}, {
|
|
|
|
"chars", "close-paren", "alias", ")",
|
|
|
|
}, {
|
|
|
|
"sequence", "group", "alias", "open-paren", "wscs", "expression", "wscs", "close-paren",
|
|
|
|
}, {
|
|
|
|
"chars", "open-brace", "alias", "{",
|
|
|
|
}, {
|
|
|
|
"chars", "close-brace", "alias", "}",
|
|
|
|
}, {
|
|
|
|
"class", "digit", "alias", "0-9",
|
|
|
|
}, {
|
2017-06-25 23:38:32 +02:00
|
|
|
"sequence", "number", "alias", "digit:1:-1",
|
2017-06-25 17:51:08 +02:00
|
|
|
}, {
|
|
|
|
"sequence", "count", "none", "number",
|
|
|
|
}, {
|
|
|
|
"sequence", "count-quantifier", "none", "open-brace", "wscs", "count", "wscs", "close-brace",
|
|
|
|
}, {
|
|
|
|
"sequence", "range-from", "none", "number",
|
|
|
|
}, {
|
|
|
|
"sequence", "range-to", "none", "number",
|
|
|
|
}, {
|
|
|
|
"chars", "comma", "alias", ",",
|
|
|
|
}, {
|
|
|
|
"sequence",
|
|
|
|
"range-quantifier",
|
|
|
|
"none",
|
|
|
|
"open-brace",
|
|
|
|
"wscs",
|
|
|
|
"range-from",
|
|
|
|
"wscs",
|
|
|
|
"comma",
|
|
|
|
"wscs",
|
|
|
|
"range-to",
|
|
|
|
"close-brace",
|
|
|
|
}, {
|
|
|
|
"chars", "one-or-more", "none", "+",
|
|
|
|
}, {
|
|
|
|
"chars", "zero-or-more", "none", "*",
|
|
|
|
}, {
|
|
|
|
"chars", "zero-or-one", "none", "?",
|
|
|
|
}, {
|
|
|
|
"choice",
|
|
|
|
"quantity",
|
|
|
|
"alias",
|
|
|
|
"count-quantifier",
|
|
|
|
"range-quantifier",
|
|
|
|
"one-or-more",
|
|
|
|
"zero-or-more",
|
|
|
|
"zero-or-one",
|
|
|
|
}, {
|
|
|
|
"choice", "quantifiable", "alias", "terminal", "symbol", "group",
|
|
|
|
}, {
|
2017-06-25 23:38:32 +02:00
|
|
|
"choice", "item-choice", "alias", "terminal", "symbol", "group",
|
2017-06-25 17:51:08 +02:00
|
|
|
}, {
|
2017-06-25 23:38:32 +02:00
|
|
|
"sequence", "item", "none", "item-choice", "quantity:0:1",
|
2017-06-25 17:51:08 +02:00
|
|
|
}, {
|
|
|
|
"sequence", "item-continue", "alias", "wscs", "item",
|
|
|
|
}, {
|
2017-06-25 23:38:32 +02:00
|
|
|
"sequence", "items-continue", "alias", "item-continue:0:-1",
|
2017-06-25 17:51:08 +02:00
|
|
|
}, {
|
|
|
|
"sequence", "sequence", "none", "item", "items-continue",
|
|
|
|
}, {
|
2017-11-02 22:19:03 +01:00
|
|
|
"choice", "option", "alias", "terminal", "symbol", "group", "sequence",
|
2017-06-25 17:51:08 +02:00
|
|
|
}, {
|
|
|
|
"chars", "pipe", "alias", "|",
|
|
|
|
}, {
|
2017-11-02 22:19:03 +01:00
|
|
|
"sequence", "option-continue", "alias", "wscs", "pipe", "wscs", "option",
|
2017-06-25 17:51:08 +02:00
|
|
|
}, {
|
2017-11-02 22:19:03 +01:00
|
|
|
"sequence", "options-continue", "alias", "option-continue:1:-1",
|
2017-06-25 17:51:08 +02:00
|
|
|
}, {
|
2017-11-02 22:19:03 +01:00
|
|
|
"sequence", "choice", "none", "option", "options-continue",
|
2017-06-25 17:51:08 +02:00
|
|
|
}, {
|
|
|
|
"choice",
|
|
|
|
"expression",
|
|
|
|
"alias",
|
|
|
|
"terminal",
|
|
|
|
"symbol",
|
|
|
|
"group",
|
|
|
|
"sequence",
|
|
|
|
"choice",
|
|
|
|
}, {
|
|
|
|
"chars", "alias", "none", "alias",
|
2017-10-29 02:49:54 +02:00
|
|
|
}, {
|
|
|
|
"chars", "ws", "none", "ws",
|
|
|
|
}, {
|
|
|
|
"chars", "nows", "none", "nows",
|
2017-06-25 17:51:08 +02:00
|
|
|
}, {
|
|
|
|
"chars", "root", "none", "root",
|
|
|
|
}, {
|
2017-11-05 03:28:36 +01:00
|
|
|
"choice", "flag", "alias", "alias", "ws", "nows", "root",
|
2017-06-25 17:51:08 +02:00
|
|
|
}, {
|
|
|
|
"chars", "colon", "alias", ":",
|
|
|
|
}, {
|
|
|
|
"sequence", "flag-tag", "alias", "colon", "flag",
|
|
|
|
}, {
|
2017-06-25 23:38:32 +02:00
|
|
|
"sequence", "flags", "alias", "flag-tag:0:-1",
|
2017-06-25 17:51:08 +02:00
|
|
|
}, {
|
|
|
|
"chars", "equal", "alias", "=",
|
|
|
|
}, {
|
|
|
|
"sequence", "definition", "none", "symbol", "flags", "wscs", "equal", "wscs", "expression",
|
|
|
|
}, {
|
|
|
|
"chars", "semicolon", "alias", ";",
|
|
|
|
}, {
|
|
|
|
"choice", "wsc-or-semicolon", "alias", "wsc", "semicolon",
|
|
|
|
}, {
|
2017-06-25 23:38:32 +02:00
|
|
|
"sequence", "wsc-or-semicolons", "alias", "wsc-or-semicolon:0:-1",
|
2017-06-25 17:51:08 +02:00
|
|
|
}, {
|
|
|
|
"sequence",
|
|
|
|
"subsequent-definition",
|
|
|
|
"alias",
|
|
|
|
"wscs",
|
|
|
|
"semicolon",
|
|
|
|
"wsc-or-semicolons",
|
|
|
|
"definition",
|
|
|
|
}, {
|
2017-06-25 23:38:32 +02:00
|
|
|
"sequence",
|
2017-06-25 17:51:08 +02:00
|
|
|
"subsequent-definitions",
|
|
|
|
"alias",
|
2017-06-25 23:38:32 +02:00
|
|
|
"subsequent-definition:0:-1",
|
2017-06-25 17:51:08 +02:00
|
|
|
}, {
|
|
|
|
"sequence",
|
|
|
|
"definitions",
|
|
|
|
"alias",
|
|
|
|
"definition",
|
|
|
|
"subsequent-definitions",
|
|
|
|
}, {
|
2017-06-25 23:38:32 +02:00
|
|
|
"sequence",
|
2017-06-25 17:51:08 +02:00
|
|
|
"opt-definitions",
|
|
|
|
"alias",
|
2017-06-25 23:38:32 +02:00
|
|
|
"definitions:0:1",
|
2017-06-25 17:51:08 +02:00
|
|
|
}, {
|
|
|
|
"sequence",
|
|
|
|
"syntax",
|
|
|
|
"root",
|
|
|
|
"wsc-or-semicolons",
|
|
|
|
"opt-definitions",
|
|
|
|
"wsc-or-semicolons",
|
|
|
|
}}
|