[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SMIE examples and questions

From: Aurélien Aptel
Subject: Re: SMIE examples and questions
Date: Fri, 31 Jul 2020 16:42:40 +0200

The language is Poke. It is C-like.
The main thing are (possibly anonymous) structure like so:

      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:

So far I only have the font-locking...
And this anemic grammar:

(defvar poke-smie-grammar
      (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))))))

reply via email to

[Prev in Thread] Current Thread [Next in Thread]