SqlParser\Context::isSeparator PHP Method

isSeparator() public static method

Checks if the given character can be a separator for two lexeme.
public static isSeparator ( string $str ) : boolean
$str string String to be checked.
return boolean
    public static function isSeparator($str)
    {
        // NOTES:   Only non alphanumeric ASCII characters may be separators.
        //          `~` is the last printable ASCII character.
        return $str <= '~' && $str !== '_' && ($str < '0' || $str > '9') && ($str < 'a' || $str > 'z') && ($str < 'A' || $str > 'Z');
    }

Usage Example

Example #1
0
 public function testisSeparator()
 {
     $this->assertTrue(Context::isSeparator('+'));
     $this->assertTrue(Context::isSeparator('.'));
     $this->assertFalse(Context::isSeparator('1'));
     $this->assertFalse(Context::isSeparator('E'));
     $this->assertFalse(Context::isSeparator('_'));
 }
All Usage Examples Of SqlParser\Context::isSeparator