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

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?

Answers:

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.