This is a C++ FQN (Fully Qualified Name) parser/tokenizer.
>>> from cpp_fqn_parser import Parser, FQN
>>> fqn = "int one_3hello0::tconstwo<mytemplate>::three(const four &) volatile"
>>> parser: Parser = Parser(fqn)
>>> result: FQN = parser.parse()
>>> print(*[f"\n{scope}" for scope in result.scopes])
Scope(name='one_3hello0', template=None)
Scope(name='tconstwo', template='<mytemplate>')pip install git+https://github.com/Cliper27/cpp_fqn_parser.git