|
From: Christian S. <chr...@ep...> - 2004-03-07 22:41:59
|
Es geschah am Sonntag, 7. M=E4rz 2004 21:37 als Rui Nuno Capela schrieb: > Vladimir, > > > But . . . bison also works and it is easier to maintain :) > > Could you give me a quick summary of why you dislike bison? > > Yeah I know, but I don't have a clue about all that bison/flex/yacc stuff. > I know the principles and theory but completely lack in the practice. As already said, I can give a short introduction if anybody's interested,=20 constrained to the things we actually need. It's really simple. > > I wrote a simple netcat script to test the parser (attached) and i'm > > having some issues with your parser, while bison generated code appears > > to be working correctly. > > Hmm. If I may put this way, that's not a parser question but a network > protocol one, AFAICT. On liblscp, each command must be isolated on each > send/recv exchange and does not rely on being CR/LF terminated, which I > think is an "undocumented" feature of the bison one :) Undocumented? src/network/lscp.y is the LSCP definition, given in Backus-Na= ur=20 =46orm (BNF), which is commonly used in all protocol definition documents (= e.g.=20 HTTP) and many file format references, so this file _is_ a document and fro= m=20 lscp.y: input : line | input LF line | input CR LF line ; > I think netcat sends the whole buffer of commands in one send(), and that > is not accepted on liblscp (probably only the first line is). AFAICT the > protocol draft doesn't mention that we can send more than one command, as Page 3 from the LSCP document: "The frontend application establishes a TCP connection to the LinuxSampler= =20 instance on a certain host system. Then the frontend application will send= =20 certain ASCII based commands" But you're right. It's not clear enough. I will fix that. That was an impli= ed=20 assumption fault by me, because usually network protocols allow this multi= =20 line behavior, because it doesn't make sense to establish a new connection= =20 for every single network command. CU Christian |