# Debug files
*.dSYM/
+project.vim
+tags
+tags .rsconscache
+source/lex.yy.c
+.rsconscache
+parser
[submodule "modules/libcds"]
path = modules/libcds
url = https://github.com/mikedlowis/data-structures.git
+[submodule "modules/build-system"]
+ path = modules/build-system
+ url = https://github.com/mikedlowis/build-system.git
--- /dev/null
+source 'https://rubygems.org'
+gem 'rake', '>= 0'
+gem 'rscons', '>= 0'
+gem 'rspec', '>= 0'
--- /dev/null
+GEM
+ remote: https://rubygems.org/
+ specs:
+ diff-lcs (1.2.5)
+ json (1.8.2)
+ rake (10.4.2)
+ rscons (1.9.0)
+ json (~> 1.0)
+ rspec (3.2.0)
+ rspec-core (~> 3.2.0)
+ rspec-expectations (~> 3.2.0)
+ rspec-mocks (~> 3.2.0)
+ rspec-core (3.2.2)
+ rspec-support (~> 3.2.0)
+ rspec-expectations (3.2.0)
+ diff-lcs (>= 1.2.0, < 2.0)
+ rspec-support (~> 3.2.0)
+ rspec-mocks (3.2.1)
+ diff-lcs (>= 1.2.0, < 2.0)
+ rspec-support (~> 3.2.0)
+ rspec-support (3.2.2)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ rake
+ rscons
+ rspec
+++ /dev/null
-INCLUDES = \
- source/ \
- modules/libcds/source/ \
- modules/libcds/source/buffer/ \
- modules/libcds/source/cmp/ \
- modules/libcds/source/exn/ \
- modules/libcds/source/list/ \
- modules/libcds/source/map/ \
- modules/libcds/source/mem/ \
- modules/libcds/source/murmur3/ \
- modules/libcds/source/rbt/ \
- modules/libcds/source/set/ \
- modules/libcds/source/string/ \
- modules/libcds/source/vector/
-
-SOURCES = $(wildcard source/*.c) \
- $(wildcard modules/libcds/source/*/*.c)
-
-LD = $(CC)
-MAKEDEPEND = $(CPP) -M $(CPPFLAGS) -o $<
-CCDEPGEN = -MMD -MF $*.d
-CFLAGS = -Wall -Wextra -O3 --std=c99 --pedantic $(addprefix -I,$(INCLUDES))
-
--include $(SOURCES:.c=.d)
-
-parser: source/lex.yy.o $(SOURCES:.c=.o)
- $(LD) $(LDFLAGS) -o $@ $^
-
-%.o : %.c
- $(CC) $(CCDEPGEN) $(CFLAGS) -c $< -o $@
-
-source/lex.yy.c: source/lexer.l
- $(LEX) $(LFLAGS) -o $@ $^
-
-clean:
- rm -f $(SOURCES:.c=.o)
- rm -f $(SOURCES:.c=.d)
- rm -f source/lex.yy.c
- rm -f parser parser.exe
-
--- /dev/null
+#!/usr/bin/env ruby
+require './modules/build-system/setup'
+
+#------------------------------------------------------------------------------
+# Environment Definitions
+#------------------------------------------------------------------------------
+# Define the default compiler environment
+main_env = BuildEnv.new do |env|
+ env["CFLAGS"] += ['-Wall', '-Wextra', '--std=c99', '--pedantic']
+ env["CPPPATH"] += Dir['modules/libcds/source/**/'] + [ ]
+end
+
+#------------------------------------------------------------------------------
+# Release Build Targets
+#------------------------------------------------------------------------------
+# Build third party libraries
+main_env.Library('build/lib/libcds.a', FileList['modules/libcds/source/**/*.c'])
+runtime_libs = ['build/lib/libcds.a']
+
+# Build the parser
+main_env.CFile('source/lex.yy.c', 'source/lexer.l')
+main_env.Program('parser', FileList['source/*.c'] + ['source/lex.yy.c'] + runtime_libs)
+
+#------------------------------------------------------------------------------
+# Test Build Targets
+#------------------------------------------------------------------------------
+if Opts[:profile].include? "test"
+# compiler_libs = ['build/lib/libparse-test.a'] + runtime_libs
+# test_env.Library('build/lib/libparse-test.a', FileList['source/libparse/*.c'])
+# test_env.Program('build/bin/sclpl-test', FileList['source/sclpl/*.c'] + compiler_libs)
+# test_env.Command('RSpec', [], 'CMD' => [
+# 'rspec', '--pattern', 'spec/**{,/*/**}/*_spec.rb', '--format', 'documentation'])
+end
--- /dev/null
+Subproject commit f1a522b4aed7c58ce3c8467ff8a00f00c3e27e64
AST* tree = Tree(type, count);
intptr_t* stack = Token_Stack - (count-1);
for (int i = 0; i < count; i++) {
- tree->children[i] = stack[i];
+ tree->children[i] = (void*)stack[i];
}
Token_Stack -= count ;
*(++Token_Stack) = (intptr_t)tree;
static void binary_send(void);
static void unary_send(void);
static void operand(void);
-static void messages(void);
static void literal(void);
static void array(void);
static void object(void);
PrintTree((AST*)*Token_Stack, 0);
Token_Stack = Token_Buffer-1;
}
+ (void)argc;
+ (void)argv;
return 0;
}