Skip to content

Commit aa8d78b

Browse files
committed
typo
0 parents  commit aa8d78b

File tree

1,476 files changed

+147067
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,476 files changed

+147067
-0
lines changed

.hgignore

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
temp/
2+
doc/.DS_Store
3+
doc/version.texinfo$
4+
.DS_Store
5+
.*~
6+
version.h$
7+
config-local.h$
8+
auto-config-local.mk$
9+
config-local.mk$
10+
bootstrap/TAGS$
11+
TAGS$
12+
tests/.*\.pyc$
13+
external/UnitTest\+\+/.*\.a
14+
external/UnitTest\+\+/src/.*\.o
15+
external/UnitTest\+\+/src/.*\.d
16+
external/UnitTest\+\+/TestUnitTest\+\+
17+
glob:external/llvm

AUTHORS

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Gregor Klinke <gck()eyestep'org>

BUGS

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
- Calling extern-C function with wrong argument number crash hrc
2+
3+
extern ("C") {
4+
void exit(int retv);
5+
}
6+
7+
8+
def foo()
9+
exit()
10+
11+
12+
- macros with empty replacement list are not registered?
13+
14+
def macro assert {
15+
{ assert(?expr:expr) } -> { }
16+
}
17+
18+
def foo()
19+
assert(1 == 1)
20+
0
21+
22+
23+
- macros don't save their context. Macros should be hygienic
24+
by saving the bindings visibile at their declaration point.
25+
26+
module X
27+
export public (y)
28+
29+
import "something.h7"
30+
31+
def macro y { { y() } -> { symbol-from-something() } }
32+
33+
In this example the site using the macro y must also import
34+
something.h7, otherwise symbol-from-something is unknown
35+
36+
37+
- size of array must be constant expression. Ex.:
38+
39+
let t : Char[buffer.num-items]
40+
41+
this produces the totally unusable error message:
42+
43+
error: Parse error: Bad expression: 566

HOWTO

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Howto compile herschel code to binary
2+
-------------------------------------
3+
4+
1. Add llvm tools into the path.
5+
6+
2. You need the little runtime addition rt.c, precompile it with clang or gcc
7+
8+
3.
9+
../temp/debug/hrc -c -s compile/d.hea ; llc d.ll ; gcc -o d.out d.s rt.o
10+
11+
and this is even faster:
12+
13+
../temp/debug/hrc -c -b compile/d.hea ; llvm-ld -v -native -o d3.out d.bc rt.o

INSTALL

