summaryrefslogtreecommitdiff
path: root/src/package.lisp
blob: cf8ce51c2d477e985b230f381ace32bde8094464 (plain)
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
(defpackage #:utilities
  (:use #:common-lisp)
  (:export #:eval-always
           #:make-string-view
           #:read-file-contents))

(defpackage #:monkey
  (:use #:common-lisp #:utilities))

(defpackage #:token
  (:use #:common-lisp #:utilities)
  (:shadow #:type)
  (:export #:token
           #:literal
           #:type
           #:type-is
           #:token=
           #:make
           #:as-token
           #:lookup-identifier
           ;; the following depend on macro arguments
           #:token-type
           ;;#:string->token
           ;;#:token->string
           ))

(defpackage #:lexer
  (:use #:common-lisp #:utilities)
  (:export #:make #:lex #:next-token))

(defpackage #:ast
  (:use #:common-lisp #:utilities)
  (:export #:node
           #:stringify
           #:token-literal
           #:emit
           #:statement
           #:expression
           #:program
           #:statements
           #:identifier
           #:integer-literal
           #:prefix-expression #:right
           #:expression-statement
           #:boolean-expression
           #:infix-expression
           #:let-statement #:name #:value
           #:return-statement #:return-value
           #:if-expression
           #:block-statement
           #:function-literal
           #:call-expression #:args))

(defpackage #:parser
  (:use #:common-lisp #:utilities)
  (:export #:make #:parse-program))

(defpackage #:monkey/test
  (:use #:common-lisp #:utilities))