cariboujs 2.0.3 → 2.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/README.md +330 -324
  2. package/ada/ada2012/AdaLexer.js +486 -316
  3. package/ada/ada2012/AdaLexerBase.js +25 -0
  4. package/ada/ada2012/AdaParser.js +4547 -3823
  5. package/ada/ada2012/AdaParserBase.js +682 -0
  6. package/ada/ada2012/AdaParserListener.js +36 -0
  7. package/ada/ada2012/AdaParserVisitor.js +24 -0
  8. package/ada/ada2012/Symbol.js +20 -0
  9. package/ada/ada2012/SymbolTable.js +144 -0
  10. package/ada/ada2012/TypeClassification.js +15 -0
  11. package/ada/ada2022/AdaLexer.js +699 -0
  12. package/ada/ada2022/AdaLexerBase.js +25 -0
  13. package/ada/ada2022/AdaParser.js +37818 -0
  14. package/ada/ada2022/AdaParserBase.js +686 -0
  15. package/ada/ada2022/AdaParserListener.js +3024 -0
  16. package/ada/ada2022/AdaParserVisitor.js +2020 -0
  17. package/ada/ada2022/Symbol.js +20 -0
  18. package/ada/ada2022/SymbolTable.js +144 -0
  19. package/ada/ada2022/TypeClassification.js +15 -0
  20. package/c/CLexer.js +846 -603
  21. package/c/CLexerBase.js +96 -0
  22. package/c/CParser.js +8798 -4776
  23. package/c/CParserBase.js +591 -0
  24. package/c/{CListener.js → CParserListener.js} +382 -112
  25. package/c/{CVisitor.js → CParserVisitor.js} +252 -72
  26. package/c/ErrorListener.js +50 -0
  27. package/c/Symbol.js +28 -0
  28. package/c/SymbolTable.js +215 -0
  29. package/c/TypeClassification.js +21 -0
  30. package/cpp/CPP14Parser.js +215 -215
  31. package/cpp/CPP14ParserListener.js +56 -56
  32. package/cpp/CPP14ParserVisitor.js +28 -28
  33. package/cql3/CqlLexer.js +708 -692
  34. package/cql3/CqlParser.js +3356 -2802
  35. package/cql3/CqlParserListener.js +36 -0
  36. package/cql3/CqlParserVisitor.js +24 -0
  37. package/csharp/v7/CSharpLexer.js +1339 -0
  38. package/csharp/v7/CSharpLexerBase.js +332 -0
  39. package/csharp/v7/CSharpParser.js +29239 -0
  40. package/csharp/v7/CSharpParserBase.js +48 -0
  41. package/csharp/v7/CSharpParserListener.js +2304 -0
  42. package/csharp/v7/CSharpParserVisitor.js +1540 -0
  43. package/csharp/v8-spec/CSharpLexer.js +1549 -0
  44. package/csharp/v8-spec/CSharpLexerBase.js +296 -0
  45. package/csharp/v8-spec/CSharpParser.js +45044 -0
  46. package/csharp/v8-spec/CSharpParserBase.js +569 -0
  47. package/csharp/v8-spec/CSharpParserListener.js +3582 -0
  48. package/csharp/v8-spec/CSharpParserVisitor.js +2392 -0
  49. package/geekcode/geekcodeLexer.js +232 -0
  50. package/geekcode/geekcodeListener.js +81 -0
  51. package/geekcode/geekcodeParser.js +1516 -0
  52. package/geekcode/geekcodeVisitor.js +58 -0
  53. package/kotlin/kotlin/KotlinLexer.js +1257 -1247
  54. package/kotlin/kotlin/KotlinParser.js +3991 -3425
  55. package/kotlin/kotlin/KotlinParserListener.js +36 -0
  56. package/kotlin/kotlin/KotlinParserVisitor.js +24 -0
  57. package/package.json +1 -1
  58. package/plantUML/PlantUMLLexer.js +215 -316
  59. package/plantUML/PlantUMLParser.js +1045 -2393
  60. package/plantUML/PlantUMLParserListener.js +171 -0
  61. package/plantUML/PlantUMLParserVisitor.js +118 -0
  62. package/sql/cockroachdb/CockroachDBLexer.js +3865 -0
  63. package/sql/cockroachdb/CockroachDBParser.js +123259 -0
  64. package/sql/cockroachdb/CockroachDBParserListener.js +7281 -0
  65. package/sql/cockroachdb/CockroachDBParserVisitor.js +4858 -0
  66. package/sql/plsql/PlSqlParser.js +27187 -42911
  67. package/sql/plsql/PlSqlParserBase.js +30 -0
  68. package/sql/plsql/PlSqlParserListener.js +0 -9
  69. package/sql/plsql/PlSqlParserVisitor.js +0 -6
  70. package/sql/snowflake/SnowflakeLexer.js +5675 -5497
  71. package/sql/snowflake/SnowflakeParser.js +27230 -22653
  72. package/sql/snowflake/SnowflakeParserListener.js +278 -8
  73. package/sql/snowflake/SnowflakeParserVisitor.js +184 -4
  74. package/sql/sqlite/SQLiteParser.js +1115 -1115
  75. package/sql/sqlite/SQLiteParserListener.js +9 -9
  76. package/sql/sqlite/SQLiteParserVisitor.js +6 -6
  77. package/sysml-v2/SysMLv2Lexer.js +1047 -0
  78. package/sysml-v2/SysMLv2Parser.js +51339 -0
  79. package/sysml-v2/SysMLv2ParserListener.js +4464 -0
  80. package/sysml-v2/SysMLv2ParserVisitor.js +2980 -0
  81. package/plantUML/PlantUMLListener.js +0 -279
  82. package/plantUML/PlantUMLVisitor.js +0 -190
