Seriously? You have much, much bigger problems coming up that "read before the equals sign", and a specific solution to this one problem would not be a good investment of your time.
Look at the way other compilers, interpreters and so forth are written: most of them use a process called
tokenisation[
^] to identify the various parts of the input, and then parse the tokens for syntactical analysis.
I think it would probably be a good idea if you spent some time reading, before launching into code. This is a good start:
Google: Writing a compiler[
^]