@AliReza-Beytari
Hello,
If this is your own format, I'd suggest first to reconsider and use something that's instead available to standard parsers. You could use XML to the same effect., which is readily extensible and can be parsed through standard means. If you're still insistent on using your own format then the boost's spirit module might be your best bet. With it you define your language's grammar and it allows for parsing based on that grammar. If you still want to write your own parser, then @mrjj's suggestion is a good starting point. Usually when you need to write a parser you start from the language's grammar and based on it you create a tokenizer that breaks up the input into lexemes. Then from the tokens you build up a parse tree that can be handled by the parser itself. The simplest is to have LL(1) parser (recursive-descent with a single token look-ahead) but it depends on the grammar really. Most will use an automated tool to provide the lexing and parsing (i.e. Flex and Bison) but this is not so much a requirement as it's convenience, because if the grammar is complex (which usually is the case) writing the parser by hand might get very involved. A few years ago I had to write a C++ syntax parser (no semantics) used to change formatting for source files, but unfortunately that code is copyrighted and I can't share it with you. As a guide, after tokenization, you mirror the grammar in the source code (like in @mrjj's example) and from there you handle the parse tree directly. You could go around the internet and look up some ready-made parsers (there are quite a few) and try to deduce how it's done. I hope this helps.
Kind regards.