File: example.as

package info (click to toggle)
jflex 1.7.0-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 13,944 kB
  • sloc: java: 421,255; xml: 1,130; makefile: 123; lisp: 90; yacc: 65; sh: 13
file content (16 lines) | stat: -rw-r--r-- 387 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

// example program for interpreter testing 
// contains division and modulo functions

input a,b
functions div(x,y) = if x < y
                     then 0
                     else div(x-y,y)+1
                     fi,
          mod(x,y) = if x < y
                     then x
                     else mod(x-y,y)
                     fi
output div(a,b), mod(a,b)
arguments 324, 17
end