cddlc 0.1.0 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/cddlc +7 -26
- data/cddlc.gemspec +2 -2
- data/data/rfc8727.cddl +946 -0
- data/data/rfc8927.cddl +96 -0
- data/data/rfc8990.cddl +213 -0
- data/data/rfc9052.cddl +154 -0
- data/data/rfc9053.cddl +21 -0
- data/data/rfc9054.cddl +13 -0
- data/data/rfc9090.cddl +14 -0
- data/data/rfc9115.cddl +99 -0
- data/data/rfc9164.cddl +32 -0
- data/data/rfc9165.cddl +35 -0
- data/data/rfc9171.cddl +334 -0
- data/data/rfc9173.cddl +36 -0
- data/data/rfc9177.cddl +6 -0
- data/data/rfc9202.cddl +6 -0
- data/data/rfc9203.cddl +11 -0
- data/data/rfc9237.cddl +27 -0
- data/data/rfc9277.cddl +11 -0
- data/data/rfc9290.cddl +37 -0
- data/data/rfc9321.cddl +67 -0
- data/data/rfc9338.cddl +34 -0
- data/lib/cddlc.rb +111 -5
- data/lib/parser/cddl-util.rb +1 -1
- data/lib/processor/cddl-expander.rb +13 -10
- data/lib/processor/cddl-undefined.rb +38 -0
- data/lib/processor/cddl-visitor.rb +2 -0
- data/lib/writer/cddl-writer.rb +38 -25
- metadata +23 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ed5e9bd6c8caace67d29c6549fd30d59fc2c17c06b671f63868d2ecb6ea0031b
|
4
|
+
data.tar.gz: 03d6d40e1ebf19da17117ca725ba09c60c33867606953d2566fd86ace2805e9a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2b1790d8845935f61f7c12070dbb95f223a6e1914c813dbf85e4ae3979b1fbcbf37abd5730a3a471c1a5777464a8fc966d36835e20df41d3e19a17203e0969f8
|
7
|
+
data.tar.gz: f0884c20358c0a7edaf9df050c79d93f3df7dfb42ceb44ee59b3cc0cb8f318a5ad5efa08964dd259d3a211dd6bcc8a1b2eed5f636cae4ca5a80b524c3a40fdab
|
data/bin/cddlc
CHANGED
@@ -58,6 +58,9 @@ begin
|
|
58
58
|
opts.on("-u", "--[no-]undefined", "Note undefined names") do |v|
|
59
59
|
$options.note_undefined = v
|
60
60
|
end
|
61
|
+
opts.on("-2", "--[no-]cddl2", "Perform some CDDL 2.0 processing") do |v|
|
62
|
+
$options.cddl2 = v
|
63
|
+
end
|
61
64
|
opts.on("-tFMT", "--to=FMT", [:basic, :neat, :json, :yaml, :enum, :cddl], "Target format") do |v|
|
62
65
|
$options.target = v
|
63
66
|
end
|
@@ -116,32 +119,10 @@ when :enum
|
|
116
119
|
when :cddl
|
117
120
|
require_relative '../lib/writer/cddl-writer.rb'
|
118
121
|
if $options.note_undefined
|
119
|
-
require_relative
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
cddl.rules.each do |k, v|
|
124
|
-
def_gen[k[0]] = true if Array === k
|
125
|
-
cddl.visit(v) do |p, &block|
|
126
|
-
case p
|
127
|
-
in ["gen", name, *_gen_args]
|
128
|
-
gen_used[name] = true
|
129
|
-
in ["name", name]
|
130
|
-
used[name] = true
|
131
|
-
else
|
132
|
-
false
|
133
|
-
end
|
134
|
-
end
|
135
|
-
end
|
136
|
-
used.each do |k, v|
|
137
|
-
unless cddl.rules[k] || cddl.prelude.rules[k]
|
138
|
-
puts ";;; *** undefined: #{k}"
|
139
|
-
end
|
140
|
-
end
|
141
|
-
gen_used.each do |k, v|
|
142
|
-
unless def_gen[k]
|
143
|
-
puts ";;; *** undefined: #{k}<>"
|
144
|
-
end
|
122
|
+
require_relative '../lib/processor/cddl-undefined.rb'
|
123
|
+
undef_rule = cddl.cddl_undefined
|
124
|
+
undef_rule.each do |k|
|
125
|
+
puts ";;; *** undefined: #{k}"
|
145
126
|
end
|
146
127
|
end
|
147
128
|
puts cddl.to_s
|
data/cddlc.gemspec
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = "cddlc"
|
3
|
-
s.version = "0.1.
|
3
|
+
s.version = "0.1.2"
|
4
4
|
s.summary = "CDDL (Concise Data Definition Language) converters and miscellaneous tools"
|
5
5
|
s.description = %q{cddlc implements converters and miscellaneous tools for CDDL, RFC 8610}
|
6
6
|
s.author = "Carsten Bormann"
|
7
7
|
s.email = "cabo@tzi.org"
|
8
8
|
s.license = "MIT"
|
9
9
|
s.homepage = "http://github.com/cabo/cddlc"
|
10
|
-
s.files = Dir['lib/**/*.rb'] + %w(cddlc.gemspec data
|
10
|
+
s.files = Dir['lib/**/*.rb'] + %w(cddlc.gemspec) + Dir['data/*.cddl'] + Dir['bin/**/*.rb']
|
11
11
|
s.executables = Dir['bin/*'].map {|x| File.basename(x)}
|
12
12
|
s.required_ruby_version = '>= 1.9.2'
|
13
13
|
|