-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtiny.nex
More file actions
25 lines (25 loc) · 695 Bytes
/
tiny.nex
File metadata and controls
25 lines (25 loc) · 695 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/if/ { return IF }
/then/ { return THEN }
/else/ { return ELSE }
/end/ { return END }
/repeat/ { return REPEAT }
/until/ { return UNTIL }
/read/ { return READ }
/write/ { return WRITE }
/:=/ { return ASSIGN }
/=/ { return EQ }
/</ { return LT }
/\+/ { return PLUS }
/-/ { return MINUS }
/\*/ { return TIMES }
/\// { return OVER }
/\(/ { return LPAREN }
/\)/ { return RPAREN }
/;/ { return SEMI }
/[0-9]+/ { return NUM }
/[a-zA-Z]+/ { return ID }
/[ \t\r\n]+/ { /* white space */ }
/{[^\{\}]*}/ { /* comments */ }
/./ { return ERROR }
//
package main