File: buffer.pn

package info (click to toggle)
maria 1.3.5-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,068 kB
  • sloc: cpp: 43,408; yacc: 8,080; ansic: 436; sh: 404; lisp: 395; makefile: 228; perl: 21
file content (6 lines) | stat: -rw-r--r-- 264 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
typedef enum {a,b,c} item_t;
typedef item_t[stack 2] buffer_t;
place items (0..#item_t) item_t: item_t i: i;
place q (1) buffer_t: {};
trans write in { items: i; q: q; } out { q: q+i; } gate %q != 0;
trans read in { q: q; } out { q: -q; items: *q; } gate /q != 0;