Author: Gianluca Guida <glguida@tlbflush.org>
Date: Thu Mar 9 03:52:16 UTC 2017
Parent: 36ea5153bb375cc6070c1800a5d135f857747f99
Log message:
doc: initial draft
1: diff --git a/Makefile.am b/Makefile.am
2: index bde7397..1bba46f 100644
3: --- a/Makefile.am
4: +++ b/Makefile.am
5: @@ -1,3 +1,3 @@
6: -SUBDIRS= src examples
7: +SUBDIRS= src examples docs
8:
9: EXTRA_DIST= tools/lemon.c
10: diff --git a/Makefile.in b/Makefile.in
11: index 585cd4e..74ea362 100644
12: --- a/Makefile.in
13: +++ b/Makefile.in
14: @@ -342,7 +342,7 @@ target_alias = @target_alias@
15: top_build_prefix = @top_build_prefix@
16: top_builddir = @top_builddir@
17: top_srcdir = @top_srcdir@
18: -SUBDIRS = src examples
19: +SUBDIRS = src examples docs
20: EXTRA_DIST = tools/lemon.c
21: all: config.h
22: $(MAKE) $(AM_MAKEFLAGS) all-recursive
23: diff --git a/configure b/configure
24: index 76e36e2..654b9f6 100755
25: --- a/configure
26: +++ b/configure
27: @@ -14655,7 +14655,7 @@ CC=$lt_save_CC
28:
29: CPPFLAGS = -DLAC_SYSDIR='"$(datadir)"' @CPPFLAGS@
30:
31: -ac_config_files="$ac_config_files Makefile src/Makefile src/lib/Makefile src/repl/Makefile examples/Makefile"
32: +ac_config_files="$ac_config_files Makefile src/Makefile src/lib/Makefile src/repl/Makefile examples/Makefile docs/Makefile"
33:
34: ac_config_headers="$ac_config_headers config.h"
35:
36: @@ -15674,6 +15674,7 @@ do
37: "src/lib/Makefile") CONFIG_FILES="$CONFIG_FILES src/lib/Makefile" ;;
38: "src/repl/Makefile") CONFIG_FILES="$CONFIG_FILES src/repl/Makefile" ;;
39: "examples/Makefile") CONFIG_FILES="$CONFIG_FILES examples/Makefile" ;;
40: + "docs/Makefile") CONFIG_FILES="$CONFIG_FILES docs/Makefile" ;;
41: "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
42:
43: *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
44: diff --git a/configure.ac b/configure.ac
45: index fc75845..ea4abbe 100644
46: --- a/configure.ac
47: +++ b/configure.ac
48: @@ -39,6 +39,7 @@ AC_CONFIG_FILES([Makefile
49: src/Makefile
50: src/lib/Makefile
51: src/repl/Makefile
52: - examples/Makefile])
53: + examples/Makefile
54: + docs/Makefile])
55: AC_CONFIG_HEADERS([config.h])
56: AC_OUTPUT
57: diff --git a/docs/Makefile.am b/docs/Makefile.am
58: new file mode 100644
59: index 0000000..24fb885
60: --- /dev/null
61: +++ b/docs/Makefile.am
62: @@ -0,0 +1 @@
63: +info_TEXINFOS = lac.texi
64: diff --git a/docs/Makefile.in b/docs/Makefile.in
65: new file mode 100644
66: index 0000000..f97f571
67: --- /dev/null
68: +++ b/docs/Makefile.in
69: @@ -0,0 +1,790 @@
70: +# Makefile.in generated by automake 1.15 from Makefile.am.
71: +# @configure_input@
72: +
73: +# Copyright (C) 1994-2014 Free Software Foundation, Inc.
74: +
75: +# This Makefile.in is free software; the Free Software Foundation
76: +# gives unlimited permission to copy and/or distribute it,
77: +# with or without modifications, as long as this notice is preserved.
78: +
79: +# This program is distributed in the hope that it will be useful,
80: +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
81: +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
82: +# PARTICULAR PURPOSE.
83: +
84: +@SET_MAKE@
85: +VPATH = @srcdir@
86: +am__is_gnu_make = { \
87: + if test -z '$(MAKELEVEL)'; then \
88: + false; \
89: + elif test -n '$(MAKE_HOST)'; then \
90: + true; \
91: + elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
92: + true; \
93: + else \
94: + false; \
95: + fi; \
96: +}
97: +am__make_running_with_option = \
98: + case $${target_option-} in \
99: + ?) ;; \
100: + *) echo "am__make_running_with_option: internal error: invalid" \
101: + "target option '$${target_option-}' specified" >&2; \
102: + exit 1;; \
103: + esac; \
104: + has_opt=no; \
105: + sane_makeflags=$$MAKEFLAGS; \
106: + if $(am__is_gnu_make); then \
107: + sane_makeflags=$$MFLAGS; \
108: + else \
109: + case $$MAKEFLAGS in \
110: + *\\[\ \ ]*) \
111: + bs=\\; \
112: + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
113: + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
114: + esac; \
115: + fi; \
116: + skip_next=no; \
117: + strip_trailopt () \
118: + { \
119: + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
120: + }; \
121: + for flg in $$sane_makeflags; do \
122: + test $$skip_next = yes && { skip_next=no; continue; }; \
123: + case $$flg in \
124: + *=*|--*) continue;; \
125: + -*I) strip_trailopt 'I'; skip_next=yes;; \
126: + -*I?*) strip_trailopt 'I';; \
127: + -*O) strip_trailopt 'O'; skip_next=yes;; \
128: + -*O?*) strip_trailopt 'O';; \
129: + -*l) strip_trailopt 'l'; skip_next=yes;; \
130: + -*l?*) strip_trailopt 'l';; \
131: + -[dEDm]) skip_next=yes;; \
132: + -[JT]) skip_next=yes;; \
133: + esac; \
134: + case $$flg in \
135: + *$$target_option*) has_opt=yes; break;; \
136: + esac; \
137: + done; \
138: + test $$has_opt = yes
139: +am__make_dryrun = (target_option=n; $(am__make_running_with_option))
140: +am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
141: +pkgdatadir = $(datadir)/@PACKAGE@
142: +pkgincludedir = $(includedir)/@PACKAGE@
143: +pkglibdir = $(libdir)/@PACKAGE@
144: +pkglibexecdir = $(libexecdir)/@PACKAGE@
145: +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
146: +install_sh_DATA = $(install_sh) -c -m 644
147: +install_sh_PROGRAM = $(install_sh) -c
148: +install_sh_SCRIPT = $(install_sh) -c
149: +INSTALL_HEADER = $(INSTALL_DATA)
150: +transform = $(program_transform_name)
151: +NORMAL_INSTALL = :
152: +PRE_INSTALL = :
153: +POST_INSTALL = :
154: +NORMAL_UNINSTALL = :
155: +PRE_UNINSTALL = :
156: +POST_UNINSTALL = :
157: +build_triplet = @build@
158: +host_triplet = @host@
159: +subdir = docs
160: +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
161: +am__aclocal_m4_deps = $(top_srcdir)/m4/ax_prog_flex.m4 \
162: + $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \
163: + $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/libsigsegv.m4 \
164: + $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
165: + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
166: + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \
167: + $(top_srcdir)/m4/readline.m4 $(top_srcdir)/m4/std-gnu11.m4 \
168: + $(top_srcdir)/configure.ac
169: +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
170: + $(ACLOCAL_M4)
171: +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/version.texi \
172: + $(srcdir)/stamp-vti $(am__DIST_COMMON)
173: +mkinstalldirs = $(install_sh) -d
174: +CONFIG_HEADER = $(top_builddir)/config.h
175: +CONFIG_CLEAN_FILES =
176: +CONFIG_CLEAN_VPATH_FILES =
177: +AM_V_P = $(am__v_P_@AM_V@)
178: +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
179: +am__v_P_0 = false
180: +am__v_P_1 = :
181: +AM_V_GEN = $(am__v_GEN_@AM_V@)
182: +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
183: +am__v_GEN_0 = @echo " GEN " $@;
184: +am__v_GEN_1 =
185: +AM_V_at = $(am__v_at_@AM_V@)
186: +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
187: +am__v_at_0 = @
188: +am__v_at_1 =
189: +SOURCES =
190: +DIST_SOURCES =
191: +AM_V_DVIPS = $(am__v_DVIPS_@AM_V@)
192: +am__v_DVIPS_ = $(am__v_DVIPS_@AM_DEFAULT_V@)
193: +am__v_DVIPS_0 = @echo " DVIPS " $@;
194: +am__v_DVIPS_1 =
195: +AM_V_MAKEINFO = $(am__v_MAKEINFO_@AM_V@)
196: +am__v_MAKEINFO_ = $(am__v_MAKEINFO_@AM_DEFAULT_V@)
197: +am__v_MAKEINFO_0 = @echo " MAKEINFO" $@;
198: +am__v_MAKEINFO_1 =
199: +AM_V_INFOHTML = $(am__v_INFOHTML_@AM_V@)
200: +am__v_INFOHTML_ = $(am__v_INFOHTML_@AM_DEFAULT_V@)
201: +am__v_INFOHTML_0 = @echo " INFOHTML" $@;
202: +am__v_INFOHTML_1 =
203: +AM_V_TEXI2DVI = $(am__v_TEXI2DVI_@AM_V@)
204: +am__v_TEXI2DVI_ = $(am__v_TEXI2DVI_@AM_DEFAULT_V@)
205: +am__v_TEXI2DVI_0 = @echo " TEXI2DVI" $@;
206: +am__v_TEXI2DVI_1 =
207: +AM_V_TEXI2PDF = $(am__v_TEXI2PDF_@AM_V@)
208: +am__v_TEXI2PDF_ = $(am__v_TEXI2PDF_@AM_DEFAULT_V@)
209: +am__v_TEXI2PDF_0 = @echo " TEXI2PDF" $@;
210: +am__v_TEXI2PDF_1 =
211: +AM_V_texinfo = $(am__v_texinfo_@AM_V@)
212: +am__v_texinfo_ = $(am__v_texinfo_@AM_DEFAULT_V@)
213: +am__v_texinfo_0 = -q
214: +am__v_texinfo_1 =
215: +AM_V_texidevnull = $(am__v_texidevnull_@AM_V@)
216: +am__v_texidevnull_ = $(am__v_texidevnull_@AM_DEFAULT_V@)
217: +am__v_texidevnull_0 = > /dev/null
218: +am__v_texidevnull_1 =
219: +INFO_DEPS = $(srcdir)/lac
220: +am__TEXINFO_TEX_DIR = $(srcdir)
221: +DVIS = lac.dvi
222: +PDFS = lac.pdf
223: +PSS = lac.ps
224: +HTMLS = lac.html
225: +TEXINFOS = lac.texi
226: +TEXI2DVI = texi2dvi
227: +TEXI2PDF = $(TEXI2DVI) --pdf --batch
228: +MAKEINFOHTML = $(MAKEINFO) --html
229: +AM_MAKEINFOHTMLFLAGS = $(AM_MAKEINFOFLAGS)
230: +DVIPS = dvips
231: +am__can_run_installinfo = \
232: + case $$AM_UPDATE_INFO_DIR in \
233: + n|no|NO) false;; \
234: + *) (install-info --version) >/dev/null 2>&1;; \
235: + esac
236: +am__installdirs = "$(DESTDIR)$(infodir)"
237: +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
238: +am__vpath_adj = case $$p in \
239: + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
240: + *) f=$$p;; \
241: + esac;
242: +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
243: +am__install_max = 40
244: +am__nobase_strip_setup = \
245: + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
246: +am__nobase_strip = \
247: + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
248: +am__nobase_list = $(am__nobase_strip_setup); \
249: + for p in $$list; do echo "$$p $$p"; done | \
250: + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
251: + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
252: + if (++n[$$2] == $(am__install_max)) \
253: + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
254: + END { for (dir in files) print dir, files[dir] }'
255: +am__base_list = \
256: + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
257: + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
258: +am__uninstall_files_from_dir = { \
259: + test -z "$$files" \
260: + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
261: + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
262: + $(am__cd) "$$dir" && rm -f $$files; }; \
263: + }
264: +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
265: +am__DIST_COMMON = $(srcdir)/Makefile.in mdate-sh texinfo.tex
266: +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
267: +ACLOCAL = @ACLOCAL@
268: +ALLOCA = @ALLOCA@
269: +AMTAR = @AMTAR@
270: +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
271: +AR = @AR@
272: +AUTOCONF = @AUTOCONF@
273: +AUTOHEADER = @AUTOHEADER@
274: +AUTOMAKE = @AUTOMAKE@
275: +AWK = @AWK@
276: +BDW_GC_CFLAGS = @BDW_GC_CFLAGS@
277: +BDW_GC_LIBS = @BDW_GC_LIBS@
278: +CC = @CC@
279: +CCDEPMODE = @CCDEPMODE@
280: +CFLAGS = @CFLAGS@
281: +CPP = @CPP@
282: +CPPFLAGS = @CPPFLAGS@
283: +CYGPATH_W = @CYGPATH_W@
284: +DEFS = @DEFS@
285: +DEPDIR = @DEPDIR@
286: +DLLTOOL = @DLLTOOL@
287: +DSYMUTIL = @DSYMUTIL@
288: +DUMPBIN = @DUMPBIN@
289: +ECHO_C = @ECHO_C@
290: +ECHO_N = @ECHO_N@
291: +ECHO_T = @ECHO_T@
292: +EGREP = @EGREP@
293: +EXEEXT = @EXEEXT@
294: +FGREP = @FGREP@
295: +GREP = @GREP@
296: +HAVE_LIBSIGSEGV = @HAVE_LIBSIGSEGV@
297: +INSTALL = @INSTALL@
298: +INSTALL_DATA = @INSTALL_DATA@
299: +INSTALL_PROGRAM = @INSTALL_PROGRAM@
300: +INSTALL_SCRIPT = @INSTALL_SCRIPT@
301: +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
302: +LD = @LD@
303: +LDFLAGS = @LDFLAGS@
304: +LEX = @LEX@
305: +LEXLIB = @LEXLIB@
306: +LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@
307: +LIBOBJS = @LIBOBJS@
308: +LIBREADLINE = @LIBREADLINE@
309: +LIBS = @LIBS@
310: +LIBSIGSEGV = @LIBSIGSEGV@
311: +LIBSIGSEGV_PREFIX = @LIBSIGSEGV_PREFIX@
312: +LIBTOOL = @LIBTOOL@
313: +LIPO = @LIPO@
314: +LN_S = @LN_S@
315: +LTLIBOBJS = @LTLIBOBJS@
316: +LTLIBREADLINE = @LTLIBREADLINE@
317: +LTLIBSIGSEGV = @LTLIBSIGSEGV@
318: +LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
319: +MAKEINFO = @MAKEINFO@
320: +MANIFEST_TOOL = @MANIFEST_TOOL@
321: +MKDIR_P = @MKDIR_P@
322: +NM = @NM@
323: +NMEDIT = @NMEDIT@
324: +OBJDUMP = @OBJDUMP@
325: +OBJEXT = @OBJEXT@
326: +OTOOL = @OTOOL@
327: +OTOOL64 = @OTOOL64@
328: +PACKAGE = @PACKAGE@
329: +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
330: +PACKAGE_NAME = @PACKAGE_NAME@
331: +PACKAGE_STRING = @PACKAGE_STRING@
332: +PACKAGE_TARNAME = @PACKAGE_TARNAME@
333: +PACKAGE_URL = @PACKAGE_URL@
334: +PACKAGE_VERSION = @PACKAGE_VERSION@
335: +PATH_SEPARATOR = @PATH_SEPARATOR@
336: +PKG_CONFIG = @PKG_CONFIG@
337: +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
338: +PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
339: +RANLIB = @RANLIB@
340: +SED = @SED@
341: +SET_MAKE = @SET_MAKE@
342: +SHELL = @SHELL@
343: +STRIP = @STRIP@
344: +VERSION = @VERSION@
345: +YACC = @YACC@
346: +YFLAGS = @YFLAGS@
347: +abs_builddir = @abs_builddir@
348: +abs_srcdir = @abs_srcdir@
349: +abs_top_builddir = @abs_top_builddir@
350: +abs_top_srcdir = @abs_top_srcdir@
351: +ac_ct_AR = @ac_ct_AR@
352: +ac_ct_CC = @ac_ct_CC@
353: +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
354: +am__include = @am__include@
355: +am__leading_dot = @am__leading_dot@
356: +am__quote = @am__quote@
357: +am__tar = @am__tar@
358: +am__untar = @am__untar@
359: +bindir = @bindir@
360: +build = @build@
361: +build_alias = @build_alias@
362: +build_cpu = @build_cpu@
363: +build_os = @build_os@
364: +build_vendor = @build_vendor@
365: +builddir = @builddir@
366: +datadir = @datadir@
367: +datarootdir = @datarootdir@
368: +docdir = @docdir@
369: +dvidir = @dvidir@
370: +exec_prefix = @exec_prefix@
371: +host = @host@
372: +host_alias = @host_alias@
373: +host_cpu = @host_cpu@
374: +host_os = @host_os@
375: +host_vendor = @host_vendor@
376: +htmldir = @htmldir@
377: +includedir = @includedir@
378: +infodir = @infodir@
379: +install_sh = @install_sh@
380: +libdir = @libdir@
381: +libexecdir = @libexecdir@
382: +localedir = @localedir@
383: +localstatedir = @localstatedir@
384: +mandir = @mandir@
385: +mkdir_p = @mkdir_p@
386: +oldincludedir = @oldincludedir@
387: +pdfdir = @pdfdir@
388: +prefix = @prefix@
389: +program_transform_name = @program_transform_name@
390: +psdir = @psdir@
391: +sbindir = @sbindir@
392: +sharedstatedir = @sharedstatedir@
393: +srcdir = @srcdir@
394: +sysconfdir = @sysconfdir@
395: +target_alias = @target_alias@
396: +top_build_prefix = @top_build_prefix@
397: +top_builddir = @top_builddir@
398: +top_srcdir = @top_srcdir@
399: +info_TEXINFOS = lac.texi
400: +all: all-am
401: +
402: +.SUFFIXES:
403: +.SUFFIXES: .dvi .html .pdf .ps .texi
404: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
405: + @for dep in $?; do \
406: + case '$(am__configure_deps)' in \
407: + *$$dep*) \
408: + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
409: + && { if test -f $@; then exit 0; else break; fi; }; \
410: + exit 1;; \
411: + esac; \
412: + done; \
413: + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu docs/Makefile'; \
414: + $(am__cd) $(top_srcdir) && \
415: + $(AUTOMAKE) --gnu docs/Makefile
416: +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
417: + @case '$?' in \
418: + *config.status*) \
419: + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
420: + *) \
421: + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
422: + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
423: + esac;
424: +
425: +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
426: + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
427: +
428: +$(top_srcdir)/configure: $(am__configure_deps)
429: + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
430: +$(ACLOCAL_M4): $(am__aclocal_m4_deps)
431: + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
432: +$(am__aclocal_m4_deps):
433: +
434: +mostlyclean-libtool:
435: + -rm -f *.lo
436: +
437: +clean-libtool:
438: + -rm -rf .libs _libs
439: +
440: +$(srcdir)/lac: lac.texi $(srcdir)/version.texi
441: + $(AM_V_MAKEINFO)restore=: && backupdir="$(am__leading_dot)am$$$$" && \
442: + am__cwd=`pwd` && $(am__cd) $(srcdir) && \
443: + rm -rf $$backupdir && mkdir $$backupdir && \
444: + if ($(MAKEINFO) --version) >/dev/null 2>&1; then \
445: + for f in $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]; do \
446: + if test -f $$f; then mv $$f $$backupdir; restore=mv; else :; fi; \
447: + done; \
448: + else :; fi && \
449: + cd "$$am__cwd"; \
450: + if $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \
451: + -o $@ $(srcdir)/lac.texi; \
452: + then \
453: + rc=0; \
454: + $(am__cd) $(srcdir); \
455: + else \
456: + rc=$$?; \
457: + $(am__cd) $(srcdir) && \
458: + $$restore $$backupdir/* `echo "./$@" | sed 's|[^/]*$$||'`; \
459: + fi; \
460: + rm -rf $$backupdir; exit $$rc
461: +
462: +.texi.dvi:
463: + $(AM_V_TEXI2DVI)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
464: + MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \
465: + $(TEXI2DVI) $(AM_V_texinfo) --build-dir=$(@:.dvi=.t2d) -o $@ $(AM_V_texidevnull) \
466: + $<
467: +
468: +.texi.pdf:
469: + $(AM_V_TEXI2PDF)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
470: + MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \
471: + $(TEXI2PDF) $(AM_V_texinfo) --build-dir=$(@:.pdf=.t2p) -o $@ $(AM_V_texidevnull) \
472: + $<
473: +
474: +.texi.html:
475: + $(AM_V_MAKEINFO)rm -rf $(@:.html=.htp)
476: + $(AM_V_at)if $(MAKEINFOHTML) $(AM_MAKEINFOHTMLFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \
477: + -o $(@:.html=.htp) $<; \
478: + then \
479: + rm -rf $@ && mv $(@:.html=.htp) $@; \
480: + else \
481: + rm -rf $(@:.html=.htp); exit 1; \
482: + fi
483: +lac.dvi: lac.texi $(srcdir)/version.texi
484: +lac.pdf: lac.texi $(srcdir)/version.texi
485: +lac.html: lac.texi $(srcdir)/version.texi
486: +$(srcdir)/version.texi: $(srcdir)/stamp-vti
487: +$(srcdir)/stamp-vti: lac.texi $(top_srcdir)/configure
488: + @(dir=.; test -f ./lac.texi || dir=$(srcdir); \
489: + set `$(SHELL) $(srcdir)/mdate-sh $$dir/lac.texi`; \
490: + echo "@set UPDATED $$1 $$2 $$3"; \
491: + echo "@set UPDATED-MONTH $$2 $$3"; \
492: + echo "@set EDITION $(VERSION)"; \
493: + echo "@set VERSION $(VERSION)") > vti.tmp$$$$ && \
494: + (cmp -s vti.tmp$$$$ $(srcdir)/version.texi \
495: + || (echo "Updating $(srcdir)/version.texi" && \
496: + cp vti.tmp$$$$ $(srcdir)/version.texi.tmp$$$$ && \
497: + mv $(srcdir)/version.texi.tmp$$$$ $(srcdir)/version.texi)) && \
498: + rm -f vti.tmp$$$$ $(srcdir)/version.texi.$$$$
499: + @cp $(srcdir)/version.texi $@
500: +
501: +mostlyclean-vti:
502: + -rm -f vti.tmp* $(srcdir)/version.texi.tmp*
503: +
504: +maintainer-clean-vti:
505: + -rm -f $(srcdir)/stamp-vti $(srcdir)/version.texi
506: +.dvi.ps:
507: + $(AM_V_DVIPS)TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
508: + $(DVIPS) $(AM_V_texinfo) -o $@ $<
509: +
510: +uninstall-dvi-am:
511: + @$(NORMAL_UNINSTALL)
512: + @list='$(DVIS)'; test -n "$(dvidir)" || list=; \
513: + for p in $$list; do \
514: + $(am__strip_dir) \
515: + echo " rm -f '$(DESTDIR)$(dvidir)/$$f'"; \
516: + rm -f "$(DESTDIR)$(dvidir)/$$f"; \
517: + done
518: +
519: +uninstall-html-am:
520: + @$(NORMAL_UNINSTALL)
521: + @list='$(HTMLS)'; test -n "$(htmldir)" || list=; \
522: + for p in $$list; do \
523: + $(am__strip_dir) \
524: + echo " rm -rf '$(DESTDIR)$(htmldir)/$$f'"; \
525: + rm -rf "$(DESTDIR)$(htmldir)/$$f"; \
526: + done
527: +
528: +uninstall-info-am:
529: + @$(PRE_UNINSTALL)
530: + @if test -d '$(DESTDIR)$(infodir)' && $(am__can_run_installinfo); then \
531: + list='$(INFO_DEPS)'; \
532: + for file in $$list; do \
533: + relfile=`echo "$$file" | sed 's|^.*/||'`; \
534: + echo " install-info --info-dir='$(DESTDIR)$(infodir)' --remove '$(DESTDIR)$(infodir)/$$relfile'"; \
535: + if install-info --info-dir="$(DESTDIR)$(infodir)" --remove "$(DESTDIR)$(infodir)/$$relfile"; \
536: + then :; else test ! -f "$(DESTDIR)$(infodir)/$$relfile" || exit 1; fi; \
537: + done; \
538: + else :; fi
539: + @$(NORMAL_UNINSTALL)
540: + @list='$(INFO_DEPS)'; \
541: + for file in $$list; do \
542: + relfile=`echo "$$file" | sed 's|^.*/||'`; \
543: + relfile_i=`echo "$$relfile" | sed 's|\.info$$||;s|$$|.i|'`; \
544: + (if test -d "$(DESTDIR)$(infodir)" && cd "$(DESTDIR)$(infodir)"; then \
545: + echo " cd '$(DESTDIR)$(infodir)' && rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]"; \
546: + rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]; \
547: + else :; fi); \
548: + done
549: +
550: +uninstall-pdf-am:
551: + @$(NORMAL_UNINSTALL)
552: + @list='$(PDFS)'; test -n "$(pdfdir)" || list=; \
553: + for p in $$list; do \
554: + $(am__strip_dir) \
555: + echo " rm -f '$(DESTDIR)$(pdfdir)/$$f'"; \
556: + rm -f "$(DESTDIR)$(pdfdir)/$$f"; \
557: + done
558: +
559: +uninstall-ps-am:
560: + @$(NORMAL_UNINSTALL)
561: + @list='$(PSS)'; test -n "$(psdir)" || list=; \
562: + for p in $$list; do \
563: + $(am__strip_dir) \
564: + echo " rm -f '$(DESTDIR)$(psdir)/$$f'"; \
565: + rm -f "$(DESTDIR)$(psdir)/$$f"; \
566: + done
567: +
568: +dist-info: $(INFO_DEPS)
569: + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
570: + list='$(INFO_DEPS)'; \
571: + for base in $$list; do \
572: + case $$base in \
573: + $(srcdir)/*) base=`echo "$$base" | sed "s|^$$srcdirstrip/||"`;; \
574: + esac; \
575: + if test -f $$base; then d=.; else d=$(srcdir); fi; \
576: + base_i=`echo "$$base" | sed 's|\.info$$||;s|$$|.i|'`; \
577: + for file in $$d/$$base $$d/$$base-[0-9] $$d/$$base-[0-9][0-9] $$d/$$base_i[0-9] $$d/$$base_i[0-9][0-9]; do \
578: + if test -f $$file; then \
579: + relfile=`expr "$$file" : "$$d/\(.*\)"`; \
580: + test -f "$(distdir)/$$relfile" || \
581: + cp -p $$file "$(distdir)/$$relfile"; \
582: + else :; fi; \
583: + done; \
584: + done
585: +
586: +mostlyclean-aminfo:
587: + -rm -rf lac.t2d lac.t2p
588: +
589: +clean-aminfo:
590: + -test -z "lac.dvi lac.pdf lac.ps lac.html" \
591: + || rm -rf lac.dvi lac.pdf lac.ps lac.html
592: +
593: +maintainer-clean-aminfo:
594: + @list='$(INFO_DEPS)'; for i in $$list; do \
595: + i_i=`echo "$$i" | sed 's|\.info$$||;s|$$|.i|'`; \
596: + echo " rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]"; \
597: + rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]; \
598: + done
599: +tags TAGS:
600: +
601: +ctags CTAGS:
602: +
603: +cscope cscopelist:
604: +
605: +
606: +distdir: $(DISTFILES)
607: + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
608: + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
609: + list='$(DISTFILES)'; \
610: + dist_files=`for file in $$list; do echo $$file; done | \
611: + sed -e "s|^$$srcdirstrip/||;t" \
612: + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
613: + case $$dist_files in \
614: + */*) $(MKDIR_P) `echo "$$dist_files" | \
615: + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
616: + sort -u` ;; \
617: + esac; \
618: + for file in $$dist_files; do \
619: + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
620: + if test -d $$d/$$file; then \
621: + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
622: + if test -d "$(distdir)/$$file"; then \
623: + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
624: + fi; \
625: + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
626: + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
627: + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
628: + fi; \
629: + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
630: + else \
631: + test -f "$(distdir)/$$file" \
632: + || cp -p $$d/$$file "$(distdir)/$$file" \
633: + || exit 1; \
634: + fi; \
635: + done
636: + $(MAKE) $(AM_MAKEFLAGS) \
637: + top_distdir="$(top_distdir)" distdir="$(distdir)" \
638: + dist-info
639: +check-am: all-am
640: +check: check-am
641: +all-am: Makefile $(INFO_DEPS)
642: +installdirs:
643: + for dir in "$(DESTDIR)$(infodir)"; do \
644: + test -z "$$dir" || $(MKDIR_P) "$$dir"; \
645: + done
646: +install: install-am
647: +install-exec: install-exec-am
648: +install-data: install-data-am
649: +uninstall: uninstall-am
650: +
651: +install-am: all-am
652: + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
653: +
654: +installcheck: installcheck-am
655: +install-strip:
656: + if test -z '$(STRIP)'; then \
657: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
658: + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
659: + install; \
660: + else \
661: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
662: + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
663: + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
664: + fi
665: +mostlyclean-generic:
666: +
667: +clean-generic:
668: +
669: +distclean-generic:
670: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
671: + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
672: +
673: +maintainer-clean-generic:
674: + @echo "This command is intended for maintainers to use"
675: + @echo "it deletes files that may require special tools to rebuild."
676: +clean: clean-am
677: +
678: +clean-am: clean-aminfo clean-generic clean-libtool mostlyclean-am
679: +
680: +distclean: distclean-am
681: + -rm -f Makefile
682: +distclean-am: clean-am distclean-generic
683: +
684: +dvi: dvi-am
685: +
686: +dvi-am: $(DVIS)
687: +
688: +html: html-am
689: +
690: +html-am: $(HTMLS)
691: +
692: +info: info-am
693: +
694: +info-am: $(INFO_DEPS)
695: +
696: +install-data-am: install-info-am
697: +
698: +install-dvi: install-dvi-am
699: +
700: +install-dvi-am: $(DVIS)
701: + @$(NORMAL_INSTALL)
702: + @list='$(DVIS)'; test -n "$(dvidir)" || list=; \
703: + if test -n "$$list"; then \
704: + echo " $(MKDIR_P) '$(DESTDIR)$(dvidir)'"; \
705: + $(MKDIR_P) "$(DESTDIR)$(dvidir)" || exit 1; \
706: + fi; \
707: + for p in $$list; do \
708: + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
709: + echo "$$d$$p"; \
710: + done | $(am__base_list) | \
711: + while read files; do \
712: + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(dvidir)'"; \
713: + $(INSTALL_DATA) $$files "$(DESTDIR)$(dvidir)" || exit $$?; \
714: + done
715: +install-exec-am:
716: +
717: +install-html: install-html-am
718: +
719: +install-html-am: $(HTMLS)
720: + @$(NORMAL_INSTALL)
721: + @list='$(HTMLS)'; list2=; test -n "$(htmldir)" || list=; \
722: + if test -n "$$list"; then \
723: + echo " $(MKDIR_P) '$(DESTDIR)$(htmldir)'"; \
724: + $(MKDIR_P) "$(DESTDIR)$(htmldir)" || exit 1; \
725: + fi; \
726: + for p in $$list; do \
727: + if test -f "$$p" || test -d "$$p"; then d=; else d="$(srcdir)/"; fi; \
728: + $(am__strip_dir) \
729: + d2=$$d$$p; \
730: + if test -d "$$d2"; then \
731: + echo " $(MKDIR_P) '$(DESTDIR)$(htmldir)/$$f'"; \
732: + $(MKDIR_P) "$(DESTDIR)$(htmldir)/$$f" || exit 1; \
733: + echo " $(INSTALL_DATA) '$$d2'/* '$(DESTDIR)$(htmldir)/$$f'"; \
734: + $(INSTALL_DATA) "$$d2"/* "$(DESTDIR)$(htmldir)/$$f" || exit $$?; \
735: + else \
736: + list2="$$list2 $$d2"; \
737: + fi; \
738: + done; \
739: + test -z "$$list2" || { echo "$$list2" | $(am__base_list) | \
740: + while read files; do \
741: + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(htmldir)'"; \
742: + $(INSTALL_DATA) $$files "$(DESTDIR)$(htmldir)" || exit $$?; \
743: + done; }
744: +install-info: install-info-am
745: +
746: +install-info-am: $(INFO_DEPS)
747: + @$(NORMAL_INSTALL)
748: + @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
749: + list='$(INFO_DEPS)'; test -n "$(infodir)" || list=; \
750: + if test -n "$$list"; then \
751: + echo " $(MKDIR_P) '$(DESTDIR)$(infodir)'"; \
752: + $(MKDIR_P) "$(DESTDIR)$(infodir)" || exit 1; \
753: + fi; \
754: + for file in $$list; do \
755: + case $$file in \
756: + $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
757: + esac; \
758: + if test -f $$file; then d=.; else d=$(srcdir); fi; \
759: + file_i=`echo "$$file" | sed 's|\.info$$||;s|$$|.i|'`; \
760: + for ifile in $$d/$$file $$d/$$file-[0-9] $$d/$$file-[0-9][0-9] \
761: + $$d/$$file_i[0-9] $$d/$$file_i[0-9][0-9] ; do \
762: + if test -f $$ifile; then \
763: + echo "$$ifile"; \
764: + else : ; fi; \
765: + done; \
766: + done | $(am__base_list) | \
767: + while read files; do \
768: + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(infodir)'"; \
769: + $(INSTALL_DATA) $$files "$(DESTDIR)$(infodir)" || exit $$?; done
770: + @$(POST_INSTALL)
771: + @if $(am__can_run_installinfo); then \
772: + list='$(INFO_DEPS)'; test -n "$(infodir)" || list=; \
773: + for file in $$list; do \
774: + relfile=`echo "$$file" | sed 's|^.*/||'`; \
775: + echo " install-info --info-dir='$(DESTDIR)$(infodir)' '$(DESTDIR)$(infodir)/$$relfile'";\
776: + install-info --info-dir="$(DESTDIR)$(infodir)" "$(DESTDIR)$(infodir)/$$relfile" || :;\
777: + done; \
778: + else : ; fi
779: +install-man:
780: +
781: +install-pdf: install-pdf-am
782: +
783: +install-pdf-am: $(PDFS)
784: + @$(NORMAL_INSTALL)
785: + @list='$(PDFS)'; test -n "$(pdfdir)" || list=; \
786: + if test -n "$$list"; then \
787: + echo " $(MKDIR_P) '$(DESTDIR)$(pdfdir)'"; \
788: + $(MKDIR_P) "$(DESTDIR)$(pdfdir)" || exit 1; \
789: + fi; \
790: + for p in $$list; do \
791: + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
792: + echo "$$d$$p"; \
793: + done | $(am__base_list) | \
794: + while read files; do \
795: + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(pdfdir)'"; \
796: + $(INSTALL_DATA) $$files "$(DESTDIR)$(pdfdir)" || exit $$?; done
797: +install-ps: install-ps-am
798: +
799: +install-ps-am: $(PSS)
800: + @$(NORMAL_INSTALL)
801: + @list='$(PSS)'; test -n "$(psdir)" || list=; \
802: + if test -n "$$list"; then \
803: + echo " $(MKDIR_P) '$(DESTDIR)$(psdir)'"; \
804: + $(MKDIR_P) "$(DESTDIR)$(psdir)" || exit 1; \
805: + fi; \
806: + for p in $$list; do \
807: + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
808: + echo "$$d$$p"; \
809: + done | $(am__base_list) | \
810: + while read files; do \
811: + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(psdir)'"; \
812: + $(INSTALL_DATA) $$files "$(DESTDIR)$(psdir)" || exit $$?; done
813: +installcheck-am:
814: +
815: +maintainer-clean: maintainer-clean-am
816: + -rm -f Makefile
817: +maintainer-clean-am: distclean-am maintainer-clean-aminfo \
818: + maintainer-clean-generic maintainer-clean-vti
819: +
820: +mostlyclean: mostlyclean-am
821: +
822: +mostlyclean-am: mostlyclean-aminfo mostlyclean-generic \
823: + mostlyclean-libtool mostlyclean-vti
824: +
825: +pdf: pdf-am
826: +
827: +pdf-am: $(PDFS)
828: +
829: +ps: ps-am
830: +
831: +ps-am: $(PSS)
832: +
833: +uninstall-am: uninstall-dvi-am uninstall-html-am uninstall-info-am \
834: + uninstall-pdf-am uninstall-ps-am
835: +
836: +.MAKE: install-am install-strip
837: +
838: +.PHONY: all all-am check check-am clean clean-aminfo clean-generic \
839: + clean-libtool cscopelist-am ctags-am dist-info distclean \
840: + distclean-generic distclean-libtool distdir dvi dvi-am html \
841: + html-am info info-am install install-am install-data \
842: + install-data-am install-dvi install-dvi-am install-exec \
843: + install-exec-am install-html install-html-am install-info \
844: + install-info-am install-man install-pdf install-pdf-am \
845: + install-ps install-ps-am install-strip installcheck \
846: + installcheck-am installdirs maintainer-clean \
847: + maintainer-clean-aminfo maintainer-clean-generic \
848: + maintainer-clean-vti mostlyclean mostlyclean-aminfo \
849: + mostlyclean-generic mostlyclean-libtool mostlyclean-vti pdf \
850: + pdf-am ps ps-am tags-am uninstall uninstall-am \
851: + uninstall-dvi-am uninstall-html-am uninstall-info-am \
852: + uninstall-pdf-am uninstall-ps-am
853: +
854: +.PRECIOUS: Makefile
855: +
856: +
857: +# Tell versions [3.59,3.63) of GNU make to not export all variables.
858: +# Otherwise a system limit (for SysV at least) may be exceeded.
859: +.NOEXPORT:
860: diff --git a/docs/lac.texi b/docs/lac.texi
861: new file mode 100644
862: index 0000000..c0e377a
863: --- /dev/null
864: +++ b/docs/lac.texi
865: @@ -0,0 +1,319 @@
866: +\input texinfo
867: +@setfilename lac
868: +@comment $Id@w{$}
869: +@comment %**start of header
870: +@include version.texi
871: +@settitle The LAC LISP Library Manual
872: +@syncodeindex pg cp
873: +@comment %**end of header
874: +
875: +@copying
876: +This manual is for the LAC LISP Library (version @value{VERSION}).
877: +
878: +Copyright @copyright{} 2017 Gianluca Guida
879: +@quotation
880: +Permission is granted to copy, distribute and/or modify this document
881: +under the terms of the GNU Free Documentation License, Version 1.3 or
882: +any later version published by the Free Software Foundation; with no
883: +Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
884: +Texts. A copy of the license is included in the section entitled
885: +``GNU Free Documentation License''.
886: +@end quotation
887: +@end copying
888: +
889: +@dircategory Texinfo documentation system
890: +@direntry
891: +* lac: (lac)The LAC LISP Library.
892: +@end direntry
893: +
894: +@titlepage
895: +@title The LAC LISP Library Manual
896: +@subtitle for version @value{VERSION}.
897: +@author Gianluca Guida
898: +@page
899: +@vskip 0pt plus 1filll
900: +@insertcopying
901: +@end titlepage
902: +
903: +@contents
904: +
905: +@ifnottex
906: +@node Top
907: +@top The LAC LISP Library Manual
908: +
909: +
910: +This manual is for the LAC LISP Library (version @value{VERSION}.
911: +@end ifnottex
912: +
913: +@menu
914: +* Introduction::
915: +* Using LAC::
916: +* The LAC Language::
917: +* The LAC Library::
918: +* Extending the language::
919: +* Adding LAC to your program::
920: +* GNU Free Documentation License::
921: +* Index::
922: +@end menu
923: +
924: +@node Introduction
925: +@chapter Introduction
926: +@cindex Introduction
927: +
928: +This manual is an introduction and a reference for the LAC LISP
929: +Library (LAC hereinafter).
930: +
931: +LAC is a simple LISP implementation. Its interpreter is meant be
932: +embedded in your application (@pxref{Adding LAC to your program}).
933: +
934: +LAC is also extensible: you can add new atom types and execute your
935: +own functions written in lower level, compiled languages
936: +(@pxref{Extending the language}).
937: +
938: +For more information about the language itself, @pxref{The LAC Language}.
939: +
940: +@node Using LAC
941: +@chapter Using LAC
942: +@cindex LAC, Using
943: +
944: +LAC is a library that implements a LISP interpreter with a system
945: +library that contains many useful functions to handle lists, symbols
946: +and integers.
947: +
948: +The interpreter itself can be extended to add features, and this is
949: +the real power of LAC.
950: +
951: +The rest of the chapter will introduce two common ways of using LAC:
952: +@i{@acronym{REPL} extension} and @i{embedding}.
953: +The difference between the two is that in the former the
954: +interpreter has control of the application, while in the latter the
955: +LISP interpreter can be called at will by the application to execute
956: +commands.
957: +
958: +Please note that this chapter is just introductory. For a more in-depth discussion of the topic, @pxref{Adding LAC to your program}.
959: +
960: +@menu
961: +* REPL Extension::
962: +* Embedding LAC::
963: +@end menu
964: +
965: +@node REPL Extension
966: +@section REPL Extension
967: +
968: +Suppose you have a low-level library that implements some features in
969: +a specific domain, and you need a language capable of using those
970: +features to create small scripts, write prototypes, explore the
971: +library capabilities.
972: +
973: +What you can do is to first use LAC to create a @acronym{REPL}
974: +@footnote{@acronym{REPL} stands for @i{Read}, @i{Eval}, @i{Print
975: +Loop}. It is used to describe the core functionality of an
976: +interpreter: reading an input, evaluating the value of the input and
977: +printing the calculated output value.} and then extend the LAC
978: +language with elements from your library.
979: +
980: +@subsection Writing a REPL for LAC
981: +
982: +Writing a @acronym{REPL} in LAC is extremely simple. The C program in
983: +@ref{repl basic code} produces an interactive command line
984: +@acronym{REPL} capable of executing LAC statements, e.g.:
985: +
986: +
987: +@example
988: +LAC>(+ 2 2)
989: +4
990: +@end example
991: +
992: +
993: +This will be essentially an interpreter for a basic LISP-like
994: +language, and you will be able to do integer, list and
995: +symbol processing with ease. You will also be able to create macros to
996: +extend the language to your needs. @xref{The LAC Language}.
997: +
998: +@float Figure, repl basic code
999: +@caption{A simple REPL for the LAC library}
1000: +@smallexample
1001: +@verbatim
1002: +#include <stdio.h>
1003: +#include <readline/readline.h>
1004: +#include <lac.h>
1005: +
1006: +int main (int argc, char *argv[])
1007: +{
1008: + lenv_t *null_env;
1009: +
1010: + /* Initialize LAC (create NULL environment) */
1011: + null_env = lac_init();
1012: + if (null_env == NULL)
1013: + {
1014: + fprintf(stderr, "Could not initialize lac");
1015: + return -1;
1016: + }
1017: +
1018: + /* REPL loop. */
1019: + while (1)
1020: + {
1021: + char *buf;
1022: + lreg_t res;
1023: +
1024: + /* Read an input line */
1025: + buf = readline ("LAC>");
1026: + if (buf == NULL)
1027: + break;
1028: +
1029: + /* Evaluate S-Expressions. */
1030: + res = sexpr_eval_string (buf, null_env);
1031: +
1032: + /* Print the result */
1033: + sexpr_fprint(stdout, res);
1034: + printf("\n");
1035: + }
1036: +
1037: + /* Exit REPL */
1038: + return 0;
1039: +}
1040: +@end verbatim
1041: +@end smallexample
1042: +@end float
1043: +
1044: +
1045: +@subsection Extending the interpreter
1046: +
1047: +The usefulness of LAC emerges when you add support for your own
1048: +libraries to this language, and you can do this in two ways: adding
1049: +@i{Native Procedures} and @i{Atom Types}.
1050: +
1051: +@subsubsection Native Procedures
1052: +
1053: +Procedures in LISP-like languages are similar to what functions are
1054: +in C. There are some major differences with C functions, for example
1055: +in LAC procedures are @i{first-class functions}@footnote{This
1056: +essentially means that a procedure (and its scope) can be treated as a
1057: +value, passed as a parameter and returned by another procedure} and
1058: +that they can be defined and modified at runtime.
1059: +
1060: +A @i{Native Procedure} is a procedure written in a low level language,
1061: +opaque to the interpreter (cannot be inspected or changed). LAC
1062: +defines a standard C interface for the @i{low-level procedures}, and
1063: +functions to hook this function to symbols in the LISP machine.
1064: +
1065: +Let's clarify the previous sentence with an example: the following C function is a @i{Native Procedure}.
1066: +
1067: +@sp 1
1068: +@example
1069: +@verbatim
1070: +LAC_API static lreg_t
1071: +proc_hello (lreg_t args, lenv_t * argenv, lenv_t * env)
1072: +{
1073: + fprintf(stdout, "Hello, World!");
1074: + return NIL;
1075: +}
1076: +@end verbatim
1077: +@end example
1078: +@sp 1
1079: +
1080: +It is a simple procedure that, ignoring all arguments passed, will
1081: +always print to standard output the string ``Hello, World!'', and
1082: +return the empty value NIL.
1083: +
1084: +LAC_API is mostly needed to tell the compiler to follow certain rules
1085: +(mostly alignment) that will ensure that it can be processed
1086: +internally by the interpreter.
1087: +
1088: +Adding this line to the code in @ref{repl basic code} is not enough though to access it. We need to associate this function to a symbol, and this is called @i{registering}.
1089: +
1090: +@sp 1
1091: +@example
1092: +@verbatim
1093: +/* PRE: lac_init() has already been
1094: + called, and has returned null_env. */
1095: +lac_extproc_register (null_env, "hello", proc_hello);
1096: +@end verbatim
1097: +@end example
1098: +@sp 1
1099: +
1100: +This will hook the procedure defined above to the symbol @i{HELLO}. If
1101: +we add to our code and run the @acronym{REPL} again, we will have a new
1102: +command available in our interpreter. Note that symbols are case
1103: +insensitive.
1104: +
1105: +@sp 1
1106: +@example
1107: +LAC>HELLO
1108: +<#LLPROC>
1109: +LAC>(HELLO)
1110: +Hello, World!()
1111: +LAC>(hello)
1112: +Hello, World!()
1113: +LAC>
1114: +@end example
1115: +@sp 1
1116: +
1117: +The function, as you can see above, first prints out to the screen the
1118: +word ``Hello, World!'', and then returns, NIL, the void value of LISP,
1119: +which is also the empty list, and this gets printed by the @i{Print}
1120: +phase of the @acronym{REPL} as @code{()}.
1121: +
1122: +To complete the example, we can change @code{proc_hello} to return a
1123: +string instead of printing it to screen directly:
1124: +@sp 1
1125: +@example
1126: +@verbatim
1127: +LAC_API static lreg_t
1128: +proc_hello(lreg_t args, lenv_t * argenv, lenv_t * env)
1129: +{
1130: + return lac_string_box("Hello, World!");
1131: +}
1132: +@end verbatim
1133: +@end example
1134: +@sp 1
1135: +If we register the above function, the @acronym{REPL} will return a string @i{atom}:
1136: +@sp 1
1137: +@example
1138: +LAC>(hello)
1139: +"Hello, World!"
1140: +LAC>
1141: +@end example
1142: +
1143: +@subsubsection Adding Atom Types
1144: +
1145: +
1146: +@node Embedding LAC
1147: +@section Embedding LAC
1148: +
1149: +@node The LAC Language
1150: +@chapter The LAC Language
1151: +@cindex The LAC Language
1152: +@cindex LAC, the language
1153: +
1154: +@menu
1155: +* The LAC System Library::
1156: +@end menu
1157: +
1158: +@node The LAC System Library
1159: +@section The LAC System Library
1160: +@cindex LAC System Library
1161: +
1162: +@node The LAC Library
1163: +@chapter The LAC Library
1164: +@cindex The LAC Library
1165: +@cindex LAC, the library
1166: +
1167: +@node Extending the language
1168: +@chapter Extending the language
1169: +@cindex Extending the language
1170: +@cindex LAC, extending the language
1171: +
1172: +@node Adding LAC to your program
1173: +@chapter Adding LAC to your program
1174: +@cindex Adding LAC to your program
1175: +@cindex LAC, adding to your program
1176: +
1177: +@node GNU Free Documentation License
1178: +@chapter GNU Free Documentation License
1179: +
1180: +
1181: +@node Index
1182: +@unnumbered Index
1183: +@printindex cp
1184: +@bye