changed project name from cl-forth to kurt
This commit is contained in:
6
build.sh
6
build.sh
@@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
sbcl --load cl-forth.asd \
|
||||
--eval '(ql:quickload :cl-forth)' \
|
||||
--eval '(asdf:make :cl-forth)' \
|
||||
sbcl --load kurt.asd \
|
||||
--eval '(ql:quickload :kurt)' \
|
||||
--eval '(asdf:make :kurt)' \
|
||||
--eval '(quit)'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
(in-package :cl-forth)
|
||||
(in-package :kurt)
|
||||
|
||||
(defun make-token (sym? line col &optional (type nil))
|
||||
(when (null type)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
(in-package :cl-forth)
|
||||
(in-package :kurt)
|
||||
|
||||
(defparameter *psuedo-identifiers*
|
||||
'(syscall-1 syscall-2 syscall-3 syscall-4 syscall-5 syscall-6 makro son kütüphane)
|
||||
26
errors.lisp
Normal file
26
errors.lisp
Normal file
@@ -0,0 +1,26 @@
|
||||
(in-package :kurt)
|
||||
|
||||
(defun report-line (line-num line col? &optional (stream t))
|
||||
(format stream "~5a:~a~%" line-num line)
|
||||
(iter (for i from 0 below (+ 6 (if (consp col?)
|
||||
(getf (cdr col?) :col) ;; if token get col
|
||||
col?)))
|
||||
(write-char #\Space stream))
|
||||
(format stream "^~%"))
|
||||
|
||||
(define-condition char-not-closed ()
|
||||
((line :initarg :line :reader line)
|
||||
(col :initarg :col :reader col)
|
||||
(line-num :initarg :line-num :reader line-num))
|
||||
(:report (lambda (condition stream)
|
||||
(format stream "Karakterin kapanış sembolü ' eksik.~%")
|
||||
(report-line (line-num condition) (line condition) (col condition) stream))))
|
||||
|
||||
(defun handle-char-not-closed (line-num line token-or-col)
|
||||
(make-condition 'char-not-closed :line-num line-num :line line :col token-or-col))
|
||||
|
||||
;; (define-condition op-not-implemented (style-warning)
|
||||
;; ((undef-ops :initarg :ops :reader undef-ops))
|
||||
;; (:report (lambda (condition stream)
|
||||
;; (format stream "These ops are not defined in op-case: ~s"
|
||||
;; (undef-ops condition)))))
|
||||
@@ -1,4 +1,4 @@
|
||||
(asdf:defsystem "cl-forth"
|
||||
(asdf:defsystem "kurt"
|
||||
:description "Stack based language implemented in Common Lisp"
|
||||
:version "0.1"
|
||||
:author "Emre Akan"
|
||||
@@ -7,11 +7,12 @@
|
||||
:serial t
|
||||
:components ((:file "package")
|
||||
(:file "util")
|
||||
(:file "assembly")
|
||||
(:file "errors")
|
||||
(:file "codegen")
|
||||
(:file "cl-forth")
|
||||
(:file "simulation")
|
||||
(:file "main")
|
||||
(:file "test/tests"))
|
||||
:build-operation "program-op"
|
||||
:build-pathname "test/cl-forth"
|
||||
:entry-point "cl-forth:main")
|
||||
:build-pathname "test/kurt"
|
||||
:entry-point "kurt:main")
|
||||
@@ -1,4 +1,4 @@
|
||||
(in-package :cl-forth)
|
||||
(in-package :kurt)
|
||||
|
||||
;; (defun main ()
|
||||
;; (let ((args (rest sb-ext:*posix-argv*)))
|
||||
@@ -97,8 +97,8 @@
|
||||
|
||||
(defun top-level-command ()
|
||||
(clingon:make-command
|
||||
:name "cl-forth"
|
||||
:description "cl-forth derleyicisi"
|
||||
:name "kurt"
|
||||
:description "kurt derleyicisi"
|
||||
:version "0.1.0"
|
||||
:authors '("Emre Akan <akannemre@gmail.com>")
|
||||
:options (top-level-options)
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
(defpackage cl-forth
|
||||
(defpackage kurt
|
||||
(:use :common-lisp :iterate)
|
||||
(:export #:main))
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
(in-package :cl-forth)
|
||||
(in-package :kurt)
|
||||
|
||||
(defvar *stack* nil)
|
||||
(defvar *bel* nil)
|
||||
|
||||
3
test/include.kurt
Normal file
3
test/include.kurt
Normal file
@@ -0,0 +1,3 @@
|
||||
kütüphane "std.lorth"
|
||||
|
||||
stdout "Merhaba Dünya!\n" write
|
||||
4
test/std.kurt
Normal file
4
test/std.kurt
Normal file
@@ -0,0 +1,4 @@
|
||||
makro sys-write 1 son
|
||||
makro write (fd string -- )
|
||||
değiş sys-write syscall-3 son
|
||||
makro stdout 1 son
|
||||
@@ -1,4 +1,4 @@
|
||||
(in-package :cl-forth)
|
||||
(in-package :kurt)
|
||||
|
||||
(defun drop-file-type (file &key (returns :string))
|
||||
(let* ((file-str (namestring file))
|
||||
@@ -73,7 +73,7 @@
|
||||
(ignore-errors
|
||||
(run-test file :target target))))
|
||||
(remove-if-not (lambda (file)
|
||||
(string= "lorth" (pathname-type file)))
|
||||
(string= "kurt" (pathname-type file)))
|
||||
(cl-fad:list-directory
|
||||
(from-root "test"))))
|
||||
counting (eq t success?) into succs
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
(in-package :cl-forth)
|
||||
(in-package :kurt)
|
||||
|
||||
(eval-when (:compile-toplevel :load-toplevel :execute)
|
||||
(defmacro eval-always (&body body)
|
||||
@@ -26,7 +26,7 @@
|
||||
(apply #'uiop:run-program args options))
|
||||
|
||||
(defun from-root (path)
|
||||
(merge-pathnames path (asdf:system-source-directory :cl-forth)))
|
||||
(merge-pathnames path (asdf:system-source-directory :kurt)))
|
||||
|
||||
;; ,(file-namestring
|
||||
;; (make-pathname :name (pathname-name path)
|
||||
|
||||
Reference in New Issue
Block a user