Best JavaScript code snippet using wpt
grammar.js
Source:grammar.js
1// Generated automatically by nearley, version 2.19.02// http://github.com/Hardmath123/nearley3(function () {4function id(x) { return x[0]; }5var grammar = {6 Lexer: undefined,7 ParserRules: [8 {"name": "_$ebnf$1", "symbols": []},9 {"name": "_$ebnf$1", "symbols": ["_$ebnf$1", "wschar"], "postprocess": function arrpush(d) {return d[0].concat([d[1]]);}},10 {"name": "_", "symbols": ["_$ebnf$1"], "postprocess": function(d) {return null;}},11 {"name": "__$ebnf$1", "symbols": ["wschar"]},12 {"name": "__$ebnf$1", "symbols": ["__$ebnf$1", "wschar"], "postprocess": function arrpush(d) {return d[0].concat([d[1]]);}},13 {"name": "__", "symbols": ["__$ebnf$1"], "postprocess": function(d) {return null;}},14 {"name": "wschar", "symbols": [/[ \t\n\v\f]/], "postprocess": id},15 {"name": "unsigned_int$ebnf$1", "symbols": [/[0-9]/]},16 {"name": "unsigned_int$ebnf$1", "symbols": ["unsigned_int$ebnf$1", /[0-9]/], "postprocess": function arrpush(d) {return d[0].concat([d[1]]);}},17 {"name": "unsigned_int", "symbols": ["unsigned_int$ebnf$1"], "postprocess": 18 function(d) {19 return parseInt(d[0].join(""));20 }21 },22 {"name": "int$ebnf$1$subexpression$1", "symbols": [{"literal":"-"}]},23 {"name": "int$ebnf$1$subexpression$1", "symbols": [{"literal":"+"}]},24 {"name": "int$ebnf$1", "symbols": ["int$ebnf$1$subexpression$1"], "postprocess": id},25 {"name": "int$ebnf$1", "symbols": [], "postprocess": function(d) {return null;}},26 {"name": "int$ebnf$2", "symbols": [/[0-9]/]},27 {"name": "int$ebnf$2", "symbols": ["int$ebnf$2", /[0-9]/], "postprocess": function arrpush(d) {return d[0].concat([d[1]]);}},28 {"name": "int", "symbols": ["int$ebnf$1", "int$ebnf$2"], "postprocess": 29 function(d) {30 if (d[0]) {31 return parseInt(d[0][0]+d[1].join(""));32 } else {33 return parseInt(d[1].join(""));34 }35 }36 },37 {"name": "unsigned_decimal$ebnf$1", "symbols": [/[0-9]/]},38 {"name": "unsigned_decimal$ebnf$1", "symbols": ["unsigned_decimal$ebnf$1", /[0-9]/], "postprocess": function arrpush(d) {return d[0].concat([d[1]]);}},39 {"name": "unsigned_decimal$ebnf$2$subexpression$1$ebnf$1", "symbols": [/[0-9]/]},40 {"name": "unsigned_decimal$ebnf$2$subexpression$1$ebnf$1", "symbols": ["unsigned_decimal$ebnf$2$subexpression$1$ebnf$1", /[0-9]/], "postprocess": function arrpush(d) {return d[0].concat([d[1]]);}},41 {"name": "unsigned_decimal$ebnf$2$subexpression$1", "symbols": [{"literal":"."}, "unsigned_decimal$ebnf$2$subexpression$1$ebnf$1"]},42 {"name": "unsigned_decimal$ebnf$2", "symbols": ["unsigned_decimal$ebnf$2$subexpression$1"], "postprocess": id},43 {"name": "unsigned_decimal$ebnf$2", "symbols": [], "postprocess": function(d) {return null;}},44 {"name": "unsigned_decimal", "symbols": ["unsigned_decimal$ebnf$1", "unsigned_decimal$ebnf$2"], "postprocess": 45 function(d) {46 return parseFloat(47 d[0].join("") +48 (d[1] ? "."+d[1][1].join("") : "")49 );50 }51 },52 {"name": "decimal$ebnf$1", "symbols": [{"literal":"-"}], "postprocess": id},53 {"name": "decimal$ebnf$1", "symbols": [], "postprocess": function(d) {return null;}},54 {"name": "decimal$ebnf$2", "symbols": [/[0-9]/]},55 {"name": "decimal$ebnf$2", "symbols": ["decimal$ebnf$2", /[0-9]/], "postprocess": function arrpush(d) {return d[0].concat([d[1]]);}},56 {"name": "decimal$ebnf$3$subexpression$1$ebnf$1", "symbols": [/[0-9]/]},57 {"name": "decimal$ebnf$3$subexpression$1$ebnf$1", "symbols": ["decimal$ebnf$3$subexpression$1$ebnf$1", /[0-9]/], "postprocess": function arrpush(d) {return d[0].concat([d[1]]);}},58 {"name": "decimal$ebnf$3$subexpression$1", "symbols": [{"literal":"."}, "decimal$ebnf$3$subexpression$1$ebnf$1"]},59 {"name": "decimal$ebnf$3", "symbols": ["decimal$ebnf$3$subexpression$1"], "postprocess": id},60 {"name": "decimal$ebnf$3", "symbols": [], "postprocess": function(d) {return null;}},61 {"name": "decimal", "symbols": ["decimal$ebnf$1", "decimal$ebnf$2", "decimal$ebnf$3"], "postprocess": 62 function(d) {63 return parseFloat(64 (d[0] || "") +65 d[1].join("") +66 (d[2] ? "."+d[2][1].join("") : "")67 );68 }69 },70 {"name": "percentage", "symbols": ["decimal", {"literal":"%"}], "postprocess": 71 function(d) {72 return d[0]/100;73 }74 },75 {"name": "jsonfloat$ebnf$1", "symbols": [{"literal":"-"}], "postprocess": id},76 {"name": "jsonfloat$ebnf$1", "symbols": [], "postprocess": function(d) {return null;}},77 {"name": "jsonfloat$ebnf$2", "symbols": [/[0-9]/]},78 {"name": "jsonfloat$ebnf$2", "symbols": ["jsonfloat$ebnf$2", /[0-9]/], "postprocess": function arrpush(d) {return d[0].concat([d[1]]);}},79 {"name": "jsonfloat$ebnf$3$subexpression$1$ebnf$1", "symbols": [/[0-9]/]},80 {"name": "jsonfloat$ebnf$3$subexpression$1$ebnf$1", "symbols": ["jsonfloat$ebnf$3$subexpression$1$ebnf$1", /[0-9]/], "postprocess": function arrpush(d) {return d[0].concat([d[1]]);}},81 {"name": "jsonfloat$ebnf$3$subexpression$1", "symbols": [{"literal":"."}, "jsonfloat$ebnf$3$subexpression$1$ebnf$1"]},82 {"name": "jsonfloat$ebnf$3", "symbols": ["jsonfloat$ebnf$3$subexpression$1"], "postprocess": id},83 {"name": "jsonfloat$ebnf$3", "symbols": [], "postprocess": function(d) {return null;}},84 {"name": "jsonfloat$ebnf$4$subexpression$1$ebnf$1", "symbols": [/[+-]/], "postprocess": id},85 {"name": "jsonfloat$ebnf$4$subexpression$1$ebnf$1", "symbols": [], "postprocess": function(d) {return null;}},86 {"name": "jsonfloat$ebnf$4$subexpression$1$ebnf$2", "symbols": [/[0-9]/]},87 {"name": "jsonfloat$ebnf$4$subexpression$1$ebnf$2", "symbols": ["jsonfloat$ebnf$4$subexpression$1$ebnf$2", /[0-9]/], "postprocess": function arrpush(d) {return d[0].concat([d[1]]);}},88 {"name": "jsonfloat$ebnf$4$subexpression$1", "symbols": [/[eE]/, "jsonfloat$ebnf$4$subexpression$1$ebnf$1", "jsonfloat$ebnf$4$subexpression$1$ebnf$2"]},89 {"name": "jsonfloat$ebnf$4", "symbols": ["jsonfloat$ebnf$4$subexpression$1"], "postprocess": id},90 {"name": "jsonfloat$ebnf$4", "symbols": [], "postprocess": function(d) {return null;}},91 {"name": "jsonfloat", "symbols": ["jsonfloat$ebnf$1", "jsonfloat$ebnf$2", "jsonfloat$ebnf$3", "jsonfloat$ebnf$4"], "postprocess": 92 function(d) {93 return parseFloat(94 (d[0] || "") +95 d[1].join("") +96 (d[2] ? "."+d[2][1].join("") : "") +97 (d[3] ? "e" + (d[3][1] || "+") + d[3][2].join("") : "")98 );99 }100 },101 {"name": "dqstring$ebnf$1", "symbols": []},102 {"name": "dqstring$ebnf$1", "symbols": ["dqstring$ebnf$1", "dstrchar"], "postprocess": function arrpush(d) {return d[0].concat([d[1]]);}},103 {"name": "dqstring", "symbols": [{"literal":"\""}, "dqstring$ebnf$1", {"literal":"\""}], "postprocess": function(d) {return d[1].join(""); }},104 {"name": "sqstring$ebnf$1", "symbols": []},105 {"name": "sqstring$ebnf$1", "symbols": ["sqstring$ebnf$1", "sstrchar"], "postprocess": function arrpush(d) {return d[0].concat([d[1]]);}},106 {"name": "sqstring", "symbols": [{"literal":"'"}, "sqstring$ebnf$1", {"literal":"'"}], "postprocess": function(d) {return d[1].join(""); }},107 {"name": "btstring$ebnf$1", "symbols": []},108 {"name": "btstring$ebnf$1", "symbols": ["btstring$ebnf$1", /[^`]/], "postprocess": function arrpush(d) {return d[0].concat([d[1]]);}},109 {"name": "btstring", "symbols": [{"literal":"`"}, "btstring$ebnf$1", {"literal":"`"}], "postprocess": function(d) {return d[1].join(""); }},110 {"name": "dstrchar", "symbols": [/[^\\"\n]/], "postprocess": id},111 {"name": "dstrchar", "symbols": [{"literal":"\\"}, "strescape"], "postprocess": 112 function(d) {113 return JSON.parse("\""+d.join("")+"\"");114 }115 },116 {"name": "sstrchar", "symbols": [/[^\\'\n]/], "postprocess": id},117 {"name": "sstrchar", "symbols": [{"literal":"\\"}, "strescape"], "postprocess": function(d) { return JSON.parse("\""+d.join("")+"\""); }},118 {"name": "sstrchar$string$1", "symbols": [{"literal":"\\"}, {"literal":"'"}], "postprocess": function joiner(d) {return d.join('');}},119 {"name": "sstrchar", "symbols": ["sstrchar$string$1"], "postprocess": function(d) {return "'"; }},120 {"name": "strescape", "symbols": [/["\\/bfnrt]/], "postprocess": id},121 {"name": "strescape", "symbols": [{"literal":"u"}, /[a-fA-F0-9]/, /[a-fA-F0-9]/, /[a-fA-F0-9]/, /[a-fA-F0-9]/], "postprocess": 122 function(d) {123 return d.join("");124 }125 },126 {"name": "table_name", "symbols": ["word"], "postprocess": d => d[0]},127 {"name": "table_name", "symbols": ["btstring"], "postprocess": d => d[0]},128 {"name": "field_name", "symbols": ["word"], "postprocess": d => d[0]},129 {"name": "field_name", "symbols": ["btstring"], "postprocess": d => d[0]},130 {"name": "string", "symbols": ["dqstring"], "postprocess": d => d[0]},131 {"name": "string", "symbols": ["sqstring"], "postprocess": d => d[0]},132 {"name": "word", "symbols": [/[A-Za-z_]/], "postprocess": id},133 {"name": "word", "symbols": ["word", /[A-Za-z0-9_]/], "postprocess": d => '' + d[0] + d[1]},134 {"name": "data_type", "symbols": ["numeric_type"], "postprocess": d => d[0]},135 {"name": "data_type", "symbols": ["datetime_type"], "postprocess": d => d[0]},136 {"name": "data_type", "symbols": ["string_type"], "postprocess": d => d[0]},137 {"name": "data_type", "symbols": ["spatial_data_type"], "postprocess": d => d[0]},138 {"name": "numeric_type", "symbols": ["integer_type"], "postprocess": d => d[0]},139 {"name": "numeric_type$subexpression$1$subexpression$1", "symbols": [/[dD]/, /[eE]/, /[cC]/, /[iI]/, /[mM]/, /[aA]/, /[lL]/], "postprocess": function(d) {return d.join(""); }},140 {"name": "numeric_type$subexpression$1", "symbols": ["numeric_type$subexpression$1$subexpression$1"]},141 {"name": "numeric_type$subexpression$1$subexpression$2", "symbols": [/[nN]/, /[uU]/, /[mM]/, /[eE]/, /[rR]/, /[iI]/, /[cC]/], "postprocess": function(d) {return d.join(""); }},142 {"name": "numeric_type$subexpression$1", "symbols": ["numeric_type$subexpression$1$subexpression$2"]},143 {"name": "numeric_type$ebnf$1$subexpression$1$subexpression$1", "symbols": ["unsigned_int"]},144 {"name": "numeric_type$ebnf$1$subexpression$1$subexpression$1", "symbols": ["unsigned_int", "_", {"literal":","}, "_", "unsigned_int"]},145 {"name": "numeric_type$ebnf$1$subexpression$1", "symbols": ["_", {"literal":"("}, "_", "numeric_type$ebnf$1$subexpression$1$subexpression$1", "_", {"literal":")"}, "_"]},146 {"name": "numeric_type$ebnf$1", "symbols": ["numeric_type$ebnf$1$subexpression$1"], "postprocess": id},147 {"name": "numeric_type$ebnf$1", "symbols": [], "postprocess": function(d) {return null;}},148 {"name": "numeric_type", "symbols": ["numeric_type$subexpression$1", "numeric_type$ebnf$1"], "postprocess": 149 d => {150 let _m = 10;151 let _d = 0;152 if (d[1] && d[1][3]) {153 if (d[1][3].length === 1) {154 _m = d[1][3][0];155 } else if (d[1][3].length === 5) {156 _m = d[1][3][0];157 _d = d[1][3][4];158 }159 }160 return {161 type: 'DECIMAL',162 params: [ _m, _d ],163 };164 }165 },166 {"name": "numeric_type$subexpression$2", "symbols": [/[fF]/, /[lL]/, /[oO]/, /[aA]/, /[tT]/], "postprocess": function(d) {return d.join(""); }},167 {"name": "numeric_type$ebnf$2$subexpression$1$subexpression$1", "symbols": ["unsigned_int"]},168 {"name": "numeric_type$ebnf$2$subexpression$1$subexpression$1", "symbols": ["unsigned_int", "_", {"literal":","}, "_", "unsigned_int"]},169 {"name": "numeric_type$ebnf$2$subexpression$1", "symbols": ["_", {"literal":"("}, "_", "numeric_type$ebnf$2$subexpression$1$subexpression$1", "_", {"literal":")"}, "_"]},170 {"name": "numeric_type$ebnf$2", "symbols": ["numeric_type$ebnf$2$subexpression$1"], "postprocess": id},171 {"name": "numeric_type$ebnf$2", "symbols": [], "postprocess": function(d) {return null;}},172 {"name": "numeric_type", "symbols": ["numeric_type$subexpression$2", "numeric_type$ebnf$2"], "postprocess": 173 d => {174 let _m = 23;175 let _d = 0;176 if (d[1] && d[1][3]) {177 if (d[1][3].length === 1) {178 _m = d[1][3][0];179 } else if (d[1][3].length === 5) {180 _m = d[1][3][0];181 _d = d[1][3][4];182 }183 }184 return {185 type: 'FLOAT',186 params: [ _m, _d ],187 };188 }189 },190 {"name": "numeric_type$subexpression$3", "symbols": [/[dD]/, /[oO]/, /[uU]/, /[bB]/, /[lL]/, /[eE]/], "postprocess": function(d) {return d.join(""); }},191 {"name": "numeric_type$ebnf$3$subexpression$1$subexpression$1", "symbols": ["unsigned_int"]},192 {"name": "numeric_type$ebnf$3$subexpression$1$subexpression$1", "symbols": ["unsigned_int", "_", {"literal":","}, "_", "unsigned_int"]},193 {"name": "numeric_type$ebnf$3$subexpression$1", "symbols": ["_", {"literal":"("}, "_", "numeric_type$ebnf$3$subexpression$1$subexpression$1", "_", {"literal":")"}]},194 {"name": "numeric_type$ebnf$3", "symbols": ["numeric_type$ebnf$3$subexpression$1"], "postprocess": id},195 {"name": "numeric_type$ebnf$3", "symbols": [], "postprocess": function(d) {return null;}},196 {"name": "numeric_type", "symbols": ["numeric_type$subexpression$3", "numeric_type$ebnf$3"], "postprocess": 197 d => {198 let _m = 53;199 let _d = 0;200 if (d[1] && d[1][3]) {201 if (d[1][3].length === 1) {202 _m = d[1][3][0];203 } else if (d[1][3].length === 5) {204 _m = d[1][3][0];205 _d = d[1][3][4];206 }207 }208 return {209 type: 'DOUBLE',210 params: [ _m, _d ],211 };212 }213 },214 {"name": "numeric_type$subexpression$4", "symbols": [/[bB]/, /[iI]/, /[tT]/], "postprocess": function(d) {return d.join(""); }},215 {"name": "numeric_type", "symbols": ["numeric_type$subexpression$4", "_", {"literal":"("}, "_", "unsigned_int", "_", {"literal":")"}], "postprocess": 216 d => {217 return {218 type: 'BIT',219 params: [ d[4] ],220 };221 }222 },223 {"name": "integer_type$subexpression$1", "symbols": [/[tT]/, /[iI]/, /[nN]/, /[yY]/, /[iI]/, /[nN]/, /[tT]/], "postprocess": function(d) {return d.join(""); }},224 {"name": "integer_type$ebnf$1$subexpression$1", "symbols": ["_", {"literal":"("}, "_", "unsigned_int", "_", {"literal":")"}, "_"]},225 {"name": "integer_type$ebnf$1", "symbols": ["integer_type$ebnf$1$subexpression$1"], "postprocess": id},226 {"name": "integer_type$ebnf$1", "symbols": [], "postprocess": function(d) {return null;}},227 {"name": "integer_type$ebnf$2$subexpression$1$subexpression$1", "symbols": [/[uU]/, /[nN]/, /[sS]/, /[iI]/, /[gG]/, /[nN]/, /[eE]/, /[dD]/], "postprocess": function(d) {return d.join(""); }},228 {"name": "integer_type$ebnf$2$subexpression$1", "symbols": ["__", "integer_type$ebnf$2$subexpression$1$subexpression$1"]},229 {"name": "integer_type$ebnf$2", "symbols": ["integer_type$ebnf$2$subexpression$1"], "postprocess": id},230 {"name": "integer_type$ebnf$2", "symbols": [], "postprocess": function(d) {return null;}},231 {"name": "integer_type$ebnf$3$subexpression$1$subexpression$1", "symbols": [/[zZ]/, /[eE]/, /[rR]/, /[oO]/, /[fF]/, /[iI]/, /[lL]/, /[lL]/], "postprocess": function(d) {return d.join(""); }},232 {"name": "integer_type$ebnf$3$subexpression$1", "symbols": ["__", "integer_type$ebnf$3$subexpression$1$subexpression$1"]},233 {"name": "integer_type$ebnf$3", "symbols": ["integer_type$ebnf$3$subexpression$1"], "postprocess": id},234 {"name": "integer_type$ebnf$3", "symbols": [], "postprocess": function(d) {return null;}},235 {"name": "integer_type", "symbols": ["integer_type$subexpression$1", "integer_type$ebnf$1", "integer_type$ebnf$2", "integer_type$ebnf$3"], "postprocess": 236 d => {237 const length = d[1] ? d[1][3] : 4;238 const result = {239 type: 'TINYINT',240 params: [ length ],241 };242 if (d[2] && d[2][1]) {243 result.unsigned = true;244 }245 if (d[3] && d[3][1]) {246 result.zerofill = true;247 }248 return result;249 }250 },251 {"name": "integer_type$subexpression$2", "symbols": [/[sS]/, /[mM]/, /[aA]/, /[lL]/, /[lL]/, /[iI]/, /[nN]/, /[tT]/], "postprocess": function(d) {return d.join(""); }},252 {"name": "integer_type$ebnf$4$subexpression$1", "symbols": ["_", {"literal":"("}, "_", "unsigned_int", "_", {"literal":")"}, "_"]},253 {"name": "integer_type$ebnf$4", "symbols": ["integer_type$ebnf$4$subexpression$1"], "postprocess": id},254 {"name": "integer_type$ebnf$4", "symbols": [], "postprocess": function(d) {return null;}},255 {"name": "integer_type$ebnf$5$subexpression$1$subexpression$1", "symbols": [/[uU]/, /[nN]/, /[sS]/, /[iI]/, /[gG]/, /[nN]/, /[eE]/, /[dD]/], "postprocess": function(d) {return d.join(""); }},256 {"name": "integer_type$ebnf$5$subexpression$1", "symbols": ["__", "integer_type$ebnf$5$subexpression$1$subexpression$1"]},257 {"name": "integer_type$ebnf$5", "symbols": ["integer_type$ebnf$5$subexpression$1"], "postprocess": id},258 {"name": "integer_type$ebnf$5", "symbols": [], "postprocess": function(d) {return null;}},259 {"name": "integer_type$ebnf$6$subexpression$1$subexpression$1", "symbols": [/[zZ]/, /[eE]/, /[rR]/, /[oO]/, /[fF]/, /[iI]/, /[lL]/, /[lL]/], "postprocess": function(d) {return d.join(""); }},260 {"name": "integer_type$ebnf$6$subexpression$1", "symbols": ["__", "integer_type$ebnf$6$subexpression$1$subexpression$1"]},261 {"name": "integer_type$ebnf$6", "symbols": ["integer_type$ebnf$6$subexpression$1"], "postprocess": id},262 {"name": "integer_type$ebnf$6", "symbols": [], "postprocess": function(d) {return null;}},263 {"name": "integer_type", "symbols": ["integer_type$subexpression$2", "integer_type$ebnf$4", "integer_type$ebnf$5", "integer_type$ebnf$6"], "postprocess": 264 d => {265 const length = d[1] ? d[1][3] : 6;266 const result = {267 type: 'SMALLINT',268 params: [ length ],269 };270 if (d[2] && d[2][1]) {271 result.unsigned = true;272 }273 if (d[3] && d[3][1]) {274 result.zerofill = true;275 }276 return result;277 }278 },279 {"name": "integer_type$subexpression$3", "symbols": [/[mM]/, /[eE]/, /[dD]/, /[iI]/, /[uU]/, /[mM]/, /[iI]/, /[nN]/, /[tT]/], "postprocess": function(d) {return d.join(""); }},280 {"name": "integer_type$ebnf$7$subexpression$1", "symbols": ["_", {"literal":"("}, "_", "unsigned_int", "_", {"literal":")"}, "_"]},281 {"name": "integer_type$ebnf$7", "symbols": ["integer_type$ebnf$7$subexpression$1"], "postprocess": id},282 {"name": "integer_type$ebnf$7", "symbols": [], "postprocess": function(d) {return null;}},283 {"name": "integer_type$ebnf$8$subexpression$1$subexpression$1", "symbols": [/[uU]/, /[nN]/, /[sS]/, /[iI]/, /[gG]/, /[nN]/, /[eE]/, /[dD]/], "postprocess": function(d) {return d.join(""); }},284 {"name": "integer_type$ebnf$8$subexpression$1", "symbols": ["__", "integer_type$ebnf$8$subexpression$1$subexpression$1"]},285 {"name": "integer_type$ebnf$8", "symbols": ["integer_type$ebnf$8$subexpression$1"], "postprocess": id},286 {"name": "integer_type$ebnf$8", "symbols": [], "postprocess": function(d) {return null;}},287 {"name": "integer_type$ebnf$9$subexpression$1$subexpression$1", "symbols": [/[zZ]/, /[eE]/, /[rR]/, /[oO]/, /[fF]/, /[iI]/, /[lL]/, /[lL]/], "postprocess": function(d) {return d.join(""); }},288 {"name": "integer_type$ebnf$9$subexpression$1", "symbols": ["__", "integer_type$ebnf$9$subexpression$1$subexpression$1"]},289 {"name": "integer_type$ebnf$9", "symbols": ["integer_type$ebnf$9$subexpression$1"], "postprocess": id},290 {"name": "integer_type$ebnf$9", "symbols": [], "postprocess": function(d) {return null;}},291 {"name": "integer_type", "symbols": ["integer_type$subexpression$3", "integer_type$ebnf$7", "integer_type$ebnf$8", "integer_type$ebnf$9"], "postprocess": 292 d => {293 const length = d[1] ? d[1][3] : 8;294 const result = {295 type: 'MEDIUMINT',296 params: [ length ],297 };298 if (d[2] && d[2][1]) {299 result.unsigned = true;300 }301 if (d[3] && d[3][1]) {302 result.zerofill = true;303 }304 return result;305 }306 },307 {"name": "integer_type$subexpression$4", "symbols": [/[iI]/, /[nN]/, /[tT]/], "postprocess": function(d) {return d.join(""); }},308 {"name": "integer_type$ebnf$10$subexpression$1", "symbols": ["_", {"literal":"("}, "_", "unsigned_int", "_", {"literal":")"}, "_"]},309 {"name": "integer_type$ebnf$10", "symbols": ["integer_type$ebnf$10$subexpression$1"], "postprocess": id},310 {"name": "integer_type$ebnf$10", "symbols": [], "postprocess": function(d) {return null;}},311 {"name": "integer_type$ebnf$11$subexpression$1$subexpression$1", "symbols": [/[uU]/, /[nN]/, /[sS]/, /[iI]/, /[gG]/, /[nN]/, /[eE]/, /[dD]/], "postprocess": function(d) {return d.join(""); }},312 {"name": "integer_type$ebnf$11$subexpression$1", "symbols": ["__", "integer_type$ebnf$11$subexpression$1$subexpression$1"]},313 {"name": "integer_type$ebnf$11", "symbols": ["integer_type$ebnf$11$subexpression$1"], "postprocess": id},314 {"name": "integer_type$ebnf$11", "symbols": [], "postprocess": function(d) {return null;}},315 {"name": "integer_type$ebnf$12$subexpression$1$subexpression$1", "symbols": [/[zZ]/, /[eE]/, /[rR]/, /[oO]/, /[fF]/, /[iI]/, /[lL]/, /[lL]/], "postprocess": function(d) {return d.join(""); }},316 {"name": "integer_type$ebnf$12$subexpression$1", "symbols": ["__", "integer_type$ebnf$12$subexpression$1$subexpression$1"]},317 {"name": "integer_type$ebnf$12", "symbols": ["integer_type$ebnf$12$subexpression$1"], "postprocess": id},318 {"name": "integer_type$ebnf$12", "symbols": [], "postprocess": function(d) {return null;}},319 {"name": "integer_type", "symbols": ["integer_type$subexpression$4", "integer_type$ebnf$10", "integer_type$ebnf$11", "integer_type$ebnf$12"], "postprocess": 320 d => {321 const length = d[1] ? d[1][3] : 11;322 const result = {323 type: 'INT',324 params: [ length ],325 };326 if (d[2] && d[2][1]) {327 result.unsigned = true;328 }329 if (d[3] && d[3][1]) {330 result.zerofill = true;331 }332 return result;333 }334 },335 {"name": "integer_type$subexpression$5", "symbols": [/[bB]/, /[iI]/, /[gG]/, /[iI]/, /[nN]/, /[tT]/], "postprocess": function(d) {return d.join(""); }},336 {"name": "integer_type$ebnf$13$subexpression$1", "symbols": ["_", {"literal":"("}, "_", "unsigned_int", "_", {"literal":")"}, "_"]},337 {"name": "integer_type$ebnf$13", "symbols": ["integer_type$ebnf$13$subexpression$1"], "postprocess": id},338 {"name": "integer_type$ebnf$13", "symbols": [], "postprocess": function(d) {return null;}},339 {"name": "integer_type$ebnf$14$subexpression$1$subexpression$1", "symbols": [/[uU]/, /[nN]/, /[sS]/, /[iI]/, /[gG]/, /[nN]/, /[eE]/, /[dD]/], "postprocess": function(d) {return d.join(""); }},340 {"name": "integer_type$ebnf$14$subexpression$1", "symbols": ["__", "integer_type$ebnf$14$subexpression$1$subexpression$1"]},341 {"name": "integer_type$ebnf$14", "symbols": ["integer_type$ebnf$14$subexpression$1"], "postprocess": id},342 {"name": "integer_type$ebnf$14", "symbols": [], "postprocess": function(d) {return null;}},343 {"name": "integer_type$ebnf$15$subexpression$1$subexpression$1", "symbols": [/[zZ]/, /[eE]/, /[rR]/, /[oO]/, /[fF]/, /[iI]/, /[lL]/, /[lL]/], "postprocess": function(d) {return d.join(""); }},344 {"name": "integer_type$ebnf$15$subexpression$1", "symbols": ["__", "integer_type$ebnf$15$subexpression$1$subexpression$1"]},345 {"name": "integer_type$ebnf$15", "symbols": ["integer_type$ebnf$15$subexpression$1"], "postprocess": id},346 {"name": "integer_type$ebnf$15", "symbols": [], "postprocess": function(d) {return null;}},347 {"name": "integer_type", "symbols": ["integer_type$subexpression$5", "integer_type$ebnf$13", "integer_type$ebnf$14", "integer_type$ebnf$15"], "postprocess": 348 d => {349 const length = d[1] ? d[1][3] : 20;350 const result = {351 type: 'BIGINT',352 params: [ length ],353 };354 if (d[2] && d[2][1]) {355 result.unsigned = true;356 }357 if (d[3] && d[3][1]) {358 result.zerofill = true;359 }360 return result;361 }362 },363 {"name": "datetime_type$subexpression$1", "symbols": [/[dD]/, /[aA]/, /[tT]/, /[eE]/], "postprocess": function(d) {return d.join(""); }},364 {"name": "datetime_type", "symbols": ["datetime_type$subexpression$1"], "postprocess": 365 d => {366 const result = {367 type: 'DATE',368 };369 return result;370 }371 },372 {"name": "datetime_type$subexpression$2", "symbols": [/[dD]/, /[aA]/, /[tT]/, /[eE]/, /[tT]/, /[iI]/, /[mM]/, /[eE]/], "postprocess": function(d) {return d.join(""); }},373 {"name": "datetime_type$ebnf$1$subexpression$1", "symbols": ["_", {"literal":"("}, "_", "unsigned_int", "_", {"literal":")"}, "_"]},374 {"name": "datetime_type$ebnf$1", "symbols": ["datetime_type$ebnf$1$subexpression$1"], "postprocess": id},375 {"name": "datetime_type$ebnf$1", "symbols": [], "postprocess": function(d) {return null;}},376 {"name": "datetime_type", "symbols": ["datetime_type$subexpression$2", "datetime_type$ebnf$1"], "postprocess": 377 d => {378 let params;379 if (d[1] && d[1][3]) {380 params.push(d[1][3]);381 }382 const result = {383 type: 'DATETIME',384 };385 if (params) {386 result.params = params;387 }388 return result;389 }390 },391 {"name": "datetime_type$subexpression$3", "symbols": [/[tT]/, /[iI]/, /[mM]/, /[eE]/, /[sS]/, /[tT]/, /[aA]/, /[mM]/, /[pP]/], "postprocess": function(d) {return d.join(""); }},392 {"name": "datetime_type$ebnf$2$subexpression$1", "symbols": ["_", {"literal":"("}, "_", "unsigned_int", "_", {"literal":")"}, "_"]},393 {"name": "datetime_type$ebnf$2", "symbols": ["datetime_type$ebnf$2$subexpression$1"], "postprocess": id},394 {"name": "datetime_type$ebnf$2", "symbols": [], "postprocess": function(d) {return null;}},395 {"name": "datetime_type", "symbols": ["datetime_type$subexpression$3", "datetime_type$ebnf$2"], "postprocess": 396 d => {397 let params;398 if (d[1] && d[1][3]) {399 params.push(d[1][3]);400 }401 const result = {402 type: 'TIMESTAMP',403 };404 if (params) {405 result.params = params;406 }407 return result;408 }409 },410 {"name": "datetime_type$subexpression$4", "symbols": [/[tT]/, /[iI]/, /[mM]/, /[eE]/], "postprocess": function(d) {return d.join(""); }},411 {"name": "datetime_type$ebnf$3$subexpression$1", "symbols": ["_", {"literal":"("}, "_", "unsigned_int", "_", {"literal":")"}, "_"]},412 {"name": "datetime_type$ebnf$3", "symbols": ["datetime_type$ebnf$3$subexpression$1"], "postprocess": id},413 {"name": "datetime_type$ebnf$3", "symbols": [], "postprocess": function(d) {return null;}},414 {"name": "datetime_type", "symbols": ["datetime_type$subexpression$4", "datetime_type$ebnf$3"], "postprocess": 415 d => {416 let params;417 if (d[1] && d[1][3]) {418 params.push(d[1][3]);419 }420 const result = {421 type: 'TIME',422 };423 if (params) {424 result.params = params;425 }426 return result;427 }428 },429 {"name": "datetime_type$subexpression$5", "symbols": [/[yY]/, /[eE]/, /[aA]/, /[rR]/], "postprocess": function(d) {return d.join(""); }},430 {"name": "datetime_type$ebnf$4$subexpression$1", "symbols": ["_", {"literal":"("}, "_", "unsigned_int", "_", {"literal":")"}, "_"]},431 {"name": "datetime_type$ebnf$4", "symbols": ["datetime_type$ebnf$4$subexpression$1"], "postprocess": id},432 {"name": "datetime_type$ebnf$4", "symbols": [], "postprocess": function(d) {return null;}},433 {"name": "datetime_type", "symbols": ["datetime_type$subexpression$5", "datetime_type$ebnf$4"], "postprocess": 434 d => {435 const result = {436 type: 'YEAR',437 };438 return result;439 }440 },441 {"name": "string_type$subexpression$1", "symbols": [/[cC]/, /[hH]/, /[aA]/, /[rR]/], "postprocess": function(d) {return d.join(""); }},442 {"name": "string_type", "symbols": ["string_type$subexpression$1", "_", {"literal":"("}, "_", "unsigned_int", "_", {"literal":")"}], "postprocess": 443 d => {444 return {445 type: 'CHAR',446 params: [ d[4] ],447 };448 }449 },450 {"name": "string_type$subexpression$2", "symbols": [/[vV]/, /[aA]/, /[rR]/, /[cC]/, /[hH]/, /[aA]/, /[rR]/], "postprocess": function(d) {return d.join(""); }},451 {"name": "string_type", "symbols": ["string_type$subexpression$2", "_", {"literal":"("}, "_", "unsigned_int", "_", {"literal":")"}], "postprocess": 452 d => {453 return {454 type: 'VARCHAR',455 params: [ d[4] ],456 };457 }458 },459 {"name": "string_type$subexpression$3", "symbols": [/[bB]/, /[iI]/, /[nN]/, /[aA]/, /[rR]/, /[yY]/], "postprocess": function(d) {return d.join(""); }},460 {"name": "string_type", "symbols": ["string_type$subexpression$3", "_", {"literal":"("}, "_", "unsigned_int", "_", {"literal":")"}], "postprocess": 461 d => {462 return {463 type: 'BINARY',464 params: [ d[4] ],465 };466 }467 },468 {"name": "string_type$subexpression$4", "symbols": [/[vV]/, /[aA]/, /[rR]/, /[bB]/, /[iI]/, /[nN]/, /[aA]/, /[rR]/, /[yY]/], "postprocess": function(d) {return d.join(""); }},469 {"name": "string_type", "symbols": ["string_type$subexpression$4", "_", {"literal":"("}, "_", "unsigned_int", "_", {"literal":")"}], "postprocess": 470 d => {471 return {472 type: 'VARBINARY',473 params: [ d[4] ],474 };475 }476 },477 {"name": "string_type$subexpression$5", "symbols": [/[tT]/, /[iI]/, /[nN]/, /[yY]/, /[bB]/, /[lL]/, /[oO]/, /[bB]/], "postprocess": function(d) {return d.join(""); }},478 {"name": "string_type", "symbols": ["string_type$subexpression$5"], "postprocess": 479 d => {480 return {481 type: 'TINYBLOB',482 };483 }484 },485 {"name": "string_type$subexpression$6", "symbols": [/[bB]/, /[lL]/, /[oO]/, /[bB]/], "postprocess": function(d) {return d.join(""); }},486 {"name": "string_type", "symbols": ["string_type$subexpression$6"], "postprocess": 487 d => {488 return {489 type: 'BLOB',490 };491 }492 },493 {"name": "string_type$subexpression$7", "symbols": [/[mM]/, /[eE]/, /[dD]/, /[iI]/, /[uU]/, /[mM]/, /[bB]/, /[lL]/, /[oO]/, /[bB]/], "postprocess": function(d) {return d.join(""); }},494 {"name": "string_type", "symbols": ["string_type$subexpression$7"], "postprocess": 495 d => {496 return {497 type: 'MEDIUMBLOB',498 };499 }500 },501 {"name": "string_type$subexpression$8", "symbols": [/[lL]/, /[oO]/, /[nN]/, /[gG]/, /[bB]/, /[lL]/, /[oO]/, /[bB]/], "postprocess": function(d) {return d.join(""); }},502 {"name": "string_type", "symbols": ["string_type$subexpression$8"], "postprocess": 503 d => {504 return {505 type: 'LONGBLOB',506 };507 }508 },509 {"name": "string_type$subexpression$9", "symbols": [/[tT]/, /[iI]/, /[nN]/, /[yY]/, /[tT]/, /[eE]/, /[xX]/, /[tT]/], "postprocess": function(d) {return d.join(""); }},510 {"name": "string_type", "symbols": ["string_type$subexpression$9"], "postprocess": 511 d => {512 return {513 type: 'TINYTEXT',514 };515 }516 },517 {"name": "string_type$subexpression$10", "symbols": [/[tT]/, /[eE]/, /[xX]/, /[tT]/], "postprocess": function(d) {return d.join(""); }},518 {"name": "string_type", "symbols": ["string_type$subexpression$10"], "postprocess": 519 d => {520 return {521 type: 'TEXT',522 };523 }524 },525 {"name": "string_type$subexpression$11", "symbols": [/[mM]/, /[eE]/, /[dD]/, /[iI]/, /[uU]/, /[mM]/, /[tT]/, /[eE]/, /[xX]/, /[tT]/], "postprocess": function(d) {return d.join(""); }},526 {"name": "string_type", "symbols": ["string_type$subexpression$11"], "postprocess": 527 d => {528 return {529 type: 'MEDIUMTEXT',530 };531 }532 },533 {"name": "string_type$subexpression$12", "symbols": [/[lL]/, /[oO]/, /[nN]/, /[gG]/, /[tT]/, /[eE]/, /[xX]/, /[tT]/], "postprocess": function(d) {return d.join(""); }},534 {"name": "string_type", "symbols": ["string_type$subexpression$12"], "postprocess": 535 d => {536 return {537 type: 'LONGTEXT',538 };539 }540 },541 {"name": "string_type$subexpression$13", "symbols": [/[jJ]/, /[sS]/, /[oO]/, /[nN]/], "postprocess": function(d) {return d.join(""); }},542 {"name": "string_type", "symbols": ["string_type$subexpression$13"], "postprocess": 543 d => {544 return {545 type: 'JSON',546 };547 }548 },549 {"name": "string_type$subexpression$14", "symbols": [/[eE]/, /[nN]/, /[uU]/, /[mM]/], "postprocess": function(d) {return d.join(""); }},550 {"name": "string_type$ebnf$1$subexpression$1$ebnf$1$subexpression$1", "symbols": [{"literal":","}, "_"]},551 {"name": "string_type$ebnf$1$subexpression$1$ebnf$1", "symbols": ["string_type$ebnf$1$subexpression$1$ebnf$1$subexpression$1"], "postprocess": id},552 {"name": "string_type$ebnf$1$subexpression$1$ebnf$1", "symbols": [], "postprocess": function(d) {return null;}},553 {"name": "string_type$ebnf$1$subexpression$1", "symbols": ["string", "_", "string_type$ebnf$1$subexpression$1$ebnf$1"]},554 {"name": "string_type$ebnf$1", "symbols": ["string_type$ebnf$1$subexpression$1"]},555 {"name": "string_type$ebnf$1$subexpression$2$ebnf$1$subexpression$1", "symbols": [{"literal":","}, "_"]},556 {"name": "string_type$ebnf$1$subexpression$2$ebnf$1", "symbols": ["string_type$ebnf$1$subexpression$2$ebnf$1$subexpression$1"], "postprocess": id},557 {"name": "string_type$ebnf$1$subexpression$2$ebnf$1", "symbols": [], "postprocess": function(d) {return null;}},558 {"name": "string_type$ebnf$1$subexpression$2", "symbols": ["string", "_", "string_type$ebnf$1$subexpression$2$ebnf$1"]},559 {"name": "string_type$ebnf$1", "symbols": ["string_type$ebnf$1", "string_type$ebnf$1$subexpression$2"], "postprocess": function arrpush(d) {return d[0].concat([d[1]]);}},560 {"name": "string_type", "symbols": ["string_type$subexpression$14", "_", {"literal":"("}, "_", "string_type$ebnf$1", "_", {"literal":")"}], "postprocess": 561 d => {562 return {563 type: 'ENUM',564 params: d[4].map(i => i[0]),565 };566 }567 },568 {"name": "string_type$subexpression$15", "symbols": [/[sS]/, /[eE]/, /[tT]/], "postprocess": function(d) {return d.join(""); }},569 {"name": "string_type$ebnf$2$subexpression$1$ebnf$1$subexpression$1", "symbols": [{"literal":","}, "_"]},570 {"name": "string_type$ebnf$2$subexpression$1$ebnf$1", "symbols": ["string_type$ebnf$2$subexpression$1$ebnf$1$subexpression$1"], "postprocess": id},571 {"name": "string_type$ebnf$2$subexpression$1$ebnf$1", "symbols": [], "postprocess": function(d) {return null;}},572 {"name": "string_type$ebnf$2$subexpression$1", "symbols": ["string", "_", "string_type$ebnf$2$subexpression$1$ebnf$1"]},573 {"name": "string_type$ebnf$2", "symbols": ["string_type$ebnf$2$subexpression$1"]},574 {"name": "string_type$ebnf$2$subexpression$2$ebnf$1$subexpression$1", "symbols": [{"literal":","}, "_"]},575 {"name": "string_type$ebnf$2$subexpression$2$ebnf$1", "symbols": ["string_type$ebnf$2$subexpression$2$ebnf$1$subexpression$1"], "postprocess": id},576 {"name": "string_type$ebnf$2$subexpression$2$ebnf$1", "symbols": [], "postprocess": function(d) {return null;}},577 {"name": "string_type$ebnf$2$subexpression$2", "symbols": ["string", "_", "string_type$ebnf$2$subexpression$2$ebnf$1"]},578 {"name": "string_type$ebnf$2", "symbols": ["string_type$ebnf$2", "string_type$ebnf$2$subexpression$2"], "postprocess": function arrpush(d) {return d[0].concat([d[1]]);}},579 {"name": "string_type", "symbols": ["string_type$subexpression$15", "_", {"literal":"("}, "_", "string_type$ebnf$2", "_", {"literal":")"}], "postprocess": 580 d => {581 return {582 type: 'SET',583 params: d[4].map(i => i[0]),584 };585 }586 },587 {"name": "spatial_data_type$subexpression$1", "symbols": [/[gG]/, /[eE]/, /[oO]/, /[mM]/, /[eE]/, /[tT]/, /[rR]/, /[yY]/], "postprocess": function(d) {return d.join(""); }},588 {"name": "spatial_data_type", "symbols": ["spatial_data_type$subexpression$1"], "postprocess": 589 d => {590 return {591 type: 'GEOMETRY',592 };593 }594 },595 {"name": "spatial_data_type$subexpression$2", "symbols": [/[pP]/, /[oO]/, /[iI]/, /[nN]/, /[tT]/], "postprocess": function(d) {return d.join(""); }},596 {"name": "spatial_data_type", "symbols": ["spatial_data_type$subexpression$2"], "postprocess": 597 d => {598 return {599 type: 'POINT',600 };601 }602 },603 {"name": "spatial_data_type$subexpression$3", "symbols": [/[lL]/, /[iI]/, /[nN]/, /[eE]/, /[sS]/, /[tT]/, /[rR]/, /[iI]/, /[nN]/, /[gG]/], "postprocess": function(d) {return d.join(""); }},604 {"name": "spatial_data_type", "symbols": ["spatial_data_type$subexpression$3"], "postprocess": 605 d => {606 return {607 type: 'LINESTRING',608 };609 }610 },611 {"name": "spatial_data_type$subexpression$4", "symbols": [/[pP]/, /[oO]/, /[lL]/, /[yY]/, /[gG]/, /[oO]/, /[nN]/], "postprocess": function(d) {return d.join(""); }},612 {"name": "spatial_data_type", "symbols": ["spatial_data_type$subexpression$4"], "postprocess": 613 d => {614 return {615 type: 'POLYGON',616 };617 }618 },619 {"name": "spatial_data_type$subexpression$5", "symbols": [/[mM]/, /[uU]/, /[lL]/, /[tT]/, /[iI]/, /[pP]/, /[oO]/, /[iI]/, /[nN]/, /[tT]/], "postprocess": function(d) {return d.join(""); }},620 {"name": "spatial_data_type", "symbols": ["spatial_data_type$subexpression$5"], "postprocess": 621 d => {622 return {623 type: 'MULTIPOINT',624 };625 }626 },627 {"name": "spatial_data_type$subexpression$6", "symbols": [/[mM]/, /[uU]/, /[lL]/, /[tT]/, /[iI]/, /[lL]/, /[iI]/, /[nN]/, /[eE]/, /[sS]/, /[tT]/, /[rR]/, /[iI]/, /[nN]/, /[gG]/], "postprocess": function(d) {return d.join(""); }},628 {"name": "spatial_data_type", "symbols": ["spatial_data_type$subexpression$6"], "postprocess": 629 d => {630 return {631 type: 'MULTILINESTRING',632 };633 }634 },635 {"name": "spatial_data_type$subexpression$7", "symbols": [/[mM]/, /[uU]/, /[lL]/, /[tT]/, /[iI]/, /[pP]/, /[oO]/, /[lL]/, /[yY]/, /[gG]/, /[oO]/, /[nN]/], "postprocess": function(d) {return d.join(""); }},636 {"name": "spatial_data_type", "symbols": ["spatial_data_type$subexpression$7"], "postprocess": 637 d => {638 return {639 type: 'MULTIPOLYGON',640 };641 }642 },643 {"name": "spatial_data_type$subexpression$8", "symbols": [/[gG]/, /[eE]/, /[oO]/, /[mM]/, /[eE]/, /[tT]/, /[rR]/, /[yY]/, /[cC]/, /[oO]/, /[lL]/, /[lL]/, /[eE]/, /[cC]/, /[tT]/, /[iI]/, /[oO]/, /[nN]/], "postprocess": function(d) {return d.join(""); }},644 {"name": "spatial_data_type", "symbols": ["spatial_data_type$subexpression$8"], "postprocess": 645 d => {646 return {647 type: 'GEOMETRYCOLLECTION',648 };649 }650 },651 {"name": "column_def$ebnf$1$subexpression$1", "symbols": ["__", "column_def_options"]},652 {"name": "column_def$ebnf$1", "symbols": ["column_def$ebnf$1$subexpression$1"], "postprocess": id},653 {"name": "column_def$ebnf$1", "symbols": [], "postprocess": function(d) {return null;}},654 {"name": "column_def", "symbols": ["field_name", "__", "data_type", "column_def$ebnf$1"], "postprocess": 655 d => {656 let allow_null = true;657 let auto_increment = false;658 let comment = '';659 let default_value = null;660 let on_update_current_timestamp = false;661 let charset = '';662 if (d[3] && d[3][1]) {663 for (let _item of d[3][1]) {664 const optionInfo = _item;665 if (optionInfo && optionInfo.key) {666 switch (optionInfo.key) {667 case 'NOT NULL': allow_null = !optionInfo.value; break;668 case 'AUTO_INCREMENT': auto_increment = optionInfo.value; break;669 case 'COMMENT': comment = optionInfo.value; break;670 case 'DEFAULT': default_value = optionInfo.value; break;671 case 'ON UPDATE CURRENT_TIMESTAMP': on_update_current_timestamp = optionInfo.value; break;672 case 'CHARSET': charset = optionInfo.value; break;673 }674 }675 }676 }677 const result = {678 type: 'column',679 name: d[0],680 data_type: d[2],681 allow_null,682 comment,683 };684 if (auto_increment) {685 result.auto_increment = auto_increment;686 }687 if (default_value !== null) {688 result.default_value = default_value;689 }690 if (on_update_current_timestamp) {691 result.on_update_current_timestamp = on_update_current_timestamp;692 }693 if (charset) {694 result.charset = charset;695 }696 return result;697 }698 },699 {"name": "column_def_options", "symbols": ["_", "column_def_option", "_"], "postprocess": d => [d[1]]},700 {"name": "column_def_options", "symbols": ["column_def_options", "__", "column_def_option"], "postprocess": d => d[0].concat(d[2])},701 {"name": "column_def_option", "symbols": ["field_not_null"], "postprocess": d => d[0]},702 {"name": "column_def_option", "symbols": ["field_auto_increment"], "postprocess": d => d[0]},703 {"name": "column_def_option", "symbols": ["field_comment"], "postprocess": d => d[0]},704 {"name": "column_def_option", "symbols": ["field_default_value"], "postprocess": d => d[0]},705 {"name": "column_def_option", "symbols": ["field_update_value"], "postprocess": d => d[0]},706 {"name": "column_def_option", "symbols": ["field_charset"], "postprocess": d => d[0]},707 {"name": "field_not_null$subexpression$1$subexpression$1", "symbols": [/[nN]/, /[oO]/, /[tT]/, {"literal":" "}, /[nN]/, /[uU]/, /[lL]/, /[lL]/], "postprocess": function(d) {return d.join(""); }},708 {"name": "field_not_null$subexpression$1", "symbols": ["field_not_null$subexpression$1$subexpression$1"]},709 {"name": "field_not_null$subexpression$1$subexpression$2", "symbols": [/[nN]/, /[uU]/, /[lL]/, /[lL]/], "postprocess": function(d) {return d.join(""); }},710 {"name": "field_not_null$subexpression$1", "symbols": ["field_not_null$subexpression$1$subexpression$2"]},711 {"name": "field_not_null", "symbols": ["field_not_null$subexpression$1"], "postprocess": 712 d => {713 return {714 key: 'NOT NULL',715 value: d[0][0] && d[0][0].toUpperCase() === 'NOT NULL',716 };717 }718 },719 {"name": "field_auto_increment$subexpression$1", "symbols": [/[aA]/, /[uU]/, /[tT]/, /[oO]/, {"literal":"_"}, /[iI]/, /[nN]/, /[cC]/, /[rR]/, /[eE]/, /[mM]/, /[eE]/, /[nN]/, /[tT]/], "postprocess": function(d) {return d.join(""); }},720 {"name": "field_auto_increment", "symbols": ["field_auto_increment$subexpression$1"], "postprocess": 721 d => {722 return {723 key: 'AUTO_INCREMENT',724 value: true,725 };726 }727 },728 {"name": "field_default_value$subexpression$1", "symbols": [/[dD]/, /[eE]/, /[fF]/, /[aA]/, /[uU]/, /[lL]/, /[tT]/], "postprocess": function(d) {return d.join(""); }},729 {"name": "field_default_value$subexpression$2", "symbols": ["decimal"]},730 {"name": "field_default_value$subexpression$2", "symbols": ["string"]},731 {"name": "field_default_value$subexpression$2$subexpression$1", "symbols": [/[cC]/, /[uU]/, /[rR]/, /[rR]/, /[eE]/, /[nN]/, /[tT]/, {"literal":"_"}, /[tT]/, /[iI]/, /[mM]/, /[eE]/, /[sS]/, /[tT]/, /[aA]/, /[mM]/, /[pP]/], "postprocess": function(d) {return d.join(""); }},732 {"name": "field_default_value$subexpression$2", "symbols": ["field_default_value$subexpression$2$subexpression$1"]},733 {"name": "field_default_value$subexpression$2$subexpression$2", "symbols": [/[nN]/, /[uU]/, /[lL]/, /[lL]/], "postprocess": function(d) {return d.join(""); }},734 {"name": "field_default_value$subexpression$2", "symbols": ["field_default_value$subexpression$2$subexpression$2"]},735 {"name": "field_default_value", "symbols": ["field_default_value$subexpression$1", "__", "field_default_value$subexpression$2"], "postprocess": 736 d => {737 return {738 key: 'DEFAULT',739 value: d[2][0],740 };741 }742 },743 {"name": "field_update_value$subexpression$1", "symbols": [/[oO]/, /[nN]/, {"literal":" "}, /[uU]/, /[pP]/, /[dD]/, /[aA]/, /[tT]/, /[eE]/, {"literal":" "}, /[cC]/, /[uU]/, /[rR]/, /[rR]/, /[eE]/, /[nN]/, /[tT]/, {"literal":"_"}, /[tT]/, /[iI]/, /[mM]/, /[eE]/, /[sS]/, /[tT]/, /[aA]/, /[mM]/, /[pP]/], "postprocess": function(d) {return d.join(""); }},744 {"name": "field_update_value", "symbols": ["field_update_value$subexpression$1"], "postprocess": 745 d => {746 return {747 key: 'ON UPDATE CURRENT_TIMESTAMP',748 value: true,749 };750 }751 },752 {"name": "field_charset$subexpression$1$subexpression$1", "symbols": [/[cC]/, /[hH]/, /[aA]/, /[rR]/, /[aA]/, /[cC]/, /[tT]/, /[eE]/, /[rR]/, {"literal":" "}, /[sS]/, /[eE]/, /[tT]/], "postprocess": function(d) {return d.join(""); }},753 {"name": "field_charset$subexpression$1", "symbols": ["field_charset$subexpression$1$subexpression$1"]},754 {"name": "field_charset$subexpression$1$subexpression$2", "symbols": [/[cC]/, /[hH]/, /[aA]/, /[rR]/, /[sS]/, /[eE]/, /[tT]/], "postprocess": function(d) {return d.join(""); }},755 {"name": "field_charset$subexpression$1", "symbols": ["field_charset$subexpression$1$subexpression$2"]},756 {"name": "field_charset", "symbols": ["field_charset$subexpression$1", "__", "word"], "postprocess": 757 d => {758 return {759 key: 'CHARSET',760 value: d[2],761 };762 }763 },764 {"name": "field_comment$subexpression$1", "symbols": [/[cC]/, /[oO]/, /[mM]/, /[mM]/, /[eE]/, /[nN]/, /[tT]/], "postprocess": function(d) {return d.join(""); }},765 {"name": "field_comment", "symbols": ["field_comment$subexpression$1", "__", "string"], "postprocess": 766 d => {767 return {768 key: 'COMMENT',769 value: d[2],770 };771 }772 },773 {"name": "create_definition_list", "symbols": ["_", "create_definition", "_"], "postprocess": d => [d[1]]},774 {"name": "create_definition_list", "symbols": ["create_definition_list", "_", {"literal":","}, "_", "create_definition"], "postprocess": 775 d => {776 return d[0].concat(d[4]) 777 }778 },779 {"name": "create_definition", "symbols": ["column_def"], "postprocess": d => d[0]},780 {"name": "create_definition", "symbols": ["primary_key"], "postprocess": d => d[0]},781 {"name": "create_definition", "symbols": ["index_key"], "postprocess": d => d[0]},782 {"name": "create_definition", "symbols": ["unique_key"], "postprocess": d => d[0]},783 {"name": "table_options", "symbols": ["_", "table_option", "_"], "postprocess": d => [d[1]]},784 {"name": "table_options", "symbols": ["table_options", "__", "table_option"], "postprocess": d => d[0].concat(d[2])},785 {"name": "table_option", "symbols": ["table_option_engine"], "postprocess": d => ({ key: 'ENGINE', value: d[0] })},786 {"name": "table_option", "symbols": ["table_option_auto_increment"], "postprocess": d => ({ key: 'AUTO_INCREMENT', value: d[0] })},787 {"name": "table_option", "symbols": ["table_option_charset"], "postprocess": d => ({ key: 'CHARSET', value: d[0] })},788 {"name": "table_option", "symbols": ["table_option_collate"], "postprocess": d => ({ key: 'COLLATE', value: d[0] })},789 {"name": "table_option", "symbols": ["table_option_comment"], "postprocess": d => ({ key: 'COMMENT', value: d[0] })},790 {"name": "table_option_engine$subexpression$1", "symbols": [/[eE]/, /[nN]/, /[gG]/, /[iI]/, /[nN]/, /[eE]/], "postprocess": function(d) {return d.join(""); }},791 {"name": "table_option_engine", "symbols": ["table_option_engine$subexpression$1", "_", {"literal":"="}, "_", "word"], "postprocess": d => d[4]},792 {"name": "table_option_auto_increment$subexpression$1", "symbols": [/[aA]/, /[uU]/, /[tT]/, /[oO]/, {"literal":"_"}, /[iI]/, /[nN]/, /[cC]/, /[rR]/, /[eE]/, /[mM]/, /[eE]/, /[nN]/, /[tT]/], "postprocess": function(d) {return d.join(""); }},793 {"name": "table_option_auto_increment", "symbols": ["table_option_auto_increment$subexpression$1", "_", {"literal":"="}, "_", "int"], "postprocess": d => d[4]},794 {"name": "table_option_charset$ebnf$1$subexpression$1$subexpression$1", "symbols": [/[dD]/, /[eE]/, /[fF]/, /[aA]/, /[uU]/, /[lL]/, /[tT]/], "postprocess": function(d) {return d.join(""); }},795 {"name": "table_option_charset$ebnf$1$subexpression$1", "symbols": ["table_option_charset$ebnf$1$subexpression$1$subexpression$1", "__"]},796 {"name": "table_option_charset$ebnf$1", "symbols": ["table_option_charset$ebnf$1$subexpression$1"], "postprocess": id},797 {"name": "table_option_charset$ebnf$1", "symbols": [], "postprocess": function(d) {return null;}},798 {"name": "table_option_charset$subexpression$1$subexpression$1", "symbols": [/[cC]/, /[hH]/, /[aA]/, /[rR]/, /[sS]/, /[eE]/, /[tT]/], "postprocess": function(d) {return d.join(""); }},799 {"name": "table_option_charset$subexpression$1", "symbols": ["table_option_charset$subexpression$1$subexpression$1"]},800 {"name": "table_option_charset$subexpression$1$subexpression$2", "symbols": [/[cC]/, /[hH]/, /[aA]/, /[rR]/, /[aA]/, /[cC]/, /[tT]/, /[eE]/, /[rR]/, {"literal":" "}, /[sS]/, /[eE]/, /[tT]/], "postprocess": function(d) {return d.join(""); }},801 {"name": "table_option_charset$subexpression$1", "symbols": ["table_option_charset$subexpression$1$subexpression$2"]},802 {"name": "table_option_charset", "symbols": ["table_option_charset$ebnf$1", "table_option_charset$subexpression$1", "_", {"literal":"="}, "_", "word"], "postprocess": d => d[5]},803 {"name": "table_option_collate$ebnf$1$subexpression$1$subexpression$1", "symbols": [/[dD]/, /[eE]/, /[fF]/, /[aA]/, /[uU]/, /[lL]/, /[tT]/], "postprocess": function(d) {return d.join(""); }},804 {"name": "table_option_collate$ebnf$1$subexpression$1", "symbols": ["table_option_collate$ebnf$1$subexpression$1$subexpression$1", "__"]},805 {"name": "table_option_collate$ebnf$1", "symbols": ["table_option_collate$ebnf$1$subexpression$1"], "postprocess": id},806 {"name": "table_option_collate$ebnf$1", "symbols": [], "postprocess": function(d) {return null;}},807 {"name": "table_option_collate$subexpression$1", "symbols": [/[cC]/, /[oO]/, /[lL]/, /[lL]/, /[aA]/, /[tT]/, /[eE]/], "postprocess": function(d) {return d.join(""); }},808 {"name": "table_option_collate", "symbols": ["table_option_collate$ebnf$1", "table_option_collate$subexpression$1", "_", {"literal":"="}, "_", "word"], "postprocess": d => d[5]},809 {"name": "table_option_comment$subexpression$1", "symbols": [/[cC]/, /[oO]/, /[mM]/, /[mM]/, /[eE]/, /[nN]/, /[tT]/], "postprocess": function(d) {return d.join(""); }},810 {"name": "table_option_comment", "symbols": ["table_option_comment$subexpression$1", "_", {"literal":"="}, "_", "string"], "postprocess": d => d[4]},811 {"name": "index_type$subexpression$1", "symbols": [/[uU]/, /[sS]/, /[iI]/, /[nN]/, /[gG]/], "postprocess": function(d) {return d.join(""); }},812 {"name": "index_type$subexpression$2$subexpression$1", "symbols": [/[bB]/, /[tT]/, /[rR]/, /[eE]/, /[eE]/], "postprocess": function(d) {return d.join(""); }},813 {"name": "index_type$subexpression$2", "symbols": ["index_type$subexpression$2$subexpression$1"]},814 {"name": "index_type$subexpression$2$subexpression$2", "symbols": [/[hH]/, /[aA]/, /[sS]/, /[hH]/], "postprocess": function(d) {return d.join(""); }},815 {"name": "index_type$subexpression$2", "symbols": ["index_type$subexpression$2$subexpression$2"]},816 {"name": "index_type", "symbols": ["_", "index_type$subexpression$1", "_", "index_type$subexpression$2", "_"], "postprocess": d => d[3]},817 {"name": "primary_key$subexpression$1", "symbols": [/[pP]/, /[rR]/, /[iI]/, /[mM]/, /[aA]/, /[rR]/, /[yY]/, {"literal":" "}, /[kK]/, /[eE]/, /[yY]/], "postprocess": function(d) {return d.join(""); }},818 {"name": "primary_key$ebnf$1", "symbols": ["index_type"], "postprocess": id},819 {"name": "primary_key$ebnf$1", "symbols": [], "postprocess": function(d) {return null;}},820 {"name": "primary_key$ebnf$2", "symbols": [{"literal":","}], "postprocess": id},821 {"name": "primary_key$ebnf$2", "symbols": [], "postprocess": function(d) {return null;}},822 {"name": "primary_key", "symbols": ["_", "primary_key$subexpression$1", "_", {"literal":"("}, "key_field_list", {"literal":")"}, "primary_key$ebnf$1", "_", "primary_key$ebnf$2"], "postprocess": 823 d => {824 return {825 type: 'primary_key',826 fields: d[4],827 };828 }829 },830 {"name": "index_key$subexpression$1", "symbols": [/[kK]/, /[eE]/, /[yY]/], "postprocess": function(d) {return d.join(""); }},831 {"name": "index_key$ebnf$1", "symbols": ["index_type"], "postprocess": id},832 {"name": "index_key$ebnf$1", "symbols": [], "postprocess": function(d) {return null;}},833 {"name": "index_key$ebnf$2", "symbols": [{"literal":","}], "postprocess": id},834 {"name": "index_key$ebnf$2", "symbols": [], "postprocess": function(d) {return null;}},835 {"name": "index_key", "symbols": ["_", "index_key$subexpression$1", "__", "field_name", "_", {"literal":"("}, "key_field_list", {"literal":")"}, "index_key$ebnf$1", "_", "index_key$ebnf$2"], "postprocess": 836 d => {837 return {838 type: 'index_key',839 name: d[3],840 fields: d[6],841 };842 }843 },844 {"name": "unique_key$subexpression$1", "symbols": [/[uU]/, /[nN]/, /[iI]/, /[qQ]/, /[uU]/, /[eE]/, {"literal":" "}, /[kK]/, /[eE]/, /[yY]/], "postprocess": function(d) {return d.join(""); }},845 {"name": "unique_key$ebnf$1", "symbols": ["index_type"], "postprocess": id},846 {"name": "unique_key$ebnf$1", "symbols": [], "postprocess": function(d) {return null;}},847 {"name": "unique_key$ebnf$2", "symbols": [{"literal":","}], "postprocess": id},848 {"name": "unique_key$ebnf$2", "symbols": [], "postprocess": function(d) {return null;}},849 {"name": "unique_key", "symbols": ["_", "unique_key$subexpression$1", "__", "field_name", "_", {"literal":"("}, "key_field_list", {"literal":")"}, "unique_key$ebnf$1", "_", "unique_key$ebnf$2"], "postprocess": 850 d => {851 return {852 type: 'unique_key',853 name: d[3],854 fields: d[6],855 };856 }857 },858 {"name": "key_field_list$ebnf$1$subexpression$1", "symbols": [{"literal":"("}, "_", "unsigned_int", "_", {"literal":")"}]},859 {"name": "key_field_list$ebnf$1", "symbols": ["key_field_list$ebnf$1$subexpression$1"], "postprocess": id},860 {"name": "key_field_list$ebnf$1", "symbols": [], "postprocess": function(d) {return null;}},861 {"name": "key_field_list", "symbols": ["_", "field_name", "key_field_list$ebnf$1", "_"], "postprocess": d => [d[1]]},862 {"name": "key_field_list", "symbols": ["key_field_list", "_", {"literal":","}, "_", "field_name"], "postprocess": 863 d => {864 return d[0].concat(d[4]);865 }866 },867 {"name": "main$ebnf$1", "symbols": ["P_CREATE_TABLE"]},868 {"name": "main$ebnf$1", "symbols": ["main$ebnf$1", "P_CREATE_TABLE"], "postprocess": function arrpush(d) {return d[0].concat([d[1]]);}},869 {"name": "main", "symbols": ["main$ebnf$1"], "postprocess": d => d[0]},870 {"name": "P_CREATE_TABLE$subexpression$1", "symbols": [/[cC]/, /[rR]/, /[eE]/, /[aA]/, /[tT]/, /[eE]/], "postprocess": function(d) {return d.join(""); }},871 {"name": "P_CREATE_TABLE$ebnf$1$subexpression$1$subexpression$1", "symbols": [/[tT]/, /[eE]/, /[mM]/, /[pP]/, /[oO]/, /[rR]/, /[aA]/, /[rR]/, /[yY]/], "postprocess": function(d) {return d.join(""); }},872 {"name": "P_CREATE_TABLE$ebnf$1$subexpression$1", "symbols": ["__", "P_CREATE_TABLE$ebnf$1$subexpression$1$subexpression$1"]},873 {"name": "P_CREATE_TABLE$ebnf$1", "symbols": ["P_CREATE_TABLE$ebnf$1$subexpression$1"], "postprocess": id},874 {"name": "P_CREATE_TABLE$ebnf$1", "symbols": [], "postprocess": function(d) {return null;}},875 {"name": "P_CREATE_TABLE$subexpression$2", "symbols": [/[tT]/, /[aA]/, /[bB]/, /[lL]/, /[eE]/], "postprocess": function(d) {return d.join(""); }},876 {"name": "P_CREATE_TABLE$ebnf$2$subexpression$1$subexpression$1", "symbols": [/[iI]/, /[fF]/, {"literal":" "}, /[nN]/, /[oO]/, /[tT]/, {"literal":" "}, /[eE]/, /[xX]/, /[iI]/, /[sS]/, /[tT]/, /[sS]/], "postprocess": function(d) {return d.join(""); }},877 {"name": "P_CREATE_TABLE$ebnf$2$subexpression$1", "symbols": ["__", "P_CREATE_TABLE$ebnf$2$subexpression$1$subexpression$1"]},878 {"name": "P_CREATE_TABLE$ebnf$2", "symbols": ["P_CREATE_TABLE$ebnf$2$subexpression$1"], "postprocess": id},879 {"name": "P_CREATE_TABLE$ebnf$2", "symbols": [], "postprocess": function(d) {return null;}},880 {"name": "P_CREATE_TABLE$ebnf$3", "symbols": ["table_options"], "postprocess": id},881 {"name": "P_CREATE_TABLE$ebnf$3", "symbols": [], "postprocess": function(d) {return null;}},882 {"name": "P_CREATE_TABLE$ebnf$4", "symbols": []},883 {"name": "P_CREATE_TABLE$ebnf$4", "symbols": ["P_CREATE_TABLE$ebnf$4", {"literal":";"}], "postprocess": function arrpush(d) {return d[0].concat([d[1]]);}},884 {"name": "P_CREATE_TABLE", "symbols": ["_", "P_CREATE_TABLE$subexpression$1", "P_CREATE_TABLE$ebnf$1", "__", "P_CREATE_TABLE$subexpression$2", "P_CREATE_TABLE$ebnf$2", "__", "table_name", "_", {"literal":"("}, "create_definition_list", {"literal":")"}, "P_CREATE_TABLE$ebnf$3", "_", "P_CREATE_TABLE$ebnf$4", "_"], "postprocess": 885 d => {886 return {887 type: 'create_table',888 name: d[7],889 columns: d[10],890 options: d[12],891 };892 }893 }894]895 , ParserStart: "main"896}897if (typeof module !== 'undefined'&& typeof module.exports !== 'undefined') {898 module.exports = grammar;899} else {900 window.grammar = grammar;901}...
tables.js
Source:tables.js
1// munged from https://osquery.io/docs/tables/#specs2export default [3 {4 "name": "acpi_tables",5 "description": "Firmware ACPI functional table common metadata and content.",6 "columns": [7 {"name": "name", "type": "TEXT_TYPE", "description": "ACPI table name"}8 {"name": "size", "type": "INTEGER_TYPE", "description": "Size of compiled table data"}9 {"name": "md5", "type": "TEXT_TYPE", "description": "MD5 hash of table content"}10 ]11 },12 {13 "name": "arp_cache",14 "description": "Address resolution cache, both static and dynamic (from ARP, NDP).",15 "columns": [16 {"name": "address", "type": "TEXT_TYPE", "description": "IPv4 address target"}17 {"name": "mac", "type": "TEXT_TYPE", "description": "MAC address of broadcasted address"}18 {"name": "interface", "type": "TEXT_TYPE", "description": "Interface of the network for the MAC"}19 {"name": "permanent", "type": "TEXT_TYPE", "description": "1 for true, 0 for false"}20 ]21 },22 {23 "name": "authorized_keys",24 "description": "A line-delimited authorized_keys table.",25 "columns": [26 {"name": "uid", "type": "BIGINT_TYPE", "description": "The local owner of authorized_keys file"}27 {"name": "algorithm", "type": "TEXT_TYPE", "description": "algorithim of key"}28 {"name": "key", "type": "TEXT_TYPE", "description": "parsed authorized keys line"}29 {"name": "key_file", "type": "TEXT_TYPE", "description": "Path to the authorized_keys file"}30 ]31 },32 {33 "name": "block_devices",34 "description": "Block (buffered access) device file nodes: disks, ramdisks, and DMG containers.",35 "columns": [36 {"name": "name", "type": "TEXT_TYPE", "description": "Block device name"}37 {"name": "parent", "type": "TEXT_TYPE", "description": "Block device parent name"}38 {"name": "vendor", "type": "TEXT_TYPE", "description": "Block device vendor string"}39 {"name": "model", "type": "TEXT_TYPE", "description": "Block device model string identifier"}40 {"name": "size", "type": "BIGINT_TYPE", "description": "Block device size in bytes"}41 {"name": "uuid", "type": "TEXT_TYPE", "description": "Block device Universally Unique Identifier"}42 {"name": "type", "type": "TEXT_TYPE", "description": "Block device type string"}43 {"name": "label", "type": "TEXT_TYPE", "description": "Block device label string"}44 ]45 },46 {47 "name": "chrome_extensions",48 "description": "Chrome browser extensions.",49 "columns": [50 {"name": "uid", "type": "BIGINT_TYPE", "description": "The local user that owns the extension"}51 {"name": "name", "type": "TEXT_TYPE", "description": "Extension display name"}52 {"name": "identifier", "type": "TEXT_TYPE", "description": "Extension identifier"}53 {"name": "version", "type": "TEXT_TYPE", "description": "Extension-supplied version"}54 {"name": "description", "type": "TEXT_TYPE", "description": "Extension-optional description"}55 {"name": "locale", "type": "TEXT_TYPE", "description": "Default locale supported by extension"}56 {"name": "update_url", "type": "TEXT_TYPE", "description": "Extension-supplied update URI"}57 {"name": "author", "type": "TEXT_TYPE", "description": "Optional extension author"}58 {"name": "persistent", "type": "INTEGER_TYPE", "description": "1 If extension is persistent across all tabs else 0"}59 {"name": "path", "type": "TEXT_TYPE", "description": "Path to extension folder"}60 ]61 },62 {63 "name": "cpuid",64 "description": "Useful CPU features from the cpuid ASM call.",65 "columns": [66 {"name": "feature", "type": "TEXT_TYPE", "description": "Present feature flags"}67 {"name": "value", "type": "TEXT_TYPE", "description": "Bit value or string"}68 {"name": "output_register", "type": "TEXT_TYPE", "description": "Register used to for feature value"}69 {"name": "output_bit", "type": "INTEGER_TYPE", "description": "Bit in register value for feature value"}70 {"name": "input_eax", "type": "TEXT_TYPE", "description": "Value of EAX used"}71 ]72 },73 {74 "name": "crontab",75 "description": "Line parsed values from system and user cron/tab.",76 "columns": [77 {"name": "event", "type": "TEXT_TYPE", "description": "The job @event name (rare)"}78 {"name": "minute", "type": "TEXT_TYPE", "description": "The exact minute for the job"}79 {"name": "hour", "type": "TEXT_TYPE", "description": "The hour of the day for the job"}80 {"name": "day_of_month", "type": "TEXT_TYPE", "description": "The day of the month for the job"}81 {"name": "month", "type": "TEXT_TYPE", "description": "The month of the year for the job"}82 {"name": "day_of_week", "type": "TEXT_TYPE", "description": "The day of the week for the job"}83 {"name": "command", "type": "TEXT_TYPE", "description": "Raw command string"}84 {"name": "path", "type": "TEXT_TYPE", "description": "File parsed"}85 ]86 },87 {88 "name": "device_file",89 "description": "Similar to the file table, but use TSK and allow block address access.",90 "columns": [91 {"name": "device", "type": "TEXT_TYPE", "description": "Absolute file path to device node"}92 {"name": "partition", "type": "TEXT_TYPE", "description": "A partition number"}93 {"name": "path", "type": "TEXT_TYPE", "description": "A logical path within the device node"}94 {"name": "filename", "type": "TEXT_TYPE", "description": "Name portion of file path"}95 {"name": "inode", "type": "BIGINT_TYPE", "description": "Filesystem inode number"}96 {"name": "uid", "type": "BIGINT_TYPE", "description": "Owning user ID"}97 {"name": "gid", "type": "BIGINT_TYPE", "description": "Owning group ID"}98 {"name": "mode", "type": "TEXT_TYPE", "description": "Permission bits"}99 {"name": "size", "type": "BIGINT_TYPE", "description": "Size of file in bytes"}100 {"name": "block_size", "type": "INTEGER_TYPE", "description": "Block size of filesystem"}101 {"name": "atime", "type": "BIGINT_TYPE", "description": "Last access time"}102 {"name": "mtime", "type": "BIGINT_TYPE", "description": "Last modification time"}103 {"name": "ctime", "type": "BIGINT_TYPE", "description": "Creation time"}104 {"name": "hard_links", "type": "INTEGER_TYPE", "description": "Number of hard links"}105 {"name": "type", "type": "TEXT_TYPE", "description": "File status"}106 ]107 },108 {109 "name": "device_hash",110 "description": "Similar to the hash table, but use TSK and allow block address access.",111 "columns": [112 {"name": "device", "type": "TEXT_TYPE", "description": "Absolute file path to device node"}113 {"name": "partition", "type": "TEXT_TYPE", "description": "A partition number"}114 {"name": "inode", "type": "BIGINT_TYPE", "description": "Filesystem inode number"}115 {"name": "md5", "type": "TEXT_TYPE", "description": "MD5 hash of provided inode data"}116 {"name": "sha1", "type": "TEXT_TYPE", "description": "SHA1 hash of provided inode data"}117 {"name": "sha256", "type": "TEXT_TYPE", "description": "SHA256 hash of provided inode data"}118 ]119 },120 {121 "name": "device_partitions",122 "description": "Use TSK to enumerate details about partitions on a disk device.",123 "columns": [124 {"name": "device", "type": "TEXT_TYPE", "description": "Absolute file path to device node"}125 {"name": "partition", "type": "INTEGER_TYPE", "description": "A partition number or description"}126 {"name": "label", "type": "TEXT_TYPE", "description": ""}127 {"name": "type", "type": "TEXT_TYPE", "description": ""}128 {"name": "offset", "type": "BIGINT_TYPE", "description": ""}129 {"name": "blocks_size", "type": "BIGINT_TYPE", "description": "Byte size of each block"}130 {"name": "blocks", "type": "BIGINT_TYPE", "description": "Number of blocks"}131 {"name": "inodes", "type": "BIGINT_TYPE", "description": "Number of meta nodes"}132 {"name": "flags", "type": "INTEGER_TYPE", "description": ""}133 ]134 },135 {136 "name": "disk_encryption",137 "description": "Disk Encryption",138 "columns": [139 {"name": "name", "type": "TEXT_TYPE", "description": "Disk name"}140 {"name": "uuid", "type": "TEXT_TYPE", "description": "Disk Universally Unique Identifier"}141 {"name": "encrypted", "type": "INTEGER_TYPE", "description": "1 If encrypted: true (disk is encrypted), else 0"}142 {"name": "type", "type": "TEXT_TYPE", "description": "Description of cipher type and mode if available"}143 ]144 },145 {146 "name": "etc_hosts",147 "description": "Line-parsed /etc/hosts.",148 "columns": [149 {"name": "address", "type": "TEXT_TYPE", "description": "IP address mapping"}150 {"name": "hostnames", "type": "TEXT_TYPE", "description": "Raw hosts mapping"}151 ]152 },153 {154 "name": "etc_protocols",155 "description": "Line-parsed /etc/protocols.",156 "columns": [157 {"name": "name", "type": "TEXT_TYPE", "description": "Protocol name"}158 {"name": "number", "type": "INTEGER_TYPE", "description": "Protocol number"}159 {"name": "alias", "type": "TEXT_TYPE", "description": "Protocol alias"}160 {"name": "comment", "type": "TEXT_TYPE", "description": "Comment with protocol description"}161 ]162 },163 {164 "name": "etc_services",165 "description": "Line-parsed /etc/services.",166 "columns": [167 {"name": "name", "type": "TEXT_TYPE", "description": "Service name"}168 {"name": "port", "type": "INTEGER_TYPE", "description": "Service port number"}169 {"name": "protocol", "type": "TEXT_TYPE", "description": "Transport protocol (TCP/UDP)"}170 {"name": "aliases", "type": "TEXT_TYPE", "description": "Optional space separated list of other names for a service"}171 {"name": "comment", "type": "TEXT_TYPE", "description": "Optional comment for a service."}172 ]173 },174 {175 "name": "file_events",176 "description": "Track time/action changes to files specified in configuration data.",177 "columns": [178 {"name": "target_path", "type": "TEXT_TYPE", "description": "The path associated with the event"}179 {"name": "category", "type": "TEXT_TYPE", "description": "The category of the file defined in the config"}180 {"name": "action", "type": "TEXT_TYPE", "description": "Change action (UPDATE, REMOVE, etc)"}181 {"name": "transaction_id", "type": "BIGINT_TYPE", "description": "ID used during bulk update"}182 {"name": "inode", "type": "BIGINT_TYPE", "description": "Filesystem inode number"}183 {"name": "uid", "type": "BIGINT_TYPE", "description": "Owning user ID"}184 {"name": "gid", "type": "BIGINT_TYPE", "description": "Owning group ID"}185 {"name": "mode", "type": "TEXT_TYPE", "description": "Permission bits"}186 {"name": "size", "type": "BIGINT_TYPE", "description": "Size of file in bytes"}187 {"name": "atime", "type": "BIGINT_TYPE", "description": "Last access time"}188 {"name": "mtime", "type": "BIGINT_TYPE", "description": "Last modification time"}189 {"name": "ctime", "type": "BIGINT_TYPE", "description": "Last status change time"}190 {"name": "md5", "type": "TEXT_TYPE", "description": "The MD5 of the file after change"}191 {"name": "sha1", "type": "TEXT_TYPE", "description": "The SHA1 of the file after change"}192 {"name": "sha256", "type": "TEXT_TYPE", "description": "The SHA256 of the file after change"}193 {"name": "hashed", "type": "INTEGER_TYPE", "description": "1 if the file was hashed, 0 if not, -1 if hashing failed"}194 {"name": "time", "type": "BIGINT_TYPE", "description": "Time of file event"}195 ]196 },197 {198 "name": "firefox_addons",199 "description": "Firefox browser extensions, webapps, and addons.",200 "columns": [201 {"name": "uid", "type": "BIGINT_TYPE", "description": "The local user that owns the addon"}202 {"name": "name", "type": "TEXT_TYPE", "description": "Addon display name"}203 {"name": "identifier", "type": "TEXT_TYPE", "description": "Addon identifier"}204 {"name": "creator", "type": "TEXT_TYPE", "description": "Addon-supported creator string"}205 {"name": "type", "type": "TEXT_TYPE", "description": "Extension, addon, webapp"}206 {"name": "version", "type": "TEXT_TYPE", "description": "Addon-supplied version string"}207 {"name": "description", "type": "TEXT_TYPE", "description": "Addon-supplied description string"}208 {"name": "source_url", "type": "TEXT_TYPE", "description": "URL that installed the addon"}209 {"name": "visible", "type": "INTEGER_TYPE", "description": "1 If the addon is shown in browser else 0"}210 {"name": "active", "type": "INTEGER_TYPE", "description": "1 If the addon is active else 0"}211 {"name": "disabled", "type": "INTEGER_TYPE", "description": "1 If the addon is application-disabled else 0"}212 {"name": "autoupdate", "type": "INTEGER_TYPE", "description": "1 If the addon applies background updates else 0"}213 {"name": "native", "type": "INTEGER_TYPE", "description": "1 If the addon includes binary components else 0"}214 {"name": "location", "type": "TEXT_TYPE", "description": "Global, profile location"}215 {"name": "path", "type": "TEXT_TYPE", "description": "Path to plugin bundle"}216 ]217 },218 {219 "name": "groups",220 "description": "Local system groups.",221 "columns": [222 {"name": "gid", "type": "BIGINT_TYPE", "description": "Unsigned int64 group ID"}223 {"name": "gid_signed", "type": "BIGINT_TYPE", "description": "A signed int64 version of gid"}224 {"name": "groupname", "type": "TEXT_TYPE", "description": "Canonical local group name"}225 ]226 },227 {228 "name": "hardware_events",229 "description": "Hardware (PCI/USB/HID) events from UDEV or IOKit.",230 "columns": [231 {"name": "action", "type": "TEXT_TYPE", "description": "Remove, insert, change properties, etc"}232 {"name": "path", "type": "TEXT_TYPE", "description": "Local device path assigned (optional)"}233 {"name": "type", "type": "TEXT_TYPE", "description": "Type of hardware and hardware event"}234 {"name": "driver", "type": "TEXT_TYPE", "description": "Driver claiming the device"}235 {"name": "vendor", "type": "TEXT_TYPE", "description": "Hardware device vendor"}236 {"name": "vendor_id", "type": "TEXT_TYPE", "description": "Hex encoded Hardware vendor identifier"}237 {"name": "model", "type": "TEXT_TYPE", "description": "Hardware device model"}238 {"name": "model_id", "type": "TEXT_TYPE", "description": "Hex encoded Hardware model identifier"}239 {"name": "serial", "type": "TEXT_TYPE", "description": "Device serial (optional)"}240 {"name": "revision", "type": "TEXT_TYPE", "description": "Device revision (optional)"}241 {"name": "time", "type": "BIGINT_TYPE", "description": "Time of hardware event"}242 ]243 },244 {245 "name": "interface_addresses",246 "description": "Network interfaces and relevant metadata.",247 "columns": [248 {"name": "interface", "type": "TEXT_TYPE", "description": "Interface name"}249 {"name": "address", "type": "TEXT_TYPE", "description": "Specific address for interface"}250 {"name": "mask", "type": "TEXT_TYPE", "description": "Interface netmask"}251 {"name": "broadcast", "type": "TEXT_TYPE", "description": "Broadcast address for the interface"}252 {"name": "point_to_point", "type": "TEXT_TYPE", "description": "PtP address for the interface"}253 ]254 },255 {256 "name": "interface_details",257 "description": "Detailed information and stats of network interfaces.",258 "columns": [259 {"name": "interface", "type": "TEXT_TYPE", "description": "Interface name"}260 {"name": "mac", "type": "TEXT_TYPE", "description": "MAC of interface (optional)"}261 {"name": "type", "type": "INTEGER_TYPE", "description": "Interface type (includes virtual)"}262 {"name": "mtu", "type": "INTEGER_TYPE", "description": "Network MTU"}263 {"name": "metric", "type": "INTEGER_TYPE", "description": "Metric based on the speed of the interface"}264 {"name": "ipackets", "type": "BIGINT_TYPE", "description": "Input packets"}265 {"name": "opackets", "type": "BIGINT_TYPE", "description": "Output packets"}266 {"name": "ibytes", "type": "BIGINT_TYPE", "description": "Input bytes"}267 {"name": "obytes", "type": "BIGINT_TYPE", "description": "Output bytes"}268 {"name": "ierrors", "type": "BIGINT_TYPE", "description": "Input errors"}269 {"name": "oerrors", "type": "BIGINT_TYPE", "description": "Output errors"}270 {"name": "last_change", "type": "BIGINT_TYPE", "description": "Time of last device modification (optional)"}271 ]272 },273 {274 "name": "kernel_info",275 "description": "Basic active kernel information.",276 "columns": [277 {"name": "version", "type": "TEXT_TYPE", "description": "Kernel version"}278 {"name": "arguments", "type": "TEXT_TYPE", "description": "Kernel arguments"}279 {"name": "path", "type": "TEXT_TYPE", "description": "Kernel path"}280 {"name": "device", "type": "TEXT_TYPE", "description": "Kernel device identifier"}281 ]282 },283 {284 "name": "known_hosts",285 "description": "A line-delimited known_hosts table.",286 "columns": [287 {"name": "uid", "type": "BIGINT_TYPE", "description": "The local user that owns the known_hosts file"}288 {"name": "key", "type": "TEXT_TYPE", "description": "parsed authorized keys line"}289 {"name": "key_file", "type": "TEXT_TYPE", "description": "Path to known_hosts file"}290 ]291 },292 {293 "name": "last",294 "description": "System logins and logouts.",295 "columns": [296 {"name": "username", "type": "TEXT_TYPE", "description": "Entry username"}297 {"name": "tty", "type": "TEXT_TYPE", "description": "Entry terminal"}298 {"name": "pid", "type": "INTEGER_TYPE", "description": "Process (or thread) ID"}299 {"name": "type", "type": "INTEGER_TYPE", "description": "Entry type, according to ut_type types (utmp.h)"}300 {"name": "time", "type": "INTEGER_TYPE", "description": "Entry timestamp"}301 {"name": "host", "type": "TEXT_TYPE", "description": "Entry hostname"}302 ]303 },304 {305 "name": "listening_ports",306 "description": "Processes with listening (bound) network sockets/ports.",307 "columns": [308 {"name": "pid", "type": "INTEGER_TYPE", "description": "Process (or thread) ID"}309 {"name": "port", "type": "INTEGER_TYPE", "description": "Transport layer port"}310 {"name": "protocol", "type": "INTEGER_TYPE", "description": "Transport protocol (TCP/UDP)"}311 {"name": "family", "type": "INTEGER_TYPE", "description": "Network protocol (IPv4, IPv6)"}312 {"name": "address", "type": "TEXT_TYPE", "description": "Specific address for bind"}313 ]314 },315 {316 "name": "logged_in_users",317 "description": "Users with an active shell on the system.",318 "columns": [319 {"name": "user", "type": "TEXT_TYPE", "description": "User login name"}320 {"name": "tty", "type": "TEXT_TYPE", "description": "Device name"}321 {"name": "host", "type": "TEXT_TYPE", "description": "Remote hostname"}322 {"name": "time", "type": "INTEGER_TYPE", "description": "Time entry was made"}323 {"name": "pid", "type": "INTEGER_TYPE", "description": "Process (or thread) ID"}324 ]325 },326 {327 "name": "magic",328 "description": "Magic number recognition library table.",329 "columns": [330 {"name": "path", "type": "TEXT_TYPE", "description": "Absolute path to target file"}331 {"name": "data", "type": "TEXT_TYPE", "description": "Magic number data from libmagic"}332 {"name": "mime_type", "type": "TEXT_TYPE", "description": "MIME type data from libmagic"}333 {"name": "mime_encoding", "type": "TEXT_TYPE", "description": "MIME encoding data from libmagic"}334 ]335 },336 {337 "name": "mounts",338 "description": "System mounted devices and filesystems (not process specific).",339 "columns": [340 {"name": "device", "type": "TEXT_TYPE", "description": "Mounted device"}341 {"name": "device_alias", "type": "TEXT_TYPE", "description": "Mounted device alias"}342 {"name": "path", "type": "TEXT_TYPE", "description": "Mounted device path"}343 {"name": "type", "type": "TEXT_TYPE", "description": "Mounted device type"}344 {"name": "blocks_size", "type": "BIGINT_TYPE", "description": "Block size in bytes"}345 {"name": "blocks", "type": "BIGINT_TYPE", "description": "Mounted device used blocks"}346 {"name": "blocks_free", "type": "BIGINT_TYPE", "description": "Mounted device free blocks"}347 {"name": "blocks_available", "type": "BIGINT_TYPE", "description": "Mounted device available blocks"}348 {"name": "inodes", "type": "BIGINT_TYPE", "description": "Mounted device used inodes"}349 {"name": "inodes_free", "type": "BIGINT_TYPE", "description": "Mounted device free inodes"}350 {"name": "flags", "type": "TEXT_TYPE", "description": "Mounted device flags"}351 ]352 },353 {354 "name": "opera_extensions",355 "description": "Opera browser extensions.",356 "columns": [357 {"name": "uid", "type": "BIGINT_TYPE", "description": "The local user that owns the extension"}358 {"name": "name", "type": "TEXT_TYPE", "description": "Extension display name"}359 {"name": "identifier", "type": "TEXT_TYPE", "description": "Extension identifier"}360 {"name": "version", "type": "TEXT_TYPE", "description": "Extension-supplied version"}361 {"name": "description", "type": "TEXT_TYPE", "description": "Extension-optional description"}362 {"name": "locale", "type": "TEXT_TYPE", "description": "Default locale supported by extension"}363 {"name": "update_url", "type": "TEXT_TYPE", "description": "Extension-supplied update URI"}364 {"name": "author", "type": "TEXT_TYPE", "description": "Optional extension author"}365 {"name": "persistent", "type": "INTEGER_TYPE", "description": "1 If extension is persistent across all tabs else 0"}366 {"name": "path", "type": "TEXT_TYPE", "description": "Path to extension folder"}367 ]368 },369 {370 "name": "os_version",371 "description": "A single row containing the operating system name and version.",372 "columns": [373 {"name": "name", "type": "TEXT_TYPE", "description": "Distribution or product name"}374 {"name": "major", "type": "INTEGER_TYPE", "description": "Major release version"}375 {"name": "minor", "type": "INTEGER_TYPE", "description": "Minor release version"}376 {"name": "patch", "type": "INTEGER_TYPE", "description": "Optional patch release"}377 {"name": "build", "type": "TEXT_TYPE", "description": "Optional build-specific or variant string"}378 ]379 },380 {381 "name": "pci_devices",382 "description": "PCI devices active on the host system.",383 "columns": [384 {"name": "pci_slot", "type": "TEXT_TYPE", "description": "PCI Device used slot"}385 {"name": "pci_class", "type": "TEXT_TYPE", "description": "PCI Device class"}386 {"name": "driver", "type": "TEXT_TYPE", "description": "PCI Device used driver"}387 {"name": "vendor", "type": "TEXT_TYPE", "description": "PCI Device vendor"}388 {"name": "vendor_id", "type": "TEXT_TYPE", "description": "Hex encoded PCI Device vendor identifier"}389 {"name": "model", "type": "TEXT_TYPE", "description": "PCI Device model"}390 {"name": "model_id", "type": "TEXT_TYPE", "description": "Hex encoded PCI Device model identifier"}391 ]392 },393 {394 "name": "platform_info",395 "description": "Information about EFI/UEFI/ROM and platform/boot.",396 "columns": [397 {"name": "vendor", "type": "TEXT_TYPE", "description": "Platform code vendor"}398 {"name": "version", "type": "TEXT_TYPE", "description": "Platform code version"}399 {"name": "date", "type": "TEXT_TYPE", "description": "Self-reported platform code update date"}400 {"name": "revision", "type": "TEXT_TYPE", "description": "BIOS major and minor revision"}401 {"name": "address", "type": "TEXT_TYPE", "description": "Relative address of firmware mapping"}402 {"name": "size", "type": "TEXT_TYPE", "description": "Size in bytes of firmware"}403 {"name": "volume_size", "type": "INTEGER_TYPE", "description": "(Optional) size of firmware volume"}404 {"name": "extra", "type": "TEXT_TYPE", "description": "Platform-specific additional information"}405 ]406 },407 {408 "name": "process_envs",409 "description": "A key/value table of environment variables for each process.",410 "columns": [411 {"name": "pid", "type": "INTEGER_TYPE", "description": "Process (or thread) ID"}412 {"name": "key", "type": "TEXT_TYPE", "description": "Environment variable name"}413 {"name": "value", "type": "TEXT_TYPE", "description": "Environment variable value"}414 ]415 },416 {417 "name": "process_events",418 "description": "Track time/action process executions.",419 "columns": [420 {"name": "pid", "type": "BIGINT_TYPE", "description": "Process (or thread) ID"}421 {"name": "path", "type": "TEXT_TYPE", "description": "Path of executed file"}422 {"name": "mode", "type": "BIGINT_TYPE", "description": "File mode permissions"}423 {"name": "cmdline", "type": "TEXT_TYPE", "description": "Command line arguments (argv)"}424 {"name": "cmdline_size", "type": "BIGINT_TYPE", "description": "Actual size (bytes) of command line arguments"}425 {"name": "environment", "type": "TEXT_TYPE", "description": "Environment variables delimited by spaces"}426 {"name": "environment_count", "type": "BIGINT_TYPE", "description": "Number of environment variables"}427 {"name": "environment_size", "type": "BIGINT_TYPE", "description": "Actual size (bytes) of environment list"}428 {"name": "uid", "type": "BIGINT_TYPE", "description": "User ID at process start"}429 {"name": "euid", "type": "BIGINT_TYPE", "description": "Effective user ID at process start"}430 {"name": "gid", "type": "BIGINT_TYPE", "description": "Group ID at process start"}431 {"name": "egid", "type": "BIGINT_TYPE", "description": "Effective group ID at process start"}432 {"name": "owner_uid", "type": "BIGINT_TYPE", "description": "File owner user ID"}433 {"name": "owner_gid", "type": "BIGINT_TYPE", "description": "File owner group ID"}434 {"name": "create_time", "type": "BIGINT_TYPE", "description": "File creation in UNIX time"}435 {"name": "access_time", "type": "BIGINT_TYPE", "description": "File last access in UNIX time"}436 {"name": "modify_time", "type": "BIGINT_TYPE", "description": "File modification in UNIX time"}437 {"name": "change_time", "type": "BIGINT_TYPE", "description": "File last metadata change in UNIX time"}438 {"name": "overflows", "type": "TEXT_TYPE", "description": "List of structures that overflowed"}439 {"name": "parent", "type": "BIGINT_TYPE", "description": "Process parent's PID"}440 {"name": "time", "type": "BIGINT_TYPE", "description": "Time of execution in UNIX time"}441 {"name": "uptime", "type": "BIGINT_TYPE", "description": "Time of execution in system uptime"}442 ]443 },444 {445 "name": "process_memory_map",446 "description": "Process memory mapped files and pseudo device/regions.",447 "columns": [448 {"name": "pid", "type": "INTEGER_TYPE", "description": "Process (or thread) ID"}449 {"name": "start", "type": "TEXT_TYPE", "description": "Virtual start address (hex)"}450 {"name": "end", "type": "TEXT_TYPE", "description": "Virtual end address (hex)"}451 {"name": "permissions", "type": "TEXT_TYPE", "description": "r=read, w=write, x=execute, p=private (cow)"}452 {"name": "offset", "type": "BIGINT_TYPE", "description": "Offset into mapped path"}453 {"name": "device", "type": "TEXT_TYPE", "description": "MA:MI Major/minor device ID"}454 {"name": "inode", "type": "INTEGER_TYPE", "description": "Mapped path inode, 0 means uninitialized (BSS)"}455 {"name": "path", "type": "TEXT_TYPE", "description": "Path to mapped file or mapped type"}456 {"name": "pseudo", "type": "INTEGER_TYPE", "description": "1 If path is a pseudo path, else 0"}457 ]458 },459 {460 "name": "process_open_files",461 "description": "File descriptors for each process.",462 "columns": [463 {"name": "pid", "type": "BIGINT_TYPE", "description": "Process (or thread) ID"}464 {"name": "fd", "type": "BIGINT_TYPE", "description": "Process-specific file descriptor number"}465 {"name": "path", "type": "TEXT_TYPE", "description": "Filesystem path of descriptor"}466 ]467 },468 {469 "name": "process_open_sockets",470 "description": "Processes which have open network sockets on the system.",471 "columns": [472 {"name": "pid", "type": "INTEGER_TYPE", "description": "Process (or thread) ID"}473 {"name": "fd", "type": "BIGINT_TYPE", "description": "Socket file descriptor number"}474 {"name": "socket", "type": "BIGINT_TYPE", "description": "Socket handle or inode number"}475 {"name": "family", "type": "INTEGER_TYPE", "description": "Network protocol (IPv4, IPv6)"}476 {"name": "protocol", "type": "INTEGER_TYPE", "description": "Transport protocol (TCP/UDP)"}477 {"name": "local_address", "type": "TEXT_TYPE", "description": "Socket local address"}478 {"name": "remote_address", "type": "TEXT_TYPE", "description": "Socket remote address"}479 {"name": "local_port", "type": "INTEGER_TYPE", "description": "Socket local port"}480 {"name": "remote_port", "type": "INTEGER_TYPE", "description": "Socket remote port"}481 {"name": "path", "type": "TEXT_TYPE", "description": "For UNIX sockets (family=AF_UNIX), the domain path"}482 ]483 },484 {485 "name": "processes",486 "description": "All running processes on the host system.",487 "columns": [488 {"name": "pid", "type": "BIGINT_TYPE", "description": "Process (or thread) ID"}489 {"name": "name", "type": "TEXT_TYPE", "description": "The process path or shorthand argv[0]"}490 {"name": "path", "type": "TEXT_TYPE", "description": "Path to executed binary"}491 {"name": "cmdline", "type": "TEXT_TYPE", "description": "Complete argv"}492 {"name": "state", "type": "TEXT_TYPE", "description": "Process state"}493 {"name": "cwd", "type": "TEXT_TYPE", "description": "Process current working directory"}494 {"name": "root", "type": "TEXT_TYPE", "description": "Process virtual root directory"}495 {"name": "uid", "type": "BIGINT_TYPE", "description": "Unsigned user ID"}496 {"name": "gid", "type": "BIGINT_TYPE", "description": "Unsigned group ID"}497 {"name": "euid", "type": "BIGINT_TYPE", "description": "Unsigned effective user ID"}498 {"name": "egid", "type": "BIGINT_TYPE", "description": "Unsigned effective group ID"}499 {"name": "suid", "type": "BIGINT_TYPE", "description": "Unsigned saved user ID"}500 {"name": "sgid", "type": "BIGINT_TYPE", "description": "Unsigned saved group ID"}501 {"name": "on_disk", "type": "INTEGER_TYPE", "description": "The process path exists yes=1, no=0, unknown=-1"}502 {"name": "wired_size", "type": "BIGINT_TYPE", "description": "Bytes of unpagable memory used by process"}503 {"name": "resident_size", "type": "BIGINT_TYPE", "description": "Bytes of private memory used by process"}504 {"name": "phys_footprint", "type": "BIGINT_TYPE", "description": "Bytes of total physical memory used"}505 {"name": "user_time", "type": "BIGINT_TYPE", "description": "CPU time spent in user space"}506 {"name": "system_time", "type": "BIGINT_TYPE", "description": "CPU time spent in kernel space"}507 {"name": "start_time", "type": "BIGINT_TYPE", "description": "Process start in seconds since boot (non-sleeping)"}508 {"name": "parent", "type": "BIGINT_TYPE", "description": "Process parent's PID"}509 {"name": "group", "type": "BIGINT_TYPE", "description": "Process group"}510 {"name": "nice", "type": "INTEGER_TYPE", "description": "Process nice level (-20 to 20, default 0)"}511 ]512 },513 {514 "name": "routes",515 "description": "The active route table for the host system.",516 "columns": [517 {"name": "destination", "type": "TEXT_TYPE", "description": "Destination IP address"}518 {"name": "netmask", "type": "TEXT_TYPE", "description": "Netmask length"}519 {"name": "gateway", "type": "TEXT_TYPE", "description": "Route gateway"}520 {"name": "source", "type": "TEXT_TYPE", "description": "Route source"}521 {"name": "flags", "type": "INTEGER_TYPE", "description": "Flags to describe route"}522 {"name": "interface", "type": "TEXT_TYPE", "description": "Route local interface"}523 {"name": "mtu", "type": "INTEGER_TYPE", "description": "Maximum Transmission Unit for the route"}524 {"name": "metric", "type": "INTEGER_TYPE", "description": "Cost of route. Lowest is preferred"}525 {"name": "type", "type": "TEXT_TYPE", "description": "Type of route"}526 ]527 },528 {529 "name": "shell_history",530 "description": "A line-delimited (command) table of per-user .*_history data.",531 "columns": [532 {"name": "uid", "type": "BIGINT_TYPE", "description": "Shell history owner"}533 {"name": "command", "type": "TEXT_TYPE", "description": "Unparsed date/line/command history line"}534 {"name": "history_file", "type": "TEXT_TYPE", "description": "Path to the .*_history for this user"}535 ]536 },537 {538 "name": "smbios_tables",539 "description": "BIOS (DMI) structure common details and content.",540 "columns": [541 {"name": "number", "type": "INTEGER_TYPE", "description": "Table entry number"}542 {"name": "type", "type": "INTEGER_TYPE", "description": "Table entry type"}543 {"name": "description", "type": "TEXT_TYPE", "description": "Table entry description"}544 {"name": "handle", "type": "INTEGER_TYPE", "description": "Table entry handle"}545 {"name": "header_size", "type": "INTEGER_TYPE", "description": "Header size in bytes"}546 {"name": "size", "type": "INTEGER_TYPE", "description": "Table entry size in bytes"}547 {"name": "md5", "type": "TEXT_TYPE", "description": "MD5 hash of table entry"}548 ]549 },550 {551 "name": "suid_bin",552 "description": "suid binaries in common locations.",553 "columns": [554 {"name": "path", "type": "TEXT_TYPE", "description": "Binary path"}555 {"name": "username", "type": "TEXT_TYPE", "description": "Binary owner username"}556 {"name": "groupname", "type": "TEXT_TYPE", "description": "Binary owner group"}557 {"name": "permissions", "type": "TEXT_TYPE", "description": "Binary permissions"}558 ]559 },560 {561 "name": "system_controls",562 "description": "sysctl names, values, and settings information.",563 "columns": [564 {"name": "name", "type": "TEXT_TYPE", "description": "Full sysctl MIB name"}565 {"name": "oid", "type": "TEXT_TYPE", "description": "Control MIB"}566 {"name": "subsystem", "type": "TEXT_TYPE", "description": "Subsystem ID, control type"}567 {"name": "current_value", "type": "TEXT_TYPE", "description": "Value of setting"}568 {"name": "config_value", "type": "TEXT_TYPE", "description": "The MIB value set in /etc/sysctl.conf"}569 {"name": "type", "type": "TEXT_TYPE", "description": "Data type"}570 ]571 },572 {573 "name": "system_info",574 "description": "System information for identification.",575 "columns": [576 {"name": "hostname", "type": "TEXT_TYPE", "description": "Network hostname including domain"}577 {"name": "uuid", "type": "TEXT_TYPE", "description": "Unique ID provided by the system"}578 {"name": "cpu_type", "type": "TEXT_TYPE", "description": "CPU type"}579 {"name": "cpu_subtype", "type": "TEXT_TYPE", "description": "CPU subtype"}580 {"name": "cpu_brand", "type": "TEXT_TYPE", "description": "CPU brand string"}581 {"name": "cpu_physical_cores", "type": "INTEGER_TYPE", "description": "Max number of CPU physical cores"}582 {"name": "cpu_logical_cores", "type": "INTEGER_TYPE", "description": "Max number of CPU logical cores"}583 {"name": "physical_memory", "type": "BIGINT_TYPE", "description": "Total physical memory in bytes"}584 {"name": "hardware_model", "type": "TEXT_TYPE", "description": "Hardware model string"}585 {"name": "hardware_serial", "type": "TEXT_TYPE", "description": "System serial number frequently used for asset tracking"}586 {"name": "computer_name", "type": "TEXT_TYPE", "description": "Friendly computer name (optional)"}587 ]588 },589 {590 "name": "uptime",591 "description": "Track time passed since last boot.",592 "columns": [593 {"name": "days", "type": "INTEGER_TYPE", "description": "Days of uptime"}594 {"name": "hours", "type": "INTEGER_TYPE", "description": "Hours of uptime"}595 {"name": "minutes", "type": "INTEGER_TYPE", "description": "Minutes of uptime"}596 {"name": "seconds", "type": "INTEGER_TYPE", "description": "Seconds of uptime"}597 {"name": "total_seconds", "type": "BIGINT_TYPE", "description": "Total uptime seconds"}598 ]599 },600 {601 "name": "usb_devices",602 "description": "USB devices that are actively plugged into the host system.",603 "columns": [604 {"name": "usb_address", "type": "INTEGER_TYPE", "description": "USB Device used address"}605 {"name": "usb_port", "type": "INTEGER_TYPE", "description": "USB Device used port"}606 {"name": "vendor", "type": "TEXT_TYPE", "description": "USB Device vendor string"}607 {"name": "vendor_id", "type": "TEXT_TYPE", "description": "Hex encoded USB Device vendor identifier"}608 {"name": "model", "type": "TEXT_TYPE", "description": "USB Device model string"}609 {"name": "model_id", "type": "TEXT_TYPE", "description": "Hex encoded USB Device model identifier"}610 {"name": "serial", "type": "TEXT_TYPE", "description": "USB Device serial connection"}611 {"name": "removable", "type": "INTEGER_TYPE", "description": "1 If USB device is removable else 0"}612 ]613 },614 {615 "name": "user_groups",616 "description": "Local system user group relationships.",617 "columns": [618 {"name": "uid", "type": "BIGINT_TYPE", "description": "User ID"}619 {"name": "gid", "type": "BIGINT_TYPE", "description": "Group ID"}620 ]621 },622 {623 "name": "users",624 "description": "Local system users.",625 "columns": [626 {"name": "uid", "type": "BIGINT_TYPE", "description": "User ID"}627 {"name": "gid", "type": "BIGINT_TYPE", "description": "Group ID (unsigned)"}628 {"name": "uid_signed", "type": "BIGINT_TYPE", "description": "User ID as int64 signed (Apple)"}629 {"name": "gid_signed", "type": "BIGINT_TYPE", "description": "Default group ID as int64 signed (Apple)"}630 {"name": "username", "type": "TEXT_TYPE", "description": "Username"}631 {"name": "description", "type": "TEXT_TYPE", "description": "Optional user description"}632 {"name": "directory", "type": "TEXT_TYPE", "description": "User's home directory"}633 {"name": "shell", "type": "TEXT_TYPE", "description": "User's configured default shell"}634 ]635 },636 {637 "name": "yara",638 "description": "Track YARA matches for files or PIDs.",639 "columns": [640 {"name": "path", "type": "TEXT_TYPE", "description": "The path scanned"}641 {"name": "matches", "type": "TEXT_TYPE", "description": "List of YARA matches"}642 {"name": "count", "type": "INTEGER_TYPE", "description": "Number of YARA matches"}643 {"name": "sig_group", "type": "TEXT_TYPE", "description": "Signature group used"}644 {"name": "sigfile", "type": "TEXT_TYPE", "description": "Signature file used"}645 {"name": "pattern", "type": "TEXT_TYPE", "description": "A pattern which can be used to match file paths"}646 {"name": "strings", "type": "TEXT_TYPE", "description": "Matching strings"}647 {"name": "tags", "type": "TEXT_TYPE", "description": "Matching tags"}648 ]649 },650 {651 "name": "yara_events",652 "description": "Track YARA matches for files specified in configuration data.",653 "columns": [654 {"name": "target_path", "type": "TEXT_TYPE", "description": "The path scanned"}655 {"name": "category", "type": "TEXT_TYPE", "description": "The category of the file"}656 {"name": "action", "type": "TEXT_TYPE", "description": "Change action (UPDATE, REMOVE, etc)"}657 {"name": "transaction_id", "type": "BIGINT_TYPE", "description": "ID used during bulk update"}658 {"name": "matches", "type": "TEXT_TYPE", "description": "List of YARA matches"}659 {"name": "count", "type": "INTEGER_TYPE", "description": "Number of YARA matches"}660 {"name": "time", "type": "BIGINT_TYPE", "description": "Time of the scan"}661 {"name": "strings", "type": "TEXT_TYPE", "description": "Matching strings"}662 {"name": "tags", "type": "TEXT_TYPE", "description": "Matching tags"}663 ]664 },665 {666 "name": "file",667 "description": "Interactive filesystem attributes and metadata.",668 "columns": [669 {"name": "path", "type": "TEXT_TYPE", "description": "Absolute file path"},670 {"name": "directory", "type": "TEXT_TYPE", "description": "Directory of file(s)"},671 {"name": "filename", "type": "TEXT_TYPE", "description": "Name portion of file path"},672 {"name": "inode", "type": "BIGINT_TYPE", "description": "Filesystem inode number"},673 {"name": "uid", "type": "BIGINT_TYPE", "description": "Owning user ID"},674 {"name": "gid", "type": "BIGINT_TYPE", "description": "Owning group ID"},675 {"name": "mode", "type": "TEXT_TYPE", "description": "Permission bits"},676 {"name": "device", "type": "BIGINT_TYPE", "description": "Device ID (optional)"},677 {"name": "size", "type": "BIGINT_TYPE", "description": "Size of file in bytes"},678 {"name": "block_size", "type": "INTEGER_TYPE", "description": " Block size of filesystem"},679 {"name": "atime", "type": "BIGINT_TYPE", "description": "Last access time"},680 {"name": "mtime", "type": "BIGINT_TYPE", "description": "Last modification time"},681 {"name": "ctime", "type": "BIGINT_TYPE", "description": "Last status change time"},682 {"name": "btime", "type": "BIGINT_TYPE", "description": "(B)irth or (cr)eate time"},683 {"name": "hard_links", "type": "INTEGER_TYPE", "description": "Number of hard links"},684 {"name": "type", "type": "TEXT_TYPE", "description": "File status"}685 ]686 }...
contracts.ts
Source:contracts.ts
1namespace c2{3 export interface data_type4 extends syntax_model { }5 export interface native_type6 extends data_type { } 7 export interface chronology_type8 extends data_type { }9 export interface numeric_type10 extends data_type { }11 export interface sqlclr_type12 extends data_type{ }13 14 export interface date_type15 extends chronology_type,16 native_type { }17 export interface time_type18 extends chronology_type,19 native_type { }20 export interface datetime_type21 extends chronology_type,22 native_type { }23 export interface datetime2_type24 extends chronology_type,25 native_type { }26 export interface datetimeoffset_type27 extends chronology_type,28 native_type { }29 export interface integer_type30 extends numeric_type { }31 export interface bit_type32 extends integer_type,33 native_type { }34 export interface int_type35 extends integer_type,36 native_type { }37 export interface bigint_type38 extends integer_type,39 native_type { }40 export interface tinyint_type41 extends integer_type,42 native_type { }43 export interface smallint_type44 extends integer_type,45 native_type { }46 export interface fractional_type47 extends numeric_type{ }48 export interface precise_fractional_type49 extends fractional_type{ }50 export interface floating_fractional_type51 extends fractional_type{ }52 export interface decimal_type53 extends precise_fractional_type, native_type{ }54 export interface float_type55 extends floating_fractional_type,56 native_type{ }57 export interface real_type58 extends floating_fractional_type,59 native_type{ }60 export interface text_type61 extends data_type { }62 export interface unicode_text_type63 extends text_type{ }64 export interface ansi_text_type65 extends text_type{ }66 export interface variable_length_text_type67 extends text_type{ }68 export interface fixed_length_text_type69 extends text_type{ }70 export interface nvarchar_type71 extends unicode_text_type,72 variable_length_text_type,73 native_type { }74 export interface varchar_type75 extends ansi_text_type,76 variable_length_text_type,77 native_type { }78 export interface nchar_type79 extends unicode_text_type,80 fixed_length_text_type,81 native_type { }82 export interface char_type83 extends ansi_text_type,84 fixed_length_text_type,85 native_type { }86 87 export interface currency_type88 extends data_type { }89 export interface smallmoney_type90 extends currency_type,91 native_type{ }92 export interface money_type93 extends currency_type,94 native_type{ }...
Using AI Code Generation
1var wpt = require('wpt');2wpt.integer_type(10);3var wpt = require('wpt');4wpt.float_type(10.5);5var wpt = require('wpt');6wpt.string_type("Hello World");7var wpt = require('wpt');8wpt.object_type({});9var wpt = require('wpt');10wpt.array_type([]);11var wpt = require('wpt');12wpt.boolean_type(true);13var wpt = require('wpt');14wpt.null_type(null);15var wpt = require('wpt');16wpt.undefined_type(undefined);17var wpt = require('wpt');18wpt.function_type(function() {});19var wpt = require('wpt');20wpt.symbol_type(Symbol());21var wpt = require('wpt');22wpt.date_type(new Date());23var wpt = require('wpt');24wpt.regexp_type(/test/);25var wpt = require('wpt');26wpt.error_type(new Error());27var wpt = require('wpt');28wpt.map_type(new Map());29var wpt = require('wpt');30wpt.set_type(new Set());
Using AI Code Generation
1const wptools = require('wptools');2const wp = wptools.page('Albert Einstein');3wp.get()4 .then((page) => {5 return page.integer_type('birth_date');6 })7 .then((date) => {8 console.log(date);9 })10 .catch((error) => {11 console.log(error);12 });13#### `page.json()`14const wptools = require('wptools');15const wp = wptools.page('Albert Einstein');16wp.get()17 .then((page) => {18 return page.json();19 })20 .then((json) => {21 console.log(json);22 })23 .catch((error) => {24 console.log(error);25 });26#### `page.lang()`27const wptools = require('wptools');28const wp = wptools.page('Albert Einstein');29wp.get()30 .then((page) => {31 return page.lang();32 })33 .then((lang) => {34 console.log(lang);35 })36 .catch((error) => {37 console.log(error);38 });39#### `page.links()`40const wptools = require('wptools');41const wp = wptools.page('Albert Einstein');42wp.links()43 .then((links) => {44 console.log(links);45 })46 .catch((error) => {47 console.log(error);48 });49#### `page.linksFrom()`50const wptools = require('wptools');51const wp = wptools.page('Albert Einstein');52wp.linksFrom()53 .then((links) => {54 console.log(links);55 })56 .catch((error) => {57 console.log(error);58 });59#### `page.linksTo()`
Using AI Code Generation
1var wpt = require('wpt');2var options = {3};4wpt.runTest(options, function(err, data) {5 if(err){6 console.log(err);7 }else{8 console.log(data);9 }10});11#### `wpt.runTest(options, callback)`12#### `wpt.getTestStatus(testId, callback)`13#### `wpt.getTestResults(testId, callback)`14#### `wpt.getLocations(callback)`15#### `wpt.getTesters(callback)`16[MIT](LICENSE)
Using AI Code Generation
1var wptools = require('wptools');2wptools.integer_type('2000').then(function (response) {3 console.log(response);4});5{ type: 'integer', value: 2000 }6var wptools = require('wptools');7wptools.get_article('Albert Einstein').then(function (response) {8 console.log(response);9});10{ article: 'Albert Einstein was a German-born theoretical physicist who developed the theory of relativity, one of the two pillars of modern physics (alongside quantum mechanics). His work is also known for its influence on the philosophy of science. Einstein is best known in popular culture for his mass–energy equivalence formula E = mc2 (which has been dubbed "the world\'s most famous equation"). He received the 1921 Nobel Prize in Physics "for his services to theoretical physics, and especially for his discovery of the law of the photoelectric effect", a pivotal step in the development of quantum theory.' }11var wptools = require('wptools');12wptools.get_categories('Albert Einstein').then(function (response) {13 console.log(response);14});15{ categories: [ 'Category:Articles containing video clips', 'Category:Articles with Curlie links', 'Category:Articles with hCards', 'Category:Articles with short description', 'Category:Articles with unsourced statements from June 2016', 'Category:Articles with unsourced statements from July 2016', 'Category:Articles with unsourced statements from May 2016', 'Category:Articles with unsourced statements from November 2016
Using AI Code Generation
1var wpt = require('wpt');2var wpt = new WebPageTest('www.webpagetest.org', 'A.3e3a7e3a3e3e3e3e3e3e3e3e3e3e3e3e');3wpt.integer_type('FirstView', 'docTime', function(err, data) {4 if (err) return console.error(err);5 console.log(data);6});7var wpt = require('wpt');8var wpt = new WebPageTest('www.webpagetest.org', 'A.3e3a7e3a3e3e3e3e3e3e3e3e3e3e3e3e');9wpt.integer_type('FirstView', 'fullyLoaded', function(err, data) {10 if (err) return console.error(err);11 console.log(data);12});13var wpt = require('wpt');14var wpt = new WebPageTest('www.webpagetest.org', 'A.3e3a7e3a3e3e3e3e3e3e3e3e3e3e3e3e');15wpt.integer_type('FirstView', 'loadTime', function(err, data) {16 if (err) return console.error(err);17 console.log(data);18});19var wpt = require('wpt');20var wpt = new WebPageTest('www.webpagetest.org', 'A.3e3a7e3a3e3e3e3e3e3e3e3e3e3e3e3e');21wpt.integer_type('FirstView', 'render', function(err, data) {22 if (err) return console.error(err);23 console.log(data);24});25var wpt = require('wpt');26var wpt = new WebPageTest('www.webpagetest.org', 'A.3e3a7e3a3e3e3e3e3e3e3e3e3e3e
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!