#------------------------------------------------------------------------------
BIN = sclpl
OBJS = source/main.o \
+ source/pkg.o \
source/vec.o \
source/pprint.o \
source/parser.o \
source/syms.o \
source/codegen.o
-.PHONY: all tests specs
-all: sclpl tests specs
+.PHONY: all specs tests
+all: sclpl specs tests
lib${BIN}.a: ${OBJS}
${AR} ${ARFLAGS} $@ $^
specs: $(BIN)
rspec --pattern 'spec/**{,/*/**}/*_spec.rb' --format documentation
+tests: $(BIN)
+ @echo "Parsing example file..."
+ ./sclpl -Aast < example.src
+
.l.c:
${LEX} -o $@ $<
expect(p, '(');
while (!matches(p, ')')) {
expect(p, T_STRING);
+ pkg_add_require(&(p->pkg), "required/module");
}
expect(p, ')');
}
expect(p, '(');
while (!matches(p, ')')) {
expect(p, T_ID);
+ pkg_add_provide(&(p->pkg), "provided/symbol");
}
expect(p, ')');
}
} else {
error(p, "only definitions are allowed at the top level");
}
+ pkg_add_definition(&(p->pkg), NULL);
}
return NULL;
}
expression_block(p);
} else if (matches(p, T_IF)) {
if_expression(p);
-// } else if (matches(p, T_ID)) {
-// identifier(p);
-// if (matches(p, '('))
-// func_expr_list(p);
} else if (matches(p, T_ID)) {
identifier(p);
} else {
--- /dev/null
+#include <sclpl.h>
+
+void pkg_add_require(Package* p, char* req)
+{
+}
+
+void pkg_add_provide(Package* p, char* exp)
+{
+}
+
+void pkg_add_definition(Package* p, AST* ast)
+{
+}
+