From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Aur=C3=A9lien_Aptel?= Newsgroups: gmane.emacs.devel Subject: Re: SMIE examples and questions Date: Fri, 31 Jul 2020 16:42:40 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19607"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Emacs development discussions To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Jul 31 16:43:25 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1k1WFp-00050V-KA for ged-emacs-devel@m.gmane-mx.org; Fri, 31 Jul 2020 16:43:25 +0200 Original-Received: from localhost ([::1]:49952 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k1WFo-0002nE-NV for ged-emacs-devel@m.gmane-mx.org; Fri, 31 Jul 2020 10:43:24 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56296) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k1WFK-0002MX-UM for emacs-devel@gnu.org; Fri, 31 Jul 2020 10:42:54 -0400 Original-Received: from mail-il1-x130.google.com ([2607:f8b0:4864:20::130]:35727) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k1WFJ-0000Jf-94 for emacs-devel@gnu.org; Fri, 31 Jul 2020 10:42:54 -0400 Original-Received: by mail-il1-x130.google.com with SMTP id t18so25551912ilh.2 for ; Fri, 31 Jul 2020 07:42:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=P05/wgd9L5VGZ1UBypT/pVE2LLohhVQqxR8pbefZWCk=; b=jjLjJW2KuLawuxTqOfYlO1RLgdj7XkUGZ6TMXBr+h3jK1Lxi/Nci/Gk6bP4v9vZttZ cVsrAS5NouD2Fh/Sm+zhVrXAI30RUFCQeTphYBPkMsT+D7+tm9cI2Ws073SE91ItXLE3 2F7XOxoiByYL7YpPVYhIcotZT68x7hgPYEfH1rCtN/8nDgq6wJQ6bAi0PHz1hRUQRlG/ QTl91JPPk+695EG5hrmI/iBTN0E/lYcTuE/XIDE8KYhE6ljuvVkcl/2FNA6G23Ui4M0t u4a/9FLzAuFca7RVr+mAKBhlp+R8xtHQRI8pHfIKSMfQFPJL/++Pk4Pmq6rRMd2IjOFG iRqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=P05/wgd9L5VGZ1UBypT/pVE2LLohhVQqxR8pbefZWCk=; b=lwZ+4ORG1pJLAMlDNlYNC91ZBqR8uTd5HNgOtnk05Fx8IE+no7whLPXraFKlrA0xn1 gVZF59HmyaKrIw3ZtC51kkgBsh/kKS6smpxvf/DWClJt79A8ZU1x7feNKfd7gzDkIiaE XTq5ZuOEudA9Nk/J8nJb8b9Rk4juTewA17h9SkSJGBCw1n2rcoj80TParfsE5CueVBo9 8cluwz+Q/RRuzAd4YCvQiPdOphSQG78bniSP6dcRaQJOPYSYzDfIc9knYTJfAJQZoqh7 a9sAB03IqijORln22tUGdGRPbT1nXq/W9mHWocn5mDJ6s7S8eoj9fVjOQzwknSu9Bfvu 4FDA== X-Gm-Message-State: AOAM533iQ7bMrLSCyCw7qkHTud5Zg2kjZNC+NCwsiZeOT/uwmrmHb0t9 tgOjHh+MF2e0rlpuFT7zYh9QSKFlUybK1b6Mahs= X-Google-Smtp-Source: ABdhPJzqlrHA1fh2UvCJthHNaAcCfO5EhQAIXb0Ut55ZAIAp4ZxSUzIkywUsVZGqqYmp2PbmUdhdLNdrMKndwsA3M+o= X-Received: by 2002:a92:cd45:: with SMTP id v5mr4268012ilq.170.1596206571525; Fri, 31 Jul 2020 07:42:51 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::130; envelope-from=aurelien.aptel@gmail.com; helo=mail-il1-x130.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:253364 Archived-At: The language is Poke. It is C-like. The main thing are (possibly anonymous) structure like so: struct { int32_t foo; int8_t bar; }; Some expressions can be embedded in the type, and there is a binding system similar to typedef where you can do: deftype foo = struct {...}; devar bar = 42; Sample source: https://git.savannah.gnu.org/cgit/poke.git/tree/pickles/elf.pk There's an ANTLRv4 grammar here: https://git.savannah.gnu.org/cgit/poke.git/tree/etc/poke.g4 So far I only have the font-locking... https://git.savannah.gnu.org/cgit/poke.git/tree/etc/poke-mode.el And this anemic grammar: (defvar poke-smie-grammar (smie-prec2->grammar (smie-bnf->prec2 '((id) (def ("defvar" id "=" inst) ("deftype" id "=" inst)) ;; (exp (exp "+" exp) ;; (exp "-" exp) ;; (exp "*" exp) ;; (exp "==" exp) ;; (exp "!=" exp) ;; (exp "<" exp) ;; (exp "<=" exp) ;; (exp ">" exp) ;; (exp ">=" exp) ;; ("(" exp ")")) (inst ("struct" insts) ("union" insts) (id id)) (insts (insts ";" insts) (inst))))))