-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex_type.rb
More file actions
44 lines (36 loc) · 1.14 KB
/
index_type.rb
File metadata and controls
44 lines (36 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
class IndexType
@@indexes_Table = Hash["PRIMARY" => 1, "KEY" => 2, "UNIQUE" => 3]
def initialize()
puts 'In IndexType class'
end
def index_type_check(token)
case token
#when /^`[a-zA-Z]*`$/
when /^`[a-zA-Z]\w*?`$/
puts "Go_To_bracket_Transition"
return_value = "Go_To_bracket_Transition"
#when /^[a-zA-Z]*$/
when /^[a-zA-Z]\w*$/
if @@indexes_Table.has_key?(token)
return_value = true # continue to next transition
else
puts "Go_To_bracket_Transition"
return_value = "Go_To_bracket_Transition"
end
#when /^\(`[a-zA-Z]*`\)$/
when /^\(`[a-zA-Z]\w*`\)$/
#validate here if we have column name has same this primary key name
puts "Primary key name is : #{token}"
return_value = true
#when /^\([a-zA-Z]*\)$/
when /^\([a-zA-Z]\w*\)$/
#validate here if we have column name has same this primary key name
puts "Primary key name is : #{token}"
return_value = true
else
puts 'Error, In index_type class'
return_value = token
end
return return_value
end
end