Syntax-hilighting for ATS code in docbook

53 views
Skip to first unread message

gmhwxi

unread,
Feb 24, 2016, 2:38:59 AM2/24/16
to ats-lang-users

With the help of the atexting tool, I managed to syntax-hilight the ATS code in docbook.
I had wanted to do this for so long :)

For instance, please take a look at this book chapter:

http://ats-lang.sourceforge.net/DOCUMENT/ATS2TUTORIAL/HTML/HTMLTOC/c359.html

The texting functions for syntax-hilighting are sats2xhtml and dats2xhtml:

https://github.com/githwxi/ATS-Postiats/tree/master/doc/BOOK/ATS2TUTORIAL/ATEXT/myatexting.dats

Cheers!

gmhwxi

unread,
Feb 24, 2016, 9:35:32 AM2/24/16
to ats-lang-users
FYI.

All the ATS code in ATS2TUTORIAL is now syntax-hilited:

http://ats-lang.sourceforge.net/DOCUMENT/ATS2TUTORIAL/HTML/HTMLTOC/book1.html

gmhwxi

unread,
Feb 24, 2016, 10:23:04 PM2/24/16
to ats-lang-users

FYI.

All the ATS code in INT2PROGINATS is now syntax-hilited:

http://ats-lang.sourceforge.net/DOCUMENT/INT2PROGINATS/HTML/HTMLTOC/book1.html

Kiwamu Okabe

unread,
May 7, 2016, 12:36:19 AM5/7/16
to ats-lang-users
On Wed, Feb 24, 2016 at 4:38 PM, gmhwxi <gmh...@gmail.com> wrote:
> The texting functions for syntax-hilighting are sats2xhtml and dats2xhtml:
>
> https://github.com/githwxi/ATS-Postiats/tree/master/doc/BOOK/ATS2TUTORIAL/ATEXT/myatexting.dats

Today, I tried to build your document using the syntax-hilighting.
However I get the attached result.

How to use sats2xhtml and dats2xhtml?

Best regards,
--
Kiwamu Okabe at METASEPI DESIGN
x3086.html

gmhwxi

unread,
May 7, 2016, 12:50:29 AM5/7/16
to ats-lang-users
You need now to execute

'make synhilit'

to syntax-hilight the ATS code in the book.


On Wednesday, February 24, 2016 at 2:38:59 AM UTC-5, gmhwxi wrote:

Kiwamu Okabe

unread,
May 7, 2016, 1:01:41 AM5/7/16
to ats-lang-users
On Sat, May 7, 2016 at 1:50 PM, gmhwxi <gmh...@gmail.com> wrote:
> You need now to execute
>
> 'make synhilit'
>
> to syntax-hilight the ATS code in the book.

Do you mean following commands?

```
$ pwd
/home/kiwamu/src/ATS-Postiats/doc/BOOK/INT2PROGINATS
$ make
$ make -C ATEXT
$ make -C HTML synhilit
```

However I catch following error...

```
$ pwd
/home/kiwamu/src/ATS-Postiats/doc/BOOK/INT2PROGINATS
$ make -C ATEXT
make: Entering directory
'/home/kiwamu/src/ATS-Postiats/doc/BOOK/INT2PROGINATS/ATEXT'
\
/home/kiwamu/src/ATS-Postiats/bin/patscc -O2 -o bin/myatexting \
-D_ATS_GCBDW \
-DATS_MEMALLOC_GCBDW \
myatexting.dats
/home/kiwamu/src/ATS-Postiats/utils/atexting/atexting_mylib.dats \
/home/kiwamu/src/ats-lang-anairiats-0.2.12/ccomp/runtime/ats_prelude.c
-L/home/kiwamu/src/ats-lang-anairiats-0.2.12/ccomp/lib
-L/home/kiwamu/src/ats-lang-anairiats-0.2.12/ccomp/lib64 -latsynmark
-latsopt -lats -lgmp -lgc
/home/kiwamu/src/ats-lang-anairiats-0.2.12/ccomp/runtime/ats_prelude.c:36:20:
fatal error: config.h: No such file or directory
compilation terminated.
```

It needs running "configure" at top directory?
But I catch more fail at "configure".

```
$ pwd
/home/kiwamu/src/ATS-Postiats
$ autoreconf
$ ./configure
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
configure: error: cannot find install-sh, install.sh, or shtool in "."
"./.." "./../.."
```

Hongwei Xi

