@aml-org/amf-antlr-parsers 0.0.1

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 (32) hide show
  1. package/index.js +9 -0
  2. package/lib/internal/graphql/GraphQL.interp +223 -0
  3. package/lib/internal/graphql/GraphQL.tokens +130 -0
  4. package/lib/internal/graphql/GraphQLLexer.interp +239 -0
  5. package/lib/internal/graphql/GraphQLLexer.js +264 -0
  6. package/lib/internal/graphql/GraphQLLexer.tokens +130 -0
  7. package/lib/internal/graphql/GraphQLListener.js +727 -0
  8. package/lib/internal/graphql/GraphQLParser.js +8018 -0
  9. package/lib/internal/graphqlcb.js +90 -0
  10. package/lib/internal/graphqlcb.m.js +34 -0
  11. package/lib/internal/graphqlfederation/GraphQLFederation.interp +253 -0
  12. package/lib/internal/graphqlfederation/GraphQLFederation.tokens +148 -0
  13. package/lib/internal/graphqlfederation/GraphQLFederationLexer.interp +344 -0
  14. package/lib/internal/graphqlfederation/GraphQLFederationLexer.js +300 -0
  15. package/lib/internal/graphqlfederation/GraphQLFederationLexer.tokens +152 -0
  16. package/lib/internal/graphqlfederation/GraphQLFederationListener.js +823 -0
  17. package/lib/internal/graphqlfederation/GraphQLFederationParser.interp +324 -0
  18. package/lib/internal/graphqlfederation/GraphQLFederationParser.js +12033 -0
  19. package/lib/internal/graphqlfederation/GraphQLFederationParser.tokens +152 -0
  20. package/lib/internal/graphqlfederation/GraphQLFederationParserListener.js +975 -0
  21. package/lib/internal/graphqlfederationcb.js +90 -0
  22. package/lib/internal/graphqlfederationcb.m.js +35 -0
  23. package/lib/internal/proto3/Protobuf3.interp +200 -0
  24. package/lib/internal/proto3/Protobuf3.tokens +128 -0
  25. package/lib/internal/proto3/Protobuf3Lexer.interp +234 -0
  26. package/lib/internal/proto3/Protobuf3Lexer.js +262 -0
  27. package/lib/internal/proto3/Protobuf3Lexer.tokens +128 -0
  28. package/lib/internal/proto3/Protobuf3Listener.js +575 -0
  29. package/lib/internal/proto3/Protobuf3Parser.js +6767 -0
  30. package/lib/internal/protobuf3cb.js +90 -0
  31. package/lib/internal/protobuf3cb.m.js +34 -0
  32. package/package.json +23 -0
