tripper 0.0.3d

Sign up to get free protection for your applications and to get access to all the features.
Files changed (210) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +17 -0
  3. data/Gemfile +4 -0
  4. data/LICENSE.txt +22 -0
  5. data/README.md +29 -0
  6. data/Rakefile +1 -0
  7. data/TODO +26 -0
  8. data/lib/generators/USAGE +8 -0
  9. data/lib/generators/tripper.rb +51 -0
  10. data/lib/generators/tripper/commonalities/commonalities.rb +226 -0
  11. data/lib/generators/tripper/detect_changes/detect_changes_generator.rb +173 -0
  12. data/lib/generators/tripper/detect_changes/model.rb +226 -0
  13. data/lib/generators/tripper/detect_changes/templates/migration.rb +7 -0
  14. data/lib/generators/tripper/detect_changes/templates/model/belongs_to.rb +1 -0
  15. data/lib/generators/tripper/detect_changes/templates/model/has_one.rb +1 -0
  16. data/lib/generators/tripper/detect_changes/templates/model/validates.rb +2 -0
  17. data/lib/generators/tripper/from_community/from_community_generator.rb +95 -0
  18. data/lib/generators/tripper/from_community/templates/actions/create.rb +8 -0
  19. data/lib/generators/tripper/from_community/templates/actions/destroy.rb +5 -0
  20. data/lib/generators/tripper/from_community/templates/actions/edit.rb +3 -0
  21. data/lib/generators/tripper/from_community/templates/actions/index.rb +3 -0
  22. data/lib/generators/tripper/from_community/templates/actions/new.rb +3 -0
  23. data/lib/generators/tripper/from_community/templates/actions/show.rb +3 -0
  24. data/lib/generators/tripper/from_community/templates/actions/update.rb +8 -0
  25. data/lib/generators/tripper/from_community/templates/controller.rb +3 -0
  26. data/lib/generators/tripper/from_community/templates/fixtures.yml +9 -0
  27. data/lib/generators/tripper/from_community/templates/helper.rb +2 -0
  28. data/lib/generators/tripper/from_community/templates/migration.rb +30 -0
  29. data/lib/generators/tripper/from_community/templates/model.rb +54 -0
  30. data/lib/generators/tripper/from_community/templates/tests/rspec/actions/create.rb +11 -0
  31. data/lib/generators/tripper/from_community/templates/tests/rspec/actions/destroy.rb +6 -0
  32. data/lib/generators/tripper/from_community/templates/tests/rspec/actions/edit.rb +4 -0
  33. data/lib/generators/tripper/from_community/templates/tests/rspec/actions/index.rb +4 -0
  34. data/lib/generators/tripper/from_community/templates/tests/rspec/actions/new.rb +4 -0
  35. data/lib/generators/tripper/from_community/templates/tests/rspec/actions/show.rb +4 -0
  36. data/lib/generators/tripper/from_community/templates/tests/rspec/actions/update.rb +11 -0
  37. data/lib/generators/tripper/from_community/templates/tests/rspec/controller.rb +8 -0
  38. data/lib/generators/tripper/from_community/templates/tests/rspec/model.rb +7 -0
  39. data/lib/generators/tripper/from_community/templates/tests/shoulda/actions/create.rb +13 -0
  40. data/lib/generators/tripper/from_community/templates/tests/shoulda/actions/destroy.rb +8 -0
  41. data/lib/generators/tripper/from_community/templates/tests/shoulda/actions/edit.rb +6 -0
  42. data/lib/generators/tripper/from_community/templates/tests/shoulda/actions/index.rb +6 -0
  43. data/lib/generators/tripper/from_community/templates/tests/shoulda/actions/new.rb +6 -0
  44. data/lib/generators/tripper/from_community/templates/tests/shoulda/actions/show.rb +6 -0
  45. data/lib/generators/tripper/from_community/templates/tests/shoulda/actions/update.rb +13 -0
  46. data/lib/generators/tripper/from_community/templates/tests/shoulda/controller.rb +5 -0
  47. data/lib/generators/tripper/from_community/templates/tests/shoulda/model.rb +7 -0
  48. data/lib/generators/tripper/from_community/templates/tests/testunit/actions/create.rb +11 -0
  49. data/lib/generators/tripper/from_community/templates/tests/testunit/actions/destroy.rb +6 -0
  50. data/lib/generators/tripper/from_community/templates/tests/testunit/actions/edit.rb +4 -0
  51. data/lib/generators/tripper/from_community/templates/tests/testunit/actions/index.rb +4 -0
  52. data/lib/generators/tripper/from_community/templates/tests/testunit/actions/new.rb +4 -0
  53. data/lib/generators/tripper/from_community/templates/tests/testunit/actions/show.rb +4 -0
  54. data/lib/generators/tripper/from_community/templates/tests/testunit/actions/update.rb +11 -0
  55. data/lib/generators/tripper/from_community/templates/tests/testunit/controller.rb +5 -0
  56. data/lib/generators/tripper/from_community/templates/tests/testunit/model.rb +7 -0
  57. data/lib/generators/tripper/from_community/templates/views/erb/_form.html.erb +16 -0
  58. data/lib/generators/tripper/from_community/templates/views/erb/edit.html.erb +14 -0
  59. data/lib/generators/tripper/from_community/templates/views/erb/index.html.erb +29 -0
  60. data/lib/generators/tripper/from_community/templates/views/erb/new.html.erb +7 -0
  61. data/lib/generators/tripper/from_community/templates/views/erb/show.html.erb +25 -0
  62. data/lib/generators/tripper/from_community/templates/views/haml/_form.html.haml +9 -0
  63. data/lib/generators/tripper/from_community/templates/views/haml/edit.html.haml +14 -0
  64. data/lib/generators/tripper/from_community/templates/views/haml/index.html.haml +25 -0
  65. data/lib/generators/tripper/from_community/templates/views/haml/new.html.haml +7 -0
  66. data/lib/generators/tripper/from_community/templates/views/haml/show.html.haml +20 -0
  67. data/lib/generators/tripper/layout/USAGE +18 -0
  68. data/lib/generators/tripper/layout/layout_generator.rb +29 -0
  69. data/lib/generators/tripper/layout/templates/error_messages_helper.rb +23 -0
  70. data/lib/generators/tripper/layout/templates/layout.html.erb +19 -0
  71. data/lib/generators/tripper/layout/templates/layout.html.haml +21 -0
  72. data/lib/generators/tripper/layout/templates/layout_helper.rb +22 -0
  73. data/lib/generators/tripper/layout/templates/stylesheet.css +83 -0
  74. data/lib/generators/tripper/layout/templates/stylesheet.sass +73 -0
  75. data/lib/generators/tripper/obj_constraint.rb +23 -0
  76. data/lib/generators/tripper/predicate.rb +12 -0
  77. data/lib/generators/tripper/sync_with_community/model.rb +260 -0
  78. data/lib/generators/tripper/sync_with_community/sync_with_community_generator.rb +310 -0
  79. data/lib/generators/tripper/sync_with_community/templates/migration.rb +7 -0
  80. data/lib/generators/tripper/sync_with_community/templates/model/belongs_to.rb +1 -0
  81. data/lib/generators/tripper/sync_with_community/templates/model/has_one.rb +1 -0
  82. data/lib/generators/tripper/sync_with_community/templates/model/validates.rb +2 -0
  83. data/lib/generators/tripper/templates/actions/create.rb +8 -0
  84. data/lib/generators/tripper/templates/actions/destroy.rb +5 -0
  85. data/lib/generators/tripper/templates/actions/edit.rb +3 -0
  86. data/lib/generators/tripper/templates/actions/index.rb +3 -0
  87. data/lib/generators/tripper/templates/actions/new.rb +3 -0
  88. data/lib/generators/tripper/templates/actions/show.rb +3 -0
  89. data/lib/generators/tripper/templates/actions/update.rb +8 -0
  90. data/lib/generators/tripper/templates/controller.rb +3 -0
  91. data/lib/generators/tripper/templates/fixtures.yml +9 -0
  92. data/lib/generators/tripper/templates/helper.rb +2 -0
  93. data/lib/generators/tripper/templates/migration.rb +30 -0
  94. data/lib/generators/tripper/templates/model.rb +54 -0
  95. data/lib/generators/tripper/templates/tests/rspec/actions/create.rb +11 -0
  96. data/lib/generators/tripper/templates/tests/rspec/actions/destroy.rb +6 -0
  97. data/lib/generators/tripper/templates/tests/rspec/actions/edit.rb +4 -0
  98. data/lib/generators/tripper/templates/tests/rspec/actions/index.rb +4 -0
  99. data/lib/generators/tripper/templates/tests/rspec/actions/new.rb +4 -0
  100. data/lib/generators/tripper/templates/tests/rspec/actions/show.rb +4 -0
  101. data/lib/generators/tripper/templates/tests/rspec/actions/update.rb +11 -0
  102. data/lib/generators/tripper/templates/tests/rspec/controller.rb +8 -0
  103. data/lib/generators/tripper/templates/tests/rspec/model.rb +7 -0
  104. data/lib/generators/tripper/templates/tests/shoulda/actions/create.rb +13 -0
  105. data/lib/generators/tripper/templates/tests/shoulda/actions/destroy.rb +8 -0
  106. data/lib/generators/tripper/templates/tests/shoulda/actions/edit.rb +6 -0
  107. data/lib/generators/tripper/templates/tests/shoulda/actions/index.rb +6 -0
  108. data/lib/generators/tripper/templates/tests/shoulda/actions/new.rb +6 -0
  109. data/lib/generators/tripper/templates/tests/shoulda/actions/show.rb +6 -0
  110. data/lib/generators/tripper/templates/tests/shoulda/actions/update.rb +13 -0
  111. data/lib/generators/tripper/templates/tests/shoulda/controller.rb +5 -0
  112. data/lib/generators/tripper/templates/tests/shoulda/model.rb +7 -0
  113. data/lib/generators/tripper/templates/tests/testunit/actions/create.rb +11 -0
  114. data/lib/generators/tripper/templates/tests/testunit/actions/destroy.rb +6 -0
  115. data/lib/generators/tripper/templates/tests/testunit/actions/edit.rb +4 -0
  116. data/lib/generators/tripper/templates/tests/testunit/actions/index.rb +4 -0
  117. data/lib/generators/tripper/templates/tests/testunit/actions/new.rb +4 -0
  118. data/lib/generators/tripper/templates/tests/testunit/actions/show.rb +4 -0
  119. data/lib/generators/tripper/templates/tests/testunit/actions/update.rb +11 -0
  120. data/lib/generators/tripper/templates/tests/testunit/controller.rb +5 -0
  121. data/lib/generators/tripper/templates/tests/testunit/model.rb +7 -0
  122. data/lib/generators/tripper/templates/views/erb/_form.html.erb +16 -0
  123. data/lib/generators/tripper/templates/views/erb/edit.html.erb +14 -0
  124. data/lib/generators/tripper/templates/views/erb/index.html.erb +29 -0
  125. data/lib/generators/tripper/templates/views/erb/new.html.erb +7 -0
  126. data/lib/generators/tripper/templates/views/erb/show.html.erb +25 -0
  127. data/lib/generators/tripper/templates/views/haml/_form.html.haml +9 -0
  128. data/lib/generators/tripper/templates/views/haml/edit.html.haml +14 -0
  129. data/lib/generators/tripper/templates/views/haml/index.html.haml +25 -0
  130. data/lib/generators/tripper/templates/views/haml/new.html.haml +7 -0
  131. data/lib/generators/tripper/templates/views/haml/show.html.haml +20 -0
  132. data/lib/tripper.rb +1 -0
  133. data/lib/tripper/GOSPLDB/config/database.yml +6 -0
  134. data/lib/tripper/GOSPLDB/config_db.rb +9 -0
  135. data/lib/tripper/GOSPLDB/console +2 -0
  136. data/lib/tripper/GOSPLDB/gospl_db_classes.rb +343 -0
  137. data/lib/tripper/GOSPLDB/play_around.rb +4 -0
  138. data/lib/tripper/GOSPLDB/rakefile.rb +88 -0
  139. data/lib/tripper/GOSPLDBToORMDB/gospl_db_to_orm_db.rb +88 -0
  140. data/lib/tripper/ORMDB/config/database.yml +6 -0
  141. data/lib/tripper/ORMDB/config_db.rb +9 -0
  142. data/lib/tripper/ORMDB/console +2 -0
  143. data/lib/tripper/ORMDB/db/migrations/0_create_orm_object_table.rb +17 -0
  144. data/lib/tripper/ORMDB/db/migrations/10_create_no_lot_constraint_table.rb +17 -0
  145. data/lib/tripper/ORMDB/db/migrations/11_create_value_constraint_table.rb +14 -0
  146. data/lib/tripper/ORMDB/db/migrations/12_create_value_constraint_value_table.rb +16 -0
  147. data/lib/tripper/ORMDB/db/migrations/13_create_value_range_table.rb +15 -0
  148. data/lib/tripper/ORMDB/db/migrations/14_create_frequency_constraint_table.rb +16 -0
  149. data/lib/tripper/ORMDB/db/migrations/15_create_value_table.rb +15 -0
  150. data/lib/tripper/ORMDB/db/migrations/16_create_ring_constraint_table.rb +14 -0
  151. data/lib/tripper/ORMDB/db/migrations/17_create_orm_schema_table.rb +21 -0
  152. data/lib/tripper/ORMDB/db/migrations/18_create_uniqueness_constraint_table.rb +15 -0
  153. data/lib/tripper/ORMDB/db/migrations/1_create_no_lot_table.rb +18 -0
  154. data/lib/tripper/ORMDB/db/migrations/2_create_lot_table.rb +18 -0
  155. data/lib/tripper/ORMDB/db/migrations/3_create_object_role_table.rb +18 -0
  156. data/lib/tripper/ORMDB/db/migrations/4_create_reference_table.rb +17 -0
  157. data/lib/tripper/ORMDB/db/migrations/5_create_predicate_table.rb +18 -0
  158. data/lib/tripper/ORMDB/db/migrations/6_create_object_role_constraint_table.rb +18 -0
  159. data/lib/tripper/ORMDB/db/migrations/7_create_subtype_table.rb +17 -0
  160. data/lib/tripper/ORMDB/db/migrations/8_create_mandatory_constraint_table.rb +15 -0
  161. data/lib/tripper/ORMDB/db/migrations/9_create_constraint_table.rb +15 -0
  162. data/lib/tripper/ORMDB/db/orm_ml.sqlite3 +0 -0
  163. data/lib/tripper/ORMDB/db/orm_ml.sqlite3.backup +0 -0
  164. data/lib/tripper/ORMDB/db/orm_ml.sqlite3.juli28-2013 +0 -0
  165. data/lib/tripper/ORMDB/db/orm_ml.sqlite3.old +0 -0
  166. data/lib/tripper/ORMDB/db/schema.rb +58 -0
  167. data/lib/tripper/ORMDB/erd.pdf +0 -0
  168. data/lib/tripper/ORMDB/migrate_db.rb +21 -0
  169. data/lib/tripper/ORMDB/orm_db_classes.rb +423 -0
  170. data/lib/tripper/ORMDB/populate.rb +4 -0
  171. data/lib/tripper/ORMDB/rakefile.rb +88 -0
  172. data/lib/tripper/model_parsers/attribute_parser/AttributeParser.g +50 -0
  173. data/lib/tripper/model_parsers/attribute_parser/AttributeParser.tokens +13 -0
  174. data/lib/tripper/model_parsers/attribute_parser/AttributeParserLexer.rb +538 -0
  175. data/lib/tripper/model_parsers/attribute_parser/AttributeParserParser.rb +412 -0
  176. data/lib/tripper/model_parsers/attribute_parser/playing_around.rb +14 -0
  177. data/lib/tripper/model_parsers/belongs_to/BelongsToParser.g +63 -0
  178. data/lib/tripper/model_parsers/belongs_to/BelongsToParser.tokens +21 -0
  179. data/lib/tripper/model_parsers/belongs_to/BelongsToParserLexer.rb +667 -0
  180. data/lib/tripper/model_parsers/belongs_to/BelongsToParserParser.rb +552 -0
  181. data/lib/tripper/model_parsers/belongs_to/playing_around.rb +9 -0
  182. data/lib/tripper/model_parsers/database_fields_parser/DatabaseFieldsParser.g +47 -0
  183. data/lib/tripper/model_parsers/database_fields_parser/DatabaseFieldsParser.tokens +14 -0
  184. data/lib/tripper/model_parsers/database_fields_parser/DatabaseFieldsParserLexer.rb +513 -0
  185. data/lib/tripper/model_parsers/database_fields_parser/DatabaseFieldsParserParser.rb +279 -0
  186. data/lib/tripper/model_parsers/database_fields_parser/playing_around.rb +14 -0
  187. data/lib/tripper/model_parsers/has_and_belongs_to_many/HasAndBelongsToManyParser.g +92 -0
  188. data/lib/tripper/model_parsers/has_and_belongs_to_many/HasAndBelongsToManyParser.tokens +25 -0
  189. data/lib/tripper/model_parsers/has_and_belongs_to_many/HasAndBelongsToManyParserLexer.rb +787 -0
  190. data/lib/tripper/model_parsers/has_and_belongs_to_many/HasAndBelongsToManyParserParser.rb +1024 -0
  191. data/lib/tripper/model_parsers/has_and_belongs_to_many/playing_around.rb +9 -0
  192. data/lib/tripper/model_parsers/has_many/HasManyParser.g +77 -0
  193. data/lib/tripper/model_parsers/has_many/HasManyParser.tokens +23 -0
  194. data/lib/tripper/model_parsers/has_many/HasManyParserLexer.rb +710 -0
  195. data/lib/tripper/model_parsers/has_many/HasManyParserParser.rb +788 -0
  196. data/lib/tripper/model_parsers/has_many/playing_around.rb +9 -0
  197. data/lib/tripper/model_parsers/has_one/HasOneParser.g +63 -0
  198. data/lib/tripper/model_parsers/has_one/HasOneParser.tokens +21 -0
  199. data/lib/tripper/model_parsers/has_one/HasOneParserLexer.rb +664 -0
  200. data/lib/tripper/model_parsers/has_one/HasOneParserParser.rb +552 -0
  201. data/lib/tripper/model_parsers/has_one/playing_around.rb +9 -0
  202. data/lib/tripper/model_parsers/validates/ValidatesParser.g +68 -0
  203. data/lib/tripper/model_parsers/validates/ValidatesParser.tokens +35 -0
  204. data/lib/tripper/model_parsers/validates/ValidatesParserLexer.rb +899 -0
  205. data/lib/tripper/model_parsers/validates/ValidatesParserParser.rb +869 -0
  206. data/lib/tripper/model_parsers/validates/playing_around.rb +9 -0
  207. data/lib/tripper/rails.rb +8 -0
  208. data/lib/tripper/version.rb +3 -0
  209. data/tripper.gemspec +33 -0
  210. metadata +408 -0
