graphql-c_parser 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 9109a8a897c785a062ac9e3baa1c24d630256394e3dec22cfdbce814acfc34bb
4
+ data.tar.gz: 3986a928d6d666c6d29f0857192ac881892015b48e00e68d2014741495f8da6a
5
+ SHA512:
6
+ metadata.gz: 9e3b3e1939c719b23e43eb481997b47319fc0048fbe1b9dd91bbaae8a8eda54fcb8b5584562b03b77a7fe67ba8b8c89dba7098b6caa5906949136e59f8b4ed01
7
+ data.tar.gz: 5e7812ef9be94728a0c83de9b510bb426f474be52f028f16a7ac12453c67b22b6f635910eb384510b0ee85e133a96680080679d658bccd8f5b3e181d93ca43d2
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+ require 'mkmf'
3
+
4
+ create_makefile 'graphql/graphql_c_parser_ext'
@@ -0,0 +1,22 @@
1
+ #include "graphql_c_parser_ext.h"
2
+
3
+ VALUE GraphQL_CParser_Lexer_tokenize(VALUE self, VALUE query_string) {
4
+ return tokenize(query_string);
5
+ }
6
+
7
+ VALUE GraphQL_CParser_Parser_c_parse(VALUE self) {
8
+ yyparse(self, rb_ivar_get(self, rb_intern("@filename")));
9
+ return Qnil;
10
+ }
11
+
12
+ void Init_graphql_c_parser_ext() {
13
+ VALUE GraphQL = rb_define_module("GraphQL");
14
+ VALUE CParser = rb_define_module_under(GraphQL, "CParser");
15
+ VALUE Lexer = rb_define_module_under(CParser, "Lexer");
16
+ rb_define_singleton_method(Lexer, "tokenize", GraphQL_CParser_Lexer_tokenize, 1);
17
+ setup_static_token_variables();
18
+
19
+ VALUE Parser = rb_define_class_under(CParser, "Parser", rb_cObject);
20
+ rb_define_method(Parser, "c_parse", GraphQL_CParser_Parser_c_parse, 0);
21
+ initialize_node_class_variables();
22
+ }
@@ -0,0 +1,7 @@
1
+ #ifndef Graphql_ext_h
2
+ #define Graphql_ext_h
3
+ #include <ruby.h>
4
+ #include "lexer.h"
5
+ #include "parser.h"
6
+ void Init_graphql_c_parser_ext();
7
+ #endif