Jison parser: Retrieve n number of text after a specific token

66 views Asked by At

I am using jison parser to parse my commands. I want to parse the command:

grp <group_name> -i <id1> <id2> <id3> ......

and want to retrieve the data as:

{ group: <group_name>, id: [id1, id2, id3...] }

But to parse using jison parser, I could try

GROUP TEXT ID TEXT TEXT TEXT ... Here i will have to specify TEXT tokens 'n' number of times.

Can anyone tell me how to parse it without specifying n number of tokens?

0

There are 0 answers