From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=35682 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OF9dy-0002B8-A2 for qemu-devel@nongnu.org; Thu, 20 May 2010 13:34:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OF9dw-0007lp-RC for qemu-devel@nongnu.org; Thu, 20 May 2010 13:34:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:12606) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OF9dw-0007ld-IS for qemu-devel@nongnu.org; Thu, 20 May 2010 13:34:48 -0400 Date: Thu, 20 May 2010 13:29:32 -0300 From: Luiz Capitulino Message-ID: <20100520132932.02a6efac@redhat.com> In-Reply-To: <4BF55ADA.5080807@codemonkey.ws> References: <1274303733-3700-1-git-send-email-lcapitulino@redhat.com> <4BF45B6C.8000908@codemonkey.ws> <4BF552BF.6020601@redhat.com> <4BF55ADA.5080807@codemonkey.ws> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [PATCH 0/6]: QMP: Fix issues in parser/lexer List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Paolo Bonzini , aliguori@us.ibm.com, qemu-devel@nongnu.org On Thu, 20 May 2010 10:52:58 -0500 Anthony Liguori wrote: > On 05/20/2010 10:18 AM, Paolo Bonzini wrote: > > On 05/19/2010 11:43 PM, Anthony Liguori wrote: > >> > >>> 4. Lexer expects a 'terminal' char to process a token > >>> > >>> Which means clients must send a sort of end of line char, so > >>> that we > >>> process their input. > >>> > >>> Maybe I'm missing something here, but I thought that the whole > >>> point of writing our own parser was to avoid this. > >> > >> If the lexer gets: > >> > >> "abc" > >> > >> It has no way of knowing if that's a token or if we're going to get: > >> > >> "abcd" > > > > Only } and ] are valid characters at the end of a JSON object, and > > neither requires lookahead. > > Having look ahead operate differently for different states really > complicates the lexer. I don't see this as a big problem in practice. Would be a nice feature, but it's fine for me too and we'll have to note that in the QMP's spec.