occi 1.2.1 → 2.0.0

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.
Files changed (99) hide show
  1. data/.gitignore +9 -0
  2. data/.project +32 -0
  3. data/.rspec +1 -0
  4. data/.travis.yml +8 -0
  5. data/.yardopts +1 -0
  6. data/AUTHORS +8 -0
  7. data/Gemfile +35 -14
  8. data/Gemfile.lock +89 -32
  9. data/LICENSE +13 -4
  10. data/README.md +70 -21
  11. data/Rakefile +25 -21
  12. data/lib/OpenNebula/Acl.rb +256 -0
  13. data/lib/OpenNebula/AclPool.rb +53 -0
  14. data/lib/OpenNebula/Group.rb +147 -0
  15. data/lib/OpenNebula/GroupPool.rb +54 -0
  16. data/lib/OpenNebula/Host.rb +143 -0
  17. data/lib/OpenNebula/HostPool.rb +55 -0
  18. data/lib/OpenNebula/Image.rb +256 -0
  19. data/lib/OpenNebula/ImagePool.rb +74 -0
  20. data/lib/OpenNebula/OpenNebula.rb +137 -0
  21. data/lib/OpenNebula/Pool.rb +285 -0
  22. data/lib/OpenNebula/Template.rb +173 -0
  23. data/lib/OpenNebula/TemplatePool.rb +74 -0
  24. data/lib/OpenNebula/User.rb +157 -0
  25. data/lib/OpenNebula/UserPool.rb +53 -0
  26. data/lib/OpenNebula/VirtualMachine.rb +319 -0
  27. data/lib/OpenNebula/VirtualMachinePool.rb +120 -0
  28. data/lib/OpenNebula/VirtualNetwork.rb +229 -0
  29. data/lib/OpenNebula/VirtualNetworkPool.rb +74 -0
  30. data/lib/OpenNebula/XMLUtils.rb +337 -0
  31. data/lib/occi/antlr/.gitignore +18 -0
  32. data/lib/occi/antlr/OCCI.g +164 -0
  33. data/lib/occi/antlr/OCCI.tokens +75 -0
  34. data/lib/occi/antlr/OCCILexer.rb +1532 -0
  35. data/lib/occi/antlr/OCCIParser.rb +2472 -0
  36. data/lib/occi/antlr/README.md +2 -0
  37. data/lib/occi/backend/dummy.rb +232 -0
  38. data/lib/occi/backend/ec2/Compute.rb +310 -0
  39. data/lib/occi/backend/ec2/compute.rb +310 -0
  40. data/lib/occi/backend/ec2/ec2.rb +215 -0
  41. data/lib/occi/backend/manager.rb +131 -0
  42. data/lib/occi/backend/opennebula/compute.rb +360 -0
  43. data/lib/occi/backend/opennebula/network.rb +143 -0
  44. data/lib/occi/backend/opennebula/opennebula.rb +188 -0
  45. data/lib/occi/backend/opennebula/storage.rb +175 -0
  46. data/lib/occi/configuration.rb +118 -0
  47. data/lib/occi/core/action.rb +29 -0
  48. data/lib/occi/core/attribute_properties.rb +54 -0
  49. data/lib/occi/core/attributes.rb +40 -0
  50. data/lib/occi/core/category.rb +62 -0
  51. data/lib/occi/core/collection.rb +27 -0
  52. data/lib/occi/core/entity.rb +135 -0
  53. data/lib/occi/core/kind.rb +55 -0
  54. data/lib/occi/core/link.rb +88 -0
  55. data/lib/occi/core/mixin.rb +43 -0
  56. data/lib/occi/core/resource.rb +73 -0
  57. data/lib/occi/exceptions.rb +59 -0
  58. data/lib/occi/extensions/monitoring/cpu.rb +51 -0
  59. data/lib/occi/extensions/monitoring/memory.rb +49 -0
  60. data/lib/occi/extensions/monitoring/metric.rb +54 -0
  61. data/lib/occi/extensions/monitoring/netrx.rb +49 -0
  62. data/lib/occi/extensions/monitoring/nettx.rb +55 -0
  63. data/lib/occi/extensions/one/VNC.rb +58 -0
  64. data/lib/occi/extensions/one/vnc.rb +58 -0
  65. data/lib/occi/log.rb +47 -0
  66. data/lib/occi/parse.rb +164 -0
  67. data/lib/occi/registry.rb +87 -0
  68. data/lib/occi/server.rb +594 -0
  69. data/lib/occi/version.rb +3 -0
  70. data/occi.gemspec +18 -96
  71. data/spec/occi/antlr/parser_spec.rb +82 -0
  72. data/spec/spec_helper.rb +6 -0
  73. metadata +100 -208
  74. data/.autotest +0 -21
  75. data/.rvmrc +0 -1
  76. data/VERSION +0 -1
  77. data/lib/occi.rb +0 -1
  78. data/lib/occi/client.rb +0 -36
  79. data/lib/occi/compute.rb +0 -4
  80. data/lib/occi/network.rb +0 -4
  81. data/lib/occi/resource.rb +0 -59
  82. data/lib/occi/storage.rb +0 -7
  83. data/test/fixtures/cassettes/compute_all.yml +0 -28
  84. data/test/fixtures/cassettes/compute_create.yml +0 -45
  85. data/test/fixtures/cassettes/compute_destroy.yml +0 -22
  86. data/test/fixtures/cassettes/compute_find.yml +0 -28
  87. data/test/fixtures/cassettes/compute_update.yml +0 -35
  88. data/test/fixtures/cassettes/network_all.yml +0 -28
  89. data/test/fixtures/cassettes/network_create.yml +0 -37
  90. data/test/fixtures/cassettes/network_destroy.yml +0 -22
  91. data/test/fixtures/cassettes/network_find.yml +0 -28
  92. data/test/fixtures/cassettes/storage_all.yml +0 -28
  93. data/test/fixtures/cassettes/storage_create.yml +0 -50
  94. data/test/fixtures/cassettes/storage_destroy.yml +0 -22
  95. data/test/fixtures/cassettes/storage_find.yml +0 -28
  96. data/test/lib/occi/compute_test.rb +0 -91
  97. data/test/lib/occi/network_test.rb +0 -57
  98. data/test/lib/occi/storage_test.rb +0 -67
  99. data/test/test_helper.rb +0 -48
