tp_plus 0.0.73 → 0.0.74
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +74 -65
- data/Rakefile +35 -21
- data/bin/tpp +73 -73
- data/lib/tp_plus/interpreter.rb +152 -129
- data/lib/tp_plus/namespace.rb +66 -66
- data/lib/tp_plus/nodes/abort_node.rb +9 -9
- data/lib/tp_plus/nodes/address_node.rb +22 -0
- data/lib/tp_plus/nodes/argument_node.rb +20 -19
- data/lib/tp_plus/nodes/assignment_node.rb +45 -45
- data/lib/tp_plus/nodes/call_node.rb +34 -34
- data/lib/tp_plus/nodes/case_condition_node.rb +26 -26
- data/lib/tp_plus/nodes/case_node.rb +33 -33
- data/lib/tp_plus/nodes/comment_node.rb +22 -22
- data/lib/tp_plus/nodes/conditional_node.rb +60 -54
- data/lib/tp_plus/nodes/definition_node.rb +22 -22
- data/lib/tp_plus/nodes/digit_node.rb +22 -21
- data/lib/tp_plus/nodes/empty_stmt_node.rb +9 -0
- data/lib/tp_plus/nodes/eval_node.rb +13 -13
- data/lib/tp_plus/nodes/expression_node.rb +68 -65
- data/lib/tp_plus/nodes/for_node.rb +20 -20
- data/lib/tp_plus/nodes/header_node.rb +27 -27
- data/lib/tp_plus/nodes/indirect_node.rb +51 -49
- data/lib/tp_plus/nodes/inline_conditional_node.rb +40 -40
- data/lib/tp_plus/nodes/io_method_node.rb +55 -55
- data/lib/tp_plus/nodes/io_node.rb +31 -30
- data/lib/tp_plus/nodes/jump_node.rb +23 -23
- data/lib/tp_plus/nodes/label_definition_node.rb +21 -21
- data/lib/tp_plus/nodes/motion_node.rb +62 -62
- data/lib/tp_plus/nodes/namespace_node.rb +16 -16
- data/lib/tp_plus/nodes/namespaced_var_node.rb +38 -38
- data/lib/tp_plus/nodes/numreg_node.rb +26 -25
- data/lib/tp_plus/nodes/offset_node.rb +27 -27
- data/lib/tp_plus/nodes/operator_node.rb +78 -72
- data/lib/tp_plus/nodes/paren_expression_node.rb +17 -0
- data/lib/tp_plus/nodes/pause_node.rb +9 -9
- data/lib/tp_plus/nodes/position_data_node.rb +64 -50
- data/lib/tp_plus/nodes/position_node.rb +26 -25
- data/lib/tp_plus/nodes/posreg_node.rb +64 -48
- data/lib/tp_plus/nodes/raise_node.rb +13 -13
- data/lib/tp_plus/nodes/real_node.rb +27 -27
- data/lib/tp_plus/nodes/set_skip_node.rb +14 -0
- data/lib/tp_plus/nodes/skip_node.rb +22 -22
- data/lib/tp_plus/nodes/speed_node.rb +29 -29
- data/lib/tp_plus/nodes/string_node.rb +13 -13
- data/lib/tp_plus/nodes/string_register_node.rb +26 -25
- data/lib/tp_plus/nodes/termination_node.rb +23 -18
- data/lib/tp_plus/nodes/terminator_node.rb +16 -16
- data/lib/tp_plus/nodes/time_node.rb +24 -24
- data/lib/tp_plus/nodes/timer_method_node.rb +37 -37
- data/lib/tp_plus/nodes/timer_node.rb +16 -21
- data/lib/tp_plus/nodes/units_node.rb +20 -20
- data/lib/tp_plus/nodes/use_node.rb +21 -21
- data/lib/tp_plus/nodes/user_alarm_node.rb +16 -15
- data/lib/tp_plus/nodes/var_method_node.rb +23 -23
- data/lib/tp_plus/nodes/var_node.rb +39 -39
- data/lib/tp_plus/nodes/vision_register_node.rb +22 -21
- data/lib/tp_plus/nodes/wait_for_node.rb +54 -54
- data/lib/tp_plus/nodes/wait_until_node.rb +65 -65
- data/lib/tp_plus/nodes/while_node.rb +42 -36
- data/lib/tp_plus/parser.rb +1682 -1592
- data/lib/tp_plus/scanner.rb +283 -383
- data/lib/tp_plus/token.rb +97 -0
- data/lib/tp_plus/version.rb +3 -3
- data/lib/tp_plus.rb +66 -62
- data/test/test_helper.rb +5 -5
- data/test/tp_plus/test_interpreter.rb +1309 -1168
- data/test/tp_plus/test_parser.rb +496 -489
- data/test/tp_plus/test_scanner.rb +577 -522
- data/tp_plus.gemspec +31 -28
- metadata +61 -14
- data/lib/tp_plus/nodes/set_node.rb +0 -22
@@ -1,9 +1,9 @@
|
|
1
|
-
module TPPlus
|
2
|
-
module Nodes
|
3
|
-
class PauseNode
|
4
|
-
def eval(context)
|
5
|
-
"PAUSE"
|
6
|
-
end
|
7
|
-
end
|
8
|
-
end
|
9
|
-
end
|
1
|
+
module TPPlus
|
2
|
+
module Nodes
|
3
|
+
class PauseNode
|
4
|
+
def eval(context)
|
5
|
+
"PAUSE"
|
6
|
+
end
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
@@ -1,50 +1,64 @@
|
|
1
|
-
module TPPlus
|
2
|
-
module Nodes
|
3
|
-
class PositionDataNode
|
4
|
-
attr_reader :hash
|
5
|
-
def initialize(hash)
|
6
|
-
@hash = hash
|
7
|
-
@ids = []
|
8
|
-
end
|
9
|
-
|
10
|
-
def valid?
|
11
|
-
return false unless @hash[:positions].is_a?(Array)
|
12
|
-
return false if @hash[:positions].map {|p| position_valid?(p) == false }.any?
|
13
|
-
|
14
|
-
true
|
15
|
-
end
|
16
|
-
|
17
|
-
def position_valid?(position_hash)
|
18
|
-
return false if @ids.include?(position_hash[:id])
|
19
|
-
@ids.push(position_hash[:id])
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
return false unless
|
28
|
-
return false unless position_hash[:
|
29
|
-
return false unless position_hash[:
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
return false unless position_hash[:
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
1
|
+
module TPPlus
|
2
|
+
module Nodes
|
3
|
+
class PositionDataNode
|
4
|
+
attr_reader :hash
|
5
|
+
def initialize(hash)
|
6
|
+
@hash = hash
|
7
|
+
@ids = []
|
8
|
+
end
|
9
|
+
|
10
|
+
def valid?
|
11
|
+
return false unless @hash[:positions].is_a?(Array)
|
12
|
+
return false if @hash[:positions].map {|p| position_valid?(p) == false }.any?
|
13
|
+
|
14
|
+
true
|
15
|
+
end
|
16
|
+
|
17
|
+
def position_valid?(position_hash)
|
18
|
+
return false if @ids.include?(position_hash[:id])
|
19
|
+
@ids.push(position_hash[:id])
|
20
|
+
|
21
|
+
position_hash[:mask].select {|q|
|
22
|
+
!mask_valid?(q)
|
23
|
+
}.empty?
|
24
|
+
end
|
25
|
+
|
26
|
+
def mask_valid?(position_hash)
|
27
|
+
return false unless position_hash[:group].is_a?(Fixnum)
|
28
|
+
return false unless position_hash[:uframe].is_a?(Fixnum)
|
29
|
+
return false unless position_hash[:utool].is_a?(Fixnum)
|
30
|
+
|
31
|
+
if position_hash[:config].is_a?(Hash)
|
32
|
+
return false unless boolean?(position_hash[:config][:flip])
|
33
|
+
return false unless boolean?(position_hash[:config][:up])
|
34
|
+
return false unless boolean?(position_hash[:config][:top])
|
35
|
+
return false unless position_hash[:config][:turn_counts].is_a?(Array)
|
36
|
+
return false unless position_hash[:config][:turn_counts].length == 3
|
37
|
+
return false if position_hash[:config][:turn_counts].map {|tc| tc.is_a?(Fixnum) == false }.any?
|
38
|
+
return false unless position_hash[:components].is_a?(Hash)
|
39
|
+
[:x,:y,:z,:w,:p,:r].each do |component|
|
40
|
+
return false unless position_hash[:components][component].is_a?(Float)
|
41
|
+
end
|
42
|
+
else
|
43
|
+
# must be joint representation
|
44
|
+
return false unless position_hash[:components].is_a?(Hash)
|
45
|
+
position_hash[:components].each do |component|
|
46
|
+
return false unless component[1].is_a?(Float)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
true
|
51
|
+
end
|
52
|
+
|
53
|
+
def boolean?(thing)
|
54
|
+
thing.is_a?(TrueClass) || thing.is_a?(FalseClass)
|
55
|
+
end
|
56
|
+
|
57
|
+
def eval(context, options={})
|
58
|
+
raise "Invalid position data" unless valid?
|
59
|
+
context.position_data = @hash
|
60
|
+
nil
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
@@ -1,25 +1,26 @@
|
|
1
|
-
module TPPlus
|
2
|
-
module Nodes
|
3
|
-
class PositionNode
|
4
|
-
attr_accessor :comment
|
5
|
-
|
6
|
-
|
7
|
-
@
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
end
|
1
|
+
module TPPlus
|
2
|
+
module Nodes
|
3
|
+
class PositionNode
|
4
|
+
attr_accessor :comment
|
5
|
+
attr_reader :id
|
6
|
+
def initialize(id)
|
7
|
+
@id = id
|
8
|
+
@comment = ""
|
9
|
+
end
|
10
|
+
|
11
|
+
def requires_mixed_logic?(context)
|
12
|
+
false
|
13
|
+
end
|
14
|
+
|
15
|
+
def comment_string
|
16
|
+
return "" if @comment == ""
|
17
|
+
|
18
|
+
":#{@comment}"
|
19
|
+
end
|
20
|
+
|
21
|
+
def eval(context,options={})
|
22
|
+
"P[#{@id}#{comment_string}]"
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -1,48 +1,64 @@
|
|
1
|
-
module TPPlus
|
2
|
-
module Nodes
|
3
|
-
class PosregNode
|
4
|
-
|
5
|
-
COMPONENTS = {
|
6
|
-
"x" => 1,
|
7
|
-
"y" => 2,
|
8
|
-
"z" => 3,
|
9
|
-
"w" => 4,
|
10
|
-
"p" => 5,
|
11
|
-
"r" => 6
|
12
|
-
}
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
1
|
+
module TPPlus
|
2
|
+
module Nodes
|
3
|
+
class PosregNode
|
4
|
+
|
5
|
+
COMPONENTS = {
|
6
|
+
"x" => 1,
|
7
|
+
"y" => 2,
|
8
|
+
"z" => 3,
|
9
|
+
"w" => 4,
|
10
|
+
"p" => 5,
|
11
|
+
"r" => 6,
|
12
|
+
}
|
13
|
+
|
14
|
+
GROUPS = {
|
15
|
+
"gp1" => "GP1",
|
16
|
+
"gp2" => "GP2",
|
17
|
+
"gp3" => "GP3",
|
18
|
+
"gp4" => "GP4",
|
19
|
+
"gp5" => "GP5"
|
20
|
+
}
|
21
|
+
|
22
|
+
attr_accessor :comment
|
23
|
+
attr_reader :id
|
24
|
+
def initialize(id)
|
25
|
+
@id = id
|
26
|
+
@comment = ""
|
27
|
+
end
|
28
|
+
|
29
|
+
def comment_string
|
30
|
+
return "" if @comment == ""
|
31
|
+
|
32
|
+
":#{@comment}"
|
33
|
+
end
|
34
|
+
|
35
|
+
def component(m)
|
36
|
+
return "" if m == ""
|
37
|
+
|
38
|
+
",#{COMPONENTS[m]}"
|
39
|
+
end
|
40
|
+
|
41
|
+
def component_valid?(c)
|
42
|
+
[""].concat(COMPONENTS.keys).include? c
|
43
|
+
end
|
44
|
+
|
45
|
+
def component_groups?(c)
|
46
|
+
[""].concat(GROUPS.keys).include? c
|
47
|
+
end
|
48
|
+
|
49
|
+
def requires_mixed_logic?(context)
|
50
|
+
false
|
51
|
+
end
|
52
|
+
|
53
|
+
def eval(context,options={})
|
54
|
+
options[:method] ||= ""
|
55
|
+
|
56
|
+
group_string = GROUPS["gp" + options[:group].eval(context).to_s] + ":" if options[:group]
|
57
|
+
|
58
|
+
raise "Invalid component" unless component_valid?(options[:method]) || component_groups?(options[:group])
|
59
|
+
|
60
|
+
"PR[#{group_string}#{@id}#{component(options[:method])}#{comment_string}]"
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
@@ -1,13 +1,13 @@
|
|
1
|
-
module TPPlus
|
2
|
-
module Nodes
|
3
|
-
class RaiseNode
|
4
|
-
def initialize(target)
|
5
|
-
@target = target
|
6
|
-
end
|
7
|
-
|
8
|
-
def eval(context, options={})
|
9
|
-
"#{@target.eval(context)}"
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
1
|
+
module TPPlus
|
2
|
+
module Nodes
|
3
|
+
class RaiseNode
|
4
|
+
def initialize(target)
|
5
|
+
@target = target
|
6
|
+
end
|
7
|
+
|
8
|
+
def eval(context, options={})
|
9
|
+
"#{@target.eval(context)}"
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -1,27 +1,27 @@
|
|
1
|
-
module TPPlus
|
2
|
-
module Nodes
|
3
|
-
class RealNode
|
4
|
-
def initialize(value)
|
5
|
-
@value = value
|
6
|
-
end
|
7
|
-
|
8
|
-
def requires_mixed_logic?(context)
|
9
|
-
false
|
10
|
-
end
|
11
|
-
|
12
|
-
def eval(context,options={})
|
13
|
-
val = if options[:as_string]
|
14
|
-
("%.2f" % @value).sub(/^0/,'')
|
15
|
-
else
|
16
|
-
@value
|
17
|
-
end
|
18
|
-
|
19
|
-
if @value < 0
|
20
|
-
"(#{val})"
|
21
|
-
else
|
22
|
-
val
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
1
|
+
module TPPlus
|
2
|
+
module Nodes
|
3
|
+
class RealNode
|
4
|
+
def initialize(value)
|
5
|
+
@value = value
|
6
|
+
end
|
7
|
+
|
8
|
+
def requires_mixed_logic?(context)
|
9
|
+
false
|
10
|
+
end
|
11
|
+
|
12
|
+
def eval(context,options={})
|
13
|
+
val = if options[:as_string]
|
14
|
+
("%.2f" % @value).sub(/^0/,'')
|
15
|
+
else
|
16
|
+
@value
|
17
|
+
end
|
18
|
+
|
19
|
+
if @value < 0
|
20
|
+
"(#{val})"
|
21
|
+
else
|
22
|
+
val
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -1,22 +1,22 @@
|
|
1
|
-
module TPPlus
|
2
|
-
module Nodes
|
3
|
-
class SkipNode
|
4
|
-
def initialize(target, lpos_pr)
|
5
|
-
@target = target
|
6
|
-
@lpos_pr = lpos_pr
|
7
|
-
end
|
8
|
-
|
9
|
-
def lpos_pr(context)
|
10
|
-
return "" if @lpos_pr.nil?
|
11
|
-
|
12
|
-
",#{@lpos_pr.eval(context)}=LPOS"
|
13
|
-
end
|
14
|
-
|
15
|
-
def eval(context)
|
16
|
-
raise "Label (#{@target}) not found" if context.labels[@target.to_sym].nil?
|
17
|
-
|
18
|
-
"Skip,LBL[#{context.labels[@target.to_sym]}]#{lpos_pr(context)}"
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
1
|
+
module TPPlus
|
2
|
+
module Nodes
|
3
|
+
class SkipNode
|
4
|
+
def initialize(target, lpos_pr)
|
5
|
+
@target = target
|
6
|
+
@lpos_pr = lpos_pr
|
7
|
+
end
|
8
|
+
|
9
|
+
def lpos_pr(context)
|
10
|
+
return "" if @lpos_pr.nil?
|
11
|
+
|
12
|
+
",#{@lpos_pr.eval(context)}=LPOS"
|
13
|
+
end
|
14
|
+
|
15
|
+
def eval(context)
|
16
|
+
raise "Label (#{@target}) not found" if context.labels[@target.to_sym].nil?
|
17
|
+
|
18
|
+
"Skip,LBL[#{context.labels[@target.to_sym]}]#{lpos_pr(context)}"
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
@@ -1,29 +1,29 @@
|
|
1
|
-
module TPPlus
|
2
|
-
module Nodes
|
3
|
-
class SpeedNode
|
4
|
-
def initialize(speed_hash)
|
5
|
-
@speed_hash = speed_hash
|
6
|
-
end
|
7
|
-
|
8
|
-
def speed(context)
|
9
|
-
@speed_hash[:speed].eval(context)
|
10
|
-
end
|
11
|
-
|
12
|
-
def units
|
13
|
-
case @speed_hash[:units]
|
14
|
-
when "mm/s"
|
15
|
-
"mm/sec"
|
16
|
-
else
|
17
|
-
@speed_hash[:units]
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
|
22
|
-
def eval(context)
|
23
|
-
return @speed_hash[:speed] if @speed_hash[:units].nil?
|
24
|
-
|
25
|
-
"#{speed(context)}#{units}"
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
1
|
+
module TPPlus
|
2
|
+
module Nodes
|
3
|
+
class SpeedNode
|
4
|
+
def initialize(speed_hash)
|
5
|
+
@speed_hash = speed_hash
|
6
|
+
end
|
7
|
+
|
8
|
+
def speed(context)
|
9
|
+
@speed_hash[:speed].eval(context)
|
10
|
+
end
|
11
|
+
|
12
|
+
def units
|
13
|
+
case @speed_hash[:units]
|
14
|
+
when "mm/s"
|
15
|
+
"mm/sec"
|
16
|
+
else
|
17
|
+
@speed_hash[:units]
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
|
22
|
+
def eval(context)
|
23
|
+
return @speed_hash[:speed] if @speed_hash[:units].nil?
|
24
|
+
|
25
|
+
"#{speed(context)}#{units}"
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
@@ -1,13 +1,13 @@
|
|
1
|
-
module TPPlus
|
2
|
-
module Nodes
|
3
|
-
class StringNode
|
4
|
-
def initialize(s)
|
5
|
-
@s = s
|
6
|
-
end
|
7
|
-
|
8
|
-
def eval(context)
|
9
|
-
"'#{@s}'"
|
10
|
-
end
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
1
|
+
module TPPlus
|
2
|
+
module Nodes
|
3
|
+
class StringNode
|
4
|
+
def initialize(s)
|
5
|
+
@s = s
|
6
|
+
end
|
7
|
+
|
8
|
+
def eval(context)
|
9
|
+
"'#{@s}'"
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -1,25 +1,26 @@
|
|
1
|
-
module TPPlus
|
2
|
-
module Nodes
|
3
|
-
class StringRegisterNode
|
4
|
-
attr_accessor :comment
|
5
|
-
|
6
|
-
|
7
|
-
@
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
end
|
1
|
+
module TPPlus
|
2
|
+
module Nodes
|
3
|
+
class StringRegisterNode
|
4
|
+
attr_accessor :comment
|
5
|
+
attr_reader :id
|
6
|
+
def initialize(id)
|
7
|
+
@id = id
|
8
|
+
@comment = ""
|
9
|
+
end
|
10
|
+
|
11
|
+
def requires_mixed_logic?(context)
|
12
|
+
false
|
13
|
+
end
|
14
|
+
|
15
|
+
def comment_string
|
16
|
+
return "" if @comment == ""
|
17
|
+
|
18
|
+
":#{@comment}"
|
19
|
+
end
|
20
|
+
|
21
|
+
def eval(context,options={})
|
22
|
+
"SR[#{@id}#{comment_string}]"
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -1,18 +1,23 @@
|
|
1
|
-
module TPPlus
|
2
|
-
module Nodes
|
3
|
-
class TerminationNode
|
4
|
-
def initialize(value)
|
5
|
-
@value = value
|
6
|
-
end
|
7
|
-
|
8
|
-
def eval(context)
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
#
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
end
|
1
|
+
module TPPlus
|
2
|
+
module Nodes
|
3
|
+
class TerminationNode
|
4
|
+
def initialize(value)
|
5
|
+
@value = value
|
6
|
+
end
|
7
|
+
|
8
|
+
def eval(context)
|
9
|
+
val = @value.eval(context)
|
10
|
+
case val
|
11
|
+
when Integer
|
12
|
+
"CNT#{val}"
|
13
|
+
else
|
14
|
+
if val[0] == "R"
|
15
|
+
"CNT #{val}"
|
16
|
+
else
|
17
|
+
"FINE"
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -1,16 +1,16 @@
|
|
1
|
-
module TPPlus
|
2
|
-
module Nodes
|
3
|
-
class TerminatorNode
|
4
|
-
def eval(context)
|
5
|
-
nil
|
6
|
-
end
|
7
|
-
end
|
8
|
-
end
|
9
|
-
end
|
10
|
-
|
11
|
-
# IF R[1:foo]<>1,JMP LBL[100] ;
|
12
|
-
# R[1:foo]=2 ;
|
13
|
-
# JMP LBL[101] ;
|
14
|
-
# LBL[100] ;
|
15
|
-
# R[1:foo]=1 ;
|
16
|
-
# LBL[101] ;
|
1
|
+
module TPPlus
|
2
|
+
module Nodes
|
3
|
+
class TerminatorNode
|
4
|
+
def eval(context)
|
5
|
+
nil
|
6
|
+
end
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
11
|
+
# IF R[1:foo]<>1,JMP LBL[100] ;
|
12
|
+
# R[1:foo]=2 ;
|
13
|
+
# JMP LBL[101] ;
|
14
|
+
# LBL[100] ;
|
15
|
+
# R[1:foo]=1 ;
|
16
|
+
# LBL[101] ;
|