Class: Code::Parser::Name
Instance Method Summary collapse
- #ampersand ⇒ Object
- #asterisk ⇒ Object
- #begin_keyword ⇒ Object
- #character ⇒ Object
- #closing_curly_bracket ⇒ Object
- #closing_parenthesis ⇒ Object
- #closing_square_bracket ⇒ Object
- #colon ⇒ Object
- #comma ⇒ Object
- #do_keyword ⇒ Object
- #dot ⇒ Object
- #double_quote ⇒ Object
- #else_keyword ⇒ Object
- #elsif_keyword ⇒ Object
- #elsunless_keyword ⇒ Object
- #end_keyword ⇒ Object
- #equal ⇒ Object
- #exclamation_mark ⇒ Object
- #false_keyword ⇒ Object
- #greater ⇒ Object
- #if_keyword ⇒ Object
- #keyword ⇒ Object
- #lesser ⇒ Object
- #newline ⇒ Object
- #nothing_keyword ⇒ Object
- #opening_curly_bracket ⇒ Object
- #opening_parenthesis ⇒ Object
- #opening_square_bracket ⇒ Object
- #pipe ⇒ Object
- #question_mark ⇒ Object
- #reserved_character ⇒ Object
- #root ⇒ Object
- #separator ⇒ Object
- #single_quote ⇒ Object
- #space ⇒ Object
- #special_characters ⇒ Object
- #special_name ⇒ Object
- #true_keyword ⇒ Object
- #unless_keyword ⇒ Object
- #until_keyword ⇒ Object
- #while_keyword ⇒ Object
Instance Method Details
#ampersand ⇒ Object
66 67 68 |
# File 'lib/code/parser/name.rb', line 66 def ampersand str("&") end |
#asterisk ⇒ Object
78 79 80 |
# File 'lib/code/parser/name.rb', line 78 def asterisk str("*") end |
#begin_keyword ⇒ Object
86 87 88 |
# File 'lib/code/parser/name.rb', line 86 def begin_keyword str("begin") end |
#character ⇒ Object
154 155 156 |
# File 'lib/code/parser/name.rb', line 154 def character reserved_character.absent << any end |
#closing_curly_bracket ⇒ Object
30 31 32 |
# File 'lib/code/parser/name.rb', line 30 def closing_curly_bracket str("}") end |
#closing_parenthesis ⇒ Object
46 47 48 |
# File 'lib/code/parser/name.rb', line 46 def closing_parenthesis str(")") end |
#closing_square_bracket ⇒ Object
38 39 40 |
# File 'lib/code/parser/name.rb', line 38 def closing_square_bracket str("]") end |
#colon ⇒ Object
22 23 24 |
# File 'lib/code/parser/name.rb', line 22 def colon str(":") end |
#comma ⇒ Object
14 15 16 |
# File 'lib/code/parser/name.rb', line 14 def comma str(",") end |
#do_keyword ⇒ Object
82 83 84 |
# File 'lib/code/parser/name.rb', line 82 def do_keyword str("do") end |
#dot ⇒ Object
58 59 60 |
# File 'lib/code/parser/name.rb', line 58 def dot str(".") end |
#double_quote ⇒ Object
54 55 56 |
# File 'lib/code/parser/name.rb', line 54 def double_quote str('"') end |
#else_keyword ⇒ Object
98 99 100 |
# File 'lib/code/parser/name.rb', line 98 def else_keyword str("else") end |
#elsif_keyword ⇒ Object
94 95 96 |
# File 'lib/code/parser/name.rb', line 94 def elsif_keyword str("elsif") end |
#elsunless_keyword ⇒ Object
118 119 120 |
# File 'lib/code/parser/name.rb', line 118 def elsunless_keyword str("elsunless") end |
#end_keyword ⇒ Object
90 91 92 |
# File 'lib/code/parser/name.rb', line 90 def end_keyword str("end") end |
#equal ⇒ Object
18 19 20 |
# File 'lib/code/parser/name.rb', line 18 def equal str("=") end |
#exclamation_mark ⇒ Object
134 135 136 |
# File 'lib/code/parser/name.rb', line 134 def exclamation_mark str("!") end |
#false_keyword ⇒ Object
126 127 128 |
# File 'lib/code/parser/name.rb', line 126 def false_keyword str("false") end |
#greater ⇒ Object
74 75 76 |
# File 'lib/code/parser/name.rb', line 74 def greater str(">") end |
#if_keyword ⇒ Object
110 111 112 |
# File 'lib/code/parser/name.rb', line 110 def if_keyword str("if") end |
#keyword ⇒ Object
166 167 168 169 170 171 |
# File 'lib/code/parser/name.rb', line 166 def keyword do_keyword | begin_keyword | end_keyword | while_keyword | until_keyword | if_keyword | elsif_keyword | else_keyword | unless_keyword | elsunless_keyword | true_keyword | false_keyword | nothing_keyword end |
#lesser ⇒ Object
70 71 72 |
# File 'lib/code/parser/name.rb', line 70 def lesser str("<") end |
#newline ⇒ Object
10 11 12 |
# File 'lib/code/parser/name.rb', line 10 def newline str("\n") end |
#nothing_keyword ⇒ Object
130 131 132 |
# File 'lib/code/parser/name.rb', line 130 def nothing_keyword str("nothing") end |
#opening_curly_bracket ⇒ Object
26 27 28 |
# File 'lib/code/parser/name.rb', line 26 def opening_curly_bracket str("{") end |
#opening_parenthesis ⇒ Object
42 43 44 |
# File 'lib/code/parser/name.rb', line 42 def opening_parenthesis str("(") end |
#opening_square_bracket ⇒ Object
34 35 36 |
# File 'lib/code/parser/name.rb', line 34 def opening_square_bracket str("[") end |
#pipe ⇒ Object
62 63 64 |
# File 'lib/code/parser/name.rb', line 62 def pipe str("|") end |
#question_mark ⇒ Object
138 139 140 |
# File 'lib/code/parser/name.rb', line 138 def question_mark str("?") end |
#reserved_character ⇒ Object
146 147 148 149 150 151 152 |
# File 'lib/code/parser/name.rb', line 146 def reserved_character ampersand | equal | pipe | dot | colon | comma | space | newline | opening_curly_bracket | closing_curly_bracket | opening_parenthesis | closing_parenthesis | opening_square_bracket | closing_square_bracket | single_quote | double_quote | lesser | greater | asterisk end |
#root ⇒ Object
173 174 175 176 177 178 179 180 181 |
# File 'lib/code/parser/name.rb', line 173 def root ( (special_name << separator.ignore) | ( (keyword << separator).absent << special_characters.absent << character.repeat(1) ) ) end |
#separator ⇒ Object
158 159 160 |
# File 'lib/code/parser/name.rb', line 158 def separator reserved_character | any.absent end |
#single_quote ⇒ Object
50 51 52 |
# File 'lib/code/parser/name.rb', line 50 def single_quote str("'") end |
#space ⇒ Object
6 7 8 |
# File 'lib/code/parser/name.rb', line 6 def space str(" ") end |
#special_characters ⇒ Object
162 163 164 |
# File 'lib/code/parser/name.rb', line 162 def special_characters exclamation_mark | question_mark end |
#special_name ⇒ Object
142 143 144 |
# File 'lib/code/parser/name.rb', line 142 def special_name str("...") | str("..") | str(".") | str("**") | str("*") | str("&") end |
#true_keyword ⇒ Object
122 123 124 |
# File 'lib/code/parser/name.rb', line 122 def true_keyword str("true") end |
#unless_keyword ⇒ Object
114 115 116 |
# File 'lib/code/parser/name.rb', line 114 def unless_keyword str("unless") end |
#until_keyword ⇒ Object
106 107 108 |
# File 'lib/code/parser/name.rb', line 106 def until_keyword str("until") end |
#while_keyword ⇒ Object
102 103 104 |
# File 'lib/code/parser/name.rb', line 102 def while_keyword str("while") end |