I am getting input from a text file. I have read all the text and tokenized it.
Here is input sample
.MAIN [
.HEADING1 [ .TEXT 30000 ]
.HEADING2 [
[
.TEXT1 YAMA
.TEXT2 THAH
]
]
]
After tokenization, tokens list contains “.MAIN”, “[“, “.HEADING1”, and so on. Now what I want to find index of closing bracket for a particular starting square bracket. For example if i give my function index 0 (the first starting square bracket) function should return me last index, and if give my function index of starting square bracket of .HEADING1 then it should return me index of closing bracket at same line.
Try this one: