Add StringRef and StringSwitch in pat.

This is used to enhance the funcationality of pat.