0
votes

I have the task to write an application that controls OpenVPN using the management interface, which is just a text stream.

I thought about using a lexer and parser generator like lex and yacc to do the job. But since there also are asynchronous lines beginning with ">", I don't know if that is even possible.

Should I just parse the text myself or can lex and yacc (actually, fslex and fsyacc, since I should use F#) deal with that sort of thing?

Thanks.

1

1 Answers

1
votes

It's probably feasible. You can best handle the asynchronous lines by overruling input of the lexer and take those asynchronous lines out at the earliest stage. Should those lines be injected somehow into the steady stream of tokens or can/will they be handled separately? Injecting into the steady stream is going to be more difficult unless you have easy to detect points to inject them.