rails-graphql 0.2.0 → 1.0.0.beta

Sign up to get free protection for your applications and to get access to all the features.
Files changed (297) hide show
  1. checksums.yaml +4 -4
  2. data/ext/console.rb +18 -0
  3. data/ext/extconf.h +3 -0
  4. data/ext/extconf.rb +1 -54
  5. data/ext/gql_parser.c +646 -0
  6. data/ext/shared.c +482 -0
  7. data/ext/shared.h +177 -0
  8. data/lib/gql_parser.so +0 -0
  9. data/lib/rails/graphql/adapters/mysql_adapter.rb +59 -0
  10. data/lib/rails/graphql/adapters/pg_adapter.rb +25 -22
  11. data/lib/rails/graphql/adapters/sqlite_adapter.rb +17 -14
  12. data/lib/rails/graphql/alternative/field_set.rb +36 -0
  13. data/lib/rails/graphql/alternative/mutation.rb +17 -0
  14. data/lib/rails/graphql/alternative/query.rb +93 -0
  15. data/lib/rails/graphql/alternative/subscription.rb +17 -0
  16. data/lib/rails/graphql/alternative.rb +20 -0
  17. data/lib/rails/graphql/argument.rb +21 -24
  18. data/lib/rails/graphql/callback.rb +24 -9
  19. data/lib/rails/graphql/collectors/hash_collector.rb +14 -6
  20. data/lib/rails/graphql/collectors/idented_collector.rb +10 -7
  21. data/lib/rails/graphql/collectors/json_collector.rb +22 -17
  22. data/lib/rails/graphql/collectors.rb +4 -4
  23. data/lib/rails/graphql/config.rb +130 -15
  24. data/lib/rails/graphql/directive/cached_directive.rb +33 -0
  25. data/lib/rails/graphql/directive/deprecated_directive.rb +10 -10
  26. data/lib/rails/graphql/directive/include_directive.rb +5 -4
  27. data/lib/rails/graphql/directive/skip_directive.rb +5 -4
  28. data/lib/rails/graphql/directive.rb +118 -63
  29. data/lib/rails/graphql/errors.rb +33 -4
  30. data/lib/rails/graphql/event.rb +16 -5
  31. data/lib/rails/graphql/field/authorized_field.rb +19 -3
  32. data/lib/rails/graphql/field/input_field.rb +11 -10
  33. data/lib/rails/graphql/field/mutation_field.rb +42 -7
  34. data/lib/rails/graphql/field/output_field.rb +102 -13
  35. data/lib/rails/graphql/field/proxied_field.rb +31 -22
  36. data/lib/rails/graphql/field/resolved_field.rb +26 -24
  37. data/lib/rails/graphql/field/scoped_config.rb +10 -4
  38. data/lib/rails/graphql/field/subscription_field.rb +140 -0
  39. data/lib/rails/graphql/field/typed_field.rb +43 -22
  40. data/lib/rails/graphql/field.rb +70 -56
  41. data/lib/rails/graphql/global_id.rb +85 -0
  42. data/lib/rails/graphql/helpers/attribute_delegator.rb +5 -5
  43. data/lib/rails/graphql/helpers/inherited_collection/array.rb +50 -0
  44. data/lib/rails/graphql/helpers/inherited_collection/base.rb +43 -0
  45. data/lib/rails/graphql/helpers/inherited_collection/hash.rb +87 -0
  46. data/lib/rails/graphql/helpers/inherited_collection.rb +25 -76
  47. data/lib/rails/graphql/helpers/instantiable.rb +15 -0
  48. data/lib/rails/graphql/helpers/leaf_from_ar.rb +7 -7
  49. data/lib/rails/graphql/helpers/registerable.rb +44 -62
  50. data/lib/rails/graphql/helpers/unregisterable.rb +16 -0
  51. data/lib/rails/graphql/helpers/with_arguments.rb +31 -27
  52. data/lib/rails/graphql/helpers/with_assignment.rb +10 -8
  53. data/lib/rails/graphql/helpers/with_callbacks.rb +25 -8
  54. data/lib/rails/graphql/helpers/with_description.rb +71 -0
  55. data/lib/rails/graphql/helpers/with_directives.rb +54 -30
  56. data/lib/rails/graphql/helpers/with_events.rb +21 -23
  57. data/lib/rails/graphql/helpers/with_fields.rb +76 -22
  58. data/lib/rails/graphql/helpers/with_global_id.rb +22 -0
  59. data/lib/rails/graphql/helpers/with_name.rb +43 -0
  60. data/lib/rails/graphql/helpers/with_namespace.rb +7 -4
  61. data/lib/rails/graphql/helpers/with_owner.rb +8 -7
  62. data/lib/rails/graphql/helpers/with_schema_fields.rb +137 -55
  63. data/lib/rails/graphql/helpers/with_validator.rb +9 -9
  64. data/lib/rails/graphql/helpers.rb +10 -3
  65. data/lib/rails/graphql/introspection.rb +43 -36
  66. data/lib/rails/graphql/railtie.rb +88 -33
  67. data/lib/rails/graphql/railties/base_generator.rb +3 -9
  68. data/lib/rails/graphql/railties/channel.rb +157 -0
  69. data/lib/rails/graphql/railties/controller.rb +62 -17
  70. data/lib/rails/graphql/railties/controller_runtime.rb +5 -5
  71. data/lib/rails/graphql/railties/log_subscriber.rb +81 -14
  72. data/lib/rails/graphql/request/arguments.rb +24 -49
  73. data/lib/rails/graphql/request/backtrace.rb +191 -0
  74. data/lib/rails/graphql/request/component/field.rb +86 -65
  75. data/lib/rails/graphql/request/component/fragment.rb +72 -24
  76. data/lib/rails/graphql/request/component/operation/subscription.rb +164 -4
  77. data/lib/rails/graphql/request/component/operation.rb +63 -31
  78. data/lib/rails/graphql/request/component/spread.rb +68 -25
  79. data/lib/rails/graphql/request/component/typename.rb +27 -12
  80. data/lib/rails/graphql/request/component.rb +75 -36
  81. data/lib/rails/graphql/request/context.rb +18 -8
  82. data/lib/rails/graphql/request/errors.rb +16 -6
  83. data/lib/rails/graphql/request/event.rb +19 -8
  84. data/lib/rails/graphql/request/helpers/directives.rb +68 -27
  85. data/lib/rails/graphql/request/helpers/selection_set.rb +51 -25
  86. data/lib/rails/graphql/request/helpers/value_writers.rb +18 -16
  87. data/lib/rails/graphql/request/prepared_data.rb +98 -0
  88. data/lib/rails/graphql/request/steps/authorizable.rb +24 -14
  89. data/lib/rails/graphql/request/steps/organizable.rb +110 -48
  90. data/lib/rails/graphql/request/steps/{prepareable.rb → preparable.rb} +20 -7
  91. data/lib/rails/graphql/request/steps/{resolveable.rb → resolvable.rb} +15 -6
  92. data/lib/rails/graphql/request/strategy/cached_strategy.rb +64 -0
  93. data/lib/rails/graphql/request/strategy/dynamic_instance.rb +6 -6
  94. data/lib/rails/graphql/request/strategy/multi_query_strategy.rb +6 -13
  95. data/lib/rails/graphql/request/strategy/sequenced_strategy.rb +9 -9
  96. data/lib/rails/graphql/request/strategy.rb +131 -75
  97. data/lib/rails/graphql/request/subscription.rb +80 -0
  98. data/lib/rails/graphql/request.rb +305 -86
  99. data/lib/rails/graphql/schema.rb +240 -48
  100. data/lib/rails/graphql/shortcuts.rb +22 -3
  101. data/lib/rails/graphql/source/active_record/builders.rb +50 -36
  102. data/lib/rails/graphql/source/active_record_source.rb +70 -54
  103. data/lib/rails/graphql/source/base.rb +111 -0
  104. data/lib/rails/graphql/source/builder.rb +128 -0
  105. data/lib/rails/graphql/source/scoped_arguments.rb +31 -19
  106. data/lib/rails/graphql/source.rb +89 -213
  107. data/lib/rails/graphql/subscription/provider/action_cable.rb +112 -0
  108. data/lib/rails/graphql/subscription/provider/base.rb +191 -0
  109. data/lib/rails/graphql/subscription/provider.rb +18 -0
  110. data/lib/rails/graphql/subscription/store/base.rb +145 -0
  111. data/lib/rails/graphql/subscription/store/memory.rb +127 -0
  112. data/lib/rails/graphql/subscription/store.rb +19 -0
  113. data/lib/rails/graphql/subscription.rb +17 -0
  114. data/lib/rails/graphql/to_gql.rb +29 -32
  115. data/lib/rails/graphql/type/enum/directive_location_enum.rb +11 -11
  116. data/lib/rails/graphql/type/enum/type_kind_enum.rb +3 -3
  117. data/lib/rails/graphql/type/enum.rb +34 -48
  118. data/lib/rails/graphql/type/input.rb +74 -23
  119. data/lib/rails/graphql/type/interface.rb +16 -26
  120. data/lib/rails/graphql/type/object/directive_object.rb +4 -4
  121. data/lib/rails/graphql/type/object/enum_value_object.rb +3 -3
  122. data/lib/rails/graphql/type/object/field_object.rb +24 -6
  123. data/lib/rails/graphql/type/object/input_value_object.rb +3 -3
  124. data/lib/rails/graphql/type/object/schema_object.rb +5 -8
  125. data/lib/rails/graphql/type/object/type_object.rb +29 -19
  126. data/lib/rails/graphql/type/object.rb +26 -23
  127. data/lib/rails/graphql/type/scalar/any_scalar.rb +30 -0
  128. data/lib/rails/graphql/type/scalar/bigint_scalar.rb +5 -5
  129. data/lib/rails/graphql/type/scalar/binary_scalar.rb +3 -3
  130. data/lib/rails/graphql/type/scalar/boolean_scalar.rb +8 -8
  131. data/lib/rails/graphql/type/scalar/date_scalar.rb +3 -3
  132. data/lib/rails/graphql/type/scalar/date_time_scalar.rb +3 -3
  133. data/lib/rails/graphql/type/scalar/decimal_scalar.rb +3 -3
  134. data/lib/rails/graphql/type/scalar/float_scalar.rb +5 -5
  135. data/lib/rails/graphql/type/scalar/id_scalar.rb +6 -5
  136. data/lib/rails/graphql/type/scalar/int_scalar.rb +6 -5
  137. data/lib/rails/graphql/type/scalar/json_scalar.rb +39 -0
  138. data/lib/rails/graphql/type/scalar/string_scalar.rb +18 -4
  139. data/lib/rails/graphql/type/scalar/time_scalar.rb +5 -5
  140. data/lib/rails/graphql/type/scalar.rb +25 -22
  141. data/lib/rails/graphql/type/union.rb +14 -16
  142. data/lib/rails/graphql/type.rb +34 -25
  143. data/lib/rails/graphql/type_map.rb +257 -165
  144. data/lib/rails/graphql/uri.rb +166 -0
  145. data/lib/rails/graphql/version.rb +15 -3
  146. data/lib/rails/graphql.rake +3 -0
  147. data/lib/rails/graphql.rb +85 -52
  148. data/lib/rails-graphql.rb +1 -1
  149. data/test/assets/en.yml +29 -0
  150. data/test/assets/introspection-mem.txt +1 -1
  151. data/test/assets/mem.gql +18 -45
  152. data/test/assets/mysql.gql +392 -0
  153. data/test/assets/sqlite.gql +21 -12
  154. data/test/assets/translate.gql +335 -0
  155. data/test/config.rb +18 -8
  156. data/test/graphql/schema_test.rb +12 -19
  157. data/test/graphql/source_test.rb +8 -75
  158. data/test/graphql/type/enum_test.rb +207 -203
  159. data/test/graphql/type/input_test.rb +14 -9
  160. data/test/graphql/type/interface_test.rb +4 -4
  161. data/test/graphql/type/scalar/any_scalar_test.rb +38 -0
  162. data/test/graphql/type/scalar/boolean_scalar_test.rb +6 -3
  163. data/test/graphql/type/scalar/json_scalar_test.rb +23 -0
  164. data/test/graphql/type_map_test.rb +51 -66
  165. data/test/graphql/type_test.rb +0 -19
  166. data/test/graphql_test.rb +1 -1
  167. data/test/integration/{authorization/authorization_test.rb → authorization_test.rb} +40 -14
  168. data/test/integration/config.rb +36 -3
  169. data/test/integration/customization_test.rb +39 -0
  170. data/test/integration/global_id_test.rb +99 -0
  171. data/test/integration/memory/star_wars_introspection_test.rb +24 -16
  172. data/test/integration/memory/star_wars_query_test.rb +54 -3
  173. data/test/integration/memory/star_wars_validation_test.rb +1 -1
  174. data/test/integration/mysql/star_wars_introspection_test.rb +25 -0
  175. data/test/integration/persisted_query_test.rb +87 -0
  176. data/test/integration/resolver_precedence_test.rb +154 -0
  177. data/test/integration/schemas/memory.rb +22 -7
  178. data/test/integration/schemas/mysql.rb +62 -0
  179. data/test/integration/schemas/sqlite.rb +21 -12
  180. data/test/integration/sqlite/star_wars_global_id_test.rb +83 -0
  181. data/test/integration/sqlite/star_wars_introspection_test.rb +10 -0
  182. data/test/integration/sqlite/star_wars_query_test.rb +14 -1
  183. data/test/integration/translate_test.rb +61 -0
  184. data/test/test_ext.rb +16 -13
  185. metadata +108 -157
  186. data/ext/depend +0 -3
  187. data/ext/graphqlparser/Ast.cpp +0 -346
  188. data/ext/graphqlparser/Ast.h +0 -1214
  189. data/ext/graphqlparser/AstNode.h +0 -36
  190. data/ext/graphqlparser/AstVisitor.h +0 -137
  191. data/ext/graphqlparser/GraphQLParser.cpp +0 -76
  192. data/ext/graphqlparser/GraphQLParser.h +0 -55
  193. data/ext/graphqlparser/JsonVisitor.cpp +0 -161
  194. data/ext/graphqlparser/JsonVisitor.cpp.inc +0 -456
  195. data/ext/graphqlparser/JsonVisitor.h +0 -121
  196. data/ext/graphqlparser/JsonVisitor.h.inc +0 -110
  197. data/ext/graphqlparser/VERSION +0 -1
  198. data/ext/graphqlparser/c/GraphQLAst.cpp +0 -324
  199. data/ext/graphqlparser/c/GraphQLAst.h +0 -180
  200. data/ext/graphqlparser/c/GraphQLAstForEachConcreteType.h +0 -44
  201. data/ext/graphqlparser/c/GraphQLAstNode.cpp +0 -25
  202. data/ext/graphqlparser/c/GraphQLAstNode.h +0 -33
  203. data/ext/graphqlparser/c/GraphQLAstToJSON.cpp +0 -21
  204. data/ext/graphqlparser/c/GraphQLAstToJSON.h +0 -24
  205. data/ext/graphqlparser/c/GraphQLAstVisitor.cpp +0 -55
  206. data/ext/graphqlparser/c/GraphQLAstVisitor.h +0 -53
  207. data/ext/graphqlparser/c/GraphQLParser.cpp +0 -35
  208. data/ext/graphqlparser/c/GraphQLParser.h +0 -54
  209. data/ext/graphqlparser/dump_json_ast.cpp +0 -48
  210. data/ext/graphqlparser/lexer.lpp +0 -324
  211. data/ext/graphqlparser/parser.ypp +0 -693
  212. data/ext/graphqlparser/parsergen/lexer.cpp +0 -2633
  213. data/ext/graphqlparser/parsergen/lexer.h +0 -528
  214. data/ext/graphqlparser/parsergen/location.hh +0 -189
  215. data/ext/graphqlparser/parsergen/parser.tab.cpp +0 -3300
  216. data/ext/graphqlparser/parsergen/parser.tab.hpp +0 -646
  217. data/ext/graphqlparser/parsergen/position.hh +0 -179
  218. data/ext/graphqlparser/parsergen/stack.hh +0 -156
  219. data/ext/graphqlparser/syntaxdefs.h +0 -19
  220. data/ext/libgraphqlparser/AstNode.h +0 -36
  221. data/ext/libgraphqlparser/CMakeLists.txt +0 -148
  222. data/ext/libgraphqlparser/CONTRIBUTING.md +0 -23
  223. data/ext/libgraphqlparser/GraphQLParser.cpp +0 -76
  224. data/ext/libgraphqlparser/GraphQLParser.h +0 -55
  225. data/ext/libgraphqlparser/JsonVisitor.cpp +0 -161
  226. data/ext/libgraphqlparser/JsonVisitor.h +0 -121
  227. data/ext/libgraphqlparser/LICENSE +0 -22
  228. data/ext/libgraphqlparser/README.clang-tidy +0 -7
  229. data/ext/libgraphqlparser/README.md +0 -84
  230. data/ext/libgraphqlparser/ast/ast.ast +0 -203
  231. data/ext/libgraphqlparser/ast/ast.py +0 -61
  232. data/ext/libgraphqlparser/ast/c.py +0 -100
  233. data/ext/libgraphqlparser/ast/c.pyc +0 -0
  234. data/ext/libgraphqlparser/ast/c_impl.py +0 -61
  235. data/ext/libgraphqlparser/ast/c_impl.pyc +0 -0
  236. data/ext/libgraphqlparser/ast/c_visitor_impl.py +0 -39
  237. data/ext/libgraphqlparser/ast/c_visitor_impl.pyc +0 -0
  238. data/ext/libgraphqlparser/ast/casing.py +0 -26
  239. data/ext/libgraphqlparser/ast/casing.pyc +0 -0
  240. data/ext/libgraphqlparser/ast/cxx.py +0 -197
  241. data/ext/libgraphqlparser/ast/cxx.pyc +0 -0
  242. data/ext/libgraphqlparser/ast/cxx_impl.py +0 -61
  243. data/ext/libgraphqlparser/ast/cxx_impl.pyc +0 -0
  244. data/ext/libgraphqlparser/ast/cxx_json_visitor_header.py +0 -42
  245. data/ext/libgraphqlparser/ast/cxx_json_visitor_header.pyc +0 -0
  246. data/ext/libgraphqlparser/ast/cxx_json_visitor_impl.py +0 -80
  247. data/ext/libgraphqlparser/ast/cxx_json_visitor_impl.pyc +0 -0
  248. data/ext/libgraphqlparser/ast/cxx_visitor.py +0 -64
  249. data/ext/libgraphqlparser/ast/cxx_visitor.pyc +0 -0
  250. data/ext/libgraphqlparser/ast/js.py +0 -65
  251. data/ext/libgraphqlparser/ast/license.py +0 -10
  252. data/ext/libgraphqlparser/ast/license.pyc +0 -0
  253. data/ext/libgraphqlparser/c/GraphQLAstNode.cpp +0 -25
  254. data/ext/libgraphqlparser/c/GraphQLAstNode.h +0 -33
  255. data/ext/libgraphqlparser/c/GraphQLAstToJSON.cpp +0 -21
  256. data/ext/libgraphqlparser/c/GraphQLAstToJSON.h +0 -24
  257. data/ext/libgraphqlparser/c/GraphQLAstVisitor.cpp +0 -55
  258. data/ext/libgraphqlparser/c/GraphQLAstVisitor.h +0 -53
  259. data/ext/libgraphqlparser/c/GraphQLParser.cpp +0 -35
  260. data/ext/libgraphqlparser/c/GraphQLParser.h +0 -54
  261. data/ext/libgraphqlparser/clang-tidy-all.sh +0 -3
  262. data/ext/libgraphqlparser/cmake/version.cmake +0 -16
  263. data/ext/libgraphqlparser/dump_json_ast.cpp +0 -48
  264. data/ext/libgraphqlparser/go/README.md +0 -20
  265. data/ext/libgraphqlparser/go/callbacks.go +0 -18
  266. data/ext/libgraphqlparser/go/gotest.go +0 -64
  267. data/ext/libgraphqlparser/lexer.lpp +0 -324
  268. data/ext/libgraphqlparser/libgraphqlparser.pc.in +0 -11
  269. data/ext/libgraphqlparser/parser.ypp +0 -693
  270. data/ext/libgraphqlparser/parsergen/lexer.cpp +0 -2633
  271. data/ext/libgraphqlparser/parsergen/lexer.h +0 -528
  272. data/ext/libgraphqlparser/parsergen/location.hh +0 -189
  273. data/ext/libgraphqlparser/parsergen/parser.tab.cpp +0 -3300
  274. data/ext/libgraphqlparser/parsergen/parser.tab.hpp +0 -646
  275. data/ext/libgraphqlparser/parsergen/position.hh +0 -179
  276. data/ext/libgraphqlparser/parsergen/stack.hh +0 -156
  277. data/ext/libgraphqlparser/python/CMakeLists.txt +0 -14
  278. data/ext/libgraphqlparser/python/README.md +0 -5
  279. data/ext/libgraphqlparser/python/example.py +0 -31
  280. data/ext/libgraphqlparser/syntaxdefs.h +0 -19
  281. data/ext/libgraphqlparser/test/BuildCAPI.c +0 -5
  282. data/ext/libgraphqlparser/test/CMakeLists.txt +0 -25
  283. data/ext/libgraphqlparser/test/JsonVisitorTests.cpp +0 -28
  284. data/ext/libgraphqlparser/test/ParserTests.cpp +0 -352
  285. data/ext/libgraphqlparser/test/kitchen-sink.graphql +0 -59
  286. data/ext/libgraphqlparser/test/kitchen-sink.json +0 -1
  287. data/ext/libgraphqlparser/test/schema-kitchen-sink.graphql +0 -78
  288. data/ext/libgraphqlparser/test/schema-kitchen-sink.json +0 -1
  289. data/ext/libgraphqlparser/test/valgrind.supp +0 -33
  290. data/ext/version.cpp +0 -21
  291. data/lib/graphqlparser.so +0 -0
  292. data/lib/rails/graphql/native/functions.rb +0 -38
  293. data/lib/rails/graphql/native/location.rb +0 -41
  294. data/lib/rails/graphql/native/pointers.rb +0 -23
  295. data/lib/rails/graphql/native/visitor.rb +0 -349
  296. data/lib/rails/graphql/native.rb +0 -56
  297. data/test/integration/schemas/authorization.rb +0 -12