@@ -0,0 +1,1024 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # HasAndBelongsToManyParser.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: HasAndBelongsToManyParser.g
8
+ # Generated at: 2013-07-28 14:32:00
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
+ # - - - - - - begin action @parser::header - - - - - -
60
+ # HasAndBelongsToManyParser.g
61
+
62
+
63
+ def strip_quotes str
64
+ return str[1,(str.length)-2]
65
+ end
66
+
67
+ @@attribute = nil
68
+ @@class_name = nil
69
+ @@foreign_key = nil
70
+ @@association_foreign_key = nil
71
+
72
+ # - - - - - - end action @parser::header - - - - - - -
73
+
74
+
75
+ module HasAndBelongsToManyParser
76
+ # TokenData defines all of the token type integer values
77
+ # as constants, which will be included in all
78
+ # ANTLR-generated recognizers.
79
+ const_defined?( :TokenData ) or TokenData = ANTLR3::TokenScheme.new
80
+
81
+ module TokenData
82
+
83
+ # define the token constants
84
+ define_tokens( :ACTUALSTRING => 10, :T__19 => 19, :T__16 => 16, :HC => 6,
85
+ :T__15 => 15, :T__18 => 18, :T__17 => 17, :T__12 => 12,
86
+ :T__11 => 11, :T__14 => 14, :T__13 => 13, :ATTRIBUTE => 5,
87
+ :WHITESPACE => 9, :LC => 7, :DIGIT => 8, :COMMENT => 4,
88
+ :EOF => -1 )
89
+
90
+ # register the proper human-readable name or literal value
91
+ # for each token type
92
+ #
93
+ # this is necessary because anonymous tokens, which are
94
+ # created from literal values in the grammar, do not
95
+ # have descriptive names
96
+ register_names( "COMMENT", "ATTRIBUTE", "HC", "LC", "DIGIT", "WHITESPACE",
97
+ "ACTUALSTRING", "'has_and_belongs_to_many'", "','",
98
+ "':'", "'class_name'", "'=>'", "'\\''", "'\"'", "'foreign_key'",
99
+ "'association_foreign_key'" )
100
+
101
+ end
102
+
103
+
104
+ class Parser < ANTLR3::Parser
105
+ @grammar_home = HasAndBelongsToManyParser
106
+
107
+ RULE_METHODS = [ :comment, :has_and_belongs_to_many, :class_name, :class_name_old_syntax,
108
+ :class_name_word, :class_name_new_syntax, :foreign_key,
109
+ :foreign_key_old_syntax, :foreign_key_word, :foreign_key_new_syntax,
110
+ :association_foreign_key, :association_foreign_key_old_syntax,
111
+ :association_foreign_key_word, :association_foreign_key_new_syntax,
112
+ :attribute ].freeze
113
+
114
+
115
+ include TokenData
116
+
117
+ begin
118
+ generated_using( "HasAndBelongsToManyParser.g", "3.2.1-SNAPSHOT Jul 31, 2010 19:34:52", "1.8.11" )
119
+ rescue NoMethodError => error
120
+ # ignore
121
+ end
122
+
123
+ def initialize( input, options = {} )
124
+ super( input, options )
125
+
126
+
127
+ end
128
+
129
+ attr_accessor :attribute, :class_name, :foreign_key, :association_foreign_key
130
+
131
+ # - - - - - - - - - - - - Rules - - - - - - - - - - - - -
132
+
133
+ #
134
+ # parser rule comment
135
+ #
136
+ # (in HasAndBelongsToManyParser.g)
137
+ # 22:1: comment : COMMENT ;
138
+ #
139
+ def comment
140
+ # -> uncomment the next line to manually enable rule tracing
141
+ # trace_in( __method__, 1 )
142
+
143
+ begin
144
+ # at line 22:10: COMMENT
145
+ match( COMMENT, TOKENS_FOLLOWING_COMMENT_IN_comment_35 )
146
+
147
+ rescue ANTLR3::Error::RecognitionError => re
148
+ report_error(re)
149
+ recover(re)
150
+
151
+ ensure
152
+ # -> uncomment the next line to manually enable rule tracing
153
+ # trace_out( __method__, 1 )
154
+
155
+ end
156
+
157
+ return
158
+ end
159
+
160
+
161
+ #
162
+ # parser rule has_and_belongs_to_many
163
+ #
164
+ # (in HasAndBelongsToManyParser.g)
165
+ # 24:1: has_and_belongs_to_many returns [expr] : ( (c= COMMENT )* | 'has_and_belongs_to_many' attribute ( class_name )? ( foreign_key )? ( association_foreign_key )? ( comment )? ) ;
166
+ #
167
+ def has_and_belongs_to_many
168
+ # -> uncomment the next line to manually enable rule tracing
169
+ # trace_in( __method__, 2 )
170
+ expr = nil
171
+ c = nil
172
+
173
+ begin
174
+ # at line 24:41: ( (c= COMMENT )* | 'has_and_belongs_to_many' attribute ( class_name )? ( foreign_key )? ( association_foreign_key )? ( comment )? )
175
+ # at line 24:41: ( (c= COMMENT )* | 'has_and_belongs_to_many' attribute ( class_name )? ( foreign_key )? ( association_foreign_key )? ( comment )? )
176
+ alt_6 = 2
177
+ look_6_0 = @input.peek( 1 )
178
+
179
+ if ( look_6_0 == EOF || look_6_0 == COMMENT )
180
+ alt_6 = 1
181
+ elsif ( look_6_0 == T__11 )
182
+ alt_6 = 2
183
+ else
184
+ raise NoViableAlternative( "", 6, 0 )
185
+ end
186
+ case alt_6
187
+ when 1
188
+ # at line 24:42: (c= COMMENT )*
189
+ # at line 24:42: (c= COMMENT )*
190
+ while true # decision 1
191
+ alt_1 = 2
192
+ look_1_0 = @input.peek( 1 )
193
+
194
+ if ( look_1_0 == COMMENT )
195
+ alt_1 = 1
196
+
197
+ end
198
+ case alt_1
199
+ when 1
200
+ # at line 24:43: c= COMMENT
201
+ c = match( COMMENT, TOKENS_FOLLOWING_COMMENT_IN_has_and_belongs_to_many_50 )
202
+
203
+ else
204
+ break # out of loop for decision 1
205
+ end
206
+ end # loop for decision 1
207
+
208
+ when 2
209
+ # at line 24:57: 'has_and_belongs_to_many' attribute ( class_name )? ( foreign_key )? ( association_foreign_key )? ( comment )?
210
+ match( T__11, TOKENS_FOLLOWING_T__11_IN_has_and_belongs_to_many_56 )
211
+ @state.following.push( TOKENS_FOLLOWING_attribute_IN_has_and_belongs_to_many_58 )
212
+ attribute
213
+ @state.following.pop
214
+ # at line 24:93: ( class_name )?
215
+ alt_2 = 2
216
+ look_2_0 = @input.peek( 1 )
217
+
218
+ if ( look_2_0 == T__12 )
219
+ look_2_1 = @input.peek( 2 )
220
+
221
+ if ( look_2_1 == T__13 )
222
+ look_2_3 = @input.peek( 3 )
223
+
224
+ if ( look_2_3 == T__14 )
225
+ alt_2 = 1
226
+ end
227
+ elsif ( look_2_1 == T__14 )
228
+ alt_2 = 1
229
+ end
230
+ end
231
+ case alt_2
232
+ when 1
233
+ # at line 24:93: class_name
234
+ @state.following.push( TOKENS_FOLLOWING_class_name_IN_has_and_belongs_to_many_60 )
235
+ class_name
236
+ @state.following.pop
237
+
238
+ end
239
+ # at line 24:105: ( foreign_key )?
240
+ alt_3 = 2
241
+ look_3_0 = @input.peek( 1 )
242
+
243
+ if ( look_3_0 == T__12 )
244
+ look_3_1 = @input.peek( 2 )
245
+
246
+ if ( look_3_1 == T__13 )
247
+ look_3_3 = @input.peek( 3 )
248
+
249
+ if ( look_3_3 == T__18 )
250
+ alt_3 = 1
251
+ end
252
+ elsif ( look_3_1 == T__18 )
253
+ alt_3 = 1
254
+ end
255
+ end
256
+ case alt_3
257
+ when 1
258
+ # at line 24:105: foreign_key
259
+ @state.following.push( TOKENS_FOLLOWING_foreign_key_IN_has_and_belongs_to_many_63 )
260
+ foreign_key
261
+ @state.following.pop
262
+
263
+ end
264
+ # at line 24:118: ( association_foreign_key )?
265
+ alt_4 = 2
266
+ look_4_0 = @input.peek( 1 )
267
+
268
+ if ( look_4_0 == T__12 )
269
+ alt_4 = 1
270
+ end
271
+ case alt_4
272
+ when 1
273
+ # at line 24:118: association_foreign_key
274
+ @state.following.push( TOKENS_FOLLOWING_association_foreign_key_IN_has_and_belongs_to_many_66 )
275
+ association_foreign_key
276
+ @state.following.pop
277
+
278
+ end
279
+ # at line 24:143: ( comment )?
280
+ alt_5 = 2
281
+ look_5_0 = @input.peek( 1 )
282
+
283
+ if ( look_5_0 == COMMENT )
284
+ alt_5 = 1
285
+ end
286
+ case alt_5
287
+ when 1
288
+ # at line 24:143: comment
289
+ @state.following.push( TOKENS_FOLLOWING_comment_IN_has_and_belongs_to_many_69 )
290
+ comment
291
+ @state.following.pop
292
+
293
+ end
294
+
295
+ end
296
+ # --> action
297
+
298
+ expr = {attribute: @attribute, class_name: @class_name, foreign_key: @foreign_key, association_foreign_key: @association_foreign_key} unless c
299
+
300
+ # <-- action
301
+
302
+ rescue ANTLR3::Error::RecognitionError => re
303
+ report_error(re)
304
+ recover(re)
305
+
306
+ ensure
307
+ # -> uncomment the next line to manually enable rule tracing
308
+ # trace_out( __method__, 2 )
309
+
310
+ end
311
+
312
+ return expr
313
+ end
314
+
315
+
316
+ #
317
+ # parser rule class_name
318
+ #
319
+ # (in HasAndBelongsToManyParser.g)
320
+ # 30:1: class_name : ',' ( class_name_old_syntax | class_name_new_syntax ) ;
321
+ #
322
+ def class_name
323
+ # -> uncomment the next line to manually enable rule tracing
324
+ # trace_in( __method__, 3 )
325
+
326
+ begin
327
+ # at line 30:13: ',' ( class_name_old_syntax | class_name_new_syntax )
328
+ match( T__12, TOKENS_FOLLOWING_T__12_IN_class_name_82 )
329
+ # at line 30:17: ( class_name_old_syntax | class_name_new_syntax )
330
+ alt_7 = 2
331
+ look_7_0 = @input.peek( 1 )
332
+
333
+ if ( look_7_0 == T__13 )
334
+ alt_7 = 1
335
+ elsif ( look_7_0 == T__14 )
336
+ alt_7 = 2
337
+ else
338
+ raise NoViableAlternative( "", 7, 0 )
339
+ end
340
+ case alt_7
341
+ when 1
342
+ # at line 30:18: class_name_old_syntax
343
+ @state.following.push( TOKENS_FOLLOWING_class_name_old_syntax_IN_class_name_85 )
344
+ class_name_old_syntax
345
+ @state.following.pop
346
+
347
+ when 2
348
+ # at line 30:42: class_name_new_syntax
349
+ @state.following.push( TOKENS_FOLLOWING_class_name_new_syntax_IN_class_name_89 )
350
+ class_name_new_syntax
351
+ @state.following.pop
352
+
353
+ end
354
+
355
+ rescue ANTLR3::Error::RecognitionError => re
356
+ report_error(re)
357
+ recover(re)
358
+
359
+ ensure
360
+ # -> uncomment the next line to manually enable rule tracing
361
+ # trace_out( __method__, 3 )
362
+
363
+ end
364
+
365
+ return
366
+ end
367
+
368
+
369
+ #
370
+ # parser rule class_name_old_syntax
371
+ #
372
+ # (in HasAndBelongsToManyParser.g)
373
+ # 32:1: class_name_old_syntax : ':' 'class_name' '=>' class_name_word ;
374
+ #
375
+ def class_name_old_syntax
376
+ # -> uncomment the next line to manually enable rule tracing
377
+ # trace_in( __method__, 4 )
378
+
379
+ begin
380
+ # at line 32:24: ':' 'class_name' '=>' class_name_word
381
+ match( T__13, TOKENS_FOLLOWING_T__13_IN_class_name_old_syntax_97 )
382
+ match( T__14, TOKENS_FOLLOWING_T__14_IN_class_name_old_syntax_99 )
383
+ match( T__15, TOKENS_FOLLOWING_T__15_IN_class_name_old_syntax_101 )
384
+ @state.following.push( TOKENS_FOLLOWING_class_name_word_IN_class_name_old_syntax_103 )
385
+ class_name_word
386
+ @state.following.pop
387
+
388
+ rescue ANTLR3::Error::RecognitionError => re
389
+ report_error(re)
390
+ recover(re)
391
+
392
+ ensure
393
+ # -> uncomment the next line to manually enable rule tracing
394
+ # trace_out( __method__, 4 )
395
+
396
+ end
397
+
398
+ return
399
+ end
400
+
401
+
402
+ #
403
+ # parser rule class_name_word
404
+ #
405
+ # (in HasAndBelongsToManyParser.g)
406
+ # 35:1: class_name_word : ( ( '\\'' a= ATTRIBUTE '\\'' ) | ( '\"' a= ATTRIBUTE '\"' ) | ( ':' a= ATTRIBUTE ) ) ;
407
+ #
408
+ def class_name_word
409
+ # -> uncomment the next line to manually enable rule tracing
410
+ # trace_in( __method__, 5 )
411
+ a = nil
412
+
413
+ begin
414
+ # at line 35:18: ( ( '\\'' a= ATTRIBUTE '\\'' ) | ( '\"' a= ATTRIBUTE '\"' ) | ( ':' a= ATTRIBUTE ) )
415
+ # at line 35:18: ( ( '\\'' a= ATTRIBUTE '\\'' ) | ( '\"' a= ATTRIBUTE '\"' ) | ( ':' a= ATTRIBUTE ) )
416
+ alt_8 = 3
417
+ case look_8 = @input.peek( 1 )
418
+ when T__16 then alt_8 = 1
419
+ when T__17 then alt_8 = 2
420
+ when T__13 then alt_8 = 3
421
+ else
422
+ raise NoViableAlternative( "", 8, 0 )
423
+ end
424
+ case alt_8
425
+ when 1
426
+ # at line 35:19: ( '\\'' a= ATTRIBUTE '\\'' )
427
+ # at line 35:19: ( '\\'' a= ATTRIBUTE '\\'' )
428
+ # at line 35:20: '\\'' a= ATTRIBUTE '\\''
429
+ match( T__16, TOKENS_FOLLOWING_T__16_IN_class_name_word_113 )
430
+ a = match( ATTRIBUTE, TOKENS_FOLLOWING_ATTRIBUTE_IN_class_name_word_117 )
431
+ match( T__16, TOKENS_FOLLOWING_T__16_IN_class_name_word_119 )
432
+
433
+
434
+ when 2
435
+ # at line 35:45: ( '\"' a= ATTRIBUTE '\"' )
436
+ # at line 35:45: ( '\"' a= ATTRIBUTE '\"' )
437
+ # at line 35:46: '\"' a= ATTRIBUTE '\"'
438
+ match( T__17, TOKENS_FOLLOWING_T__17_IN_class_name_word_125 )
439
+ a = match( ATTRIBUTE, TOKENS_FOLLOWING_ATTRIBUTE_IN_class_name_word_129 )
440
+ match( T__17, TOKENS_FOLLOWING_T__17_IN_class_name_word_131 )
441
+
442
+
443
+ when 3
444
+ # at line 35:69: ( ':' a= ATTRIBUTE )
445
+ # at line 35:69: ( ':' a= ATTRIBUTE )
446
+ # at line 35:70: ':' a= ATTRIBUTE
447
+ match( T__13, TOKENS_FOLLOWING_T__13_IN_class_name_word_137 )
448
+ a = match( ATTRIBUTE, TOKENS_FOLLOWING_ATTRIBUTE_IN_class_name_word_141 )
449
+
450
+
451
+ end
452
+ # --> action
453
+
454
+ @class_name = a.text
455
+
456
+ # <-- action
457
+
458
+ rescue ANTLR3::Error::RecognitionError => re
459
+ report_error(re)
460
+ recover(re)
461
+
462
+ ensure
463
+ # -> uncomment the next line to manually enable rule tracing
464
+ # trace_out( __method__, 5 )
465
+
466
+ end
467
+
468
+ return
469
+ end
470
+
471
+
472
+ #
473
+ # parser rule class_name_new_syntax
474
+ #
475
+ # (in HasAndBelongsToManyParser.g)
476
+ # 41:1: class_name_new_syntax : 'class_name' ':' class_name_word ;
477
+ #
478
+ def class_name_new_syntax
479
+ # -> uncomment the next line to manually enable rule tracing
480
+ # trace_in( __method__, 6 )
481
+
482
+ begin
483
+ # at line 41:24: 'class_name' ':' class_name_word
484
+ match( T__14, TOKENS_FOLLOWING_T__14_IN_class_name_new_syntax_154 )
485
+ match( T__13, TOKENS_FOLLOWING_T__13_IN_class_name_new_syntax_156 )
486
+ @state.following.push( TOKENS_FOLLOWING_class_name_word_IN_class_name_new_syntax_158 )
487
+ class_name_word
488
+ @state.following.pop
489
+
490
+ rescue ANTLR3::Error::RecognitionError => re
491
+ report_error(re)
492
+ recover(re)
493
+
494
+ ensure
495
+ # -> uncomment the next line to manually enable rule tracing
496
+ # trace_out( __method__, 6 )
497
+
498
+ end
499
+
500
+ return
501
+ end
502
+
503
+
504
+ #
505
+ # parser rule foreign_key
506
+ #
507
+ # (in HasAndBelongsToManyParser.g)
508
+ # 43:1: foreign_key : ',' ( foreign_key_old_syntax | foreign_key_new_syntax ) ;
509
+ #
510
+ def foreign_key
511
+ # -> uncomment the next line to manually enable rule tracing
512
+ # trace_in( __method__, 7 )
513
+
514
+ begin
515
+ # at line 43:14: ',' ( foreign_key_old_syntax | foreign_key_new_syntax )
516
+ match( T__12, TOKENS_FOLLOWING_T__12_IN_foreign_key_165 )
517
+ # at line 43:18: ( foreign_key_old_syntax | foreign_key_new_syntax )
518
+ alt_9 = 2
519
+ look_9_0 = @input.peek( 1 )
520
+
521
+ if ( look_9_0 == T__13 )
522
+ alt_9 = 1
523
+ elsif ( look_9_0 == T__18 )
524
+ alt_9 = 2
525
+ else
526
+ raise NoViableAlternative( "", 9, 0 )
527
+ end
528
+ case alt_9
529
+ when 1
530
+ # at line 43:19: foreign_key_old_syntax
531
+ @state.following.push( TOKENS_FOLLOWING_foreign_key_old_syntax_IN_foreign_key_168 )
532
+ foreign_key_old_syntax
533
+ @state.following.pop
534
+
535
+ when 2
536
+ # at line 43:44: foreign_key_new_syntax
537
+ @state.following.push( TOKENS_FOLLOWING_foreign_key_new_syntax_IN_foreign_key_172 )
538
+ foreign_key_new_syntax
539
+ @state.following.pop
540
+
541
+ end
542
+
543
+ rescue ANTLR3::Error::RecognitionError => re
544
+ report_error(re)
545
+ recover(re)
546
+
547
+ ensure
548
+ # -> uncomment the next line to manually enable rule tracing
549
+ # trace_out( __method__, 7 )
550
+
551
+ end
552
+
553
+ return
554
+ end
555
+
556
+
557
+ #
558
+ # parser rule foreign_key_old_syntax
559
+ #
560
+ # (in HasAndBelongsToManyParser.g)
561
+ # 45:1: foreign_key_old_syntax : ':' 'foreign_key' '=>' foreign_key_word ;
562
+ #
563
+ def foreign_key_old_syntax
564
+ # -> uncomment the next line to manually enable rule tracing
565
+ # trace_in( __method__, 8 )
566
+
567
+ begin
568
+ # at line 45:25: ':' 'foreign_key' '=>' foreign_key_word
569
+ match( T__13, TOKENS_FOLLOWING_T__13_IN_foreign_key_old_syntax_180 )
570
+ match( T__18, TOKENS_FOLLOWING_T__18_IN_foreign_key_old_syntax_182 )
571
+ match( T__15, TOKENS_FOLLOWING_T__15_IN_foreign_key_old_syntax_184 )
572
+ @state.following.push( TOKENS_FOLLOWING_foreign_key_word_IN_foreign_key_old_syntax_186 )
573
+ foreign_key_word
574
+ @state.following.pop
575
+
576
+ rescue ANTLR3::Error::RecognitionError => re
577
+ report_error(re)
578
+ recover(re)
579
+
580
+ ensure
581
+ # -> uncomment the next line to manually enable rule tracing
582
+ # trace_out( __method__, 8 )
583
+
584
+ end
585
+
586
+ return
587
+ end
588
+
589
+
590
+ #
591
+ # parser rule foreign_key_word
592
+ #
593
+ # (in HasAndBelongsToManyParser.g)
594
+ # 48:1: foreign_key_word : ( ( '\\'' a= ATTRIBUTE '\\'' ) | ( '\"' a= ATTRIBUTE '\"' ) | ( ':' a= ATTRIBUTE ) ) ;
595
+ #
596
+ def foreign_key_word
597
+ # -> uncomment the next line to manually enable rule tracing
598
+ # trace_in( __method__, 9 )
599
+ a = nil
600
+
601
+ begin
602
+ # at line 48:19: ( ( '\\'' a= ATTRIBUTE '\\'' ) | ( '\"' a= ATTRIBUTE '\"' ) | ( ':' a= ATTRIBUTE ) )
603
+ # at line 48:19: ( ( '\\'' a= ATTRIBUTE '\\'' ) | ( '\"' a= ATTRIBUTE '\"' ) | ( ':' a= ATTRIBUTE ) )
604
+ alt_10 = 3
605
+ case look_10 = @input.peek( 1 )
606
+ when T__16 then alt_10 = 1
607
+ when T__17 then alt_10 = 2
608
+ when T__13 then alt_10 = 3
609
+ else
610
+ raise NoViableAlternative( "", 10, 0 )
611
+ end
612
+ case alt_10
613
+ when 1
614
+ # at line 48:20: ( '\\'' a= ATTRIBUTE '\\'' )
615
+ # at line 48:20: ( '\\'' a= ATTRIBUTE '\\'' )
616
+ # at line 48:21: '\\'' a= ATTRIBUTE '\\''
617
+ match( T__16, TOKENS_FOLLOWING_T__16_IN_foreign_key_word_196 )
618
+ a = match( ATTRIBUTE, TOKENS_FOLLOWING_ATTRIBUTE_IN_foreign_key_word_200 )
619
+ match( T__16, TOKENS_FOLLOWING_T__16_IN_foreign_key_word_202 )
620
+
621
+
622
+ when 2
623
+ # at line 48:46: ( '\"' a= ATTRIBUTE '\"' )
624
+ # at line 48:46: ( '\"' a= ATTRIBUTE '\"' )
625
+ # at line 48:47: '\"' a= ATTRIBUTE '\"'
626
+ match( T__17, TOKENS_FOLLOWING_T__17_IN_foreign_key_word_208 )
627
+ a = match( ATTRIBUTE, TOKENS_FOLLOWING_ATTRIBUTE_IN_foreign_key_word_212 )
628
+ match( T__17, TOKENS_FOLLOWING_T__17_IN_foreign_key_word_214 )
629
+
630
+
631
+ when 3
632
+ # at line 48:70: ( ':' a= ATTRIBUTE )
633
+ # at line 48:70: ( ':' a= ATTRIBUTE )
634
+ # at line 48:71: ':' a= ATTRIBUTE
635
+ match( T__13, TOKENS_FOLLOWING_T__13_IN_foreign_key_word_220 )
636
+ a = match( ATTRIBUTE, TOKENS_FOLLOWING_ATTRIBUTE_IN_foreign_key_word_224 )
637
+
638
+
639
+ end
640
+ # --> action
641
+
642
+ @foreign_key = a.text
643
+
644
+ # <-- action
645
+
646
+ rescue ANTLR3::Error::RecognitionError => re
647
+ report_error(re)
648
+ recover(re)
649
+
650
+ ensure
651
+ # -> uncomment the next line to manually enable rule tracing
652
+ # trace_out( __method__, 9 )
653
+
654
+ end
655
+
656
+ return
657
+ end
658
+
659
+
660
+ #
661
+ # parser rule foreign_key_new_syntax
662
+ #
663
+ # (in HasAndBelongsToManyParser.g)
664
+ # 54:1: foreign_key_new_syntax : 'foreign_key' ':' foreign_key_word ;
665
+ #
666
+ def foreign_key_new_syntax
667
+ # -> uncomment the next line to manually enable rule tracing
668
+ # trace_in( __method__, 10 )
669
+
670
+ begin
671
+ # at line 54:25: 'foreign_key' ':' foreign_key_word
672
+ match( T__18, TOKENS_FOLLOWING_T__18_IN_foreign_key_new_syntax_237 )
673
+ match( T__13, TOKENS_FOLLOWING_T__13_IN_foreign_key_new_syntax_239 )
674
+ @state.following.push( TOKENS_FOLLOWING_foreign_key_word_IN_foreign_key_new_syntax_241 )
675
+ foreign_key_word
676
+ @state.following.pop
677
+
678
+ rescue ANTLR3::Error::RecognitionError => re
679
+ report_error(re)
680
+ recover(re)
681
+
682
+ ensure
683
+ # -> uncomment the next line to manually enable rule tracing
684
+ # trace_out( __method__, 10 )
685
+
686
+ end
687
+
688
+ return
689
+ end
690
+
691
+
692
+ #
693
+ # parser rule association_foreign_key
694
+ #
695
+ # (in HasAndBelongsToManyParser.g)
696
+ # 57:1: association_foreign_key : ',' ( association_foreign_key_old_syntax | association_foreign_key_new_syntax ) ;
697
+ #
698
+ def association_foreign_key
699
+ # -> uncomment the next line to manually enable rule tracing
700
+ # trace_in( __method__, 11 )
701
+
702
+ begin
703
+ # at line 57:26: ',' ( association_foreign_key_old_syntax | association_foreign_key_new_syntax )
704
+ match( T__12, TOKENS_FOLLOWING_T__12_IN_association_foreign_key_249 )
705
+ # at line 57:30: ( association_foreign_key_old_syntax | association_foreign_key_new_syntax )
706
+ alt_11 = 2
707
+ look_11_0 = @input.peek( 1 )
708
+
709
+ if ( look_11_0 == T__13 )
710
+ alt_11 = 1
711
+ elsif ( look_11_0 == T__19 )
712
+ alt_11 = 2
713
+ else
714
+ raise NoViableAlternative( "", 11, 0 )
715
+ end
716
+ case alt_11
717
+ when 1
718
+ # at line 57:31: association_foreign_key_old_syntax
719
+ @state.following.push( TOKENS_FOLLOWING_association_foreign_key_old_syntax_IN_association_foreign_key_252 )
720
+ association_foreign_key_old_syntax
721
+ @state.following.pop
722
+
723
+ when 2
724
+ # at line 57:68: association_foreign_key_new_syntax
725
+ @state.following.push( TOKENS_FOLLOWING_association_foreign_key_new_syntax_IN_association_foreign_key_256 )
726
+ association_foreign_key_new_syntax
727
+ @state.following.pop
728
+
729
+ end
730
+
731
+ rescue ANTLR3::Error::RecognitionError => re
732
+ report_error(re)
733
+ recover(re)
734
+
735
+ ensure
736
+ # -> uncomment the next line to manually enable rule tracing
737
+ # trace_out( __method__, 11 )
738
+
739
+ end
740
+
741
+ return
742
+ end
743
+
744
+
745
+ #
746
+ # parser rule association_foreign_key_old_syntax
747
+ #
748
+ # (in HasAndBelongsToManyParser.g)
749
+ # 59:1: association_foreign_key_old_syntax : ':' 'association_foreign_key' '=>' association_foreign_key_word ;
750
+ #
751
+ def association_foreign_key_old_syntax
752
+ # -> uncomment the next line to manually enable rule tracing
753
+ # trace_in( __method__, 12 )
754
+
755
+ begin
756
+ # at line 59:37: ':' 'association_foreign_key' '=>' association_foreign_key_word
757
+ match( T__13, TOKENS_FOLLOWING_T__13_IN_association_foreign_key_old_syntax_264 )
758
+ match( T__19, TOKENS_FOLLOWING_T__19_IN_association_foreign_key_old_syntax_266 )
759
+ match( T__15, TOKENS_FOLLOWING_T__15_IN_association_foreign_key_old_syntax_268 )
760
+ @state.following.push( TOKENS_FOLLOWING_association_foreign_key_word_IN_association_foreign_key_old_syntax_270 )
761
+ association_foreign_key_word
762
+ @state.following.pop
763
+
764
+ rescue ANTLR3::Error::RecognitionError => re
765
+ report_error(re)
766
+ recover(re)
767
+
768
+ ensure
769
+ # -> uncomment the next line to manually enable rule tracing
770
+ # trace_out( __method__, 12 )
771
+
772
+ end
773
+
774
+ return
775
+ end
776
+
777
+
778
+ #
779
+ # parser rule association_foreign_key_word
780
+ #
781
+ # (in HasAndBelongsToManyParser.g)
782
+ # 62:1: association_foreign_key_word : ( ( '\\'' a= ATTRIBUTE '\\'' ) | ( '\"' a= ATTRIBUTE '\"' ) | ( ':' a= ATTRIBUTE ) ) ;
783
+ #
784
+ def association_foreign_key_word
785
+ # -> uncomment the next line to manually enable rule tracing
786
+ # trace_in( __method__, 13 )
787
+ a = nil
788
+
789
+ begin
790
+ # at line 62:31: ( ( '\\'' a= ATTRIBUTE '\\'' ) | ( '\"' a= ATTRIBUTE '\"' ) | ( ':' a= ATTRIBUTE ) )
791
+ # at line 62:31: ( ( '\\'' a= ATTRIBUTE '\\'' ) | ( '\"' a= ATTRIBUTE '\"' ) | ( ':' a= ATTRIBUTE ) )
792
+ alt_12 = 3
793
+ case look_12 = @input.peek( 1 )
794
+ when T__16 then alt_12 = 1
795
+ when T__17 then alt_12 = 2
796
+ when T__13 then alt_12 = 3
797
+ else
798
+ raise NoViableAlternative( "", 12, 0 )
799
+ end
800
+ case alt_12
801
+ when 1
802
+ # at line 62:32: ( '\\'' a= ATTRIBUTE '\\'' )
803
+ # at line 62:32: ( '\\'' a= ATTRIBUTE '\\'' )
804
+ # at line 62:33: '\\'' a= ATTRIBUTE '\\''
805
+ match( T__16, TOKENS_FOLLOWING_T__16_IN_association_foreign_key_word_280 )
806
+ a = match( ATTRIBUTE, TOKENS_FOLLOWING_ATTRIBUTE_IN_association_foreign_key_word_284 )
807
+ match( T__16, TOKENS_FOLLOWING_T__16_IN_association_foreign_key_word_286 )
808
+
809
+
810
+ when 2
811
+ # at line 62:58: ( '\"' a= ATTRIBUTE '\"' )
812
+ # at line 62:58: ( '\"' a= ATTRIBUTE '\"' )
813
+ # at line 62:59: '\"' a= ATTRIBUTE '\"'
814
+ match( T__17, TOKENS_FOLLOWING_T__17_IN_association_foreign_key_word_292 )
815
+ a = match( ATTRIBUTE, TOKENS_FOLLOWING_ATTRIBUTE_IN_association_foreign_key_word_296 )
816
+ match( T__17, TOKENS_FOLLOWING_T__17_IN_association_foreign_key_word_298 )
817
+
818
+
819
+ when 3
820
+ # at line 62:82: ( ':' a= ATTRIBUTE )
821
+ # at line 62:82: ( ':' a= ATTRIBUTE )
822
+ # at line 62:83: ':' a= ATTRIBUTE
823
+ match( T__13, TOKENS_FOLLOWING_T__13_IN_association_foreign_key_word_304 )
824
+ a = match( ATTRIBUTE, TOKENS_FOLLOWING_ATTRIBUTE_IN_association_foreign_key_word_308 )
825
+
826
+
827
+ end
828
+ # --> action
829
+
830
+ @association_foreign_key = a.text
831
+
832
+ # <-- action
833
+
834
+ rescue ANTLR3::Error::RecognitionError => re
835
+ report_error(re)
836
+ recover(re)
837
+
838
+ ensure
839
+ # -> uncomment the next line to manually enable rule tracing
840
+ # trace_out( __method__, 13 )
841
+
842
+ end
843
+
844
+ return
845
+ end
846
+
847
+
848
+ #
849
+ # parser rule association_foreign_key_new_syntax
850
+ #
851
+ # (in HasAndBelongsToManyParser.g)
852
+ # 68:1: association_foreign_key_new_syntax : 'association_foreign_key' ':' foreign_key_word ;
853
+ #
854
+ def association_foreign_key_new_syntax
855
+ # -> uncomment the next line to manually enable rule tracing
856
+ # trace_in( __method__, 14 )
857
+
858
+ begin
859
+ # at line 68:37: 'association_foreign_key' ':' foreign_key_word
860
+ match( T__19, TOKENS_FOLLOWING_T__19_IN_association_foreign_key_new_syntax_321 )
861
+ match( T__13, TOKENS_FOLLOWING_T__13_IN_association_foreign_key_new_syntax_323 )
862
+ @state.following.push( TOKENS_FOLLOWING_foreign_key_word_IN_association_foreign_key_new_syntax_325 )
863
+ foreign_key_word
864
+ @state.following.pop
865
+
866
+ rescue ANTLR3::Error::RecognitionError => re
867
+ report_error(re)
868
+ recover(re)
869
+
870
+ ensure
871
+ # -> uncomment the next line to manually enable rule tracing
872
+ # trace_out( __method__, 14 )
873
+
874
+ end
875
+
876
+ return
877
+ end
878
+
879
+
880
+ #
881
+ # parser rule attribute
882
+ #
883
+ # (in HasAndBelongsToManyParser.g)
884
+ # 71:1: attribute : ( ( '\\'' a= ATTRIBUTE '\\'' ) | ( '\"' a= ATTRIBUTE '\"' ) | ( ':' a= ATTRIBUTE ) );
885
+ #
886
+ def attribute
887
+ # -> uncomment the next line to manually enable rule tracing
888
+ # trace_in( __method__, 15 )
889
+ a = nil
890
+
891
+ begin
892
+ # at line 71:10: ( ( '\\'' a= ATTRIBUTE '\\'' ) | ( '\"' a= ATTRIBUTE '\"' ) | ( ':' a= ATTRIBUTE ) )
893
+ alt_13 = 3
894
+ case look_13 = @input.peek( 1 )
895
+ when T__16 then alt_13 = 1
896
+ when T__17 then alt_13 = 2
897
+ when T__13 then alt_13 = 3
898
+ else
899
+ raise NoViableAlternative( "", 13, 0 )
900
+ end
901
+ case alt_13
902
+ when 1
903
+ # at line 71:12: ( '\\'' a= ATTRIBUTE '\\'' )
904
+ # at line 71:12: ( '\\'' a= ATTRIBUTE '\\'' )
905
+ # at line 71:13: '\\'' a= ATTRIBUTE '\\''
906
+ match( T__16, TOKENS_FOLLOWING_T__16_IN_attribute_334 )
907
+ a = match( ATTRIBUTE, TOKENS_FOLLOWING_ATTRIBUTE_IN_attribute_338 )
908
+ match( T__16, TOKENS_FOLLOWING_T__16_IN_attribute_340 )
909
+
910
+
911
+ when 2
912
+ # at line 71:38: ( '\"' a= ATTRIBUTE '\"' )
913
+ # at line 71:38: ( '\"' a= ATTRIBUTE '\"' )
914
+ # at line 71:39: '\"' a= ATTRIBUTE '\"'
915
+ match( T__17, TOKENS_FOLLOWING_T__17_IN_attribute_346 )
916
+ a = match( ATTRIBUTE, TOKENS_FOLLOWING_ATTRIBUTE_IN_attribute_350 )
917
+ match( T__17, TOKENS_FOLLOWING_T__17_IN_attribute_352 )
918
+
919
+
920
+ when 3
921
+ # at line 71:62: ( ':' a= ATTRIBUTE )
922
+ # at line 71:62: ( ':' a= ATTRIBUTE )
923
+ # at line 71:63: ':' a= ATTRIBUTE
924
+ match( T__13, TOKENS_FOLLOWING_T__13_IN_attribute_358 )
925
+ a = match( ATTRIBUTE, TOKENS_FOLLOWING_ATTRIBUTE_IN_attribute_362 )
926
+
927
+ # --> action
928
+
929
+ @attribute = a.text
930
+
931
+ # <-- action
932
+
933
+ end
934
+ rescue ANTLR3::Error::RecognitionError => re
935
+ report_error(re)
936
+ recover(re)
937
+
938
+ ensure
939
+ # -> uncomment the next line to manually enable rule tracing
940
+ # trace_out( __method__, 15 )
941
+
942
+ end
943
+
944
+ return
945
+ end
946
+
947
+
948
+
949
+ TOKENS_FOLLOWING_COMMENT_IN_comment_35 = Set[ 1 ]
950
+ TOKENS_FOLLOWING_COMMENT_IN_has_and_belongs_to_many_50 = Set[ 1, 4 ]
951
+ TOKENS_FOLLOWING_T__11_IN_has_and_belongs_to_many_56 = Set[ 13, 16, 17 ]
952
+ TOKENS_FOLLOWING_attribute_IN_has_and_belongs_to_many_58 = Set[ 1, 4, 12 ]
953
+ TOKENS_FOLLOWING_class_name_IN_has_and_belongs_to_many_60 = Set[ 1, 4, 12 ]
954
+ TOKENS_FOLLOWING_foreign_key_IN_has_and_belongs_to_many_63 = Set[ 1, 4, 12 ]
955
+ TOKENS_FOLLOWING_association_foreign_key_IN_has_and_belongs_to_many_66 = Set[ 1, 4 ]
956
+ TOKENS_FOLLOWING_comment_IN_has_and_belongs_to_many_69 = Set[ 1 ]
957
+ TOKENS_FOLLOWING_T__12_IN_class_name_82 = Set[ 13, 14 ]
958
+ TOKENS_FOLLOWING_class_name_old_syntax_IN_class_name_85 = Set[ 1 ]
959
+ TOKENS_FOLLOWING_class_name_new_syntax_IN_class_name_89 = Set[ 1 ]
960
+ TOKENS_FOLLOWING_T__13_IN_class_name_old_syntax_97 = Set[ 14 ]
961
+ TOKENS_FOLLOWING_T__14_IN_class_name_old_syntax_99 = Set[ 15 ]
962
+ TOKENS_FOLLOWING_T__15_IN_class_name_old_syntax_101 = Set[ 13, 16, 17 ]
963
+ TOKENS_FOLLOWING_class_name_word_IN_class_name_old_syntax_103 = Set[ 1 ]
964
+ TOKENS_FOLLOWING_T__16_IN_class_name_word_113 = Set[ 5 ]
965
+ TOKENS_FOLLOWING_ATTRIBUTE_IN_class_name_word_117 = Set[ 16 ]
966
+ TOKENS_FOLLOWING_T__16_IN_class_name_word_119 = Set[ 1 ]
967
+ TOKENS_FOLLOWING_T__17_IN_class_name_word_125 = Set[ 5 ]
968
+ TOKENS_FOLLOWING_ATTRIBUTE_IN_class_name_word_129 = Set[ 17 ]
969
+ TOKENS_FOLLOWING_T__17_IN_class_name_word_131 = Set[ 1 ]
970
+ TOKENS_FOLLOWING_T__13_IN_class_name_word_137 = Set[ 5 ]
971
+ TOKENS_FOLLOWING_ATTRIBUTE_IN_class_name_word_141 = Set[ 1 ]
972
+ TOKENS_FOLLOWING_T__14_IN_class_name_new_syntax_154 = Set[ 13 ]
973
+ TOKENS_FOLLOWING_T__13_IN_class_name_new_syntax_156 = Set[ 13, 16, 17 ]
974
+ TOKENS_FOLLOWING_class_name_word_IN_class_name_new_syntax_158 = Set[ 1 ]
975
+ TOKENS_FOLLOWING_T__12_IN_foreign_key_165 = Set[ 13, 18 ]
976
+ TOKENS_FOLLOWING_foreign_key_old_syntax_IN_foreign_key_168 = Set[ 1 ]
977
+ TOKENS_FOLLOWING_foreign_key_new_syntax_IN_foreign_key_172 = Set[ 1 ]
978
+ TOKENS_FOLLOWING_T__13_IN_foreign_key_old_syntax_180 = Set[ 18 ]
979
+ TOKENS_FOLLOWING_T__18_IN_foreign_key_old_syntax_182 = Set[ 15 ]
980
+ TOKENS_FOLLOWING_T__15_IN_foreign_key_old_syntax_184 = Set[ 13, 16, 17 ]
981
+ TOKENS_FOLLOWING_foreign_key_word_IN_foreign_key_old_syntax_186 = Set[ 1 ]
982
+ TOKENS_FOLLOWING_T__16_IN_foreign_key_word_196 = Set[ 5 ]
983
+ TOKENS_FOLLOWING_ATTRIBUTE_IN_foreign_key_word_200 = Set[ 16 ]
984
+ TOKENS_FOLLOWING_T__16_IN_foreign_key_word_202 = Set[ 1 ]
985
+ TOKENS_FOLLOWING_T__17_IN_foreign_key_word_208 = Set[ 5 ]
986
+ TOKENS_FOLLOWING_ATTRIBUTE_IN_foreign_key_word_212 = Set[ 17 ]
987
+ TOKENS_FOLLOWING_T__17_IN_foreign_key_word_214 = Set[ 1 ]
988
+ TOKENS_FOLLOWING_T__13_IN_foreign_key_word_220 = Set[ 5 ]
989
+ TOKENS_FOLLOWING_ATTRIBUTE_IN_foreign_key_word_224 = Set[ 1 ]
990
+ TOKENS_FOLLOWING_T__18_IN_foreign_key_new_syntax_237 = Set[ 13 ]
991
+ TOKENS_FOLLOWING_T__13_IN_foreign_key_new_syntax_239 = Set[ 13, 16, 17 ]
992
+ TOKENS_FOLLOWING_foreign_key_word_IN_foreign_key_new_syntax_241 = Set[ 1 ]
993
+ TOKENS_FOLLOWING_T__12_IN_association_foreign_key_249 = Set[ 13, 19 ]
994
+ TOKENS_FOLLOWING_association_foreign_key_old_syntax_IN_association_foreign_key_252 = Set[ 1 ]
995
+ TOKENS_FOLLOWING_association_foreign_key_new_syntax_IN_association_foreign_key_256 = Set[ 1 ]
996
+ TOKENS_FOLLOWING_T__13_IN_association_foreign_key_old_syntax_264 = Set[ 19 ]
997
+ TOKENS_FOLLOWING_T__19_IN_association_foreign_key_old_syntax_266 = Set[ 15 ]
998
+ TOKENS_FOLLOWING_T__15_IN_association_foreign_key_old_syntax_268 = Set[ 13, 16, 17 ]
999
+ TOKENS_FOLLOWING_association_foreign_key_word_IN_association_foreign_key_old_syntax_270 = Set[ 1 ]
1000
+ TOKENS_FOLLOWING_T__16_IN_association_foreign_key_word_280 = Set[ 5 ]
1001
+ TOKENS_FOLLOWING_ATTRIBUTE_IN_association_foreign_key_word_284 = Set[ 16 ]
1002
+ TOKENS_FOLLOWING_T__16_IN_association_foreign_key_word_286 = Set[ 1 ]
1003
+ TOKENS_FOLLOWING_T__17_IN_association_foreign_key_word_292 = Set[ 5 ]
1004
+ TOKENS_FOLLOWING_ATTRIBUTE_IN_association_foreign_key_word_296 = Set[ 17 ]
1005
+ TOKENS_FOLLOWING_T__17_IN_association_foreign_key_word_298 = Set[ 1 ]
1006
+ TOKENS_FOLLOWING_T__13_IN_association_foreign_key_word_304 = Set[ 5 ]
1007
+ TOKENS_FOLLOWING_ATTRIBUTE_IN_association_foreign_key_word_308 = Set[ 1 ]
1008
+ TOKENS_FOLLOWING_T__19_IN_association_foreign_key_new_syntax_321 = Set[ 13 ]
1009
+ TOKENS_FOLLOWING_T__13_IN_association_foreign_key_new_syntax_323 = Set[ 13, 16, 17 ]
1010
+ TOKENS_FOLLOWING_foreign_key_word_IN_association_foreign_key_new_syntax_325 = Set[ 1 ]
1011
+ TOKENS_FOLLOWING_T__16_IN_attribute_334 = Set[ 5 ]
1012
+ TOKENS_FOLLOWING_ATTRIBUTE_IN_attribute_338 = Set[ 16 ]
1013
+ TOKENS_FOLLOWING_T__16_IN_attribute_340 = Set[ 1 ]
1014
+ TOKENS_FOLLOWING_T__17_IN_attribute_346 = Set[ 5 ]
1015
+ TOKENS_FOLLOWING_ATTRIBUTE_IN_attribute_350 = Set[ 17 ]
1016
+ TOKENS_FOLLOWING_T__17_IN_attribute_352 = Set[ 1 ]
1017
+ TOKENS_FOLLOWING_T__13_IN_attribute_358 = Set[ 5 ]
1018
+ TOKENS_FOLLOWING_ATTRIBUTE_IN_attribute_362 = Set[ 1 ]
1019
+
1020
+ end # class Parser < ANTLR3::Parser
1021
+
1022
+ at_exit { Parser.main( ARGV ) } if __FILE__ == $0
1023
+ end
1024
+