Class: Query::Parser::Number
- Defined in:
- lib/query/parser/number.rb
Instance Method Summary collapse
- #a ⇒ Object
- #b ⇒ Object
- #base_10_digit ⇒ Object
- #base_10_number ⇒ Object
- #base_10_whole ⇒ Object
- #base_16_digit ⇒ Object
- #base_16_number ⇒ Object
- #base_16_whole ⇒ Object
- #base_2_digit ⇒ Object
- #base_2_number ⇒ Object
- #base_2_whole ⇒ Object
- #base_8_digit ⇒ Object
- #base_8_number ⇒ Object
- #base_8_whole ⇒ Object
- #c ⇒ Object
- #d ⇒ Object
- #decimal ⇒ Object
- #dot ⇒ Object
- #e ⇒ Object
- #eight ⇒ Object
- #exponent ⇒ Object
- #f ⇒ Object
- #five ⇒ Object
- #four ⇒ Object
- #nine ⇒ Object
- #o ⇒ Object
- #one ⇒ Object
- #root ⇒ Object
- #seven ⇒ Object
- #six ⇒ Object
- #three ⇒ Object
- #two ⇒ Object
- #underscore ⇒ Object
- #x ⇒ Object
- #zero ⇒ Object
Instance Method Details
#a ⇒ Object
50 51 52 |
# File 'lib/query/parser/number.rb', line 50 def a str("a") | str("A") end |
#b ⇒ Object
54 55 56 |
# File 'lib/query/parser/number.rb', line 54 def b str("b") | str("B") end |
#base_10_digit ⇒ Object
91 92 93 |
# File 'lib/query/parser/number.rb', line 91 def base_10_digit zero | one | two | three | four | five | six | seven | eight | nine end |
#base_10_number ⇒ Object
131 132 133 |
# File 'lib/query/parser/number.rb', line 131 def base_10_number base_10_whole.aka(:whole) << exponent.maybe end |
#base_10_whole ⇒ Object
107 108 109 |
# File 'lib/query/parser/number.rb', line 107 def base_10_whole base_10_digit << (underscore.ignore | base_10_digit).repeat end |
#base_16_digit ⇒ Object
86 87 88 89 |
# File 'lib/query/parser/number.rb', line 86 def base_16_digit zero | one | two | three | four | five | six | seven | eight | nine | a | b | c | d | e | f end |
#base_16_number ⇒ Object
127 128 129 |
# File 'lib/query/parser/number.rb', line 127 def base_16_number zero.ignore << x.ignore << base_16_whole end |
#base_16_whole ⇒ Object
103 104 105 |
# File 'lib/query/parser/number.rb', line 103 def base_16_whole base_16_digit << (underscore.ignore | base_16_digit).repeat end |
#base_2_digit ⇒ Object
99 100 101 |
# File 'lib/query/parser/number.rb', line 99 def base_2_digit zero | one end |
#base_2_number ⇒ Object
139 140 141 |
# File 'lib/query/parser/number.rb', line 139 def base_2_number zero.ignore << b.ignore << base_2_whole end |
#base_2_whole ⇒ Object
115 116 117 |
# File 'lib/query/parser/number.rb', line 115 def base_2_whole base_2_digit << (underscore.ignore | base_2_digit).repeat end |
#base_8_digit ⇒ Object
95 96 97 |
# File 'lib/query/parser/number.rb', line 95 def base_8_digit zero | one | two | three | four | five | six | seven end |
#base_8_number ⇒ Object
135 136 137 |
# File 'lib/query/parser/number.rb', line 135 def base_8_number zero.ignore << o.ignore << base_8_whole end |
#base_8_whole ⇒ Object
111 112 113 |
# File 'lib/query/parser/number.rb', line 111 def base_8_whole base_8_digit << (underscore.ignore | base_8_digit).repeat end |
#c ⇒ Object
58 59 60 |
# File 'lib/query/parser/number.rb', line 58 def c str("c") | str("C") end |
#d ⇒ Object
62 63 64 |
# File 'lib/query/parser/number.rb', line 62 def d str("d") | str("D") end |
#decimal ⇒ Object
123 124 125 |
# File 'lib/query/parser/number.rb', line 123 def decimal (base_10_whole << dot << base_10_whole).aka(:decimal) << exponent.maybe end |
#dot ⇒ Object
46 47 48 |
# File 'lib/query/parser/number.rb', line 46 def dot str(".") end |
#e ⇒ Object
66 67 68 |
# File 'lib/query/parser/number.rb', line 66 def e str("e") | str("E") end |
#eight ⇒ Object
38 39 40 |
# File 'lib/query/parser/number.rb', line 38 def eight str("8") end |
#exponent ⇒ Object
119 120 121 |
# File 'lib/query/parser/number.rb', line 119 def exponent (e << Number).aka(:exponent) end |
#f ⇒ Object
70 71 72 |
# File 'lib/query/parser/number.rb', line 70 def f str("f") | str("F") end |
#five ⇒ Object
26 27 28 |
# File 'lib/query/parser/number.rb', line 26 def five str("5") end |
#four ⇒ Object
22 23 24 |
# File 'lib/query/parser/number.rb', line 22 def four str("4") end |
#nine ⇒ Object
42 43 44 |
# File 'lib/query/parser/number.rb', line 42 def nine str("9") end |
#o ⇒ Object
74 75 76 |
# File 'lib/query/parser/number.rb', line 74 def o str("o") | str("O") end |
#one ⇒ Object
10 11 12 |
# File 'lib/query/parser/number.rb', line 10 def one str("1") end |
#root ⇒ Object
143 144 145 146 147 148 149 150 151 |
# File 'lib/query/parser/number.rb', line 143 def root ( ( decimal.aka(:decimal) | base_16_number.aka(:base_16) | base_8_number.aka(:base_8) | base_2_number.aka(:base_2) | base_10_number.aka(:base_10) ) << Special.present ).aka(:number) end |
#seven ⇒ Object
34 35 36 |
# File 'lib/query/parser/number.rb', line 34 def seven str("7") end |
#six ⇒ Object
30 31 32 |
# File 'lib/query/parser/number.rb', line 30 def six str("6") end |
#three ⇒ Object
18 19 20 |
# File 'lib/query/parser/number.rb', line 18 def three str("3") end |
#two ⇒ Object
14 15 16 |
# File 'lib/query/parser/number.rb', line 14 def two str("2") end |
#underscore ⇒ Object
82 83 84 |
# File 'lib/query/parser/number.rb', line 82 def underscore str("_") end |
#x ⇒ Object
78 79 80 |
# File 'lib/query/parser/number.rb', line 78 def x str("x") | str("X") end |
#zero ⇒ Object
6 7 8 |
# File 'lib/query/parser/number.rb', line 6 def zero str("0") end |