@@ -1,528 +0,0 @@
1
- #ifndef yyHEADER_H
2
- #define yyHEADER_H 1
3
- #define yyIN_HEADER 1
4
-
5
- #line 5 "lexer.h"
6
-
7
- #line 7 "lexer.h"
8
-
9
- #define YY_INT_ALIGNED short int
10
-
11
- /* A lexical scanner generated by flex */
12
-
13
- #define FLEX_SCANNER
14
- #define YY_FLEX_MAJOR_VERSION 2
15
- #define YY_FLEX_MINOR_VERSION 6
16
- #define YY_FLEX_SUBMINOR_VERSION 4
17
- #if YY_FLEX_SUBMINOR_VERSION > 0
18
- #define FLEX_BETA
19
- #endif
20
-
21
- #ifdef yyget_lval
22
- #define yyget_lval_ALREADY_DEFINED
23
- #else
24
- #define yyget_lval yyget_lval
25
- #endif
26
-
27
- #ifdef yyset_lval
28
- #define yyset_lval_ALREADY_DEFINED
29
- #else
30
- #define yyset_lval yyset_lval
31
- #endif
32
-
33
- #ifdef yyget_lloc
34
- #define yyget_lloc_ALREADY_DEFINED
35
- #else
36
- #define yyget_lloc yyget_lloc
37
- #endif
38
-
39
- #ifdef yyset_lloc
40
- #define yyset_lloc_ALREADY_DEFINED
41
- #else
42
- #define yyset_lloc yyset_lloc
43
- #endif
44
-
45
- /* First, we deal with platform-specific or compiler-specific issues. */
46
-
47
- /* begin standard C headers. */
48
- #include <stdio.h>
49
- #include <string.h>
50
- #include <errno.h>
51
- #include <stdlib.h>
52
-
53
- /* end standard C headers. */
54
-
55
- /* flex integer type definitions */
56
-
57
- #ifndef FLEXINT_H
58
- #define FLEXINT_H
59
-
60
- /* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
61
-
62
- #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
63
-
64
- /* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
65
- * if you want the limit (max/min) macros for int types.
66
- */
67
- #ifndef __STDC_LIMIT_MACROS
68
- #define __STDC_LIMIT_MACROS 1
69
- #endif
70
-
71
- #include <inttypes.h>
72
- typedef int8_t flex_int8_t;
73
- typedef uint8_t flex_uint8_t;
74
- typedef int16_t flex_int16_t;
75
- typedef uint16_t flex_uint16_t;
76
- typedef int32_t flex_int32_t;
77
- typedef uint32_t flex_uint32_t;
78
- #else
79
- typedef signed char flex_int8_t;
80
- typedef short int flex_int16_t;
81
- typedef int flex_int32_t;
82
- typedef unsigned char flex_uint8_t;
83
- typedef unsigned short int flex_uint16_t;
84
- typedef unsigned int flex_uint32_t;
85
-
86
- /* Limits of integral types. */
87
- #ifndef INT8_MIN
88
- #define INT8_MIN (-128)
89
- #endif
90
- #ifndef INT16_MIN
91
- #define INT16_MIN (-32767-1)
92
- #endif
93
- #ifndef INT32_MIN
94
- #define INT32_MIN (-2147483647-1)
95
- #endif
96
- #ifndef INT8_MAX
97
- #define INT8_MAX (127)
98
- #endif
99
- #ifndef INT16_MAX
100
- #define INT16_MAX (32767)
101
- #endif
102
- #ifndef INT32_MAX
103
- #define INT32_MAX (2147483647)
104
- #endif
105
- #ifndef UINT8_MAX
106
- #define UINT8_MAX (255U)
107
- #endif
108
- #ifndef UINT16_MAX
109
- #define UINT16_MAX (65535U)
110
- #endif
111
- #ifndef UINT32_MAX
112
- #define UINT32_MAX (4294967295U)
113
- #endif
114
-
115
- #ifndef SIZE_MAX
116
- #define SIZE_MAX (~(size_t)0)
117
- #endif
118
-
119
- #endif /* ! C99 */
120
-
121
- #endif /* ! FLEXINT_H */
122
-
123
- /* begin standard C++ headers. */
124
-
125
- /* TODO: this is always defined, so inline it */
126
- #define yyconst const
127
-
128
- #if defined(__GNUC__) && __GNUC__ >= 3
129
- #define yynoreturn __attribute__((__noreturn__))
130
- #else
131
- #define yynoreturn
132
- #endif
133
-
134
- /* An opaque pointer. */
135
- #ifndef YY_TYPEDEF_YY_SCANNER_T
136
- #define YY_TYPEDEF_YY_SCANNER_T
137
- typedef void* yyscan_t;
138
- #endif
139
-
140
- /* For convenience, these vars (plus the bison vars far below)
141
- are macros in the reentrant scanner. */
142
- #define yyin yyg->yyin_r
143
- #define yyout yyg->yyout_r
144
- #define yyextra yyg->yyextra_r
145
- #define yyleng yyg->yyleng_r
146
- #define yytext yyg->yytext_r
147
- #define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
148
- #define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
149
- #define yy_flex_debug yyg->yy_flex_debug_r
150
-
151
- /* Size of default input buffer. */
152
- #ifndef YY_BUF_SIZE
153
- #ifdef __ia64__
154
- /* On IA-64, the buffer size is 16k, not 8k.
155
- * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
156
- * Ditto for the __ia64__ case accordingly.
157
- */
158
- #define YY_BUF_SIZE 32768
159
- #else
160
- #define YY_BUF_SIZE 16384
161
- #endif /* __ia64__ */
162
- #endif
163
-
164
- #ifndef YY_TYPEDEF_YY_BUFFER_STATE
165
- #define YY_TYPEDEF_YY_BUFFER_STATE
166
- typedef struct yy_buffer_state *YY_BUFFER_STATE;
167
- #endif
168
-
169
- #ifndef YY_TYPEDEF_YY_SIZE_T
170
- #define YY_TYPEDEF_YY_SIZE_T
171
- typedef size_t yy_size_t;
172
- #endif
173
-
174
- #ifndef YY_STRUCT_YY_BUFFER_STATE
175
- #define YY_STRUCT_YY_BUFFER_STATE
176
- struct yy_buffer_state
177
- {
178
- FILE *yy_input_file;
179
-
180
- char *yy_ch_buf; /* input buffer */
181
- char *yy_buf_pos; /* current position in input buffer */
182
-
183
- /* Size of input buffer in bytes, not including room for EOB
184
- * characters.
185
- */
186
- int yy_buf_size;
187
-
188
- /* Number of characters read into yy_ch_buf, not including EOB
189
- * characters.
190
- */
191
- int yy_n_chars;
192
-
193
- /* Whether we "own" the buffer - i.e., we know we created it,
194
- * and can realloc() it to grow it, and should free() it to
195
- * delete it.
196
- */
197
- int yy_is_our_buffer;
198
-
199
- /* Whether this is an "interactive" input source; if so, and
200
- * if we're using stdio for input, then we want to use getc()
201
- * instead of fread(), to make sure we stop fetching input after
202
- * each newline.
203
- */
204
- int yy_is_interactive;
205
-
206
- /* Whether we're considered to be at the beginning of a line.
207
- * If so, '^' rules will be active on the next match, otherwise
208
- * not.
209
- */
210
- int yy_at_bol;
211
-
212
- int yy_bs_lineno; /**< The line count. */
213
- int yy_bs_column; /**< The column count. */
214
-
215
- /* Whether to try to fill the input buffer when we reach the
216
- * end of it.
217
- */
218
- int yy_fill_buffer;
219
-
220
- int yy_buffer_status;
221
-
222
- };
223
- #endif /* !YY_STRUCT_YY_BUFFER_STATE */
224
-
225
- void yyrestart ( FILE *input_file , yyscan_t yyscanner );
226
- void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );
227
- YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner );
228
- void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );
229
- void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );
230
- void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );
231
- void yypop_buffer_state ( yyscan_t yyscanner );
232
-
233
- YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner );
234
- YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner );
235
- YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner );
236
-
237
- void *yyalloc ( yy_size_t , yyscan_t yyscanner );
238
- void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner );
239
- void yyfree ( void * , yyscan_t yyscanner );
240
-
241
- /* Begin user sect3 */
242
-
243
- #define yywrap(yyscanner) (/*CONSTCOND*/1)
244
- #define YY_SKIP_YYWRAP
245
-
246
- #define yytext_ptr yytext_r
247
-
248
- #ifdef YY_HEADER_EXPORT_START_CONDITIONS
249
- #define INITIAL 0
250
- #define STRING_STATE 1
251
- #define BLOCK_STRING_STATE 2
252
- #define C_COMMENT_STATE 3
253
- #define LINE_COMMENT_STATE 4
254
-
255
- #endif
256
-
257
- #ifndef YY_NO_UNISTD_H
258
- /* Special case for "unistd.h", since it is non-ANSI. We include it way
259
- * down here because we want the user's section 1 to have been scanned first.
260
- * The user has a chance to override it with an option.
261
- */
262
- #include <unistd.h>
263
- #endif
264
-
265
- #define YY_EXTRA_TYPE struct LexerExtra *
266
-
267
- int yylex_init (yyscan_t* scanner);
268
-
269
- int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner);
270
-
271
- /* Accessor methods to globals.
272
- These are made visible to non-reentrant scanners for convenience. */
273
-
274
- int yylex_destroy ( yyscan_t yyscanner );
275
-
276
- int yyget_debug ( yyscan_t yyscanner );
277
-
278
- void yyset_debug ( int debug_flag , yyscan_t yyscanner );
279
-
280
- YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner );
281
-
282
- void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner );
283
-
284
- FILE *yyget_in ( yyscan_t yyscanner );
285
-
286
- void yyset_in ( FILE * _in_str , yyscan_t yyscanner );
287
-
288
- FILE *yyget_out ( yyscan_t yyscanner );
289
-
290
- void yyset_out ( FILE * _out_str , yyscan_t yyscanner );
291
-
292
- int yyget_leng ( yyscan_t yyscanner );
293
-
294
- char *yyget_text ( yyscan_t yyscanner );
295
-
296
- int yyget_lineno ( yyscan_t yyscanner );
297
-
298
- void yyset_lineno ( int _line_number , yyscan_t yyscanner );
299
-
300
- int yyget_column ( yyscan_t yyscanner );
301
-
302
- void yyset_column ( int _column_no , yyscan_t yyscanner );
303
-
304
- YYSTYPE * yyget_lval ( yyscan_t yyscanner );
305
-
306
- void yyset_lval ( YYSTYPE * yylval_param , yyscan_t yyscanner );
307
-
308
- YYLTYPE *yyget_lloc ( yyscan_t yyscanner );
309
-
310
- void yyset_lloc ( YYLTYPE * yylloc_param , yyscan_t yyscanner );
311
-
312
- /* Macros after this point can all be overridden by user definitions in
313
- * section 1.
314
- */
315
-
316
- #ifndef YY_SKIP_YYWRAP
317
- #ifdef __cplusplus
318
- extern "C" int yywrap ( yyscan_t yyscanner );
319
- #else
320
- extern int yywrap ( yyscan_t yyscanner );
321
- #endif
322
- #endif
323
-
324
- #ifndef yytext_ptr
325
- static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner);
326
- #endif
327
-
328
- #ifdef YY_NEED_STRLEN
329
- static int yy_flex_strlen ( const char * , yyscan_t yyscanner);
330
- #endif
331
-
332
- #ifndef YY_NO_INPUT
333
-
334
- #endif
335
-
336
- /* Amount of stuff to slurp up with each read. */
337
- #ifndef YY_READ_BUF_SIZE
338
- #ifdef __ia64__
339
- /* On IA-64, the buffer size is 16k, not 8k */
340
- #define YY_READ_BUF_SIZE 16384
341
- #else
342
- #define YY_READ_BUF_SIZE 8192
343
- #endif /* __ia64__ */
344
- #endif
345
-
346
- /* Number of entries by which start-condition stack grows. */
347
- #ifndef YY_START_STACK_INCR
348
- #define YY_START_STACK_INCR 25
349
- #endif
350
-
351
- /* Default declaration of generated scanner - a define so the user can
352
- * easily add parameters.
353
- */
354
- #ifndef YY_DECL
355
- #define YY_DECL_IS_OURS 1
356
-
357
- extern int yylex \
358
- (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner);
359
-
360
- #define YY_DECL int yylex \
361
- (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner)
362
- #endif /* !YY_DECL */
363
-
364
- /* yy_get_previous_state - get the state just before the EOB char was reached */
365
-
366
- #undef YY_NEW_FILE
367
- #undef YY_FLUSH_BUFFER
368
- #undef yy_set_bol
369
- #undef yy_new_buffer
370
- #undef yy_set_interactive
371
- #undef YY_DO_BEFORE_ACTION
372
-
373
- #ifdef YY_DECL_IS_OURS
374
- #undef YY_DECL_IS_OURS
375
- #undef YY_DECL
376
- #endif
377
-
378
- #ifndef yy_create_buffer_ALREADY_DEFINED
379
- #undef yy_create_buffer
380
- #endif
381
- #ifndef yy_delete_buffer_ALREADY_DEFINED
382
- #undef yy_delete_buffer
383
- #endif
384
- #ifndef yy_scan_buffer_ALREADY_DEFINED
385
- #undef yy_scan_buffer
386
- #endif
387
- #ifndef yy_scan_string_ALREADY_DEFINED
388
- #undef yy_scan_string
389
- #endif
390
- #ifndef yy_scan_bytes_ALREADY_DEFINED
391
- #undef yy_scan_bytes
392
- #endif
393
- #ifndef yy_init_buffer_ALREADY_DEFINED
394
- #undef yy_init_buffer
395
- #endif
396
- #ifndef yy_flush_buffer_ALREADY_DEFINED
397
- #undef yy_flush_buffer
398
- #endif
399
- #ifndef yy_load_buffer_state_ALREADY_DEFINED
400
- #undef yy_load_buffer_state
401
- #endif
402
- #ifndef yy_switch_to_buffer_ALREADY_DEFINED
403
- #undef yy_switch_to_buffer
404
- #endif
405
- #ifndef yypush_buffer_state_ALREADY_DEFINED
406
- #undef yypush_buffer_state
407
- #endif
408
- #ifndef yypop_buffer_state_ALREADY_DEFINED
409
- #undef yypop_buffer_state
410
- #endif
411
- #ifndef yyensure_buffer_stack_ALREADY_DEFINED
412
- #undef yyensure_buffer_stack
413
- #endif
414
- #ifndef yylex_ALREADY_DEFINED
415
- #undef yylex
416
- #endif
417
- #ifndef yyrestart_ALREADY_DEFINED
418
- #undef yyrestart
419
- #endif
420
- #ifndef yylex_init_ALREADY_DEFINED
421
- #undef yylex_init
422
- #endif
423
- #ifndef yylex_init_extra_ALREADY_DEFINED
424
- #undef yylex_init_extra
425
- #endif
426
- #ifndef yylex_destroy_ALREADY_DEFINED
427
- #undef yylex_destroy
428
- #endif
429
- #ifndef yyget_debug_ALREADY_DEFINED
430
- #undef yyget_debug
431
- #endif
432
- #ifndef yyset_debug_ALREADY_DEFINED
433
- #undef yyset_debug
434
- #endif
435
- #ifndef yyget_extra_ALREADY_DEFINED
436
- #undef yyget_extra
437
- #endif
438
- #ifndef yyset_extra_ALREADY_DEFINED
439
- #undef yyset_extra
440
- #endif
441
- #ifndef yyget_in_ALREADY_DEFINED
442
- #undef yyget_in
443
- #endif
444
- #ifndef yyset_in_ALREADY_DEFINED
445
- #undef yyset_in
446
- #endif
447
- #ifndef yyget_out_ALREADY_DEFINED
448
- #undef yyget_out
449
- #endif
450
- #ifndef yyset_out_ALREADY_DEFINED
451
- #undef yyset_out
452
- #endif
453
- #ifndef yyget_leng_ALREADY_DEFINED
454
- #undef yyget_leng
455
- #endif
456
- #ifndef yyget_text_ALREADY_DEFINED
457
- #undef yyget_text
458
- #endif
459
- #ifndef yyget_lineno_ALREADY_DEFINED
460
- #undef yyget_lineno
461
- #endif
462
- #ifndef yyset_lineno_ALREADY_DEFINED
463
- #undef yyset_lineno
464
- #endif
465
- #ifndef yyget_column_ALREADY_DEFINED
466
- #undef yyget_column
467
- #endif
468
- #ifndef yyset_column_ALREADY_DEFINED
469
- #undef yyset_column
470
- #endif
471
- #ifndef yywrap_ALREADY_DEFINED
472
- #undef yywrap
473
- #endif
474
- #ifndef yyget_lval_ALREADY_DEFINED
475
- #undef yyget_lval
476
- #endif
477
- #ifndef yyset_lval_ALREADY_DEFINED
478
- #undef yyset_lval
479
- #endif
480
- #ifndef yyget_lloc_ALREADY_DEFINED
481
- #undef yyget_lloc
482
- #endif
483
- #ifndef yyset_lloc_ALREADY_DEFINED
484
- #undef yyset_lloc
485
- #endif
486
- #ifndef yyalloc_ALREADY_DEFINED
487
- #undef yyalloc
488
- #endif
489
- #ifndef yyrealloc_ALREADY_DEFINED
490
- #undef yyrealloc
491
- #endif
492
- #ifndef yyfree_ALREADY_DEFINED
493
- #undef yyfree
494
- #endif
495
- #ifndef yytext_ALREADY_DEFINED
496
- #undef yytext
497
- #endif
498
- #ifndef yyleng_ALREADY_DEFINED
499
- #undef yyleng
500
- #endif
501
- #ifndef yyin_ALREADY_DEFINED
502
- #undef yyin
503
- #endif
504
- #ifndef yyout_ALREADY_DEFINED
505
- #undef yyout
506
- #endif
507
- #ifndef yy_flex_debug_ALREADY_DEFINED
508
- #undef yy_flex_debug
509
- #endif
510
- #ifndef yylineno_ALREADY_DEFINED
511
- #undef yylineno
512
- #endif
513
- #ifndef yytables_fload_ALREADY_DEFINED
514
- #undef yytables_fload
515
- #endif
516
- #ifndef yytables_destroy_ALREADY_DEFINED
517
- #undef yytables_destroy
518
- #endif
519
- #ifndef yyTABLES_NAME_ALREADY_DEFINED
520
- #undef yyTABLES_NAME
521
- #endif
522
-
523
- #line 205 "lexer.lpp"
524
-
525
-
526
- #line 526 "lexer.h"
527
- #undef yyIN_HEADER
528
- #endif /* yyHEADER_H */
@@ -1,189 +0,0 @@
1
- // A Bison parser, made by GNU Bison 3.0.5.
2
-
3
- // Locations for Bison parsers in C++
4
-
5
- // Copyright (C) 2002-2015, 2018 Free Software Foundation, Inc.
6
-
7
- // This program is free software: you can redistribute it and/or modify
8
- // it under the terms of the GNU General Public License as published by
9
- // the Free Software Foundation, either version 3 of the License, or
10
- // (at your option) any later version.
11
-
12
- // This program is distributed in the hope that it will be useful,
13
- // but WITHOUT ANY WARRANTY; without even the implied warranty of
14
- // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
- // GNU General Public License for more details.
16
-
17
- // You should have received a copy of the GNU General Public License
18
- // along with this program. If not, see <http://www.gnu.org/licenses/>.
19
-
20
- // As a special exception, you may create a larger work that contains
21
- // part or all of the Bison parser skeleton and distribute that work
22
- // under terms of your choice, so long as that work isn't itself a
23
- // parser generator using the skeleton or a modified version thereof
24
- // as a parser skeleton. Alternatively, if you modify or redistribute
25
- // the parser skeleton itself, you may (at your option) remove this
26
- // special exception, which will cause the skeleton and the resulting
27
- // Bison output files to be licensed under the GNU General Public
28
- // License without this special exception.
29
-
30
- // This special exception was added by the Free Software Foundation in
31
- // version 2.2 of Bison.
32
-
33
- /**
34
- ** \file location.hh
35
- ** Define the yy::location class.
36
- */
37
-
38
- #ifndef YY_YY_LOCATION_HH_INCLUDED
39
- # define YY_YY_LOCATION_HH_INCLUDED
40
-
41
- # include "position.hh"
42
-
43
-
44
- namespace yy {
45
- #line 46 "location.hh" // location.cc:333
46
- /// Abstract a location.
47
- class location
48
- {
49
- public:
50
-
51
- /// Construct a location from \a b to \a e.
52
- location (const position& b, const position& e)
53
- : begin (b)
54
- , end (e)
55
- {}
56
-
57
- /// Construct a 0-width location in \a p.
58
- explicit location (const position& p = position ())
59
- : begin (p)
60
- , end (p)
61
- {}
62
-
63
- /// Construct a 0-width location in \a f, \a l, \a c.
64
- explicit location (std::string* f,
65
- unsigned l = 1u,
66
- unsigned c = 1u)
67
- : begin (f, l, c)
68
- , end (f, l, c)
69
- {}
70
-
71
-
72
- /// Initialization.
73
- void initialize (std::string* f = YY_NULLPTR,
74
- unsigned l = 1u,
75
- unsigned c = 1u)
76
- {
77
- begin.initialize (f, l, c);
78
- end = begin;
79
- }
80
-
81
- /** \name Line and Column related manipulators
82
- ** \{ */
83
- public:
84
- /// Reset initial location to final location.
85
- void step ()
86
- {
87
- begin = end;
88
- }
89
-
90
- /// Extend the current location to the COUNT next columns.
91
- void columns (int count = 1)
92
- {
93
- end += count;
94
- }
95
-
96
- /// Extend the current location to the COUNT next lines.
97
- void lines (int count = 1)
98
- {
99
- end.lines (count);
100
- }
101
- /** \} */
102
-
103
-
104
- public:
105
- /// Beginning of the located region.
106
- position begin;
107
- /// End of the located region.
108
- position end;
109
- };
110
-
111
- /// Join two locations, in place.
112
- inline location& operator+= (location& res, const location& end)
113
- {
114
- res.end = end.end;
115
- return res;
116
- }
117
-
118
- /// Join two locations.
119
- inline location operator+ (location res, const location& end)
120
- {
121
- return res += end;
122
- }
123
-
124
- /// Add \a width columns to the end position, in place.
125
- inline location& operator+= (location& res, int width)
126
- {
127
- res.columns (width);
128
- return res;
129
- }
130
-
131
- /// Add \a width columns to the end position.
132
- inline location operator+ (location res, int width)
133
- {
134
- return res += width;
135
- }
136
-
137
- /// Subtract \a width columns to the end position, in place.
138
- inline location& operator-= (location& res, int width)
139
- {
140
- return res += -width;
141
- }
142
-
143
- /// Subtract \a width columns to the end position.
144
- inline location operator- (location res, int width)
145
- {
146
- return res -= width;
147
- }
148
-
149
- /// Compare two location objects.
150
- inline bool
151
- operator== (const location& loc1, const location& loc2)
152
- {
153
- return loc1.begin == loc2.begin && loc1.end == loc2.end;
154
- }
155
-
156
- /// Compare two location objects.
157
- inline bool
158
- operator!= (const location& loc1, const location& loc2)
159
- {
160
- return !(loc1 == loc2);
161
- }
162
-
163
- /** \brief Intercept output stream redirection.
164
- ** \param ostr the destination output stream
165
- ** \param loc a reference to the location to redirect
166
- **
167
- ** Avoid duplicate information.
168
- */
169
- template <typename YYChar>
170
- inline std::basic_ostream<YYChar>&
171
- operator<< (std::basic_ostream<YYChar>& ostr, const location& loc)
172
- {
173
- unsigned end_col = 0 < loc.end.column ? loc.end.column - 1 : 0;
174
- ostr << loc.begin;
175
- if (loc.end.filename
176
- && (!loc.begin.filename
177
- || *loc.begin.filename != *loc.end.filename))
178
- ostr << '-' << loc.end.filename << ':' << loc.end.line << '.' << end_col;
179
- else if (loc.begin.line < loc.end.line)
180
- ostr << '-' << loc.end.line << '.' << end_col;
181
- else if (loc.begin.column < end_col)
182
- ostr << '-' << end_col;
183
- return ostr;
184
- }
185
-
186
-
187
- } // yy
188
- #line 189 "location.hh" // location.cc:333
189
- #endif // !YY_YY_LOCATION_HH_INCLUDED