unread,
May 7, 2016, 8:33:26 AM5/7/16
to ats-lan...@googlegroups.com
You need to have config.h available at ${ATSHOME} (not ${PATSHOME)).


--
You received this message because you are subscribed to the Google Groups "ats-lang-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ats-lang-user...@googlegroups.com.
To post to this group, send email to ats-lan...@googlegroups.com.
Visit this group at https://groups.google.com/group/ats-lang-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/ats-lang-users/CAEvX6dkktAO3O52NufAxVgCnD2963NKR5-Gg4VAGZx%2BO%3DqB1rA%40mail.gmail.com.

Kiwamu Okabe

unread,
May 7, 2016, 8:46:24 AM5/7/16
to ats-lang-users
On Sat, May 7, 2016 at 9:33 PM, Hongwei Xi <gmh...@gmail.com> wrote:
> You need to have config.h available at ${ATSHOME} (not ${PATSHOME)).

Umm... I have it at ${ATSHOME}...

```
$ pwd
/home/kiwamu/src/ATS-Postiats/doc/BOOK/INT2PROGINATS
$ make -C ATEXT
make: Entering directory
'/home/kiwamu/src/ATS-Postiats/doc/BOOK/INT2PROGINATS/ATEXT'
\
/home/kiwamu/src/ATS-Postiats/bin/patscc -O2 -o bin/myatexting \
-D_ATS_GCBDW \
-DATS_MEMALLOC_GCBDW \
myatexting.dats
/home/kiwamu/src/ATS-Postiats/utils/atexting/atexting_mylib.dats \
/home/kiwamu/src/ats-lang-anairiats-0.2.12/ccomp/runtime/ats_prelude.c
-L/home/kiwamu/src/ats-lang-anairiats-0.2.12/ccomp/lib
-L/home/kiwamu/src/ats-lang-anairiats-0.2.12/ccomp/lib64 -latsynmark
-latsopt -lats -lgmp -lgc
/home/kiwamu/src/ats-lang-anairiats-0.2.12/ccomp/runtime/ats_prelude.c:36:20:
fatal error: config.h: No such file or directory
compilation terminated.
Makefile:33: recipe for target 'myatexting' failed
make: *** [myatexting] Error 1
make: Leaving directory
'/home/kiwamu/src/ATS-Postiats/doc/BOOK/INT2PROGINATS/ATEXT'
$ file $ATSHOME/config.h
/home/kiwamu/src/ats-lang-anairiats-0.2.12/config.h: ASCII text
```

Hongwei Xi

unread,
May 7, 2016, 9:02:21 AM5/7/16
to ats-lan...@googlegroups.com
Try

cp ${ATSHOME}/config.h ${PATSHOME}/.



--
You received this message because you are subscribed to the Google Groups "ats-lang-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ats-lang-user...@googlegroups.com.
To post to this group, send email to ats-lan...@googlegroups.com.
Visit this group at https://groups.google.com/group/ats-lang-users.

Kiwamu Okabe

unread,
May 7, 2016, 9:08:59 AM5/7/16
to ats-lang-users
On Sat, May 7, 2016 at 10:02 PM, Hongwei Xi <gmh...@gmail.com> wrote:
> Try
>
> cp ${ATSHOME}/config.h ${PATSHOME}/.

```
$ pwd
/home/kiwamu/src/ATS-Postiats/doc/BOOK/INT2PROGINATS
$ cp ${ATSHOME}/config.h ${PATSHOME}/
$ make -C ATEXT
make: Entering directory
'/home/kiwamu/src/ATS-Postiats/doc/BOOK/INT2PROGINATS/ATEXT'
\
/home/kiwamu/src/ATS-Postiats/bin/patscc -O2 -o bin/myatexting \
-D_ATS_GCBDW \
-DATS_MEMALLOC_GCBDW \
myatexting.dats
/home/kiwamu/src/ATS-Postiats/utils/atexting/atexting_mylib.dats \
/home/kiwamu/src/ats-lang-anairiats-0.2.12/ccomp/runtime/ats_prelude.c
-L/home/kiwamu/src/ats-lang-anairiats-0.2.12/ccomp/lib
-L/home/kiwamu/src/ats-lang-anairiats-0.2.12/ccomp/lib64 -latsynmark
-latsopt -lats -lgmp -lgc
/usr/bin/ld: cannot find -latsynmark
/usr/bin/ld: cannot find -latsopt
collect2: error: ld returned 1 exit status
Makefile:33: recipe for target 'myatexting' failed
```

The `libatsynmark` and `libatsopt` come from ATS1?

