activefacts-cql 1.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +11 -0
- data/.rspec +1 -0
- data/.travis.yml +4 -0
- data/Gemfile +10 -0
- data/LICENSE.txt +21 -0
- data/README.md +19 -0
- data/Rakefile +6 -0
- data/activefacts-cql.gemspec +29 -0
- data/bin/setup +7 -0
- data/lib/activefacts/cql.rb +7 -0
- data/lib/activefacts/cql/.gitignore +0 -0
- data/lib/activefacts/cql/Rakefile +14 -0
- data/lib/activefacts/cql/compiler.rb +156 -0
- data/lib/activefacts/cql/compiler/clause.rb +1137 -0
- data/lib/activefacts/cql/compiler/constraint.rb +581 -0
- data/lib/activefacts/cql/compiler/entity_type.rb +457 -0
- data/lib/activefacts/cql/compiler/expression.rb +443 -0
- data/lib/activefacts/cql/compiler/fact.rb +390 -0
- data/lib/activefacts/cql/compiler/fact_type.rb +421 -0
- data/lib/activefacts/cql/compiler/query.rb +106 -0
- data/lib/activefacts/cql/compiler/shared.rb +161 -0
- data/lib/activefacts/cql/compiler/value_type.rb +174 -0
- data/lib/activefacts/cql/parser.rb +234 -0
- data/lib/activefacts/cql/parser/CQLParser.treetop +167 -0
- data/lib/activefacts/cql/parser/Context.treetop +48 -0
- data/lib/activefacts/cql/parser/Expressions.treetop +67 -0
- data/lib/activefacts/cql/parser/FactTypes.treetop +358 -0
- data/lib/activefacts/cql/parser/Language/English.treetop +315 -0
- data/lib/activefacts/cql/parser/Language/French.treetop +315 -0
- data/lib/activefacts/cql/parser/Language/Mandarin.treetop +304 -0
- data/lib/activefacts/cql/parser/LexicalRules.treetop +253 -0
- data/lib/activefacts/cql/parser/ObjectTypes.treetop +210 -0
- data/lib/activefacts/cql/parser/Terms.treetop +183 -0
- data/lib/activefacts/cql/parser/ValueTypes.treetop +202 -0
- data/lib/activefacts/cql/parser/nodes.rb +49 -0
- data/lib/activefacts/cql/require.rb +36 -0
- data/lib/activefacts/cql/verbaliser.rb +804 -0
- data/lib/activefacts/cql/version.rb +5 -0
- data/lib/activefacts/input/cql.rb +43 -0
- data/lib/rubygems_plugin.rb +12 -0
- metadata +167 -0
@@ -0,0 +1,43 @@
|
|
1
|
+
# Compile a CQL file into an ActiveFacts vocabulary.
|
2
|
+
#
|
3
|
+
# Copyright (c) 2009 Clifford Heath. Read the LICENSE file.
|
4
|
+
#
|
5
|
+
require 'activefacts/metamodel'
|
6
|
+
require 'activefacts/cql/parser'
|
7
|
+
require 'activefacts/cql/compiler'
|
8
|
+
|
9
|
+
module ActiveFacts
|
10
|
+
module Input #:nodoc:
|
11
|
+
# Compile CQL to an ActiveFacts vocabulary.
|
12
|
+
# Invoke as
|
13
|
+
# afgen --<generator> <file>.cql
|
14
|
+
class CQL
|
15
|
+
# Read the specified file
|
16
|
+
def self.readfile(filename)
|
17
|
+
if File.basename(filename, '.cql') == "-"
|
18
|
+
read(STDIN, "<standard input>")
|
19
|
+
else
|
20
|
+
File.open(filename) {|file|
|
21
|
+
read(file, filename)
|
22
|
+
}
|
23
|
+
end
|
24
|
+
rescue => e
|
25
|
+
# Augment the exception message, but preserve the backtrace
|
26
|
+
ne = StandardError.new("In #{filename} #{e.message.strip}")
|
27
|
+
ne.set_backtrace(e.backtrace)
|
28
|
+
raise ne
|
29
|
+
end
|
30
|
+
|
31
|
+
# Read the specified input stream
|
32
|
+
def self.read(file, filename = "stdin")
|
33
|
+
readstring(file.read, filename)
|
34
|
+
end
|
35
|
+
|
36
|
+
# Read the specified input string
|
37
|
+
def self.readstring(str, filename = "string")
|
38
|
+
compiler = ActiveFacts::CQL::Compiler.new(filename)
|
39
|
+
compiler.compile(str)
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
Gem.post_install do |installer|
|
2
|
+
if installer.spec.name == 'activefacts-cql'
|
3
|
+
pattern = installer.dir + '/lib/activefacts/cql/**/*.treetop'
|
4
|
+
files = Dir[pattern]
|
5
|
+
# Hopefully this quoting will work where there are spaces in filenames, and even maybe on Windows?
|
6
|
+
cmd = "tt '#{files*"' '"}'"
|
7
|
+
puts "Compiling Treetop grammars:"
|
8
|
+
puts cmd
|
9
|
+
system cmd
|
10
|
+
puts 'For more information on ActiveFacts, see http://dataconstellation.com/ActiveFacts/'
|
11
|
+
end
|
12
|
+
end
|
metadata
ADDED
@@ -0,0 +1,167 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: activefacts-cql
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.7.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Clifford Heath
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-10-08 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 1.10.a
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 1.10.a
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: activefacts-metamodel
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 1.7.0
|
62
|
+
- - "~>"
|
63
|
+
- !ruby/object:Gem::Version
|
64
|
+
version: '1.7'
|
65
|
+
type: :runtime
|
66
|
+
prerelease: false
|
67
|
+
version_requirements: !ruby/object:Gem::Requirement
|
68
|
+
requirements:
|
69
|
+
- - ">="
|
70
|
+
- !ruby/object:Gem::Version
|
71
|
+
version: 1.7.0
|
72
|
+
- - "~>"
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '1.7'
|
75
|
+
- !ruby/object:Gem::Dependency
|
76
|
+
name: treetop
|
77
|
+
requirement: !ruby/object:Gem::Requirement
|
78
|
+
requirements:
|
79
|
+
- - ">="
|
80
|
+
- !ruby/object:Gem::Version
|
81
|
+
version: 1.4.14
|
82
|
+
- - "~>"
|
83
|
+
- !ruby/object:Gem::Version
|
84
|
+
version: '1.4'
|
85
|
+
type: :runtime
|
86
|
+
prerelease: false
|
87
|
+
version_requirements: !ruby/object:Gem::Requirement
|
88
|
+
requirements:
|
89
|
+
- - ">="
|
90
|
+
- !ruby/object:Gem::Version
|
91
|
+
version: 1.4.14
|
92
|
+
- - "~>"
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: '1.4'
|
95
|
+
description: Compiler for the Constellation Query Language, part of the ActiveFacts
|
96
|
+
suite for Fact Modeling
|
97
|
+
email:
|
98
|
+
- clifford.heath@gmail.com
|
99
|
+
executables: []
|
100
|
+
extensions: []
|
101
|
+
extra_rdoc_files: []
|
102
|
+
files:
|
103
|
+
- ".gitignore"
|
104
|
+
- ".rspec"
|
105
|
+
- ".travis.yml"
|
106
|
+
- Gemfile
|
107
|
+
- LICENSE.txt
|
108
|
+
- README.md
|
109
|
+
- Rakefile
|
110
|
+
- activefacts-cql.gemspec
|
111
|
+
- bin/setup
|
112
|
+
- lib/activefacts/cql.rb
|
113
|
+
- lib/activefacts/cql/.gitignore
|
114
|
+
- lib/activefacts/cql/Rakefile
|
115
|
+
- lib/activefacts/cql/compiler.rb
|
116
|
+
- lib/activefacts/cql/compiler/clause.rb
|
117
|
+
- lib/activefacts/cql/compiler/constraint.rb
|
118
|
+
- lib/activefacts/cql/compiler/entity_type.rb
|
119
|
+
- lib/activefacts/cql/compiler/expression.rb
|
120
|
+
- lib/activefacts/cql/compiler/fact.rb
|
121
|
+
- lib/activefacts/cql/compiler/fact_type.rb
|
122
|
+
- lib/activefacts/cql/compiler/query.rb
|
123
|
+
- lib/activefacts/cql/compiler/shared.rb
|
124
|
+
- lib/activefacts/cql/compiler/value_type.rb
|
125
|
+
- lib/activefacts/cql/parser.rb
|
126
|
+
- lib/activefacts/cql/parser/CQLParser.treetop
|
127
|
+
- lib/activefacts/cql/parser/Context.treetop
|
128
|
+
- lib/activefacts/cql/parser/Expressions.treetop
|
129
|
+
- lib/activefacts/cql/parser/FactTypes.treetop
|
130
|
+
- lib/activefacts/cql/parser/Language/English.treetop
|
131
|
+
- lib/activefacts/cql/parser/Language/French.treetop
|
132
|
+
- lib/activefacts/cql/parser/Language/Mandarin.treetop
|
133
|
+
- lib/activefacts/cql/parser/LexicalRules.treetop
|
134
|
+
- lib/activefacts/cql/parser/ObjectTypes.treetop
|
135
|
+
- lib/activefacts/cql/parser/Terms.treetop
|
136
|
+
- lib/activefacts/cql/parser/ValueTypes.treetop
|
137
|
+
- lib/activefacts/cql/parser/nodes.rb
|
138
|
+
- lib/activefacts/cql/require.rb
|
139
|
+
- lib/activefacts/cql/verbaliser.rb
|
140
|
+
- lib/activefacts/cql/version.rb
|
141
|
+
- lib/activefacts/input/cql.rb
|
142
|
+
- lib/rubygems_plugin.rb
|
143
|
+
homepage: http://github.com/cjheath/activefacts-cql
|
144
|
+
licenses:
|
145
|
+
- MIT
|
146
|
+
metadata: {}
|
147
|
+
post_install_message:
|
148
|
+
rdoc_options: []
|
149
|
+
require_paths:
|
150
|
+
- lib
|
151
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
152
|
+
requirements:
|
153
|
+
- - ">="
|
154
|
+
- !ruby/object:Gem::Version
|
155
|
+
version: '0'
|
156
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
157
|
+
requirements:
|
158
|
+
- - ">="
|
159
|
+
- !ruby/object:Gem::Version
|
160
|
+
version: '0'
|
161
|
+
requirements: []
|
162
|
+
rubyforge_project:
|
163
|
+
rubygems_version: 2.2.2
|
164
|
+
signing_key:
|
165
|
+
specification_version: 4
|
166
|
+
summary: Compiler for the Constellation Query Language
|
167
|
+
test_files: []
|