vhdl_tb 0.7.0 → 0.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ast.rb +7 -0
- data/lib/compiler.rb +1 -2
- data/lib/lexer.rb +1 -0
- data/lib/parser.rb +23 -14
- data/lib/version.rb +3 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b5c6a6e2dc9eec1e858d36aa4d1c7467ae22c0c8ee24910bc230ffc50ba409f4
|
4
|
+
data.tar.gz: d29098424d3055528c4fe5b1e93158df56df4f886c6ed268a78e58852df3612b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 59163613e1106f9e386ec27d2dc09f98a5cb0c903ef098c8dacb9ce9de91dc42036782c3af6e787d62f34d745668e2bb57cbebbfc1f3f25dcf9f434bd3cdf6f4
|
7
|
+
data.tar.gz: 2b5be7ebff918648a8f78eaa0b194d6f344fbfcf8fa0a605ddadf76ca819914a092f4e352129789a72bc9191fe1f422e646436e02feffc952313749e699bf037
|
data/lib/ast.rb
CHANGED
data/lib/compiler.rb
CHANGED
@@ -4,6 +4,7 @@ require 'optparse'
|
|
4
4
|
|
5
5
|
require_relative 'ast'
|
6
6
|
require_relative 'parser'
|
7
|
+
require_relative 'version'
|
7
8
|
|
8
9
|
module VHDL_TB
|
9
10
|
|
@@ -11,8 +12,6 @@ module VHDL_TB
|
|
11
12
|
|
12
13
|
class Compiler
|
13
14
|
|
14
|
-
VERSION = "0.7.0"
|
15
|
-
|
16
15
|
def initialize
|
17
16
|
#puts __dir__
|
18
17
|
banner
|
data/lib/lexer.rb
CHANGED
data/lib/parser.rb
CHANGED
@@ -3,8 +3,6 @@ require_relative 'generic_parser'
|
|
3
3
|
require_relative 'ast'
|
4
4
|
require_relative 'lexer'
|
5
5
|
|
6
|
-
require 'pp'
|
7
|
-
|
8
6
|
module VHDL_TB
|
9
7
|
|
10
8
|
class Parser < GenericParser
|
@@ -143,24 +141,35 @@ module VHDL_TB
|
|
143
141
|
|
144
142
|
def parse_type
|
145
143
|
type=Identifier.new
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
type.
|
144
|
+
case showNext.kind
|
145
|
+
when :identifier
|
146
|
+
type.tok=expect(:identifier)
|
147
|
+
if showNext.is_a? :lparen
|
148
|
+
acceptIt
|
149
|
+
name=type.tok
|
150
|
+
type=VectorType.new
|
151
|
+
type.name=name
|
152
|
+
type.lhs=parse_expression
|
153
|
+
if showNext.is_a? [:downto,:to]
|
154
|
+
type.dir=acceptIt
|
155
|
+
end
|
156
|
+
type.rhs=parse_expression
|
157
|
+
expect :rparen
|
155
158
|
end
|
156
|
-
|
157
|
-
|
159
|
+
else
|
160
|
+
type.tok=acceptIt # natural,...
|
158
161
|
end
|
159
162
|
type
|
160
163
|
end
|
161
164
|
|
162
165
|
def parse_expression
|
163
|
-
parse_term
|
166
|
+
e1=parse_term
|
167
|
+
while showNext.is_a? [:plus,:minus,:times,:div]
|
168
|
+
op=acceptIt
|
169
|
+
e2=parse_term
|
170
|
+
e1=Binary.new(e1,op,e2)
|
171
|
+
end
|
172
|
+
return e1
|
164
173
|
end
|
165
174
|
|
166
175
|
def parse_term
|
data/lib/version.rb
ADDED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vhdl_tb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jean-Christophe Le Lann
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-02-25 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A simple testbench generator for VHDL
|
14
14
|
email: jean-christophe.le_lann@ensta-bretagne.fr
|
@@ -28,6 +28,7 @@ files:
|
|
28
28
|
- lib/parser.rb
|
29
29
|
- lib/template.tb.vhd
|
30
30
|
- lib/token.rb
|
31
|
+
- lib/version.rb
|
31
32
|
- tests/circuit.vhd
|
32
33
|
homepage: http://rubygems.org/gems/vhdl_tb
|
33
34
|
licenses:
|