@@ -0,0 +1,90 @@
1
+ "use strict";
2
+
3
+ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
4
+
5
+ Object.defineProperty(exports, "__esModule", {
6
+ value: true
7
+ });
8
+ exports.Protobuf3ASTBuilderCB = void 0;
9
+
10
+ var _antlr = _interopRequireDefault(require("antlr4"));
11
+
12
+ var _Protobuf3Lexer = _interopRequireDefault(require("./proto3/Protobuf3Lexer.js"));
13
+
14
+ var _Protobuf3Parser = _interopRequireDefault(require("./proto3/Protobuf3Parser.js"));
15
+
16
+ var _Protobuf3Listener2 = _interopRequireDefault(require("./proto3/Protobuf3Listener.js"));
17
+
18
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
19
+
20
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
21
+
22
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
23
+
24
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
25
+
26
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
27
+
28
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
29
+
30
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
31
+
32
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
33
+
34
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
35
+
36
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
37
+
38
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
39
+
40
+ var Protobuf3ASTBuilderCB = /*#__PURE__*/function (_Protobuf3Listener) {
41
+ _inherits(Protobuf3ASTBuilderCB, _Protobuf3Listener);
42
+
43
+ var _super = _createSuper(Protobuf3ASTBuilderCB);
44
+
45
+ function Protobuf3ASTBuilderCB() {
46
+ _classCallCheck(this, Protobuf3ASTBuilderCB);
47
+
48
+ return _super.apply(this, arguments);
49
+ }
50
+
51
+ _createClass(Protobuf3ASTBuilderCB, [{
52
+ key: "visitTerminal",
53
+ value: function visitTerminal(node) {
54
+ this.cb.visitTerminal(node, this.parser);
55
+ }
56
+ }, {
57
+ key: "visitErrorNode",
58
+ value: function visitErrorNode(node) {
59
+ this.cb.visitErrorNode(node, this.parser);
60
+ }
61
+ }, {
62
+ key: "enterEveryRule",
63
+ value: function enterEveryRule(node) {
64
+ this.cb.enterEveryRule(node, this.parser);
65
+ }
66
+ }, {
67
+ key: "exitEveryRule",
68
+ value: function exitEveryRule(node) {
69
+ this.cb.exitEveryRule();
70
+ }
71
+ }, {
72
+ key: "run",
73
+ value: function run(input, cb) {
74
+ this.cb = cb;
75
+ var chars = new _antlr["default"].InputStream(input);
76
+ var lexer = new _Protobuf3Lexer["default"](chars);
77
+ var tokens = new _antlr["default"].CommonTokenStream(lexer);
78
+ this.parser = new _Protobuf3Parser["default"](tokens);
79
+ this.parser.buildParseTrees = true;
80
+ var tree = this.parser.proto();
81
+
82
+ _antlr["default"].tree.ParseTreeWalker.DEFAULT.walk(this, tree);
83
+ }
84
+ }]);
85
+
86
+ return Protobuf3ASTBuilderCB;
87
+ }(_Protobuf3Listener2["default"]);
88
+
89
+ exports.Protobuf3ASTBuilderCB = Protobuf3ASTBuilderCB;
90
+
@@ -0,0 +1,34 @@
1
+ import antlr4 from 'antlr4';
2
+ import Protobuf3Lexer from './proto3/Protobuf3Lexer.js';
3
+ import Protobuf3Parser from './proto3/Protobuf3Parser.js';
4
+ import Protobuf3Listener from './proto3/Protobuf3Listener.js';
5
+
6
+ export class Protobuf3ASTBuilderCB extends Protobuf3Listener {
7
+
8
+ visitTerminal(node) {
9
+ this.cb.visitTerminal(node, this.parser)
10
+ }
11
+
12
+ visitErrorNode(node) {
13
+ this.cb.visitErrorNode(node, this.parser)
14
+ }
15
+
16
+ enterEveryRule(node) {
17
+ this.cb.enterEveryRule(node, this.parser)
18
+ }
19
+
20
+ exitEveryRule(node) {
21
+ this.cb.exitEveryRule()
22
+ }
23
+
24
+ run(input, cb) {
25
+ this.cb = cb;
26
+ const chars = new antlr4.InputStream(input);
27
+ const lexer = new Protobuf3Lexer(chars);
28
+ const tokens = new antlr4.CommonTokenStream(lexer);
29
+ this.parser = new Protobuf3Parser(tokens);
30
+ this.parser.buildParseTrees = true;
31
+ const tree = this.parser.proto();
32
+ antlr4.tree.ParseTreeWalker.DEFAULT.walk(this, tree);
33
+ }
34
+ }
package/package.json ADDED
@@ -0,0 +1,23 @@
1
+ {
2
+ "name": "@aml-org/amf-antlr-parsers",
3
+ "version": "0.0.1",
4
+ "description": "",
5
+ "main": "index.js",
6
+ "directories": {
7
+ "lib": "lib"
8
+ },
9
+ "scripts": {
10
+ "test": "echo \"Error: no test specified\" && exit 1"
11
+ },
12
+ "author": "",
13
+ "license": "ISC",
14
+ "dependencies": {
15
+ "antlr4": "^4.9.2"
16
+ },
17
+ "devDependencies": {
18
+ "browserify": "^17.0.0",
19
+ "@babel/cli": "^7.14.5",
20
+ "@babel/core": "^7.14.5",
21
+ "@babel/preset-env": "^7.14.5"
22
+ }
23
+ }