I've got some problems parsing strings and /* */ comments. Any help will be appreciated. ----------------- // multyline comments case '*': case '/': case '(': case ')': case '+': case '-': case '=': case '~': case '|': case ';': case '%': case '&': case '{': case '}': case ',': case '[': case ']': case '?': case ':': case '^': case '<': case '>': case '!': case '.': substr += s[i]; i++; { if(i < s.Length && (substr == "/")) { if(i < s.Length && (s[i]== '*')) { do { substr += s[i]; i++; } while (i < s.Length && substr== "*/"); rTB2.Text += "Komentar - " + substr + "\n"; substr = ""; } ----------------- case '"': { do { substr += s[i]; i++; } while (i < s.Length && s[i]!='"'); rTB2.Text += "Tekst - " + substr + "\n"; substr = ""; } brake; ----------------- If someone want, here is a direct link to my code. http://www.geocities.com/puma55555/MyC.zip
M
mitko5
@mitko5
Posts
-
Need Help for a parser -
[Message Deleted]I guess You are right, but I mess up something so i could not use that way of solving the problem. If you could give me an example, will be appreciated. Regards, Mitko -- modified at 5:29 Tuesday 7th March, 2006
-
[Message Deleted]This is my code. If you see s = rTB1.Text. So you simply rewrite my code. If you can, please help :)
-
[Message Deleted][Message Deleted]