koi-reference-compiler 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +37 -14
- data/VERSION +1 -1
- data/lib/koi-reference-compiler/koi-reference-compiler.rb +1 -2
- data/lib/koi-reference-compiler/syntax_node.rb +5 -3
- data/test/{compiler/unit → unit}/ast_hash_loader/ast_hash_loader_test.rb +1 -1
- data/test/{compiler/unit → unit}/node_extensions/assignment/assignment_test.rb +1 -1
- data/test/{compiler/unit → unit}/node_extensions/blocks/block_test.rb +1 -1
- data/test/{compiler/unit → unit}/node_extensions/control_flow/if_test.rb +1 -1
- data/test/{compiler/unit → unit}/node_extensions/control_flow/unless_test.rb +1 -1
- data/test/{compiler/unit → unit}/node_extensions/expressions/additive_expression_test.rb +1 -1
- data/test/{compiler/unit → unit}/node_extensions/expressions/comparative_expression_test.rb +1 -1
- data/test/{compiler/unit → unit}/node_extensions/expressions/expression_test.rb +1 -1
- data/test/{compiler/unit → unit}/node_extensions/expressions/multitive_expression_test.rb +1 -1
- data/test/{compiler/unit → unit}/node_extensions/functions/function_call_test.rb +1 -1
- data/test/{compiler/unit → unit}/node_extensions/functions/function_definition_test.rb +1 -1
- data/test/{compiler/unit → unit}/node_extensions/hash_literals/hash_accessor_list_test.rb +1 -1
- data/test/{compiler/unit → unit}/node_extensions/hash_literals/hash_accessor_test.rb +1 -1
- data/test/{compiler/unit → unit}/node_extensions/hash_literals/hash_literal_test.rb +1 -1
- data/test/{compiler/unit → unit}/node_extensions/hash_literals/key_value_list_test.rb +1 -1
- data/test/{compiler/unit → unit}/node_extensions/hash_literals/key_value_test.rb +1 -1
- data/test/{compiler/unit → unit}/node_extensions/identifiers/identifier_test.rb +1 -1
- data/test/{compiler/unit → unit}/node_extensions/literals/false_literal_test.rb +1 -1
- data/test/{compiler/unit → unit}/node_extensions/literals/float_literal_test.rb +1 -1
- data/test/{compiler/unit → unit}/node_extensions/literals/integer_literal_test.rb +1 -1
- data/test/{compiler/unit → unit}/node_extensions/literals/nil_literal_test.rb +1 -1
- data/test/{compiler/unit → unit}/node_extensions/literals/string_literal_test.rb +1 -1
- data/test/{compiler/unit → unit}/node_extensions/literals/true_literal_test.rb +1 -1
- data/test/{compiler/unit → unit}/node_extensions/operators/addition_operator_test.rb +1 -1
- data/test/{compiler/unit → unit}/node_extensions/operators/division_operator_test.rb +1 -1
- data/test/{compiler/unit → unit}/node_extensions/operators/equality_operator_test.rb +1 -1
- data/test/{compiler/unit → unit}/node_extensions/operators/greater_than_operator_test.rb +1 -1
- data/test/{compiler/unit → unit}/node_extensions/operators/inequality_operator_test.rb +1 -1
- data/test/{compiler/unit → unit}/node_extensions/operators/less_than_operator_test.rb +1 -1
- data/test/{compiler/unit → unit}/node_extensions/operators/multiplication_operator_test.rb +1 -1
- data/test/{compiler/unit → unit}/node_extensions/operators/subtraction_operator_test.rb +1 -1
- data/test/{compiler/unit → unit}/node_extensions/statements/statement_test.rb +1 -1
- metadata +67 -67
data/README.rdoc
CHANGED
@@ -27,32 +27,55 @@ The compiler expects the AST to be passed to it in the form of a nested hash whi
|
|
27
27
|
would look like so:
|
28
28
|
|
29
29
|
{
|
30
|
-
:name => "
|
30
|
+
:name => "Block",
|
31
31
|
:text_value => "test = 1",
|
32
32
|
:offset => 0,
|
33
33
|
:elements => [
|
34
34
|
{
|
35
|
-
:name => "
|
36
|
-
:text_value => "=",
|
37
|
-
:offset =>
|
38
|
-
:elements => nil
|
39
|
-
},
|
40
|
-
{
|
41
|
-
:name => "Expression",
|
42
|
-
:text_value => "1",
|
43
|
-
:offset => 7,
|
35
|
+
:name => "Statement",
|
36
|
+
:text_value => "test = 1",
|
37
|
+
:offset => 0,
|
44
38
|
:elements => [
|
45
39
|
{
|
46
|
-
:name => "
|
47
|
-
:text_value => "1",
|
48
|
-
:offset =>
|
49
|
-
:elements =>
|
40
|
+
:name => "Assignment",
|
41
|
+
:text_value => "test = 1",
|
42
|
+
:offset => 0,
|
43
|
+
:elements => [
|
44
|
+
{
|
45
|
+
:name => "Identifier",
|
46
|
+
:text_value => "test",
|
47
|
+
:offset => 0,
|
48
|
+
:elements => nil
|
49
|
+
},
|
50
|
+
{
|
51
|
+
:name => "AssignmentOperator",
|
52
|
+
:text_value => "+",
|
53
|
+
:offset => 5,
|
54
|
+
:elements => nil
|
55
|
+
},
|
56
|
+
{
|
57
|
+
:name => "Expression",
|
58
|
+
:text_value => "1",
|
59
|
+
:offset => 7,
|
60
|
+
:elements => [
|
61
|
+
{
|
62
|
+
:name => "IntegerLiteral",
|
63
|
+
:text_value => "1",
|
64
|
+
:offset => 7,
|
65
|
+
:elements => nil
|
66
|
+
}
|
67
|
+
]
|
68
|
+
}
|
69
|
+
]
|
50
70
|
}
|
51
71
|
]
|
52
72
|
}
|
53
73
|
]
|
54
74
|
}
|
55
75
|
|
76
|
+
=== Compilation Target
|
77
|
+
|
78
|
+
This compiler produces opcodes for KoiVM virtual machines. For the reference implementation of a Koi Virtual Machine please have a look at: {koi-vm-ruby}[http://github.com/aarongough/koi-vm-ruby]
|
56
79
|
|
57
80
|
=== Installation
|
58
81
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.2
|
@@ -9,9 +9,11 @@ module KoiReferenceCompiler
|
|
9
9
|
@elements = elements
|
10
10
|
@offset = offset
|
11
11
|
@text_value = text_value
|
12
|
-
elements.
|
13
|
-
|
14
|
-
|
12
|
+
unless( elements.nil? )
|
13
|
+
elements.each do |element|
|
14
|
+
element.parent = self
|
15
|
+
end
|
16
|
+
end
|
15
17
|
end
|
16
18
|
end
|
17
19
|
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 0.0.
|
8
|
+
- 2
|
9
|
+
version: 0.0.2
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Aaron Gough
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-
|
17
|
+
date: 2010-09-01 00:00:00 -04:00
|
18
18
|
default_executable:
|
19
19
|
dependencies: []
|
20
20
|
|
@@ -72,40 +72,40 @@ files:
|
|
72
72
|
- lib/koi-reference-compiler/node_extensions/statements/statement.rb
|
73
73
|
- lib/koi-reference-compiler/syntax_node.rb
|
74
74
|
- lib/koi-reference-compiler/vm_opcodes.rb
|
75
|
-
- test/compiler/unit/ast_hash_loader/ast_hash_loader_test.rb
|
76
|
-
- test/compiler/unit/node_extensions/assignment/assignment_test.rb
|
77
|
-
- test/compiler/unit/node_extensions/blocks/block_test.rb
|
78
|
-
- test/compiler/unit/node_extensions/control_flow/if_test.rb
|
79
|
-
- test/compiler/unit/node_extensions/control_flow/unless_test.rb
|
80
|
-
- test/compiler/unit/node_extensions/expressions/additive_expression_test.rb
|
81
|
-
- test/compiler/unit/node_extensions/expressions/comparative_expression_test.rb
|
82
|
-
- test/compiler/unit/node_extensions/expressions/expression_test.rb
|
83
|
-
- test/compiler/unit/node_extensions/expressions/multitive_expression_test.rb
|
84
|
-
- test/compiler/unit/node_extensions/functions/function_call_test.rb
|
85
|
-
- test/compiler/unit/node_extensions/functions/function_definition_test.rb
|
86
|
-
- test/compiler/unit/node_extensions/hash_literals/hash_accessor_list_test.rb
|
87
|
-
- test/compiler/unit/node_extensions/hash_literals/hash_accessor_test.rb
|
88
|
-
- test/compiler/unit/node_extensions/hash_literals/hash_literal_test.rb
|
89
|
-
- test/compiler/unit/node_extensions/hash_literals/key_value_list_test.rb
|
90
|
-
- test/compiler/unit/node_extensions/hash_literals/key_value_test.rb
|
91
|
-
- test/compiler/unit/node_extensions/identifiers/identifier_test.rb
|
92
|
-
- test/compiler/unit/node_extensions/literals/false_literal_test.rb
|
93
|
-
- test/compiler/unit/node_extensions/literals/float_literal_test.rb
|
94
|
-
- test/compiler/unit/node_extensions/literals/integer_literal_test.rb
|
95
|
-
- test/compiler/unit/node_extensions/literals/nil_literal_test.rb
|
96
|
-
- test/compiler/unit/node_extensions/literals/string_literal_test.rb
|
97
|
-
- test/compiler/unit/node_extensions/literals/true_literal_test.rb
|
98
|
-
- test/compiler/unit/node_extensions/operators/addition_operator_test.rb
|
99
|
-
- test/compiler/unit/node_extensions/operators/division_operator_test.rb
|
100
|
-
- test/compiler/unit/node_extensions/operators/equality_operator_test.rb
|
101
|
-
- test/compiler/unit/node_extensions/operators/greater_than_operator_test.rb
|
102
|
-
- test/compiler/unit/node_extensions/operators/inequality_operator_test.rb
|
103
|
-
- test/compiler/unit/node_extensions/operators/less_than_operator_test.rb
|
104
|
-
- test/compiler/unit/node_extensions/operators/multiplication_operator_test.rb
|
105
|
-
- test/compiler/unit/node_extensions/operators/subtraction_operator_test.rb
|
106
|
-
- test/compiler/unit/node_extensions/statements/statement_test.rb
|
107
75
|
- test/setup/test_unit_extensions.rb
|
108
76
|
- test/test_helper.rb
|
77
|
+
- test/unit/ast_hash_loader/ast_hash_loader_test.rb
|
78
|
+
- test/unit/node_extensions/assignment/assignment_test.rb
|
79
|
+
- test/unit/node_extensions/blocks/block_test.rb
|
80
|
+
- test/unit/node_extensions/control_flow/if_test.rb
|
81
|
+
- test/unit/node_extensions/control_flow/unless_test.rb
|
82
|
+
- test/unit/node_extensions/expressions/additive_expression_test.rb
|
83
|
+
- test/unit/node_extensions/expressions/comparative_expression_test.rb
|
84
|
+
- test/unit/node_extensions/expressions/expression_test.rb
|
85
|
+
- test/unit/node_extensions/expressions/multitive_expression_test.rb
|
86
|
+
- test/unit/node_extensions/functions/function_call_test.rb
|
87
|
+
- test/unit/node_extensions/functions/function_definition_test.rb
|
88
|
+
- test/unit/node_extensions/hash_literals/hash_accessor_list_test.rb
|
89
|
+
- test/unit/node_extensions/hash_literals/hash_accessor_test.rb
|
90
|
+
- test/unit/node_extensions/hash_literals/hash_literal_test.rb
|
91
|
+
- test/unit/node_extensions/hash_literals/key_value_list_test.rb
|
92
|
+
- test/unit/node_extensions/hash_literals/key_value_test.rb
|
93
|
+
- test/unit/node_extensions/identifiers/identifier_test.rb
|
94
|
+
- test/unit/node_extensions/literals/false_literal_test.rb
|
95
|
+
- test/unit/node_extensions/literals/float_literal_test.rb
|
96
|
+
- test/unit/node_extensions/literals/integer_literal_test.rb
|
97
|
+
- test/unit/node_extensions/literals/nil_literal_test.rb
|
98
|
+
- test/unit/node_extensions/literals/string_literal_test.rb
|
99
|
+
- test/unit/node_extensions/literals/true_literal_test.rb
|
100
|
+
- test/unit/node_extensions/operators/addition_operator_test.rb
|
101
|
+
- test/unit/node_extensions/operators/division_operator_test.rb
|
102
|
+
- test/unit/node_extensions/operators/equality_operator_test.rb
|
103
|
+
- test/unit/node_extensions/operators/greater_than_operator_test.rb
|
104
|
+
- test/unit/node_extensions/operators/inequality_operator_test.rb
|
105
|
+
- test/unit/node_extensions/operators/less_than_operator_test.rb
|
106
|
+
- test/unit/node_extensions/operators/multiplication_operator_test.rb
|
107
|
+
- test/unit/node_extensions/operators/subtraction_operator_test.rb
|
108
|
+
- test/unit/node_extensions/statements/statement_test.rb
|
109
109
|
has_rdoc: true
|
110
110
|
homepage: http://github.com/aarongough/min-koi
|
111
111
|
licenses: []
|
@@ -141,37 +141,37 @@ signing_key:
|
|
141
141
|
specification_version: 3
|
142
142
|
summary: The reference compiler for the Koi language.
|
143
143
|
test_files:
|
144
|
-
- test/compiler/unit/ast_hash_loader/ast_hash_loader_test.rb
|
145
|
-
- test/compiler/unit/node_extensions/assignment/assignment_test.rb
|
146
|
-
- test/compiler/unit/node_extensions/blocks/block_test.rb
|
147
|
-
- test/compiler/unit/node_extensions/control_flow/if_test.rb
|
148
|
-
- test/compiler/unit/node_extensions/control_flow/unless_test.rb
|
149
|
-
- test/compiler/unit/node_extensions/expressions/additive_expression_test.rb
|
150
|
-
- test/compiler/unit/node_extensions/expressions/comparative_expression_test.rb
|
151
|
-
- test/compiler/unit/node_extensions/expressions/expression_test.rb
|
152
|
-
- test/compiler/unit/node_extensions/expressions/multitive_expression_test.rb
|
153
|
-
- test/compiler/unit/node_extensions/functions/function_call_test.rb
|
154
|
-
- test/compiler/unit/node_extensions/functions/function_definition_test.rb
|
155
|
-
- test/compiler/unit/node_extensions/hash_literals/hash_accessor_list_test.rb
|
156
|
-
- test/compiler/unit/node_extensions/hash_literals/hash_accessor_test.rb
|
157
|
-
- test/compiler/unit/node_extensions/hash_literals/hash_literal_test.rb
|
158
|
-
- test/compiler/unit/node_extensions/hash_literals/key_value_list_test.rb
|
159
|
-
- test/compiler/unit/node_extensions/hash_literals/key_value_test.rb
|
160
|
-
- test/compiler/unit/node_extensions/identifiers/identifier_test.rb
|
161
|
-
- test/compiler/unit/node_extensions/literals/false_literal_test.rb
|
162
|
-
- test/compiler/unit/node_extensions/literals/float_literal_test.rb
|
163
|
-
- test/compiler/unit/node_extensions/literals/integer_literal_test.rb
|
164
|
-
- test/compiler/unit/node_extensions/literals/nil_literal_test.rb
|
165
|
-
- test/compiler/unit/node_extensions/literals/string_literal_test.rb
|
166
|
-
- test/compiler/unit/node_extensions/literals/true_literal_test.rb
|
167
|
-
- test/compiler/unit/node_extensions/operators/addition_operator_test.rb
|
168
|
-
- test/compiler/unit/node_extensions/operators/division_operator_test.rb
|
169
|
-
- test/compiler/unit/node_extensions/operators/equality_operator_test.rb
|
170
|
-
- test/compiler/unit/node_extensions/operators/greater_than_operator_test.rb
|
171
|
-
- test/compiler/unit/node_extensions/operators/inequality_operator_test.rb
|
172
|
-
- test/compiler/unit/node_extensions/operators/less_than_operator_test.rb
|
173
|
-
- test/compiler/unit/node_extensions/operators/multiplication_operator_test.rb
|
174
|
-
- test/compiler/unit/node_extensions/operators/subtraction_operator_test.rb
|
175
|
-
- test/compiler/unit/node_extensions/statements/statement_test.rb
|
176
144
|
- test/setup/test_unit_extensions.rb
|
177
145
|
- test/test_helper.rb
|
146
|
+
- test/unit/ast_hash_loader/ast_hash_loader_test.rb
|
147
|
+
- test/unit/node_extensions/assignment/assignment_test.rb
|
148
|
+
- test/unit/node_extensions/blocks/block_test.rb
|
149
|
+
- test/unit/node_extensions/control_flow/if_test.rb
|
150
|
+
- test/unit/node_extensions/control_flow/unless_test.rb
|
151
|
+
- test/unit/node_extensions/expressions/additive_expression_test.rb
|
152
|
+
- test/unit/node_extensions/expressions/comparative_expression_test.rb
|
153
|
+
- test/unit/node_extensions/expressions/expression_test.rb
|
154
|
+
- test/unit/node_extensions/expressions/multitive_expression_test.rb
|
155
|
+
- test/unit/node_extensions/functions/function_call_test.rb
|
156
|
+
- test/unit/node_extensions/functions/function_definition_test.rb
|
157
|
+
- test/unit/node_extensions/hash_literals/hash_accessor_list_test.rb
|
158
|
+
- test/unit/node_extensions/hash_literals/hash_accessor_test.rb
|
159
|
+
- test/unit/node_extensions/hash_literals/hash_literal_test.rb
|
160
|
+
- test/unit/node_extensions/hash_literals/key_value_list_test.rb
|
161
|
+
- test/unit/node_extensions/hash_literals/key_value_test.rb
|
162
|
+
- test/unit/node_extensions/identifiers/identifier_test.rb
|
163
|
+
- test/unit/node_extensions/literals/false_literal_test.rb
|
164
|
+
- test/unit/node_extensions/literals/float_literal_test.rb
|
165
|
+
- test/unit/node_extensions/literals/integer_literal_test.rb
|
166
|
+
- test/unit/node_extensions/literals/nil_literal_test.rb
|
167
|
+
- test/unit/node_extensions/literals/string_literal_test.rb
|
168
|
+
- test/unit/node_extensions/literals/true_literal_test.rb
|
169
|
+
- test/unit/node_extensions/operators/addition_operator_test.rb
|
170
|
+
- test/unit/node_extensions/operators/division_operator_test.rb
|
171
|
+
- test/unit/node_extensions/operators/equality_operator_test.rb
|
172
|
+
- test/unit/node_extensions/operators/greater_than_operator_test.rb
|
173
|
+
- test/unit/node_extensions/operators/inequality_operator_test.rb
|
174
|
+
- test/unit/node_extensions/operators/less_than_operator_test.rb
|
175
|
+
- test/unit/node_extensions/operators/multiplication_operator_test.rb
|
176
|
+
- test/unit/node_extensions/operators/subtraction_operator_test.rb
|
177
|
+
- test/unit/node_extensions/statements/statement_test.rb
|