From owner-freebsd-dtrace@FreeBSD.ORG Sat Oct 4 07:59:59 2014 Return-Path: Delivered-To: freebsd-dtrace@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D416B436; Sat, 4 Oct 2014 07:59:59 +0000 (UTC) Received: from mail-wg0-x234.google.com (mail-wg0-x234.google.com [IPv6:2a00:1450:400c:c00::234]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49276F7A; Sat, 4 Oct 2014 07:59:59 +0000 (UTC) Received: by mail-wg0-f52.google.com with SMTP id a1so3054859wgh.35 for ; Sat, 04 Oct 2014 00:59:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=aTzutqAb5owHWpnW3nxDKN3f8LEMZqZuto8DRpbm1OU=; b=iJISAzbOiLIqiT9Dx3ydvIAO3fqkXTCC842MOH9uTeulu3Y4YT4CkVa0baZKNwFwQw Y5KYvD44I1D2/CkP+khRNj5L1f/VWRjD7U7sNr+fbW8t1vraK7PhkzWzC5BFalIuqjGT IvAvdmsCPVWRijRdJy0NlahifBXJFshmNUhISaUTM9rczTO84lhQv5YqmaoqlJitoS6z p8gtJ1IkyhafJlwyvq93KYJMDMWHKZeH+27h1sFmp7GaBUZPORi4Rbqdqq10nxfBwkls 4q61+dCh85S/6i4DZIEUJ4ivZTRlVIC9bYMjjL2gdIN1FpomVZ/pQgaVVhpR/FreDct3 SG0A== MIME-Version: 1.0 X-Received: by 10.181.27.197 with SMTP id ji5mr4110050wid.54.1412409597548; Sat, 04 Oct 2014 00:59:57 -0700 (PDT) Received: by 10.27.137.87 with HTTP; Sat, 4 Oct 2014 00:59:57 -0700 (PDT) In-Reply-To: <20141004041300.GA21821@charmander.picturesperfect.net> References: <20141004041300.GA21821@charmander.picturesperfect.net> Date: Sat, 4 Oct 2014 00:59:57 -0700 Message-ID: Subject: Re: [dtrace-discuss] dtrace keywords in postfix expressions From: Bryan Cantrill To: Mark Johnston Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.18-1 Cc: "dtrace-discuss@lists.dtrace.org" , freebsd-dtrace@freebsd.org X-BeenThere: freebsd-dtrace@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "A discussion list for developers working on DTrace in FreeBSD." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Oct 2014 07:59:59 -0000 Nothing like cracking open dt_grammar.y to get the blood flowing! ;) I don't think the change looks unreasonable; how does the test suite fare? If this is no way breaks extant D programs, I'm all for it... - Bryan On Fri, Oct 3, 2014 at 9:13 PM, Mark Johnston via dtrace-discuss < dtrace-discuss@lists.dtrace.org> wrote: > Hello, > > DTrace has a few keywords which are not keywords in C/C++ (e.g. > "provider"). One annoyance which has come up a few times is the fact > that such keywords cannot be used in expressions which would be valid in > the code being traced. For example, FreeBSD's struct g_consumer contains > a field called "provider", and attempting to run the following snippet of > D results in a syntax error: > > fbt::g_vfs_done:entry {printf("%s", > stringof(args[0]->bio_from->provider->name));} > > I don't see any reason the D grammar can't support this, however. The > patch at [1] attempts to fix this problem by allowing certain keywords > to appear in the place of identifiers in postfix expressions. It's not a > complete solution since it doesn't handle types or probe names, but it's a > start. Any thoughts on this approach? > > Thanks! > -Mark > > [1] http://people.freebsd.org/~markj/patches/dtrace_keywords.diff > > > ------------------------------------------- > dtrace-discuss > Archives: https://www.listbox.com/member/archive/184261/=now > RSS Feed: > https://www.listbox.com/member/archive/rss/184261/21484475-e7237b25 > Modify Your Subscription: > https://www.listbox.com/member/?member_id=21484475&id_secret=21484475-2fcb7543 > Powered by Listbox: http://www.listbox.com >