Best regards,l

Hongwei Xi

unread,
May 7, 2016, 9:17:25 AM5/7/16
to ats-lan...@googlegroups.com
You are almost there.

cd ${PATSHOME}/utils/libatsopt

make

cd ${PATSHOME}/utlls/libatsynmark

make

After building libatsopt and libatsynmark, you can move them to
${ATSHOME}/ccomp/lib

Then it should work.


--
You received this message because you are subscribed to the Google Groups "ats-lang-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ats-lang-user...@googlegroups.com.
To post to this group, send email to ats-lan...@googlegroups.com.
Visit this group at https://groups.google.com/group/ats-lang-users.

Kiwamu Okabe

unread,
May 7, 2016, 9:24:15 AM5/7/16
to ats-lang-users
On Sat, May 7, 2016 at 10:17 PM, Hongwei Xi <gmh...@gmail.com> wrote:
> You are almost there.
>
> cd ${PATSHOME}/utils/libatsopt
>
> make
>
> cd ${PATSHOME}/utlls/libatsynmark
>
> make
>
> After building libatsopt and libatsynmark, you can move them to
> ${ATSHOME}/ccomp/lib
>
> Then it should work.

```
$ cd ${PATSHOME}/utils/libatsopt
$ make
--snip--
gcc -O2 -I. -I./ccomp/runtime -c -o pats_ccomp_emit3_dats.o
pats_ccomp_emit3_dats.c
gcc -O2 -I. -I./ccomp/runtime -c -o pats_ccomp_main_dats.o
pats_ccomp_main_dats.c
gcc -O2 -I. -I./ccomp/runtime -c -o pats_comarg_dats.o pats_comarg_dats.c
make[1]: *** No rule to make target 'prelude_basics_sta_sats.o',
needed by 'prelude_libats.o'. Stop.
make[1]: Leaving directory '/home/kiwamu/src/ATS-Postiats/src/CBOOT'
Makefile:29: recipe for target 'libatsopt' failed
```

Hongwei Xi

unread,
May 7, 2016, 9:31:48 AM5/7/16
to ats-lan...@googlegroups.com
Please take a look at the following script to see how libatsopt can be built:

https://github.com/ats-lang/ats-lang.github.io/blob/master/SCRIPT/C9-ATS2-install-latest.sh

--
You received this message because you are subscribed to the Google Groups "ats-lang-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ats-lang-user...@googlegroups.com.
To post to this group, send email to ats-lan...@googlegroups.com.
Visit this group at https://groups.google.com/group/ats-lang-users.
Message has been deleted

gmhwxi

unread,
May 7, 2016, 10:22:43 AM5/7/16
to ats-lang-users
I modified that script a bit. You can now use it to build libatsopt and libatsynmark.


On Saturday, May 7, 2016 at 9:31:48 AM UTC-4, gmhwxi wrote:
Please take a look at the following script to see how libatsopt can be built:

https://github.com/ats-lang/ats-lang.github.io/blob/master/SCRIPT/C9-ATS2-install-latest.sh

On Sat, May 7, 2016 at 9:23 AM, Kiwamu Okabe wrote:
To unsubscribe from this group and stop receiving emails from it, send an email to ats-lang-users+unsubscribe@googlegroups.com.
To post to this group, send email to ats-lang-users@googlegroups.com.

Kiwamu Okabe

unread,
May 7, 2016, 10:07:45 PM5/7/16
to ats-lang-users
On Sat, May 7, 2016 at 10:31 PM, Hongwei Xi <gmh...@gmail.com> wrote:
> Please take a look at the following script to see how libatsopt can be
> built:

Thanks! I got it.

```
$ pwd
/home/kiwamu/src/ATS-Postiats
$ cp ${ATSHOME}/config.h .
$ make -f Makefile_devl
$ make -C src cleanall
$ make -C src/CBOOT/prelude
$ make -C src/CBOOT/libc
$ make -C src/CBOOT/libats
$ (cd utils/libatsopt && make && make clean)
$ cp utils/libatsopt/libatsopt.a ${ATSHOME}/ccomp/lib
$ (cd utils/libatsynmark && make && make clean)
$ cp utils/libatsynmark/libatsynmark.a ${ATSHOME}/ccomp/lib
$ cd doc/BOOK/INT2PROGINATS
$ make
$ make -C ATEXT
$ make -C HTML synhilit
$ x-www-browser HTML/index.html
```
Reply all
Reply to author
Forward
0 new messages