The Basic compiler works now.

This commit is contained in:
David Given 2016-08-12 00:19:51 +02:00
parent b592c88bdf
commit 7c60c27302
8 changed files with 53 additions and 6 deletions

View file

@ -12,6 +12,7 @@ installable {
name = "ack",
map = {
"lang/cem/cemcom.ansi+pkg",
"lang/basic/src+pkg",
"plat/pc86+pkg",
"util/ack+pkg",
"util/amisc+pkg",

View file

@ -90,7 +90,7 @@
#include <stdlib.h>
#include <stdio.h>
#include "bem.h"
#include "llmess.c"
#include "llmess.h"
typedef union {
int integer ;
@ -112,7 +112,7 @@ int in_data = 0; /* set if processing DATA statement */
char *formatstring; /* formatstring used for printing */
Symbol *s; /* Symbol dummy */
#include "yylexp.c"
#include "yylexp.h"
#include "basic.lex"
}

View file

@ -235,8 +235,6 @@ File *stream;
}
}
extern char *strchr();
getinputline()
{
/* get next input line */

47
lang/basic/src/build.lua Normal file
View file

@ -0,0 +1,47 @@
include("util/LLgen/build.lua")
llgen {
name = "llgen",
srcs = { "./*.g" }
}
normalrule {
name = "tokentab_h",
ins = {
"./maketokentab",
matching(filenamesof("+llgen"), "/Lpars.h$"),
},
outleaves = { "tokentab.h" },
commands = {
"%{ins} %{outs}"
}
}
cprogram {
name = "em_bem",
srcs = {
"./*.c",
matching(filenamesof("+llgen"), "%.c$"),
},
deps = {
"+llgen",
"+tokentab_h",
"h+emheaders",
"modules+headers",
"modules/src/alloc+lib",
"modules/src/em_code+lib_k",
"modules/src/em_mes+lib",
"modules/src/print+lib",
"modules/src/string+lib",
"modules/src/system+lib",
"util/data+em_data",
}
}
installable {
name = "pkg",
map = {
["$(PLATDEP)/em_bem"] = "+em_bem"
}
}

View file

@ -1,6 +1,6 @@
#!/bin/sh
ed -s "${1:-Lpars.h}" <<'+'
ed -s "${1:-Lpars.h}" > $2 <<'+'
1d
1,$s/# *define //
1,$s/ ...$//
@ -13,6 +13,6 @@ char *tokentab[] = {
$a
};
.
w tokentab.h
1,$p
q
+

View file

@ -13,6 +13,7 @@ definerule("ackfile",
name = e.name,
srcs = e.srcs,
deps = {
"lang/cem/cemcom.ansi+pkg",
"lang/cem/cpp.ansi+pkg",
"plat/"..plat.."+tools",
"util/ack+pkg",