I've been reading up on lex/yacc. The books and examples are not hard to follow. In fact, the whole concept is clear as a bell. With one exception. Lex/yacc seem to generate standalone programs. What if I wanted to call them as a parser function? Yacc seems to generate a main function, so how would I call from my own without conflicts.
I'm also unclear at this point how they operate on file input. I'm okay with grabbing a line from a file and sending it to the parser, but what if your parser is looking for a multi-line structure like a block enclosed in braces?
I realize I'm being stupid about both of these, but any help is appreciated. Thanks.