@@ -0,0 +1,18 @@
1
+ *.gem
2
+ *.rbc
3
+ .bundle
4
+ .config
5
+ coverage
6
+ InstalledFiles
7
+ lib/bundler/man
8
+ pkg
9
+ rdoc
10
+ spec/reports
11
+ test/tmp
12
+ test/version_tmp
13
+ tmp
14
+
15
+ # YARD artifacts
16
+ .yardoc
17
+ _yardoc
18
+ doc/
@@ -0,0 +1,164 @@
1
+ /*
2
+ Copyright (c) 2008-2011, Intel Performance Learning Solutions Ltd.
3
+ All rights reserved.
4
+
5
+ Redistribution and use in source and binary forms, with or without
6
+ modification, are permitted provided that the following conditions are met:
7
+ * Redistributions of source code must retain the above copyright
8
+ notice, this list of conditions and the following disclaimer.
9
+ * Redistributions in binary form must reproduce the above copyright
10
+ notice, this list of conditions and the following disclaimer in the
11
+ documentation and/or other materials provided with the distribution.
12
+ * Neither the name of Intel Performance Learning Solutions Ltd. nor the
13
+ names of its contributors may be used to endorse or promote products
14
+ derived from this software without specific prior written permission.
15
+
16
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19
+ DISCLAIMED. IN NO EVENT SHALL Intel Performance Learning Solutions Ltd. BE LIABLE FOR ANY
20
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26
+ */
27
+
28
+ grammar OCCI;
29
+
30
+ options {
31
+ language = Ruby;
32
+ }
33
+
34
+ @header {
35
+ require 'uri'
36
+ require 'hashie'
37
+ ATTRIBUTE = { :mutable => true, :required => false, :type => { :string => {} }, :default => '' }
38
+ }
39
+
40
+ /*
41
+ e.g.
42
+ Category: storage;
43
+ scheme="http://schemas.ogf.org/occi/infrastructure#";
44
+ class="kind";
45
+ title="Storage Resource How's your quote's escaping \" ?";
46
+ rel="http://schemas.ogf.org/occi/core#resource";
47
+ location="/storage/";
48
+ attributes="occi.storage.size occi.storage.state";
49
+ actions="http://schemas.ogf.org/occi/infrastructure/storage/action#resize http://schemas.ogf.org/occi/infrastructure/storage/action#online"
50
+ */
51
+
52
+ category returns [hash]
53
+ : 'Category' ':' category_value { hash = $category_value.hash };
54
+ category_value returns [hash]
55
+ @init{ hash = Hashie::Mash.new( {:kinds=>[],:mixins=>[],:actions=>[] } ) }
56
+ : category_term category_scheme category_class category_title? category_rel? category_location? category_attributes? category_actions? ';'?
57
+ { type = $category_class.value
58
+ cat = Hashie::Mash.new
59
+ cat.term = $category_term.value
60
+ cat.scheme = $category_scheme.value
61
+ cat.title = $category_title.value
62
+ cat.related = $category_rel.value
63
+ cat.location = $category_location.value
64
+ cat.attributes = $category_attributes.hash
65
+ cat.actions = $category_actions.array
66
+ hash[(type+'s').to_sym] << cat
67
+ };
68
+ category_term returns [value] : WS? term
69
+ { value = $term.text };
70
+ category_scheme returns [value] : ';' WS? 'scheme' '=' '"' scheme '"'
71
+ { value = $scheme.text };
72
+ category_class returns [value] : ';' WS? 'class' '=' '"' class_type '"'
73
+ { value = $class_type.text };
74
+ category_title returns [value] : ';' WS? 'title' '=' '"' title '"'
75
+ { value = $title.text };
76
+ category_rel returns [value] : ';' WS? 'rel' '=' '"' rel '"'
77
+ { value = $rel.text };
78
+ category_location returns [value] : ';' WS? 'location' '=' '"' location '"'
79
+ { value = $location.text };
80
+ category_attributes returns [hash] @init{hash = Hashie::Mash.new}
81
+ : ';' WS? 'attributes' '=' '"' attr=attribute_name { hash.merge!($attr.hash) }
82
+ ( WS? next_attr=attribute_name { hash.merge!($next_attr.hash) } )* '"';
83
+ category_actions returns [array] @init{array = Array.new}
84
+ : ';' WS? 'actions' '=' '"' act=action_location { array << $act.text }
85
+ ( WS? next_act=action_location { array << $next_act.text } )* '"';
86
+
87
+ /* e.g.
88
+ Link:
89
+ </storage/disk03>;
90
+ rel="http://example.com/occi/resource#storage";
91
+ self="/link/456-456-456";
92
+ category="http://example.com/occi/link#disk_drive";
93
+ com.example.drive0.interface="ide0"; com.example.drive1.interface="ide1"
94
+ */
95
+
96
+ link returns [hash]
97
+ : 'Link' ':' link_value { hash = $link_value.hash };
98
+ link_value returns [hash]
99
+ @init{ hash = Hashie::Mash.new }
100
+ : link_target { hash[:target] = $link_target.value }
101
+ link_rel { hash[:rel] = $link_rel.value }
102
+ link_self? { hash[:self] = $link_self.value }
103
+ link_category? { hash[:category] = $link_category.value }
104
+ link_attributes { hash[:attributes] = $link_attributes.hash }
105
+ ';'?
106
+ ;
107
+ link_target returns [value] : WS? '<' target '>' { value = $target.text };
108
+ link_rel returns [value] : ';' WS? 'rel' '=' '"' rel '"' { value = $rel.text };
109
+ link_self returns [value] : ';' WS? 'self' '=' '"' self_location '"' { value = $self_location.text };
110
+ link_category returns [value] : ';' WS? 'category' '=' '"' category_name '"' { value = $category_name.text };
111
+ link_attributes returns [hash] @init { hash = Hashie::Mash.new }
112
+ : (';' WS? attribute { hash.merge!($attribute.hash) } )*;
113
+
114
+ /*
115
+ e.g.
116
+ X-OCCI-Attribute: occi.compute.architechture="x86_64"
117
+ X-OCCI-Attribute: occi.compute.cores=2
118
+ X-OCCI-Attribute: occi.compute.hostname="testserver"
119
+ X-OCCI-Attribute: occi.compute.speed=2.66
120
+ X-OCCI-Attribute: occi.compute.memory=3.0
121
+ X-OCCI-Attribute: occi.compute.state="active"
122
+ */
123
+
124
+ x_occi_attribute returns [hash]
125
+ : 'X-OCCI-Attribute' ':' WS? attribute ';'? { hash = $attribute.hash } ;
126
+
127
+ /*
128
+ e.g.
129
+ X-OCCI-Location: http://example.com/compute/123
130
+ X-OCCI-Location: http://example.com/compute/456
131
+ */
132
+
133
+ x_occi_location returns [uri]
134
+ : 'X-OCCI-Location' ':' WS? location ';'? { uri = URI.parse($location.text) } ;
135
+
136
+ uri : ( LOALPHA | UPALPHA | DIGIT | '@' | ':' | '%' | '_' | '\\' | '+' | '.' | '~' | '#' | '?' | '&' | '/' | '=' | '-' | 'action' | 'kind' | 'mixin' )+;
137
+ term : LOALPHA ( LOALPHA | DIGIT | '-' | '_')*;
138
+ scheme : uri;
139
+ class_type : ( 'kind' | 'mixin' | 'action' );
140
+ title : ( ESC | ~( '\\' | '"' | '\'' ) | '\'' )*;
141
+ rel : uri;
142
+ location : uri;
143
+ attribute returns [hash] @init { hash = Hashie::Mash.new }
144
+ : comp_first=attribute_component { cur_hash = hash; comp = $comp_first.text }
145
+ ( '.' comp_next=attribute_component { cur_hash[comp.to_sym] = Hashie::Mash.new; cur_hash = cur_hash[comp.to_sym]; comp = $comp_next.text })*
146
+ '=' attribute_value { cur_hash[comp.to_sym] = $attribute_value.value };
147
+ attribute_name returns [hash] @init { hash = Hashie::Mash.new }
148
+ : comp_first=attribute_component { cur_hash = hash; comp = $comp_first.text }
149
+ ( '.' comp_next=attribute_component { cur_hash[comp.to_sym] = Hashie::Mash.new; cur_hash = cur_hash[comp.to_sym]; comp = $comp_next.text })*
150
+ { cur_hash[comp.to_sym] = ATTRIBUTE };
151
+ attribute_component : LOALPHA ( LOALPHA | DIGIT | '-' | '_' )*;
152
+ attribute_value returns [value] : ( string { value = $string.text } | number { value = $number.text.to_i } );
153
+ string : ( '"' ( ESC | ~( '\\' | '"' | '\'' ) | '\'' )* '"');
154
+ number : ( DIGIT* ( '.' DIGIT+ )? );
155
+ action_location : uri;
156
+ target : uri;
157
+ self_location : uri;
158
+ category_name : uri;
159
+
160
+ LOALPHA : ('a'..'z')+;
161
+ UPALPHA : ('A'..'Z')+;
162
+ DIGIT : ('0'..'9');
163
+ WS : ( '\t' | ' ' | '\r' | '\n'| '\u000C' )+;
164
+ ESC : '\\' ( '"' | '\'' );
@@ -0,0 +1,75 @@
1
+ T__29=29
2
+ T__28=28
3
+ T__27=27
4
+ T__26=26
5
+ T__25=25
6
+ T__24=24
7
+ T__23=23
8
+ T__22=22
9
+ ESC=8
10
+ T__21=21
11
+ T__20=20
12
+ T__9=9
13
+ T__19=19
14
+ T__16=16
15
+ T__15=15
16
+ T__18=18
17
+ T__17=17
18
+ T__12=12
19
+ T__11=11
20
+ T__14=14
21
+ T__13=13
22
+ T__10=10
23
+ DIGIT=7
24
+ LOALPHA=5
25
+ T__42=42
26
+ T__43=43
27
+ T__40=40
28
+ T__41=41
29
+ T__30=30
30
+ T__31=31
31
+ T__32=32
32
+ T__33=33
33
+ WS=4
34
+ T__34=34
35
+ T__35=35
36
+ T__36=36
37
+ T__37=37
38
+ UPALPHA=6
39
+ T__38=38
40
+ T__39=39
41
+ '#'=35
42
+ 'class'=15
43
+ '~'=34
44
+ 'Link'=21
45
+ '/'=38
46
+ 'kind'=41
47
+ '>'=23
48
+ '\\'=31
49
+ ';'=11
50
+ '='=13
51
+ '@'=28
52
+ 'Category'=9
53
+ '+'=32
54
+ 'X-OCCI-Attribute'=26
55
+ '_'=30
56
+ '.'=33
57
+ '%'=29
58
+ 'attributes'=19
59
+ 'scheme'=12
60
+ '"'=14
61
+ 'rel'=17
62
+ 'actions'=20
63
+ 'location'=18
64
+ 'action'=40
65
+ '\''=43
66
+ '?'=36
67
+ 'title'=16
68
+ 'mixin'=42
69
+ '<'=22
70
+ ':'=10
71
+ '-'=39
72
+ 'self'=24
73
+ 'X-OCCI-Location'=27
74
+ '&'=37
75
+ 'category'=25
@@ -0,0 +1,1532 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # OCCI.g
4
+ # --
5
+ # Generated using ANTLR version: 3.2.1-SNAPSHOT Jul 31, 2010 19:34:52
6
+ # Ruby runtime library version: 1.8.11
7
+ # Input grammar file: OCCI.g
8
+ # Generated at: 2012-05-18 21:42:45
9
+ #
10
+
11
+ # ~~~> start load path setup
12
+ this_directory = File.expand_path(File.dirname(__FILE__))
13
+ $LOAD_PATH.unshift(this_directory) unless $LOAD_PATH.include?(this_directory)
14
+
15
+ antlr_load_failed = proc do
16
+ load_path = $LOAD_PATH.map { |dir| ' - ' << dir }.join($/)
17
+ raise LoadError, <<-END.strip!
18
+
19
+ Failed to load the ANTLR3 runtime library (version 1.8.11):
20
+
21
+ Ensure the library has been installed on your system and is available
22
+ on the load path. If rubygems is available on your system, this can
23
+ be done with the command:
24
+
25
+ gem install antlr3
26
+
27
+ Current load path:
28
+ #{ load_path }
29
+
30
+ END
31
+ end
32
+
33
+ defined?(ANTLR3) or begin
34
+
35
+ # 1: try to load the ruby antlr3 runtime library from the system path
36
+ require 'antlr3'
37
+
38
+ rescue LoadError
39
+
40
+ # 2: try to load rubygems if it isn't already loaded
41
+ defined?(Gem) or begin
42
+ require 'rubygems'
43
+ rescue LoadError
44
+ antlr_load_failed.call
45
+ end
46
+
47
+ # 3: try to activate the antlr3 gem
48
+ begin
49
+ Gem.activate('antlr3', '~> 1.8.11')
50
+ rescue Gem::LoadError
51
+ antlr_load_failed.call
52
+ end
53
+
54
+ require 'antlr3'
55
+
56
+ end
57
+ # <~~~ end load path setup
58
+
59
+
60
+ module OCCI
61
+ # TokenData defines all of the token type integer values
62
+ # as constants, which will be included in all
63
+ # ANTLR-generated recognizers.
64
+ const_defined?(:TokenData) or TokenData = ANTLR3::TokenScheme.new
65
+
66
+ module TokenData
67
+
68
+ # define the token constants
69
+ define_tokens(:T__29 => 29, :T__28 => 28, :T__27 => 27, :T__26 => 26,
70
+ :T__25 => 25, :T__24 => 24, :T__23 => 23, :ESC => 8,
71
+ :T__22 => 22, :T__21 => 21, :T__20 => 20, :EOF => -1,
72
+ :T__9 => 9, :T__19 => 19, :T__16 => 16, :T__15 => 15,
73
+ :T__18 => 18, :T__17 => 17, :T__12 => 12, :T__11 => 11,
74
+ :T__14 => 14, :T__13 => 13, :T__10 => 10, :DIGIT => 7,
75
+ :LOALPHA => 5, :T__42 => 42, :T__43 => 43, :T__40 => 40,
76
+ :T__41 => 41, :T__30 => 30, :T__31 => 31, :T__32 => 32,
77
+ :T__33 => 33, :WS => 4, :T__34 => 34, :T__35 => 35, :T__36 => 36,
78
+ :T__37 => 37, :UPALPHA => 6, :T__38 => 38, :T__39 => 39)
79
+
80
+ end
81
+
82
+
83
+ class Lexer < ANTLR3::Lexer
84
+ @grammar_home = OCCI
85
+ include TokenData
86
+
87
+
88
+ begin
89
+ generated_using("OCCI.g", "3.2.1-SNAPSHOT Jul 31, 2010 19:34:52", "1.8.11")
90
+ rescue NoMethodError => error
91
+ # ignore
92
+ end
93
+
94
+ RULE_NAMES = ["T__9", "T__10", "T__11", "T__12", "T__13", "T__14",
95
+ "T__15", "T__16", "T__17", "T__18", "T__19", "T__20",
96
+ "T__21", "T__22", "T__23", "T__24", "T__25", "T__26",
97
+ "T__27", "T__28", "T__29", "T__30", "T__31", "T__32",
98
+ "T__33", "T__34", "T__35", "T__36", "T__37", "T__38",
99
+ "T__39", "T__40", "T__41", "T__42", "T__43", "LOALPHA",
100
+ "UPALPHA", "DIGIT", "WS", "ESC"].freeze
101
+ RULE_METHODS = [:t__9!, :t__10!, :t__11!, :t__12!, :t__13!, :t__14!,
102
+ :t__15!, :t__16!, :t__17!, :t__18!, :t__19!, :t__20!,
103
+ :t__21!, :t__22!, :t__23!, :t__24!, :t__25!, :t__26!,
104
+ :t__27!, :t__28!, :t__29!, :t__30!, :t__31!, :t__32!,
105
+ :t__33!, :t__34!, :t__35!, :t__36!, :t__37!, :t__38!,
106
+ :t__39!, :t__40!, :t__41!, :t__42!, :t__43!, :loalpha!,
107
+ :upalpha!, :digit!, :ws!, :esc!].freeze
108
+
109
+
110
+ def initialize(input=nil, options = {})
111
+ super(input, options)
112
+
113
+ end
114
+
115
+
116
+ # - - - - - - - - - - - lexer rules - - - - - - - - - - - -
117
+ # lexer rule t__9! (T__9)
118
+ # (in OCCI.g)
119
+ def t__9!
120
+ # -> uncomment the next line to manually enable rule tracing
121
+ # trace_in( __method__, 1 )
122
+
123
+ type = T__9
124
+ channel = ANTLR3::DEFAULT_CHANNEL
125
+
126
+
127
+ # - - - - main rule block - - - -
128
+ # at line 7:8: 'Category'
129
+ match("Category")
130
+
131
+
132
+ @state.type = type
133
+ @state.channel = channel
134
+
135
+ ensure
136
+ # -> uncomment the next line to manually enable rule tracing
137
+ # trace_out( __method__, 1 )
138
+
139
+ end
140
+
141
+ # lexer rule t__10! (T__10)
142
+ # (in OCCI.g)
143
+ def t__10!
144
+ # -> uncomment the next line to manually enable rule tracing
145
+ # trace_in( __method__, 2 )
146
+
147
+ type = T__10
148
+ channel = ANTLR3::DEFAULT_CHANNEL
149
+
150
+
151
+ # - - - - main rule block - - - -
152
+ # at line 8:9: ':'
153
+ match(0x3a)
154
+
155
+
156
+ @state.type = type
157
+ @state.channel = channel
158
+
159
+ ensure
160
+ # -> uncomment the next line to manually enable rule tracing
161
+ # trace_out( __method__, 2 )
162
+
163
+ end
164
+
165
+ # lexer rule t__11! (T__11)
166
+ # (in OCCI.g)
167
+ def t__11!
168
+ # -> uncomment the next line to manually enable rule tracing
169
+ # trace_in( __method__, 3 )
170
+
171
+ type = T__11
172
+ channel = ANTLR3::DEFAULT_CHANNEL
173
+
174
+
175
+ # - - - - main rule block - - - -
176
+ # at line 9:9: ';'
177
+ match(0x3b)
178
+
179
+
180
+ @state.type = type
181
+ @state.channel = channel
182
+
183
+ ensure
184
+ # -> uncomment the next line to manually enable rule tracing
185
+ # trace_out( __method__, 3 )
186
+
187
+ end
188
+
189
+ # lexer rule t__12! (T__12)
190
+ # (in OCCI.g)
191
+ def t__12!
192
+ # -> uncomment the next line to manually enable rule tracing
193
+ # trace_in( __method__, 4 )
194
+
195
+ type = T__12
196
+ channel = ANTLR3::DEFAULT_CHANNEL
197
+
198
+
199
+ # - - - - main rule block - - - -
200
+ # at line 10:9: 'scheme'
201
+ match("scheme")
202
+
203
+
204
+ @state.type = type
205
+ @state.channel = channel
206
+
207
+ ensure
208
+ # -> uncomment the next line to manually enable rule tracing
209
+ # trace_out( __method__, 4 )
210
+
211
+ end
212
+
213
+ # lexer rule t__13! (T__13)
214
+ # (in OCCI.g)
215
+ def t__13!
216
+ # -> uncomment the next line to manually enable rule tracing
217
+ # trace_in( __method__, 5 )
218
+
219
+ type = T__13
220
+ channel = ANTLR3::DEFAULT_CHANNEL
221
+
222
+
223
+ # - - - - main rule block - - - -
224
+ # at line 11:9: '='
225
+ match(0x3d)
226
+
227
+
228
+ @state.type = type
229
+ @state.channel = channel
230
+
231
+ ensure
232
+ # -> uncomment the next line to manually enable rule tracing
233
+ # trace_out( __method__, 5 )
234
+
235
+ end
236
+
237
+ # lexer rule t__14! (T__14)
238
+ # (in OCCI.g)
239
+ def t__14!
240
+ # -> uncomment the next line to manually enable rule tracing
241
+ # trace_in( __method__, 6 )
242
+
243
+ type = T__14
244
+ channel = ANTLR3::DEFAULT_CHANNEL
245
+
246
+
247
+ # - - - - main rule block - - - -
248
+ # at line 12:9: '\"'
249
+ match(0x22)
250
+
251
+
252
+ @state.type = type
253
+ @state.channel = channel
254
+
255
+ ensure
256
+ # -> uncomment the next line to manually enable rule tracing
257
+ # trace_out( __method__, 6 )
258
+
259
+ end
260
+
261
+ # lexer rule t__15! (T__15)
262
+ # (in OCCI.g)
263
+ def t__15!
264
+ # -> uncomment the next line to manually enable rule tracing
265
+ # trace_in( __method__, 7 )
266
+
267
+ type = T__15
268
+ channel = ANTLR3::DEFAULT_CHANNEL
269
+
270
+
271
+ # - - - - main rule block - - - -
272
+ # at line 13:9: 'class'
273
+ match("class")
274
+
275
+
276
+ @state.type = type
277
+ @state.channel = channel
278
+
279
+ ensure
280
+ # -> uncomment the next line to manually enable rule tracing
281
+ # trace_out( __method__, 7 )
282
+
283
+ end
284
+
285
+ # lexer rule t__16! (T__16)
286
+ # (in OCCI.g)
287
+ def t__16!
288
+ # -> uncomment the next line to manually enable rule tracing
289
+ # trace_in( __method__, 8 )
290
+
291
+ type = T__16
292
+ channel = ANTLR3::DEFAULT_CHANNEL
293
+
294
+
295
+ # - - - - main rule block - - - -
296
+ # at line 14:9: 'title'
297
+ match("title")
298
+
299
+
300
+ @state.type = type
301
+ @state.channel = channel
302
+
303
+ ensure
304
+ # -> uncomment the next line to manually enable rule tracing
305
+ # trace_out( __method__, 8 )
306
+
307
+ end
308
+
309
+ # lexer rule t__17! (T__17)
310
+ # (in OCCI.g)
311
+ def t__17!
312
+ # -> uncomment the next line to manually enable rule tracing
313
+ # trace_in( __method__, 9 )
314
+
315
+ type = T__17
316
+ channel = ANTLR3::DEFAULT_CHANNEL
317
+
318
+
319
+ # - - - - main rule block - - - -
320
+ # at line 15:9: 'rel'
321
+ match("rel")
322
+
323
+
324
+ @state.type = type
325
+ @state.channel = channel
326
+
327
+ ensure
328
+ # -> uncomment the next line to manually enable rule tracing
329
+ # trace_out( __method__, 9 )
330
+
331
+ end
332
+
333
+ # lexer rule t__18! (T__18)
334
+ # (in OCCI.g)
335
+ def t__18!
336
+ # -> uncomment the next line to manually enable rule tracing
337
+ # trace_in( __method__, 10 )
338
+
339
+ type = T__18
340
+ channel = ANTLR3::DEFAULT_CHANNEL
341
+
342
+
343
+ # - - - - main rule block - - - -
344
+ # at line 16:9: 'location'
345
+ match("location")
346
+
347
+
348
+ @state.type = type
349
+ @state.channel = channel
350
+
351
+ ensure
352
+ # -> uncomment the next line to manually enable rule tracing
353
+ # trace_out( __method__, 10 )
354
+
355
+ end
356
+
357
+ # lexer rule t__19! (T__19)
358
+ # (in OCCI.g)
359
+ def t__19!
360
+ # -> uncomment the next line to manually enable rule tracing
361
+ # trace_in( __method__, 11 )
362
+
363
+ type = T__19
364
+ channel = ANTLR3::DEFAULT_CHANNEL
365
+
366
+
367
+ # - - - - main rule block - - - -
368
+ # at line 17:9: 'attributes'
369
+ match("attributes")
370
+
371
+
372
+ @state.type = type
373
+ @state.channel = channel
374
+
375
+ ensure
376
+ # -> uncomment the next line to manually enable rule tracing
377
+ # trace_out( __method__, 11 )
378
+
379
+ end
380
+
381
+ # lexer rule t__20! (T__20)
382
+ # (in OCCI.g)
383
+ def t__20!
384
+ # -> uncomment the next line to manually enable rule tracing
385
+ # trace_in( __method__, 12 )
386
+
387
+ type = T__20
388
+ channel = ANTLR3::DEFAULT_CHANNEL
389
+
390
+
391
+ # - - - - main rule block - - - -
392
+ # at line 18:9: 'actions'
393
+ match("actions")
394
+
395
+
396
+ @state.type = type
397
+ @state.channel = channel
398
+
399
+ ensure
400
+ # -> uncomment the next line to manually enable rule tracing
401
+ # trace_out( __method__, 12 )
402
+
403
+ end
404
+
405
+ # lexer rule t__21! (T__21)
406
+ # (in OCCI.g)
407
+ def t__21!
408
+ # -> uncomment the next line to manually enable rule tracing
409
+ # trace_in( __method__, 13 )
410
+
411
+ type = T__21
412
+ channel = ANTLR3::DEFAULT_CHANNEL
413
+
414
+
415
+ # - - - - main rule block - - - -
416
+ # at line 19:9: 'Link'
417
+ match("Link")
418
+
419
+
420
+ @state.type = type
421
+ @state.channel = channel
422
+
423
+ ensure
424
+ # -> uncomment the next line to manually enable rule tracing
425
+ # trace_out( __method__, 13 )
426
+
427
+ end
428
+
429
+ # lexer rule t__22! (T__22)
430
+ # (in OCCI.g)
431
+ def t__22!
432
+ # -> uncomment the next line to manually enable rule tracing
433
+ # trace_in( __method__, 14 )
434
+
435
+ type = T__22
436
+ channel = ANTLR3::DEFAULT_CHANNEL
437
+
438
+
439
+ # - - - - main rule block - - - -
440
+ # at line 20:9: '<'
441
+ match(0x3c)
442
+
443
+
444
+ @state.type = type
445
+ @state.channel = channel
446
+
447
+ ensure
448
+ # -> uncomment the next line to manually enable rule tracing
449
+ # trace_out( __method__, 14 )
450
+
451
+ end
452
+
453
+ # lexer rule t__23! (T__23)
454
+ # (in OCCI.g)
455
+ def t__23!
456
+ # -> uncomment the next line to manually enable rule tracing
457
+ # trace_in( __method__, 15 )
458
+
459
+ type = T__23
460
+ channel = ANTLR3::DEFAULT_CHANNEL
461
+
462
+
463
+ # - - - - main rule block - - - -
464
+ # at line 21:9: '>'
465
+ match(0x3e)
466
+
467
+
468
+ @state.type = type
469
+ @state.channel = channel
470
+
471
+ ensure
472
+ # -> uncomment the next line to manually enable rule tracing
473
+ # trace_out( __method__, 15 )
474
+
475
+ end
476
+
477
+ # lexer rule t__24! (T__24)
478
+ # (in OCCI.g)
479
+ def t__24!
480
+ # -> uncomment the next line to manually enable rule tracing
481
+ # trace_in( __method__, 16 )
482
+
483
+ type = T__24
484
+ channel = ANTLR3::DEFAULT_CHANNEL
485
+
486
+
487
+ # - - - - main rule block - - - -
488
+ # at line 22:9: 'self'
489
+ match("self")
490
+
491
+
492
+ @state.type = type
493
+ @state.channel = channel
494
+
495
+ ensure
496
+ # -> uncomment the next line to manually enable rule tracing
497
+ # trace_out( __method__, 16 )
498
+
499
+ end
500
+
501
+ # lexer rule t__25! (T__25)
502
+ # (in OCCI.g)
503
+ def t__25!
504
+ # -> uncomment the next line to manually enable rule tracing
505
+ # trace_in( __method__, 17 )
506
+
507
+ type = T__25
508
+ channel = ANTLR3::DEFAULT_CHANNEL
509
+
510
+
511
+ # - - - - main rule block - - - -
512
+ # at line 23:9: 'category'
513
+ match("category")
514
+
515
+
516
+ @state.type = type
517
+ @state.channel = channel
518
+
519
+ ensure
520
+ # -> uncomment the next line to manually enable rule tracing
521
+ # trace_out( __method__, 17 )
522
+
523
+ end
524
+
525
+ # lexer rule t__26! (T__26)
526
+ # (in OCCI.g)
527
+ def t__26!
528
+ # -> uncomment the next line to manually enable rule tracing
529
+ # trace_in( __method__, 18 )
530
+
531
+ type = T__26
532
+ channel = ANTLR3::DEFAULT_CHANNEL
533
+
534
+
535
+ # - - - - main rule block - - - -
536
+ # at line 24:9: 'X-OCCI-Attribute'
537
+ match("X-OCCI-Attribute")
538
+
539
+
540
+ @state.type = type
541
+ @state.channel = channel
542
+
543
+ ensure
544
+ # -> uncomment the next line to manually enable rule tracing
545
+ # trace_out( __method__, 18 )
546
+
547
+ end
548
+
549
+ # lexer rule t__27! (T__27)
550
+ # (in OCCI.g)
551
+ def t__27!
552
+ # -> uncomment the next line to manually enable rule tracing
553
+ # trace_in( __method__, 19 )
554
+
555
+ type = T__27
556
+ channel = ANTLR3::DEFAULT_CHANNEL
557
+
558
+
559
+ # - - - - main rule block - - - -
560
+ # at line 25:9: 'X-OCCI-Location'
561
+ match("X-OCCI-Location")
562
+
563
+
564
+ @state.type = type
565
+ @state.channel = channel
566
+
567
+ ensure
568
+ # -> uncomment the next line to manually enable rule tracing
569
+ # trace_out( __method__, 19 )
570
+
571
+ end
572
+
573
+ # lexer rule t__28! (T__28)
574
+ # (in OCCI.g)
575
+ def t__28!
576
+ # -> uncomment the next line to manually enable rule tracing
577
+ # trace_in( __method__, 20 )
578
+
579
+ type = T__28
580
+ channel = ANTLR3::DEFAULT_CHANNEL
581
+
582
+
583
+ # - - - - main rule block - - - -
584
+ # at line 26:9: '@'
585
+ match(0x40)
586
+
587
+
588
+ @state.type = type
589
+ @state.channel = channel
590
+
591
+ ensure
592
+ # -> uncomment the next line to manually enable rule tracing
593
+ # trace_out( __method__, 20 )
594
+
595
+ end
596
+
597
+ # lexer rule t__29! (T__29)
598
+ # (in OCCI.g)
599
+ def t__29!
600
+ # -> uncomment the next line to manually enable rule tracing
601
+ # trace_in( __method__, 21 )
602
+
603
+ type = T__29
604
+ channel = ANTLR3::DEFAULT_CHANNEL
605
+
606
+
607
+ # - - - - main rule block - - - -
608
+ # at line 27:9: '%'
609
+ match(0x25)
610
+
611
+
612
+ @state.type = type
613
+ @state.channel = channel
614
+
615
+ ensure
616
+ # -> uncomment the next line to manually enable rule tracing
617
+ # trace_out( __method__, 21 )
618
+
619
+ end
620
+
621
+ # lexer rule t__30! (T__30)
622
+ # (in OCCI.g)
623
+ def t__30!
624
+ # -> uncomment the next line to manually enable rule tracing
625
+ # trace_in( __method__, 22 )
626
+
627
+ type = T__30
628
+ channel = ANTLR3::DEFAULT_CHANNEL
629
+
630
+
631
+ # - - - - main rule block - - - -
632
+ # at line 28:9: '_'
633
+ match(0x5f)
634
+
635
+
636
+ @state.type = type
637
+ @state.channel = channel
638
+
639
+ ensure
640
+ # -> uncomment the next line to manually enable rule tracing
641
+ # trace_out( __method__, 22 )
642
+
643
+ end
644
+
645
+ # lexer rule t__31! (T__31)
646
+ # (in OCCI.g)
647
+ def t__31!
648
+ # -> uncomment the next line to manually enable rule tracing
649
+ # trace_in( __method__, 23 )
650
+
651
+ type = T__31
652
+ channel = ANTLR3::DEFAULT_CHANNEL
653
+
654
+
655
+ # - - - - main rule block - - - -
656
+ # at line 29:9: '\\\\'
657
+ match(0x5c)
658
+
659
+
660
+ @state.type = type
661
+ @state.channel = channel
662
+
663
+ ensure
664
+ # -> uncomment the next line to manually enable rule tracing
665
+ # trace_out( __method__, 23 )
666
+
667
+ end
668
+
669
+ # lexer rule t__32! (T__32)
670
+ # (in OCCI.g)
671
+ def t__32!
672
+ # -> uncomment the next line to manually enable rule tracing
673
+ # trace_in( __method__, 24 )
674
+
675
+ type = T__32
676
+ channel = ANTLR3::DEFAULT_CHANNEL
677
+
678
+
679
+ # - - - - main rule block - - - -
680
+ # at line 30:9: '+'
681
+ match(0x2b)
682
+
683
+
684
+ @state.type = type
685
+ @state.channel = channel
686
+
687
+ ensure
688
+ # -> uncomment the next line to manually enable rule tracing
689
+ # trace_out( __method__, 24 )
690
+
691
+ end
692
+
693
+ # lexer rule t__33! (T__33)
694
+ # (in OCCI.g)
695
+ def t__33!
696
+ # -> uncomment the next line to manually enable rule tracing
697
+ # trace_in( __method__, 25 )
698
+
699
+ type = T__33
700
+ channel = ANTLR3::DEFAULT_CHANNEL
701
+
702
+
703
+ # - - - - main rule block - - - -
704
+ # at line 31:9: '.'
705
+ match(0x2e)
706
+
707
+
708
+ @state.type = type
709
+ @state.channel = channel
710
+
711
+ ensure
712
+ # -> uncomment the next line to manually enable rule tracing
713
+ # trace_out( __method__, 25 )
714
+
715
+ end
716
+
717
+ # lexer rule t__34! (T__34)
718
+ # (in OCCI.g)
719
+ def t__34!
720
+ # -> uncomment the next line to manually enable rule tracing
721
+ # trace_in( __method__, 26 )
722
+
723
+ type = T__34
724
+ channel = ANTLR3::DEFAULT_CHANNEL
725
+
726
+
727
+ # - - - - main rule block - - - -
728
+ # at line 32:9: '~'
729
+ match(0x7e)
730
+
731
+
732
+ @state.type = type
733
+ @state.channel = channel
734
+
735
+ ensure
736
+ # -> uncomment the next line to manually enable rule tracing
737
+ # trace_out( __method__, 26 )
738
+
739
+ end
740
+
741
+ # lexer rule t__35! (T__35)
742
+ # (in OCCI.g)
743
+ def t__35!
744
+ # -> uncomment the next line to manually enable rule tracing
745
+ # trace_in( __method__, 27 )
746
+
747
+ type = T__35
748
+ channel = ANTLR3::DEFAULT_CHANNEL
749
+
750
+
751
+ # - - - - main rule block - - - -
752
+ # at line 33:9: '#'
753
+ match(0x23)
754
+
755
+
756
+ @state.type = type
757
+ @state.channel = channel
758
+
759
+ ensure
760
+ # -> uncomment the next line to manually enable rule tracing
761
+ # trace_out( __method__, 27 )
762
+
763
+ end
764
+
765
+ # lexer rule t__36! (T__36)
766
+ # (in OCCI.g)
767
+ def t__36!
768
+ # -> uncomment the next line to manually enable rule tracing
769
+ # trace_in( __method__, 28 )
770
+
771
+ type = T__36
772
+ channel = ANTLR3::DEFAULT_CHANNEL
773
+
774
+
775
+ # - - - - main rule block - - - -
776
+ # at line 34:9: '?'
777
+ match(0x3f)
778
+
779
+
780
+ @state.type = type
781
+ @state.channel = channel
782
+
783
+ ensure
784
+ # -> uncomment the next line to manually enable rule tracing
785
+ # trace_out( __method__, 28 )
786
+
787
+ end
788
+
789
+ # lexer rule t__37! (T__37)
790
+ # (in OCCI.g)
791
+ def t__37!
792
+ # -> uncomment the next line to manually enable rule tracing
793
+ # trace_in( __method__, 29 )
794
+
795
+ type = T__37
796
+ channel = ANTLR3::DEFAULT_CHANNEL
797
+
798
+
799
+ # - - - - main rule block - - - -
800
+ # at line 35:9: '&'
801
+ match(0x26)
802
+
803
+
804
+ @state.type = type
805
+ @state.channel = channel
806
+
807
+ ensure
808
+ # -> uncomment the next line to manually enable rule tracing
809
+ # trace_out( __method__, 29 )
810
+
811
+ end
812
+
813
+ # lexer rule t__38! (T__38)
814
+ # (in OCCI.g)
815
+ def t__38!
816
+ # -> uncomment the next line to manually enable rule tracing
817
+ # trace_in( __method__, 30 )
818
+
819
+ type = T__38
820
+ channel = ANTLR3::DEFAULT_CHANNEL
821
+
822
+
823
+ # - - - - main rule block - - - -
824
+ # at line 36:9: '/'
825
+ match(0x2f)
826
+
827
+
828
+ @state.type = type
829
+ @state.channel = channel
830
+
831
+ ensure
832
+ # -> uncomment the next line to manually enable rule tracing
833
+ # trace_out( __method__, 30 )
834
+
835
+ end
836
+
837
+ # lexer rule t__39! (T__39)
838
+ # (in OCCI.g)
839
+ def t__39!
840
+ # -> uncomment the next line to manually enable rule tracing
841
+ # trace_in( __method__, 31 )
842
+
843
+ type = T__39
844
+ channel = ANTLR3::DEFAULT_CHANNEL
845
+
846
+
847
+ # - - - - main rule block - - - -
848
+ # at line 37:9: '-'
849
+ match(0x2d)
850
+
851
+
852
+ @state.type = type
853
+ @state.channel = channel
854
+
855
+ ensure
856
+ # -> uncomment the next line to manually enable rule tracing
857
+ # trace_out( __method__, 31 )
858
+
859
+ end
860
+
861
+ # lexer rule t__40! (T__40)
862
+ # (in OCCI.g)
863
+ def t__40!
864
+ # -> uncomment the next line to manually enable rule tracing
865
+ # trace_in( __method__, 32 )
866
+
867
+ type = T__40
868
+ channel = ANTLR3::DEFAULT_CHANNEL
869
+
870
+
871
+ # - - - - main rule block - - - -
872
+ # at line 38:9: 'action'
873
+ match("action")
874
+
875
+
876
+ @state.type = type
877
+ @state.channel = channel
878
+
879
+ ensure
880
+ # -> uncomment the next line to manually enable rule tracing
881
+ # trace_out( __method__, 32 )
882
+
883
+ end
884
+
885
+ # lexer rule t__41! (T__41)
886
+ # (in OCCI.g)
887
+ def t__41!
888
+ # -> uncomment the next line to manually enable rule tracing
889
+ # trace_in( __method__, 33 )
890
+
891
+ type = T__41
892
+ channel = ANTLR3::DEFAULT_CHANNEL
893
+
894
+
895
+ # - - - - main rule block - - - -
896
+ # at line 39:9: 'kind'
897
+ match("kind")
898
+
899
+
900
+ @state.type = type
901
+ @state.channel = channel
902
+
903
+ ensure
904
+ # -> uncomment the next line to manually enable rule tracing
905
+ # trace_out( __method__, 33 )
906
+
907
+ end
908
+
909
+ # lexer rule t__42! (T__42)
910
+ # (in OCCI.g)
911
+ def t__42!
912
+ # -> uncomment the next line to manually enable rule tracing
913
+ # trace_in( __method__, 34 )
914
+
915
+ type = T__42
916
+ channel = ANTLR3::DEFAULT_CHANNEL
917
+
918
+
919
+ # - - - - main rule block - - - -
920
+ # at line 40:9: 'mixin'
921
+ match("mixin")
922
+
923
+
924
+ @state.type = type
925
+ @state.channel = channel
926
+
927
+ ensure
928
+ # -> uncomment the next line to manually enable rule tracing
929
+ # trace_out( __method__, 34 )
930
+
931
+ end
932
+
933
+ # lexer rule t__43! (T__43)
934
+ # (in OCCI.g)
935
+ def t__43!
936
+ # -> uncomment the next line to manually enable rule tracing
937
+ # trace_in( __method__, 35 )
938
+
939
+ type = T__43
940
+ channel = ANTLR3::DEFAULT_CHANNEL
941
+
942
+
943
+ # - - - - main rule block - - - -
944
+ # at line 41:9: '\\''
945
+ match(0x27)
946
+
947
+
948
+ @state.type = type
949
+ @state.channel = channel
950
+
951
+ ensure
952
+ # -> uncomment the next line to manually enable rule tracing
953
+ # trace_out( __method__, 35 )
954
+
955
+ end
956
+
957
+ # lexer rule loalpha! (LOALPHA)
958
+ # (in OCCI.g)
959
+ def loalpha!
960
+ # -> uncomment the next line to manually enable rule tracing
961
+ # trace_in( __method__, 36 )
962
+
963
+ type = LOALPHA
964
+ channel = ANTLR3::DEFAULT_CHANNEL
965
+
966
+
967
+ # - - - - main rule block - - - -
968
+ # at line 160:11: ( 'a' .. 'z' )+
969
+ # at file 160:11: ( 'a' .. 'z' )+
970
+ match_count_1 = 0
971
+ while true
972
+ alt_1 = 2
973
+ look_1_0 = @input.peek(1)
974
+
975
+ if (look_1_0.between?(0x61, 0x7a))
976
+ alt_1 = 1
977
+
978
+ end
979
+ case alt_1
980
+ when 1
981
+ # at line 160:12: 'a' .. 'z'
982
+ match_range(0x61, 0x7a)
983
+
984
+ else
985
+ match_count_1 > 0 and break
986
+ eee = EarlyExit(1)
987
+
988
+
989
+ raise eee
990
+ end
991
+ match_count_1 += 1
992
+ end
993
+
994
+
995
+ @state.type = type
996
+ @state.channel = channel
997
+
998
+ ensure
999
+ # -> uncomment the next line to manually enable rule tracing
1000
+ # trace_out( __method__, 36 )
1001
+
1002
+ end
1003
+
1004
+ # lexer rule upalpha! (UPALPHA)
1005
+ # (in OCCI.g)
1006
+ def upalpha!
1007
+ # -> uncomment the next line to manually enable rule tracing
1008
+ # trace_in( __method__, 37 )
1009
+
1010
+ type = UPALPHA
1011
+ channel = ANTLR3::DEFAULT_CHANNEL
1012
+
1013
+
1014
+ # - - - - main rule block - - - -
1015
+ # at line 161:11: ( 'A' .. 'Z' )+
1016
+ # at file 161:11: ( 'A' .. 'Z' )+
1017
+ match_count_2 = 0
1018
+ while true
1019
+ alt_2 = 2
1020
+ look_2_0 = @input.peek(1)
1021
+
1022
+ if (look_2_0.between?(0x41, 0x5a))
1023
+ alt_2 = 1
1024
+
1025
+ end
1026
+ case alt_2
1027
+ when 1
1028
+ # at line 161:12: 'A' .. 'Z'
1029
+ match_range(0x41, 0x5a)
1030
+
1031
+ else
1032
+ match_count_2 > 0 and break
1033
+ eee = EarlyExit(2)
1034
+
1035
+
1036
+ raise eee
1037
+ end
1038
+ match_count_2 += 1
1039
+ end
1040
+
1041
+
1042
+ @state.type = type
1043
+ @state.channel = channel
1044
+
1045
+ ensure
1046
+ # -> uncomment the next line to manually enable rule tracing
1047
+ # trace_out( __method__, 37 )
1048
+
1049
+ end
1050
+
1051
+ # lexer rule digit! (DIGIT)
1052
+ # (in OCCI.g)
1053
+ def digit!
1054
+ # -> uncomment the next line to manually enable rule tracing
1055
+ # trace_in( __method__, 38 )
1056
+
1057
+ type = DIGIT
1058
+ channel = ANTLR3::DEFAULT_CHANNEL
1059
+
1060
+
1061
+ # - - - - main rule block - - - -
1062
+ # at line 162:11: ( '0' .. '9' )
1063
+ # at line 162:11: ( '0' .. '9' )
1064
+ # at line 162:12: '0' .. '9'
1065
+ match_range(0x30, 0x39)
1066
+
1067
+
1068
+ @state.type = type
1069
+ @state.channel = channel
1070
+
1071
+ ensure
1072
+ # -> uncomment the next line to manually enable rule tracing
1073
+ # trace_out( __method__, 38 )
1074
+
1075
+ end
1076
+
1077
+ # lexer rule ws! (WS)
1078
+ # (in OCCI.g)
1079
+ def ws!
1080
+ # -> uncomment the next line to manually enable rule tracing
1081
+ # trace_in( __method__, 39 )
1082
+
1083
+ type = WS
1084
+ channel = ANTLR3::DEFAULT_CHANNEL
1085
+
1086
+
1087
+ # - - - - main rule block - - - -
1088
+ # at line 163:11: ( '\\t' | ' ' | '\\r' | '\\n' | '\\u000C' )+
1089
+ # at file 163:11: ( '\\t' | ' ' | '\\r' | '\\n' | '\\u000C' )+
1090
+ match_count_3 = 0
1091
+ while true
1092
+ alt_3 = 2
1093
+ look_3_0 = @input.peek(1)
1094
+
1095
+ if (look_3_0.between?(0x9, 0xa) || look_3_0.between?(0xc, 0xd) || look_3_0 == 0x20)
1096
+ alt_3 = 1
1097
+
1098
+ end
1099
+ case alt_3
1100
+ when 1
1101
+ # at line
1102
+ if @input.peek(1).between?(0x9, 0xa) || @input.peek(1).between?(0xc, 0xd) || @input.peek(1) == 0x20
1103
+ @input.consume
1104
+ else
1105
+ mse = MismatchedSet(nil)
1106
+ recover mse
1107
+ raise mse
1108
+ end
1109
+
1110
+
1111
+ else
1112
+ match_count_3 > 0 and break
1113
+ eee = EarlyExit(3)
1114
+
1115
+
1116
+ raise eee
1117
+ end
1118
+ match_count_3 += 1
1119
+ end
1120
+
1121
+
1122
+ @state.type = type
1123
+ @state.channel = channel
1124
+
1125
+ ensure
1126
+ # -> uncomment the next line to manually enable rule tracing
1127
+ # trace_out( __method__, 39 )
1128
+
1129
+ end
1130
+
1131
+ # lexer rule esc! (ESC)
1132
+ # (in OCCI.g)
1133
+ def esc!
1134
+ # -> uncomment the next line to manually enable rule tracing
1135
+ # trace_in( __method__, 40 )
1136
+
1137
+ type = ESC
1138
+ channel = ANTLR3::DEFAULT_CHANNEL
1139
+
1140
+
1141
+ # - - - - main rule block - - - -
1142
+ # at line 164:11: '\\\\' ( '\"' | '\\'' )
1143
+ match(0x5c)
1144
+ if @input.peek(1) == 0x22 || @input.peek(1) == 0x27
1145
+ @input.consume
1146
+ else
1147
+ mse = MismatchedSet(nil)
1148
+ recover mse
1149
+ raise mse
1150
+ end
1151
+
1152
+
1153
+ @state.type = type
1154
+ @state.channel = channel
1155
+
1156
+ ensure
1157
+ # -> uncomment the next line to manually enable rule tracing
1158
+ # trace_out( __method__, 40 )
1159
+
1160
+ end
1161
+
1162
+ # main rule used to study the input at the current position,
1163
+ # and choose the proper lexer rule to call in order to
1164
+ # fetch the next token
1165
+ #
1166
+ # usually, you don't make direct calls to this method,
1167
+ # but instead use the next_token method, which will
1168
+ # build and emit the actual next token
1169
+ def token!
1170
+ # at line 1:8: ( T__9 | T__10 | T__11 | T__12 | T__13 | T__14 | T__15 | T__16 | T__17 | T__18 | T__19 | T__20 | T__21 | T__22 | T__23 | T__24 | T__25 | T__26 | T__27 | T__28 | T__29 | T__30 | T__31 | T__32 | T__33 | T__34 | T__35 | T__36 | T__37 | T__38 | T__39 | T__40 | T__41 | T__42 | T__43 | LOALPHA | UPALPHA | DIGIT | WS | ESC )
1171
+ alt_4 = 40
1172
+ alt_4 = @dfa4.predict(@input)
1173
+ case alt_4
1174
+ when 1
1175
+ # at line 1:10: T__9
1176
+ t__9!
1177
+
1178
+ when 2
1179
+ # at line 1:15: T__10
1180
+ t__10!
1181
+
1182
+ when 3
1183
+ # at line 1:21: T__11
1184
+ t__11!
1185
+
1186
+ when 4
1187
+ # at line 1:27: T__12
1188
+ t__12!
1189
+
1190
+ when 5
1191
+ # at line 1:33: T__13
1192
+ t__13!
1193
+
1194
+ when 6
1195
+ # at line 1:39: T__14
1196
+ t__14!
1197
+
1198
+ when 7
1199
+ # at line 1:45: T__15
1200
+ t__15!
1201
+
1202
+ when 8
1203
+ # at line 1:51: T__16
1204
+ t__16!
1205
+
1206
+ when 9
1207
+ # at line 1:57: T__17
1208
+ t__17!
1209
+
1210
+ when 10
1211
+ # at line 1:63: T__18
1212
+ t__18!
1213
+
1214
+ when 11
1215
+ # at line 1:69: T__19
1216
+ t__19!
1217
+
1218
+ when 12
1219
+ # at line 1:75: T__20
1220
+ t__20!
1221
+
1222
+ when 13
1223
+ # at line 1:81: T__21
1224
+ t__21!
1225
+
1226
+ when 14
1227
+ # at line 1:87: T__22
1228
+ t__22!
1229
+
1230
+ when 15
1231
+ # at line 1:93: T__23
1232
+ t__23!
1233
+
1234
+ when 16
1235
+ # at line 1:99: T__24
1236
+ t__24!
1237
+
1238
+ when 17
1239
+ # at line 1:105: T__25
1240
+ t__25!
1241
+
1242
+ when 18
1243
+ # at line 1:111: T__26
1244
+ t__26!
1245
+
1246
+ when 19
1247
+ # at line 1:117: T__27
1248
+ t__27!
1249
+
1250
+ when 20
1251
+ # at line 1:123: T__28
1252
+ t__28!
1253
+
1254
+ when 21
1255
+ # at line 1:129: T__29
1256
+ t__29!
1257
+
1258
+ when 22
1259
+ # at line 1:135: T__30
1260
+ t__30!
1261
+
1262
+ when 23
1263
+ # at line 1:141: T__31
1264
+ t__31!
1265
+
1266
+ when 24
1267
+ # at line 1:147: T__32
1268
+ t__32!
1269
+
1270
+ when 25
1271
+ # at line 1:153: T__33
1272
+ t__33!
1273
+
1274
+ when 26
1275
+ # at line 1:159: T__34
1276
+ t__34!
1277
+
1278
+ when 27
1279
+ # at line 1:165: T__35
1280
+ t__35!
1281
+
1282
+ when 28
1283
+ # at line 1:171: T__36
1284
+ t__36!
1285
+
1286
+ when 29
1287
+ # at line 1:177: T__37
1288
+ t__37!
1289
+
1290
+ when 30
1291
+ # at line 1:183: T__38
1292
+ t__38!
1293
+
1294
+ when 31
1295
+ # at line 1:189: T__39
1296
+ t__39!
1297
+
1298
+ when 32
1299
+ # at line 1:195: T__40
1300
+ t__40!
1301
+
1302
+ when 33
1303
+ # at line 1:201: T__41
1304
+ t__41!
1305
+
1306
+ when 34
1307
+ # at line 1:207: T__42
1308
+ t__42!
1309
+
1310
+ when 35
1311
+ # at line 1:213: T__43
1312
+ t__43!
1313
+
1314
+ when 36
1315
+ # at line 1:219: LOALPHA
1316
+ loalpha!
1317
+
1318
+ when 37
1319
+ # at line 1:227: UPALPHA
1320
+ upalpha!
1321
+
1322
+ when 38
1323
+ # at line 1:235: DIGIT
1324
+ digit!
1325
+
1326
+ when 39
1327
+ # at line 1:241: WS
1328
+ ws!
1329
+
1330
+ when 40
1331
+ # at line 1:244: ESC
1332
+ esc!
1333
+
1334
+ end
1335
+ end
1336
+
1337
+
1338
+ # - - - - - - - - - - DFA definitions - - - - - - - - - - -
1339
+ class DFA4 < ANTLR3::DFA
1340
+ EOT = unpack(1, -1, 1, 32, 2, -1, 1, 31, 2, -1, 5, 31, 1, 32, 2,
1341
+ -1, 1, 32, 3, -1, 1, 48, 8, -1, 2, 31, 6, -1, 9, 31,
1342
+ 4, -1, 7, 31, 1, 68, 3, 31, 1, -1, 3, 31, 1, 76, 3,
1343
+ 31, 1, -1, 3, 31, 1, -1, 1, 84, 2, 31, 1, -1, 1, 87,
1344
+ 1, 31, 1, 89, 3, 31, 2, -1, 1, 94, 1, 95, 1, -1, 1,
1345
+ 31, 1, -1, 2, 31, 1, 100, 3, -1, 3, 31, 1, 105, 2, -1,
1346
+ 1, 108, 1, 109, 1, 31, 5, -1, 1, 31, 1, 112, 1, -1)
1347
+ EOF = unpack(113, -1)
1348
+ MIN = unpack(1, 9, 1, 97, 2, -1, 1, 99, 2, -1, 1, 97, 1, 105, 1,
1349
+ 101, 1, 111, 1, 99, 1, 105, 2, -1, 1, 45, 3, -1, 1,
1350
+ 34, 8, -1, 2, 105, 6, -1, 1, 104, 1, 108, 1, 97, 2,
1351
+ 116, 1, 108, 1, 99, 2, 116, 1, -1, 1, 79, 2, -1, 1,
1352
+ 110, 1, 120, 1, 101, 1, 102, 1, 115, 1, 101, 1, 108,
1353
+ 2, 97, 1, 114, 1, 105, 1, 67, 1, 100, 1, 105, 1, 109,
1354
+ 1, 97, 1, 115, 1, 103, 1, 101, 1, -1, 1, 116, 1, 105,
1355
+ 1, 111, 1, 67, 1, 97, 1, 110, 1, 101, 1, -1, 1, 97,
1356
+ 1, 111, 1, 97, 1, 105, 1, 98, 1, 110, 1, 73, 1, -1,
1357
+ 2, 97, 1, -1, 1, 114, 1, -1, 1, 111, 1, 117, 1, 97,
1358
+ 1, 45, 2, -1, 1, 121, 1, 110, 1, 116, 1, 97, 1, -1,
1359
+ 1, 65, 2, 97, 1, 101, 5, -1, 1, 115, 1, 97, 1, -1)
1360
+ MAX = unpack(1, 126, 1, 97, 2, -1, 1, 101, 2, -1, 1, 108, 1, 105,
1361
+ 1, 101, 1, 111, 1, 116, 1, 105, 2, -1, 1, 45, 3, -1,
1362
+ 1, 39, 8, -1, 2, 105, 6, -1, 1, 104, 1, 108, 1, 97,
1363
+ 2, 116, 1, 108, 1, 99, 2, 116, 1, -1, 1, 79, 2, -1,
1364
+ 1, 110, 1, 120, 1, 101, 1, 102, 1, 115, 1, 101, 1, 108,
1365
+ 1, 122, 1, 97, 1, 114, 1, 105, 1, 67, 1, 100, 1, 105,
1366
+ 1, 109, 1, 122, 1, 115, 1, 103, 1, 101, 1, -1, 1, 116,
1367
+ 1, 105, 1, 111, 1, 67, 1, 122, 1, 110, 1, 101, 1, -1,
1368
+ 1, 122, 1, 111, 1, 122, 1, 105, 1, 98, 1, 110, 1, 73,
1369
+ 1, -1, 2, 122, 1, -1, 1, 114, 1, -1, 1, 111, 1, 117,
1370
+ 1, 122, 1, 45, 2, -1, 1, 121, 1, 110, 1, 116, 1, 122,
1371
+ 1, -1, 1, 76, 2, 122, 1, 101, 5, -1, 1, 115, 1, 122,
1372
+ 1, -1)
1373
+ ACCEPT = unpack(2, -1, 1, 2, 1, 3, 1, -1, 1, 5, 1, 6, 6, -1, 1, 14,
1374
+ 1, 15, 1, -1, 1, 20, 1, 21, 1, 22, 1, -1, 1, 24,
1375
+ 1, 25, 1, 26, 1, 27, 1, 28, 1, 29, 1, 30, 1, 31,
1376
+ 2, -1, 1, 35, 1, 36, 1, 37, 1, 38, 1, 39, 1, 1, 9,
1377
+ -1, 1, 13, 1, -1, 1, 40, 1, 23, 19, -1, 1, 9, 7,
1378
+ -1, 1, 16, 7, -1, 1, 33, 2, -1, 1, 7, 1, -1, 1, 8,
1379
+ 4, -1, 1, 34, 1, 4, 4, -1, 1, 32, 4, -1, 1, 12, 1,
1380
+ 18, 1, 19, 1, 17, 1, 10, 2, -1, 1, 11)
1381
+ SPECIAL = unpack(113, -1)
1382
+ TRANSITION = [
1383
+ unpack(2, 34, 1, -1, 2, 34, 18, -1, 1, 34, 1, -1, 1, 6, 1, 23,
1384
+ 1, -1, 1, 17, 1, 25, 1, 30, 3, -1, 1, 20, 1, -1, 1, 27,
1385
+ 1, 21, 1, 26, 10, 33, 1, 2, 1, 3, 1, 13, 1, 5, 1, 14, 1,
1386
+ 24, 1, 16, 2, 32, 1, 1, 8, 32, 1, 12, 11, 32, 1, 15, 2,
1387
+ 32, 1, -1, 1, 19, 2, -1, 1, 18, 1, -1, 1, 11, 1, 31, 1,
1388
+ 7, 7, 31, 1, 28, 1, 10, 1, 29, 4, 31, 1, 9, 1, 4, 1, 8,
1389
+ 6, 31, 3, -1, 1, 22),
1390
+ unpack(1, 35),
1391
+ unpack(),
1392
+ unpack(),
1393
+ unpack(1, 36, 1, -1, 1, 37),
1394
+ unpack(),
1395
+ unpack(),
1396
+ unpack(1, 39, 10, -1, 1, 38),
1397
+ unpack(1, 40),
1398
+ unpack(1, 41),
1399
+ unpack(1, 42),
1400
+ unpack(1, 44, 16, -1, 1, 43),
1401
+ unpack(1, 45),
1402
+ unpack(),
1403
+ unpack(),
1404
+ unpack(1, 46),
1405
+ unpack(),
1406
+ unpack(),
1407
+ unpack(),
1408
+ unpack(1, 47, 4, -1, 1, 47),
1409
+ unpack(),
1410
+ unpack(),
1411
+ unpack(),
1412
+ unpack(),
1413
+ unpack(),
1414
+ unpack(),
1415
+ unpack(),
1416
+ unpack(),
1417
+ unpack(1, 49),
1418
+ unpack(1, 50),
1419
+ unpack(),
1420
+ unpack(),
1421
+ unpack(),
1422
+ unpack(),
1423
+ unpack(),
1424
+ unpack(),
1425
+ unpack(1, 51),
1426
+ unpack(1, 52),
1427
+ unpack(1, 53),
1428
+ unpack(1, 54),
1429
+ unpack(1, 55),
1430
+ unpack(1, 56),
1431
+ unpack(1, 57),
1432
+ unpack(1, 58),
1433
+ unpack(1, 59),
1434
+ unpack(),
1435
+ unpack(1, 60),
1436
+ unpack(),
1437
+ unpack(),
1438
+ unpack(1, 61),
1439
+ unpack(1, 62),
1440
+ unpack(1, 63),
1441
+ unpack(1, 64),
1442
+ unpack(1, 65),
1443
+ unpack(1, 66),
1444
+ unpack(1, 67),
1445
+ unpack(26, 31),
1446
+ unpack(1, 69),
1447
+ unpack(1, 70),
1448
+ unpack(1, 71),
1449
+ unpack(1, 72),
1450
+ unpack(1, 73),
1451
+ unpack(1, 74),
1452
+ unpack(1, 75),
1453
+ unpack(26, 31),
1454
+ unpack(1, 77),
1455
+ unpack(1, 78),
1456
+ unpack(1, 79),
1457
+ unpack(),
1458
+ unpack(1, 80),
1459
+ unpack(1, 81),
1460
+ unpack(1, 82),
1461
+ unpack(1, 83),
1462
+ unpack(26, 31),
1463
+ unpack(1, 85),
1464
+ unpack(1, 86),
1465
+ unpack(),
1466
+ unpack(26, 31),
1467
+ unpack(1, 88),
1468
+ unpack(26, 31),
1469
+ unpack(1, 90),
1470
+ unpack(1, 91),
1471
+ unpack(1, 92),
1472
+ unpack(1, 93),
1473
+ unpack(),
1474
+ unpack(26, 31),
1475
+ unpack(26, 31),
1476
+ unpack(),
1477
+ unpack(1, 96),
1478
+ unpack(),
1479
+ unpack(1, 97),
1480
+ unpack(1, 98),
1481
+ unpack(18, 31, 1, 99, 7, 31),
1482
+ unpack(1, 101),
1483
+ unpack(),
1484
+ unpack(),
1485
+ unpack(1, 102),
1486
+ unpack(1, 103),
1487
+ unpack(1, 104),
1488
+ unpack(26, 31),
1489
+ unpack(),
1490
+ unpack(1, 106, 10, -1, 1, 107),
1491
+ unpack(26, 31),
1492
+ unpack(26, 31),
1493
+ unpack(1, 110),
1494
+ unpack(),
1495
+ unpack(),
1496
+ unpack(),
1497
+ unpack(),
1498
+ unpack(),
1499
+ unpack(1, 111),
1500
+ unpack(26, 31),
1501
+ unpack()
1502
+ ].freeze
1503
+
1504
+ (0 ... MIN.length).zip(MIN, MAX) do |i, a, z|
1505
+ if a > 0 and z < 0
1506
+ MAX[i] %= 0x10000
1507
+ end
1508
+ end
1509
+
1510
+ @decision = 4
1511
+
1512
+
1513
+ def description
1514
+ <<-'__dfa_description__'.strip!
1515
+ 1:1: Tokens : ( T__9 | T__10 | T__11 | T__12 | T__13 | T__14 | T__15 | T__16 | T__17 | T__18 | T__19 | T__20 | T__21 | T__22 | T__23 | T__24 | T__25 | T__26 | T__27 | T__28 | T__29 | T__30 | T__31 | T__32 | T__33 | T__34 | T__35 | T__36 | T__37 | T__38 | T__39 | T__40 | T__41 | T__42 | T__43 | LOALPHA | UPALPHA | DIGIT | WS | ESC );
1516
+ __dfa_description__
1517
+ end
1518
+ end
1519
+
1520
+
1521
+ private
1522
+
1523
+ def initialize_dfas
1524
+ super rescue nil
1525
+ @dfa4 = DFA4.new(self, 4)
1526
+
1527
+ end
1528
+ end # class Lexer < ANTLR3::Lexer
1529
+
1530
+ at_exit { Lexer.main(ARGV) } if __FILE__ == $0
1531
+ end
1532
+