Hi I'm trying to parse a file that splits up information by being surrounded by brackets. ie, [] and {}.
example segment of file:
{
[program]
[statement] NL . NL ;
[statement] NL [program] ;
[statement] NL [program] ;
[statement] NL [program] ;
[statement] NL [program] ;
[statement] NL [program] ;
[statement] NL [program] ;
[statement] NL [program] ;
[statement] NL [program] ;
[statement] NL [program] ;
[statement] NL [program] ;
}
I'm trying to parse each token within [] (ex, [statement]) to an object, however I can't use the delimiter("[") to split up the tokens and use the next() method because [] is a metacharacter
How can I go about parsing my tokens? Is there a work around to force "[" to be a pattern in itself like any other pattern that you can use delimiters with or is there something completely different that I can do?
Thanks in advance,
wntdaliv