astrapi 0.0.5 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/doc/astrapi.html +3 -2
- data/lib/compiler.rb +3 -0
- data/lib/lexer.rb +2 -2
- data/lib/parser.rb +2 -2
- data/lib/version.rb +1 -1
- metadata +10 -13
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 13c86b8b27199257c5ae8661343b6c3b4b96ee53
|
4
|
+
data.tar.gz: f7491d285d113ef5694117a78af684efbe8f3397
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cef8a631f78ff72ce9b94ff283332b237b0b49372b9436d6a99c78467fda75c0d65fa0d5d5d11d453e290c10f422191450532158a93c855fe48f6cf7d5fb32aa
|
7
|
+
data.tar.gz: be3c4df39ecb369317bf630f462371a36cb2080b128f34cef4e9dc9fd03fd4a01b615f0648360622d05166c7df9ed731492f38edf84b71ba1873926e54d6f184
|
data/doc/astrapi.html
CHANGED
@@ -52,6 +52,7 @@
|
|
52
52
|
<div style="background: #f0f3f3; overflow:auto;width:auto;border:solid gray;border-width:.1em .1em .1em .8em;padding:.2em .6em;"><pre style="margin: 0; line-height: 125%"><span style="color: #006699; font-weight: bold">module</span> <span style="color: #00CCFF; font-weight: bold">Geometry</span>
|
53
53
|
|
54
54
|
<span style="color: #006699; font-weight: bold">class</span> <span style="color: #00AA88; font-weight: bold">Scene</span>
|
55
|
+
<span style="color: #006699">attr</span> <span style="color: #336666">name</span> <span style="color: #555555">=></span> <span style="color: #336600">IDENT</span>
|
55
56
|
<span style="color: #006699">attr</span> elements <span style="color: #555555">=></span> <span style="color: #336600">Shape</span><span style="color: #555555">[]</span>
|
56
57
|
<span style="color: #006699; font-weight: bold">end</span>
|
57
58
|
|
@@ -61,11 +62,11 @@
|
|
61
62
|
<span style="color: #006699; font-weight: bold">end</span>
|
62
63
|
|
63
64
|
<span style="color: #006699; font-weight: bold">class</span> <span style="color: #00AA88; font-weight: bold">Square</span> <span style="color: #555555"><</span> <span style="color: #336600">Shape</span>
|
64
|
-
<span style="color: #006699">attr</span> size <span style="color: #555555">=></span> <span style="color: #336600">
|
65
|
+
<span style="color: #006699">attr</span> size <span style="color: #555555">=></span> <span style="color: #336600">Size</span>
|
65
66
|
<span style="color: #006699; font-weight: bold">end</span>
|
66
67
|
|
67
68
|
<span style="color: #006699; font-weight: bold">class</span> <span style="color: #00AA88; font-weight: bold">Circle</span> <span style="color: #555555"><</span> <span style="color: #336600">Shape</span>
|
68
|
-
<span style="color: #006699">attr</span> radius <span style="color: #555555">=></span> <span style="color: #336600">
|
69
|
+
<span style="color: #006699">attr</span> radius <span style="color: #555555">=></span> <span style="color: #336600">Size</span>
|
69
70
|
<span style="color: #006699; font-weight: bold">end</span>
|
70
71
|
|
71
72
|
<span style="color: #006699; font-weight: bold">class</span> <span style="color: #00AA88; font-weight: bold">Rectangle</span> <span style="color: #555555"><</span> <span style="color: #336600">Shape</span>
|
data/lib/compiler.rb
CHANGED
@@ -27,7 +27,9 @@ module Astrapi
|
|
27
27
|
end
|
28
28
|
|
29
29
|
def analyze_options args
|
30
|
+
|
30
31
|
args << "-h" if args.empty?
|
32
|
+
|
31
33
|
opt_parser = OptionParser.new do |opts|
|
32
34
|
opts.banner = "Usage: astrapi <file.mm> [options]"
|
33
35
|
|
@@ -68,6 +70,7 @@ module Astrapi
|
|
68
70
|
|
69
71
|
opts.on("-h", "--help", "Prints this help") do
|
70
72
|
puts opts
|
73
|
+
puts ">> visit Astrapi page on http://www.jcll.fr/astrapi.html <<"
|
71
74
|
exit
|
72
75
|
end
|
73
76
|
end
|
data/lib/lexer.rb
CHANGED
@@ -109,10 +109,10 @@ module Astrapi
|
|
109
109
|
case
|
110
110
|
when value = text.match(IDENT)
|
111
111
|
return Token.new [:IDENT,text,position]
|
112
|
-
when value = text.match(INT)
|
113
|
-
return Token.new [:INT,text,position]
|
114
112
|
when value = text.match(FLOAT)
|
115
113
|
return Token.new [:FLOAT,text,position]
|
114
|
+
when value = text.match(INT)
|
115
|
+
return Token.new [:INT,text,position]
|
116
116
|
when value = text.match(STRING)
|
117
117
|
return Token.new [:STRING,text,position]
|
118
118
|
when value = text.match(MODULE)
|
data/lib/parser.rb
CHANGED
@@ -11,7 +11,7 @@ module Astrapi
|
|
11
11
|
attr_accessor :lexer,:tokens
|
12
12
|
|
13
13
|
def initialize
|
14
|
-
@verbose=
|
14
|
+
@verbose=true
|
15
15
|
@lexer=Lexer.new
|
16
16
|
end
|
17
17
|
|
@@ -83,7 +83,7 @@ module Astrapi
|
|
83
83
|
|
84
84
|
def parseAttrType
|
85
85
|
indent "parseAttrType"
|
86
|
-
if showNext.is_a? [:IDENT,:FLOAT,:INT]
|
86
|
+
if showNext.is_a? [:IDENT,:FLOAT,:INT,:STRING]
|
87
87
|
type=Type.new(Identifier.new(acceptIt))
|
88
88
|
else
|
89
89
|
type=Type.new(Identifier.new(expect :identifier))
|
data/lib/version.rb
CHANGED
metadata
CHANGED
@@ -1,18 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: astrapi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jean-Christophe Le Lann
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-07-13 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
|
-
description: Starting from the metamodel of a DSL (abstract classes and their relationship),
|
14
|
-
Astrapi generates a compiler front end for this DSL. The model itself is expressed
|
15
|
-
in S-expressions
|
13
|
+
description: Starting from the metamodel of a DSL (abstract classes and their relationship), Astrapi generates a compiler front end for this DSL. The model itself is expressed in S-expressions
|
16
14
|
email: lelannje@ensta-bretagne.fr
|
17
15
|
executables:
|
18
16
|
- astrapi
|
@@ -48,25 +46,24 @@ homepage: http://www.jcll.fr/astrapi.html
|
|
48
46
|
licenses:
|
49
47
|
- MIT
|
50
48
|
metadata: {}
|
51
|
-
post_install_message: Thanks for installing!
|
52
|
-
and astrapi/tests.
|
49
|
+
post_install_message: 'Thanks for installing! Homepage : http://www.jcll.fr/astrapi.html'
|
53
50
|
rdoc_options: []
|
54
51
|
require_paths:
|
55
52
|
- lib
|
56
53
|
required_ruby_version: !ruby/object:Gem::Requirement
|
57
54
|
requirements:
|
58
|
-
- -
|
55
|
+
- - '>='
|
59
56
|
- !ruby/object:Gem::Version
|
60
57
|
version: 2.0.0
|
61
58
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
62
59
|
requirements:
|
63
|
-
- -
|
60
|
+
- - '>='
|
64
61
|
- !ruby/object:Gem::Version
|
65
62
|
version: '0'
|
66
63
|
requirements: []
|
67
|
-
rubyforge_project:
|
68
|
-
rubygems_version: 2.4.
|
69
|
-
signing_key:
|
64
|
+
rubyforge_project:
|
65
|
+
rubygems_version: 2.4.5
|
66
|
+
signing_key:
|
70
67
|
specification_version: 4
|
71
68
|
summary: meta-compiler for S-expression based Domain Specific Languages (DSL)
|
72
69
|
test_files: []
|