ruco-cpp 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/ruco +27 -2
- data/lib/ruco/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7c8882435b1fd99eebef6b07d7e00273934f6f47
|
4
|
+
data.tar.gz: ed82ad7551bbb55fbc589abaeb074ab2de17cf05
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e8b1333221d0061e48728e7187c0b4a569d66fe39868e72ed83deab021ebe17f6c2205f133cc713f8b7827e4a6ced041c5a4dbde8339f528e09090569dcac312
|
7
|
+
data.tar.gz: cc926f9b2347e19c1a309faaa15908067e03bcd2eb38060161341ee02fef8d3dd444ceb492da86e16aabcad703da3dbef6f43b8e775d75db31849f0f4203fd28
|
data/bin/ruco
CHANGED
@@ -22,10 +22,35 @@ File.write("#{grammar_name.capitalize}.hpp",rr.generate_header)
|
|
22
22
|
File.write("parse_#{grammar_name}.cpp",rr.generate_libcpp)
|
23
23
|
File.write("parse_#{grammar_name}.hpp",rr.generate_libhpp)
|
24
24
|
File.write("Makefile", rr.generate_makefile) unless File.exists? "Makefile"
|
25
|
-
|
25
|
+
File.write("#{grammar_name}.cpp", <<-EXAMPLE_FILE ) unless File.exists? "#{grammar_name}.cpp"
|
26
|
+
#include "parse_#{grammar_name}.hpp"
|
27
|
+
|
28
|
+
// This is an example of how you would parse a file and print its AST.
|
29
|
+
|
30
|
+
int main()
|
31
|
+
{
|
32
|
+
try
|
33
|
+
{
|
34
|
+
auto a = #{grammar_name.capitalize}::Parse("test.#{grammar_name}");
|
35
|
+
std::wcout << #{grammar_name.capitalize}::Jsonify(a).serialize() << std::endl;
|
36
|
+
return EXIT_SUCCESS;
|
37
|
+
}
|
38
|
+
catch(#{grammar_name.capitalize}::FileNotFoundException e)
|
39
|
+
{
|
40
|
+
std::wcout << "File test.#{grammar_name} not found." << std::endl;
|
41
|
+
}
|
42
|
+
catch(#{grammar_name.capitalize}::ParserException e)
|
43
|
+
{
|
44
|
+
std::wcout << e.GetMessage() << std::endl;
|
45
|
+
}
|
46
|
+
return EXIT_SUCCESS;
|
47
|
+
}
|
48
|
+
EXAMPLE_FILE
|
49
|
+
|
50
|
+
FileUtils.cp(File.join(Gem.loaded_specs['ruco-cpp'].full_gem_path, "data", "ruco-cpp", "picojson", "picojson.h"),"picojson.hpp")
|
26
51
|
|
27
52
|
atg = File.join(Dir.pwd, "#{grammar_name}.atg")
|
28
|
-
datadir = Gem.
|
53
|
+
datadir = File.join(Gem.loaded_specs['ruco-cpp'].full_gem_path, "data", "ruco-cpp")
|
29
54
|
puts atg
|
30
55
|
|
31
56
|
Cocor.compile atg, datadir, grammar_name.capitalize, "#{Dir.pwd}/"
|
data/lib/ruco/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ruco-cpp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Siaw
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-07-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -187,7 +187,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
187
187
|
version: '0'
|
188
188
|
requirements: []
|
189
189
|
rubyforge_project:
|
190
|
-
rubygems_version: 2.6.
|
190
|
+
rubygems_version: 2.6.14
|
191
191
|
signing_key:
|
192
192
|
specification_version: 4
|
193
193
|
summary: Boilerplate generator for Coco/R
|