Module: Kwartz::CharacterType
- Included in:
- PresentationLogicParser
- Defined in:
- lib/kwartz/parser.rb
Instance Method Summary collapse
- #is_alpha(ch) ⇒ Object
- #is_digit(ch) ⇒ Object
- #is_identchar(ch) ⇒ Object
- #is_whitespace(ch) ⇒ Object
Instance Method Details
#is_alpha(ch) ⇒ Object
26 27 28 |
# File 'lib/kwartz/parser.rb', line 26 def is_alpha(ch) return (?a <= ch && ch <= ?z) || (?A <= ch && ch <= ?Z) end |
#is_digit(ch) ⇒ Object
31 32 33 |
# File 'lib/kwartz/parser.rb', line 31 def is_digit(ch) return ?0 <= ch && ch <= ?9 end |
#is_identchar(ch) ⇒ Object
36 37 38 |
# File 'lib/kwartz/parser.rb', line 36 def is_identchar(ch) return is_alpha(ch) || is_digit(ch) || ch == ?_ end |
#is_whitespace(ch) ⇒ Object
21 22 23 |
# File 'lib/kwartz/parser.rb', line 21 def is_whitespace(ch) return ch == ?\ || ch == ?\t || ch == ?\n || ch == ?\r end |