From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=51732 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OF83a-0004zN-Po for qemu-devel@nongnu.org; Thu, 20 May 2010 11:53:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OF83R-0000Yb-I2 for qemu-devel@nongnu.org; Thu, 20 May 2010 11:53:10 -0400 Received: from mail-vw0-f45.google.com ([209.85.212.45]:61883) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OF83R-0000YF-Cy for qemu-devel@nongnu.org; Thu, 20 May 2010 11:53:01 -0400 Received: by vws1 with SMTP id 1so3858202vws.4 for ; Thu, 20 May 2010 08:53:00 -0700 (PDT) Message-ID: <4BF55ADA.5080807@codemonkey.ws> Date: Thu, 20 May 2010 10:52:58 -0500 From: Anthony Liguori MIME-Version: 1.0 References: <1274303733-3700-1-git-send-email-lcapitulino@redhat.com> <4BF45B6C.8000908@codemonkey.ws> <4BF552BF.6020601@redhat.com> In-Reply-To: <4BF552BF.6020601@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed 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: Paolo Bonzini Cc: aliguori@us.ibm.com, qemu-devel@nongnu.org, Luiz Capitulino 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. Regards, Anthony Liguori > Paolo