Compare commits
4 Commits
6545bd1302
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
00786d9cb9 | ||
|
|
b391fe9a74 | ||
|
|
12e82e64d0 | ||
|
|
9b55b9ec32 |
15
arl.org
15
arl.org
@@ -1,5 +1,6 @@
|
|||||||
#+title: ARL - Issue tracker
|
#+title: ARL - Issue tracker
|
||||||
#+date: 2026-01-23
|
#+date: 2026-01-23
|
||||||
|
#+filetags: arl
|
||||||
|
|
||||||
* TODO Write a minimum working transpiler
|
* TODO Write a minimum working transpiler
|
||||||
We need to be able to compile the following file:
|
We need to be able to compile the following file:
|
||||||
@@ -23,13 +24,13 @@ It's a Eulerian Path from the source code to the native executable.
|
|||||||
[[file:src/parser/]]
|
[[file:src/parser/]]
|
||||||
[[file:include/arl/parser/]]
|
[[file:include/arl/parser/]]
|
||||||
|
|
||||||
We need to generate some form of AST from the token stream. We want
|
We need to generate some form of AST from the token stream. This
|
||||||
something a stage above the tokeniser so it should distinguish the
|
should be a little more advanced than our initial stream,
|
||||||
following cases:
|
distinguishing between
|
||||||
- Literal value
|
- Literal values
|
||||||
- Primitive call
|
- Primitive calls
|
||||||
*** TODO AST design
|
- References to otherwise undefined words (may be defined through
|
||||||
*** TODO Token Stream to AST implementation
|
import or later on)
|
||||||
** TODO Stack effect/type analysis
|
** TODO Stack effect/type analysis
|
||||||
[[file:src/analysis/]]
|
[[file:src/analysis/]]
|
||||||
[[file:include/arl/analysis/]]
|
[[file:include/arl/analysis/]]
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
"Hello, world!\n" putstr
|
"Hello, world!\n" puts
|
||||||
37
extensions/arl-mode.el
Normal file
37
extensions/arl-mode.el
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
;;; arl-mode.el --- ARL mode for Emacs -*- lexical-binding: t; -*-
|
||||||
|
|
||||||
|
;; Copyright (C) 2026 Aryadev Chavali
|
||||||
|
|
||||||
|
;; Author: Aryadev Chavali <aryadev@aryadevchavali.com>
|
||||||
|
;; Keywords:
|
||||||
|
|
||||||
|
;; Copyright (C) 2026 Aryadev Chavali
|
||||||
|
|
||||||
|
;; This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
;; FOR A PARTICULAR PURPOSE. See the MIT License for details.
|
||||||
|
|
||||||
|
;; You may distribute and modify this code under the terms of the MIT License,
|
||||||
|
;; which you should have received a copy of along with this program. If not,
|
||||||
|
;; please go to <https://opensource.org/license/MIT>.
|
||||||
|
|
||||||
|
;;; Commentary:
|
||||||
|
|
||||||
|
;;
|
||||||
|
|
||||||
|
;;; Code:
|
||||||
|
|
||||||
|
(defvar arl-mode-comments '(?\; ";;" ("#|" . "|#")))
|
||||||
|
(defvar arl-mode-keywords '("if" "then" "else"))
|
||||||
|
(defvar arl-mode-expressions '(("\".*\"" . font-lock-string-face)))
|
||||||
|
(defvar arl-mode-automode-list '("\\.arl"))
|
||||||
|
|
||||||
|
(define-derived-mode arl-mode
|
||||||
|
arl-mode-comments
|
||||||
|
arl-mode-keywords
|
||||||
|
arl-mode-expressions
|
||||||
|
arl-mode-automode-list
|
||||||
|
nil)
|
||||||
|
|
||||||
|
(provide 'arl-mode)
|
||||||
|
;;; arl-mode.el ends here
|
||||||
@@ -25,7 +25,7 @@ typedef enum
|
|||||||
/// Known symbols which later stages would benefit from.
|
/// Known symbols which later stages would benefit from.
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
TOKEN_KNOWN_PUTSTR,
|
TOKEN_KNOWN_PUTS,
|
||||||
NUM_TOKEN_KNOWNS,
|
NUM_TOKEN_KNOWNS,
|
||||||
} token_known_t;
|
} token_known_t;
|
||||||
|
|
||||||
|
|||||||
@@ -13,8 +13,8 @@ const char *token_known_to_cstr(token_known_t known)
|
|||||||
{
|
{
|
||||||
switch (known)
|
switch (known)
|
||||||
{
|
{
|
||||||
case TOKEN_KNOWN_PUTSTR:
|
case TOKEN_KNOWN_PUTS:
|
||||||
return "putstr";
|
return "puts";
|
||||||
default:
|
default:
|
||||||
FAIL("Unexpected TOKEN_KNOWN value: %d\n", known);
|
FAIL("Unexpected TOKEN_KNOWN value: %d\n", known);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user