+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
Requirements
2+
3+
for the code itself:
4+
- c and c++ (tested with gcc 4.0.1 and 4.2.1 on Mac OS X, 4.5.0 on
5+
mingw/linux; clang 2.8 on Mac OS X)
6+
- llvm 2.9 (http://www.llvm.org)
7+
8+
for building and testing:
9+
- a shell (posix compliant shell)
10+
- sed
11+
- GNU make (tested with GNU make 3.81)
12+
- python (tested with python 2.5.1)
13+
14+
for the documentation:
15+
- texinfo (the makefile refers to texi2pdf and makeinfo). For the PDF
16+
documentation you need a substantial tex installation
17+
18+
19+
Developed on Mac OS X (10.5 and 10.6), Linux, and Windows XP.
20+
21+
22+
Build on Unix (incl. Mac OS X):
23+
24+
1. build llvm (e.g. in ~/tmp/llvm-build)
25+
26+
$ mkdir $TMP_DIR/llvm-build
27+
$ cd $TMP_DIR/llvm-build
28+
$ $LLVM_SRC_ROOT/configure
29+
$ make
30+
31+
or just get a precompiled binary from the llvm site (if available) and
32+
install it whereever you prefer.
33+
34+
2. run the configure script from within the build directory. Herschel
35+
can be build in a separate build directory:
36+
37+
$ cd my-build
38+
$ ../herschel/configure
39+
40+
See the "--help" option to that script to check different
41+
configuration possibilities. If you have llvm installed in a location
42+
which is not in your search path (esp. the "llvm-config" tool) you
43+
have to specify this information with the "--with-llvm-config" option:
44+
45+
$ ./configure --with-llvm-config=~/Dev/llvm-build2.8/Release/bin/llvm-config
46+
47+
3. review the settings in $HERSCHEL_ROOT/config.mk; probably create a
48+
config-local.mk and overwrite settings there.
49+
50+
4. go to $HERSCHEL_ROOT and type 'make'
51+
52+
$ make
53+
54+
This should build the compiler, runtime libraries, prepare the
55+
documentation, and runs the unit tests (if configured so). To run the
56+
complete test suite type
57+
58+
$ make tests
59+
60+
from the toplevel development folder. To create the documentation type
61+
62+
$ make docs.
63+
64+
If everything went smooth you can find the created tools and
65+
documentation in the 'temp' folder.
66+
67+
5. Install: TBD
68+
69+
70+
Build on Windows XP:
71+
72+
- only tested with mingw32. You need at least version
73+
mingw-get-inst-20100909, i.e. gcc 4.5.0. gcc 4.4.0 shows some strange
74+
inconsistency in the default c++ library setup.

LICENSE

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
Copyright (c) 2006-2011 Gregor Klinke
2+
All rights reserved.
3+
4+
Redistribution and use in source and binary forms, with or without
5+
modification, are permitted provided that the following conditions are
6+
met:
7+
8+
- Redistributions of source code must retain the above copyright notice,
9+
this list of conditions and the following disclaimer.
10+
11+
- Redistributions in binary form must reproduce the above copyright
12+
notice, this list of conditions and the following disclaimer in the
13+
documentation and/or other materials provided with the distribution.
14+
15+
- Neither the name of the author nor the names of other contributors may
16+
be used to endorse or promote products derived from this software
17+
without specific prior written permission.
18+
19+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
20+
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21+
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
22+
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
23+
OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
24+
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
25+
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
26+
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
27+
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
28+
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
29+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Makefile

+211
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,211 @@
1+
# This file is part of the herschel package
2+
#
3+
# Copyright (c) 2010-2011 Gregor Klinke
4+
# All rights reserved.
5+
#
6+
# This source code is released under the BSD License.
7+
8+
top_srcdir = .
9+
10+
include $(top_srcdir)/config.mk
11+
12+
#----------------------------------------------------------------------
13+
14+
SUBDIRS = external bootstrap runtime lib build doc tests
15+
16+
ALL_SUBDIRS = external bootstrap runtime lib
17+
18+
DISTFILES = \
19+
AUTHORS \
20+
BUGS \
21+
LICENSE \
22+
INSTALL \
23+
NEWS \
24+
Makefile \
25+
README \
26+
TODO \
27+
config.mk
28+
29+
include $(top_srcdir)/build/pre.mk
30+
31+
.PHONY: build tests docs
32+
33+
build: $(curdir)version.h $(curdir)config-local.h $(BUILDDIR) $(BUILDDIR)/$(BUILDSTYLE)
34+
(cd bootstrap && $(MAKE) all)
35+
36+
tests: build
37+
(cd tests/ && $(MAKE) all)
38+
39+
docs: $(curdir)doc/version.texinfo $(BUILDDIR)
40+
(cd doc/ && $(MAKE) all)
41+
42+
doxygen: doc/Doxyfile $(BUILDDIR)
43+
doxygen doc/Doxyfile
44+
45+
ifeq ($(BUILDSTYLE),dist-release)
46+
RUN_UNITTEST_TARGET = no-unittest-in-release
47+
else
48+
RUN_UNITTEST_TARGET = run-unittest
49+
endif
50+
all-post: $(RUN_UNITTEST_TARGET)
51+
52+
run-unittest:
53+
@echo ""
54+
@echo "**** Running unit tests **********"
55+
$(BUILDDIR)/$(BUILDSTYLE)/hrc$(APPEXT) -UT
56+
57+
no-unittest-in-release:
58+
59+
60+
all-local: $(curdir)version.h $(curdir)config-local.h $(curdir)doc/version.texinfo $(BUILDDIR) $(BUILDDIR)/$(BUILDSTYLE)
61+
62+
TAGS:
63+
find -E . -regex ".*\.mm$$|.*\.cpp$$|.*\.h$$" -print | etags -o TAGS -
64+
65+
clean-local:
66+
rm -rf $(distdir) $(info-distdir) $(pdf-distdir)
67+
68+
distclean-post: clean-post
69+
rm -rf TAGS $(curdir)temp/ $(curdir)auto-config-local.mk $(curdir)version.h $(curdir)config-local.h $(curdir)doc/version.texinfo $(PKGDIR) $(BUILDDIR)
70+
71+
72+
#--- doc distribution ------------------------------
73+
74+
dist-doc-info-prepare: $(BUILDDIR)
75+
-chmod -R a+w $(BUILDDIR)/$(info-distdir) >/dev/null 2>&1; rm -rf $(BUILDDIR)/$(info-distdir)
76+
mkdir $(BUILDDIR)/$(info-distdir)
77+
(cd doc/; \
78+
$(MAKE) -k info; \
79+
cp -f README.dist-info ../$(BUILDDIR)/$(info-distdir)/README >/dev/null 2>&1; \
80+
cp -f -r *.info-[0-9] ../$(BUILDDIR)/$(info-distdir) >/dev/null 2>&1; \
81+
cp -f -r *.info ../$(BUILDDIR)/$(info-distdir) >/dev/null 2>&1)
82+
83+
dist-doc-pdf-prepare: $(BUILDDIR)
84+
-chmod -R a+w $(BUILDDIR)/$(pdf-distdir) >/dev/null 2>&1; rm -rf $(BUILDDIR)/$(pdf-distdir)
85+
mkdir $(BUILDDIR)/$(pdf-distdir)
86+
(cd doc/; \
87+
$(MAKE) -k pdf; \
88+
cp -f README.dist-pdf ../$(BUILDDIR)/$(pdf-distdir)/README >/dev/null 2>&1; \
89+
cp -f -r *.pdf ../$(BUILDDIR)/$(pdf-distdir) >/dev/null 2>&1)
90+
91+
dist-doc-info-zip: $(PKGDIR) dist-doc-info-prepare
92+
(cd $(BUILDDIR); \
93+
$(ZIP) -r ../$(PKGDIR)/$(info-doc-pkg-name).zip $(info-distdir))
94+
95+
dist-doc-pdf-zip: $(PKGDIR) dist-doc-pdf-prepare
96+
(cd $(BUILDDIR); \
97+
$(ZIP) -r ../$(PKGDIR)/$(pdf-doc-pkg-name).zip $(pdf-distdir))
98+
99+
dist-doc-info-tgz: $(PKGDIR) dist-doc-info-prepare
100+
(cd $(BUILDDIR); \
101+
$(TAR) czvf ../$(PKGDIR)/$(info-doc-pkg-name).tar.gz $(info-distdir))
102+
103+
dist-doc-pdf-tgz: $(PKGDIR) dist-doc-pdf-prepare
104+
(cd $(BUILDDIR); \
105+
$(TAR) czf ../$(PKGDIR)/$(pdf-doc-pkg-name).tar.gz $(pdf-distdir))
106+
107+
dist-doc-info: dist-doc-info-zip dist-doc-info-tgz
108+
109+
dist-doc-pdf: dist-doc-pdf-zip dist-doc-pdf-tgz
110+
111+
dist-doc: dist-doc-info dist-doc-pdf
112+
113+
114+
#--- src distribution ------------------------------
115+
116+
dist-src-prepare: $(BUILDDIR) distdir
117+
118+
dist-src-zip: $(PKGDIR) dist-src-prepare
119+
(cd $(BUILDDIR); \
120+
$(ZIP) -r ../$(PKGDIR)/$(src-pkg-name).zip $(PACKAGE)-$(VERSION))
121+
122+
dist-src-tgz: $(PKGDIR) dist-src-prepare
123+
(cd $(BUILDDIR); \
124+
$(TAR) czf ../$(PKGDIR)/$(src-pkg-name).tar.gz $(PACKAGE)-$(VERSION))
125+
126+
dist-src: dist-src-zip dist-src-tgz
127+
128+
dist: dist-src
129+
130+
131+
#--- binary distribution ------------------------------
132+
133+
dist-bin-pc: $(BUILDDIR) $(PKGDIR) all-local
134+
if [ "$(TARGET_OS)" = "win" ]; then \
135+
echo "Prepare windows distribution"; \
136+
(cd src && $(MAKE) all); \
137+
pkg_name=$(PACKAGE)-pc-i386-$(VERSION); \
138+
bin_pkgdir=$(BUILDDIR)/$$pkg_name; \
139+
mkdir $$bin_pkgdir; \
140+
cp doc/README.dist-pc-bin $$bin_pkgdir/README; \
141+
cp $(BUILDDIR)/hrc.exe $$bin_pkgdir/hrc.exe; \
142+
(cd $(BUILDDIR); \
143+
$(ZIP) -r ../$(PKGDIR)/$$pkg_name.zip $$pkg_name); \
144+
fi
145+
146+
dist-bin-pkg: all-local
147+
(cd src && BUILDSTYLE=dist-$(BUILDSTYLE) $(MAKE) all)
148+
149+
150+
#----------------------------------------------------------------------
151+
152+
# windows binary distribution
153+
154+
dist-windows: $(PKGDIR)
155+
(BUILDSTYLE=release $(MAKE) dist-bin-pkg); \
156+
(cd build/dist/win && $(MAKE) all); \
157+
cp build/dist/win/hrc-*.exe $(PKGDIR)
158+
159+
160+
#----------------------------------------------------------------------
161+
162+
# mac os-x binary distribution
163+
164+
dist-macosx: $(PKGDIR)
165+
(BUILDSTYLE=release $(MAKE) dist-bin-pkg); \
166+
(cd build/dist/mac && $(MAKE) all)
167+
168+
169+
#----------------------------------------------------------------------
170+
171+
dist-all: dist-src dist-doc
172+
173+
174+
$(curdir)version.h: Makefile config.mk
175+
@echo "/* Don't edit this file. It has been created automatically. */" > $@
176+
@echo "#ifndef herschel_version_h" >> $@
177+
@echo "#define herschel_version_h" >> $@
178+
@echo "#define PACKAGE \"$(PACKAGE)\"" >> $@
179+
@echo "#define VERSION \"$(VERSION)\"" >> $@
180+
@echo "#define COPYRIGHTYEAR \"$(COPYRIGHTYEAR)\"" >> $@
181+
@echo "#define COPYRIGHTOWNER \"$(COPYRIGHTOWNER)\"" >> $@
182+
@echo "#define HR_BASE_REVISION \"$(BASE_REVISION)\"" >> $@
183+
@echo "#endif" >> $@
184+
185+
$(curdir)doc:
186+
@if [ ! -d $@ ]; then mkdir $@; fi
187+
188+
$(curdir)doc/version.texinfo: $(curdir)doc Makefile config.mk
189+
@echo "@c Don't edit this file. It has been created automatically." > $@
190+
@echo "@set VERSION $(LANG_VERSION) " > $@
191+
@echo "@set COPYRIGHTYEAR $(COPYRIGHTYEAR) " >> $@
192+
@echo "@set COPYRIGHTOWNER $(COPYRIGHTOWNER) " >> $@
193+
@echo "@set BASEREVISION $(BASE_REVISION) " >> $@
194+
195+
$(curdir)config-local.h: Makefile config.mk
196+
@echo "/* Don't edit this file. It has been created automatically. */" > $@
197+
@echo "#ifndef herschel_config_local_h" > $@
198+
@echo "#define herschel_config_local_h" >> $@
199+
@echo "#define HR_INSTDIR_prefix \"$(prefix)/\"" >> $@
200+
@echo "#define HR_INSTDIR_bindir \"$(bindir)/\"" >> $@
201+
@echo "#define HR_INSTDIR_libdir \"$(libdir)/\"" >> $@
202+
@echo "#define HR_INSTDIR_pkglibdir \"$(pkglibdir)/\"" >> $@
203+
@echo "#define HR_INSTDIR_includedir \"$(includedir)/\"" >> $@
204+
@echo "#define HR_INSTDIR_pkgincludedir \"$(pkgincludedir)/\"" >> $@
205+
@echo "#define HR_INSTDIR_datadir \"$(datadir)/\"" >> $@
206+
@echo "#define HR_INSTDIR_pkgdatadir \"$(pkgdatadir)/\"" >> $@
207+
@echo "#define HR_LLVM_EXE \"$(LLVM_EXE)\"" >> $@
208+
@echo "#endif" >> $@
209+
210+
211+
include $(top_srcdir)/build/generic.mk

NEWS

Whitespace-only changes.

0 commit comments

Comments
 (0)