File: buffer.pn

package info (click to toggle)
maria 1.3.5-2
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 3,980 kB
  • ctags: 5,458
  • sloc: cpp: 43,402; yacc: 8,080; ansic: 436; sh: 404; lisp: 395; makefile: 291; 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;