Im stuck with my parser I am writing. It basically is a recursive descent parser, which technically parses it letter by letter. That is all going nice for me, but I got a problem. The part Im stuck on with the parser, is parsing a string like this:
blabla bla "I need this part \" and this part" blablalI know when I need to get parsing the string, when it hits the first double quote. Then we need get to the second quote because a string is enclosed in those. In this particular case it simply will just stop parsing when it hits the second double quote, because there is no real difference between a quote and escaped quote.
To clearify for my rather vague description, I would need this output (when I print it to the console:
I need this part " and this part
I really consider patterns as a last option because that will screw up the tokenizer and would have me a lot of work to do. So how would I detect an escaped cape versus one which isn't?