@@ -0,0 +1,48 @@
1
+ import antlr4 from 'antlr4';
2
+ import CSharpParser from './CSharpParser.js';
3
+
4
+ const ALL_SEMANTIC_FUNCTIONS = ["IsLocalVariableDeclaration"];
5
+
6
+ function parseNoSemantics(args) {
7
+ const result = new Set();
8
+ for (const a of args) {
9
+ if (a.toLowerCase().startsWith("--no-semantics")) {
10
+ const eq = a.indexOf('=');
11
+ if (eq === -1) {
12
+ for (const f of ALL_SEMANTIC_FUNCTIONS) result.add(f);
13
+ } else {
14
+ for (const f of a.substring(eq + 1).split(',')) result.add(f.trim());
15
+ }
16
+ }
17
+ }
18
+ return result;
19
+ }
20
+
21
+ export default class CSharpParserBase extends antlr4.Parser {
22
+ constructor(input) {
23
+ super(input);
24
+ this._noSemantics = parseNoSemantics(process.argv);
25
+ }
26
+
27
+ IsRightArrow() { return this._areAdjacent(); }
28
+ IsRightShift() { return this._areAdjacent(); }
29
+ IsRightShiftAssignment() { return this._areAdjacent(); }
30
+
31
+ _areAdjacent() {
32
+ const first = this._input.LT(-2);
33
+ const second = this._input.LT(-1);
34
+ return first !== null && second !== null &&
35
+ first.tokenIndex + 1 === second.tokenIndex;
36
+ }
37
+
38
+ IsLocalVariableDeclaration() {
39
+ if (this._noSemantics.has("IsLocalVariableDeclaration")) return true;
40
+ const local_var_decl = this._ctx;
41
+ if (!(local_var_decl instanceof CSharpParser.Local_variable_declarationContext)) return true;
42
+ if (local_var_decl == null) return true;
43
+ const local_variable_type = local_var_decl.local_variable_type();
44
+ if (local_variable_type == null) return true;
45
+ if (local_variable_type.getText() === "var") return false;
46
+ return true;
47
+ }
48
+ }