Next: Introduction, Previous: (dir), Up: (dir) [Contents][Index]
This is the with-c-syntax Reference Manual, generated automatically by Declt version 4.0 beta 2 "William Riker" on Mon Aug 15 06:11:38 2022 GMT+0.
Next: Systems, Previous: The with-c-syntax Reference Manual, Up: The with-c-syntax Reference Manual [Contents][Index]
# -*- mode: org; coding: utf-8; -*- * Abstract *with-c-syntax* is a fun package which introduces the C language syntax into Common Lisp. (Yes, this package is not for practical coding, I think.) At this stage, this package has all features of ISO C 90 freestanding implementation. * News ** 2021-9-5 C Preprocessor is added. See examples below. ** 2021-5-24 C Numeric Literals are added. (Inspired by [[https://github.com/akanouras][@akanouras]]. See [[https://github.com/y2q-actionman/with-c-syntax/pull/7][PR #7]].) Hexadecimal floating number syntax may be a only practical feature of this package. (Try =#{ 0x1.fffp+1; }#=) ** 2019-4-25 - Some special handlings around =++=, =*=, etc are added. The *Duff's Device* example becomes prettier. - Added a new example, *C in Lisp in C in Lisp*. (+unholy mixture..+) * Examples ** Hello, World #+BEGIN_SRC lisp CL-USER> (with-c-syntax:with-c-syntax () format \( t \, "Hello World!" \) \; ) Hello World! NIL #+END_SRC For suppressing Lisp's syntax, you need many backslash escapes. ~#{~ and ~}#~ reader macro escapes them and wrap its contents into ~with-c-syntax~. You can use it to write simply: #+BEGIN_SRC lisp ;; enables #{ }# reader macros. CL-USER> (named-readtables:in-readtable with-c-syntax:with-c-syntax-readtable) ... CL-USER> #{ format (t, "Hello World!"); }# Hello World! NIL #+END_SRC This example shows you can call a Lisp function (~cl:format~) with C syntax. ** Inline usage. This macro can be used like a normal lisp expression. You can use it whenever C-like syntax is wanted. #+begin_src lisp (named-readtables:in-readtable with-c-syntax:with-c-syntax-readtable) (assert (= 100 #{ 98 - 76 + 54 + 3 + 21 }#)) ; => T ;;; Reader macro parameter '2' means to split C operators even inside Lisp symbols. (assert #2{ 1+2+3-4+5+6+78+9 == 100 }#) ; => T #+end_src Because this macro supports C numeric literals, Using hexadecimal floating number syntax may be a only practical feature of this package. #+begin_src lisp (named-readtables:in-readtable with-c-syntax:with-c-syntax-readtable) (princ #{ 0x1.fffp+1 }#) ;; => 3.99951171875d0 #+end_src ** Summing from 1 to 100. #+BEGIN_SRC lisp (named-readtables:in-readtable with-c-syntax:with-c-syntax-readtable) #{ int i, sum = 0; for (i = 0; i <= 100; ++i) sum += i; return sum; }# ;; => 5050 #+END_SRC ** Using C syntax inside a Lisp function. #+BEGIN_SRC lisp (named-readtables:in-readtable with-c-syntax:with-c-syntax-readtable) (defun array-transpose (arr) (destructuring-bind (i-max j-max) (array-dimensions arr) #{ int i,j; for (i = 0; i < i-max; i++) { for (j = i + 1; j < j-max; j++) { rotatef(arr[i][j], arr[j][i]); } } }#) arr) (array-transpose (make-array '(3 3) :initial-contents '((0 1 2) (3 4 5) (6 7 8)))) ; => #2A((0 3 6) (1 4 7) (2 5 8)) #+END_SRC ** Defining a function with C syntax. #+BEGIN_SRC lisp (named-readtables:in-readtable with-c-syntax:with-c-syntax-readtable) #{ int sum-of-list (list) { int list-length = length(list); int i, ret = 0; for (i = 0; i < list-length; ++i) { ret += nth(i, list); } return ret; } }# (sum-of-list '(1 2 3 4 5 6 7 8 9 10)) ; => 55 #+END_SRC ** Duff's Device #+BEGIN_SRC lisp (named-readtables:in-readtable with-c-syntax:with-c-syntax-readtable) (defun wcs-duff-device (to-seq from-seq cnt) #{ int *to = &to-seq; int *from = &from-seq; int n = (cnt + 7) / 8; n = floor(n); /* Lisp's CL:/ produces rational */ switch (cnt % 8) { case 0 : do { *to++ = *from++; case 7 : *to++ = *from++; case 6 : *to++ = *from++; case 5 : *to++ = *from++; case 4 : *to++ = *from++; case 3 : *to++ = *from++; case 2 : *to++ = *from++; case 1 : *to++ = *from++; } while (--n > 0); } }# to-seq) (defparameter *array-1* (make-array 20 :initial-element 1)) ;; C syntax can also be used for defining a variable. #{ int *array-2* [] = {2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2}; }# (wcs-duff-device *array-1* *array-2* 10) (print *array-1*) ;; => #(2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1) #+END_SRC This example shows some C operators (=++=, =--=, unary =*= and =&=) behave as you expected as possible. (This feature is based on [[https://github.com/phoe][@phoe]]'s suggestion. See [[https://github.com/y2q-actionman/with-c-syntax/issues/2][Issue #2]] .) ** C in Lisp in C in Lisp Sometimes you want to use the Lisp syntax even in =with-c-syntax=. If you feel so, you can use =`= as an escape. Here is an example: #+BEGIN_SRC lisp (named-readtables:in-readtable with-c-syntax:with-c-syntax-readtable) #{ void 99-bottles-of-beer (filename) { void * output-path = merge-pathnames (filename, user-homedir-pathname()); `(with-open-file (*standard-output* output-path :direction :output :if-exists :supersede :if-does-not-exist :create) #{ int b; for (b = 99; b >= 0; b--) { switch (b) { case 0 : write-line("No more bottles of beer on the wall, no more bottles of beer."); write-line("Go to the store and buy some more, 99 bottles of beer on the wall."); break; case 1 : write-line("1 bottle of beer on the wall, 1 bottle of beer."); write-line("Take one down and pass it around, no more bottles of beer on the wall."); break; default : format(t, "~D bottles of beer on the wall, ~D bottles of beer.~%", b, b); format(t, "Take one down and pass it around, ~D ~A of beer on the wall.~%" , b - 1 , ((b - 1) > 1)? "bottles" : "bottle"); break; } } }#); return; } }# (99-bottles-of-beer "99_bottles_of_beer.txt") (probe-file "~/99_bottles_of_beer.txt") ; => T #+END_SRC This example creates "99_bottles_of_beer.txt" file into your home directory. I used =`= for using =with-open-file= in Lisp syntax. (You can use any Lisp operators including =with-open-file= in =with-c-syntax= style. However it looks very weird; [[https://github.com/y2q-actionman/with-c-syntax/blob/e3e9ae2f1f29115f30141e3ada33372e2ce6b65d/test/libc_string.lisp#L143][An example exists in my test code]].) ** C Preprocessor *** C Macros =#define= can be used. This is a well-known MAX macro example. #+begin_src lisp (named-readtables:in-readtable with-c-syntax:with-c-syntax-readtable) #{ #define MY_MAX(x, y) ((x)>(y) ? (x) : (y)) int my-max-test (x, y) { return MY_MAX (x, y); } }# (my-max-test -1 1) ; => 1 #+end_src But you know Common Lisp already has [[http://www.lispworks.com/documentation/HyperSpec/Body/f_max_m.htm][CL:MAX]]. We can use it directly: #+begin_src lisp (named-readtables:in-readtable with-c-syntax:with-c-syntax-readtable) #{ #define MY_CL_MAX(x, ...) cl:max(x, __VA_ARGS__) int my-cl-max-test (x, y, z) { return MY_CL_MAX (x, y, z); } }# (my-cl-max-test -1 9999 0) ; => 1 #+end_src =#= (stringify) and =##= (concatenate) operator can be used, but only in Level 2 syntax (because it conflicts with standard Lisp '#' syntax.) #+begin_src lisp (named-readtables:in-readtable with-c-syntax:with-c-syntax-readtable) (string= "1.2" #2{ #define STR(x) #x #define EXPAND_STR(x) STR(x) #define CAT(x,y) x##y EXPAND_STR(CAT(1,.2)) }#) #+end_src (Yes, you can use these transformation more freely in Lisp macro!) *** Conditional Inclusion =#if= family is supported. Simple example: #+begin_src lisp (named-readtables:in-readtable with-c-syntax:with-c-syntax-readtable) #{ #define TEST_MACRO_DEFINITION int test-macro-defined-p () { #ifdef TEST_MACRO_DEFINITION return t; #else return nil; #endif } }# (test-macro-defined-p) ; => t #+end_src =#if= also works as expected. It can evaluate any Lisp expressions using =`= syntax. This feature enables to use =*features*= by =#if= conditionals: #+begin_src lisp (named-readtables:in-readtable with-c-syntax:with-c-syntax-readtable) (defun see-features-example () #{ #if `(member :sbcl *features* :test 'eq) format(nil, "I am SBCL: ~A", lisp-implementation-version()); #elif `(member :allegro *features* :test 'eq) format(nil, "I am ALLEGRO: ~A", lisp-implementation-version()); #else "Under implementation"; #endif }#) (see-features-example) ;; On SBCL ;; => "I am SBCL: 2.1.7" ;; On Allegro ;; => "I am ALLEGRO: 10.1 [64-bit Mac OS X (Intel) *SMP*] (Jul 6, 2018 18:44)" ;; On other implementations ;; => "Under implementation" #+end_src *** =#include= =#include= works as you know: #+begin_src lisp (named-readtables:in-readtable with-c-syntax:with-c-syntax-readtable) (with-open-file (stream "/tmp/tmp.h" :direction :output :if-exists :supersede) (format stream "const int foo = 100;")) (defun return-foo () #{ #include "/tmp/tmp.h" return foo; }#) (return-foo) ; => 100 #+end_src When using =#include=, it can be a problem which package the symbol is interned in. It can be changed with the with-c-syntax specific pragma [fn:1]. #+begin_src lisp (named-readtables:in-readtable with-c-syntax:with-c-syntax-readtable) (with-open-file (stream "/tmp/tmp.h" :direction :output :if-exists :supersede) ;; _Pragma() can be embedded in the included file. (format stream "const int bar = 123;")) (defpackage temp-package (:use :cl) (:export #:bar)) #2{ _Pragma("WITH_C_SYNTAX IN_PACKAGE \"TEMP-PACKAGE\"") #include "/tmp/tmp.h" }# temp-package:bar ; => 123 #+end_src (But in the Lisp world, you already have =read=, =eval=, and =load=...) * How to load ** Loading by quicklisp This library is quicklisp-ready on [[http://blog.quicklisp.org/2021/08/august-2021-quicklisp-dist-update-now.html][August 2021 dist]]. #+BEGIN_SRC lisp (ql:quickload "with-c-syntax") #+END_SRC ** or, Loading manually *** Libraries depending on - cl-yacc :: As a parser for C syntax. - alexandria :: Many utilities. - named-readtables :: For exporting '#{' reader syntax. - cl-ppcre :: For parsing numeric constants. - trivial-gray-streams :: For implementing translation phase 1 and 2 correctly. - asdf :: For using system-relative pathname, implementing =#include <...>= **** by libc - float-features :: For math.h, dealing NaN and Infinities. - floating-point-contractions :: For math.h, to implement some functions. **** by test codes - 1am :: As a testing framework. - trivial-cltl2 :: For using =compiler-let= to test =NDEBUG=. - floating-point :: For comparing mathmatical function results. *** Load with ASDF #+BEGIN_SRC lisp (asdf:load-asd "with-c-syntax.asd") (asdf:load-system :with-c-syntax) #+END_SRC *** Running tests #+BEGIN_SRC lisp (asdf:load-asd "with-c-syntax-test.asd") (asdf:test-system :with-c-syntax) #+END_SRC *** CI [[https://github.com/y2q-actionman/with-c-syntax/actions/workflows/linux-testSystem.yml/badge.svg]] There are Github Actions to run the test above. I wrote current recipes referring the example of [[https://github.com/neil-lindquist/CI-Utils][CI-Utils]]. * API Please see these docstrings or comments: - Macro [[https://github.com/y2q-actionman/with-c-syntax/blob/77408a69bbfac40b732b8fa490480bd639ee00b7/src/with-c-syntax.lisp#L15-L52][with-c-syntax]] - Comments around [[https://github.com/y2q-actionman/with-c-syntax/blob/77408a69bbfac40b732b8fa490480bd639ee00b7/src/reader.lisp#L792-L820][with-c-syntax-readtable]] - Variable [[https://github.com/y2q-actionman/with-c-syntax/blob/77408a69bbfac40b732b8fa490480bd639ee00b7/src/reader.lisp#L5-L100][*with-c-syntax-reader-level*]] - Variable [[https://github.com/y2q-actionman/with-c-syntax/blob/77408a69bbfac40b732b8fa490480bd639ee00b7/src/reader.lisp#L102-L111][*with-c-syntax-reader-case*]] - Variable [[https://github.com/y2q-actionman/with-c-syntax/blob/77408a69bbfac40b732b8fa490480bd639ee00b7/src/reader.lisp#L113-L115][*previous-readtable*]] - Variable [[https://github.com/y2q-actionman/with-c-syntax/blob/77408a69bbfac40b732b8fa490480bd639ee00b7/src/preprocessor.lisp#L19-L23][*with-c-syntax-find-include-file-function-list*]] * Further Information What this macro does is only expanding a list of symbols to a Lisp form. If you are still interested, please see: https://github.com/y2q-actionman/with-c-syntax/wiki [[https://github.com/vsedach/Vacietis][Vacietis]] is a similer project. It is a "C to Common Lisp" compiler, based on reader macros. * License Copyright (c) 2014,2019,2021 YOKOTA YukiThis program is free software. It comes without any warranty, to the extent permitted by applicable law. You can redistribute it and/or modify it under the terms of the Do What The Fuck You Want To Public License, Version 2, as published by Sam Hocevar. See the COPYING file for more details. * Footnotes [fn:1] In this example, I used =_Pragma()= operator instead of '#pragma' notation because =#p= is already used by the standard syntax. Level 2 syntax only supports that. See =*with-c-syntax-reader-case*= docstring for reader levels.
Next: Modules, Previous: Introduction, Up: The with-c-syntax Reference Manual [Contents][Index]
The main system appears first, followed by any subsystem dependency.
with-c-syntax is a fun package which introduces the C language syntax into Common Lisp.
YOKOTA Yuki <y2q.actionman@gmail.com>
WTFPL
Next: Files, Previous: Systems, Up: The with-c-syntax Reference Manual [Contents][Index]
Modules are listed depth-first from the system components tree.
Next: with-c-syntax/libc, Previous: Modules, Up: Modules [Contents][Index]
package.lisp (file).
with-c-syntax (system).
Next: with-c-syntax/include, Previous: with-c-syntax/src, Up: Modules [Contents][Index]
src (module).
with-c-syntax (system).
Previous: with-c-syntax/libc, Up: Modules [Contents][Index]
libc (module).
with-c-syntax (system).
Next: Packages, Previous: Modules, Up: The with-c-syntax Reference Manual [Contents][Index]
Files are sorted by type and then listed depth-first from the systems components trees.
Next: with-c-syntax/package.lisp, Previous: Lisp, Up: Lisp [Contents][Index]
with-c-syntax (system).
Next: with-c-syntax/src/package.lisp, Previous: with-c-syntax/with-c-syntax.asd, Up: Lisp [Contents][Index]
with-c-syntax (system).
Next: with-c-syntax/src/util.lisp, Previous: with-c-syntax/package.lisp, Up: Lisp [Contents][Index]
src (module).
Next: with-c-syntax/src/condition.lisp, Previous: with-c-syntax/src/package.lisp, Up: Lisp [Contents][Index]
package.lisp (file).
src (module).
Next: with-c-syntax/src/physical-source.lisp, Previous: with-c-syntax/src/util.lisp, Up: Lisp [Contents][Index]
package.lisp (file).
src (module).
Next: with-c-syntax/src/case-aware-find-symbol.lisp, Previous: with-c-syntax/src/condition.lisp, Up: Lisp [Contents][Index]
condition.lisp (file).
src (module).
Next: with-c-syntax/src/pp-number.lisp, Previous: with-c-syntax/src/physical-source.lisp, Up: Lisp [Contents][Index]
condition.lisp (file).
src (module).
Next: with-c-syntax/src/reader.lisp, Previous: with-c-syntax/src/case-aware-find-symbol.lisp, Up: Lisp [Contents][Index]
condition.lisp (file).
src (module).
Next: with-c-syntax/src/struct.lisp, Previous: with-c-syntax/src/pp-number.lisp, Up: Lisp [Contents][Index]
src (module).
Next: with-c-syntax/src/typedef.lisp, Previous: with-c-syntax/src/reader.lisp, Up: Lisp [Contents][Index]
package.lisp (file).
src (module).
Next: with-c-syntax/src/pseudo-pointer.lisp, Previous: with-c-syntax/src/struct.lisp, Up: Lisp [Contents][Index]
package.lisp (file).
src (module).
*typedef-names* (special variable).
Next: with-c-syntax/src/lexer.lisp, Previous: with-c-syntax/src/typedef.lisp, Up: Lisp [Contents][Index]
src (module).
Next: with-c-syntax/src/compiler.lisp, Previous: with-c-syntax/src/pseudo-pointer.lisp, Up: Lisp [Contents][Index]
src (module).
Next: with-c-syntax/src/preprocessor.lisp, Previous: with-c-syntax/src/lexer.lisp, Up: Lisp [Contents][Index]
src (module).
Next: with-c-syntax/src/predefined-macro.lisp, Previous: with-c-syntax/src/compiler.lisp, Up: Lisp [Contents][Index]
src (module).
Next: with-c-syntax/src/with-c-syntax.lisp, Previous: with-c-syntax/src/preprocessor.lisp, Up: Lisp [Contents][Index]
preprocessor.lisp (file).
src (module).
+pp-date-month-name+ (constant).
Next: with-c-syntax/libc/package.lisp, Previous: with-c-syntax/src/predefined-macro.lisp, Up: Lisp [Contents][Index]
src (module).
with-c-syntax (macro).
expand-c-syntax (function).
Next: with-c-syntax/libc/util.lisp, Previous: with-c-syntax/src/with-c-syntax.lisp, Up: Lisp [Contents][Index]
libc (module).
Next: with-c-syntax/libc/assert.lisp, Previous: with-c-syntax/libc/package.lisp, Up: Lisp [Contents][Index]
package.lisp (file).
libc (module).
Next: with-c-syntax/libc/ctype.lisp, Previous: with-c-syntax/libc/util.lisp, Up: Lisp [Contents][Index]
Next: with-c-syntax/libc/errno.lisp, Previous: with-c-syntax/libc/assert.lisp, Up: Lisp [Contents][Index]
Next: with-c-syntax/libc/fenv.lisp, Previous: with-c-syntax/libc/ctype.lisp, Up: Lisp [Contents][Index]
util.lisp (file).
libc (module).
Next: with-c-syntax/libc/float.lisp, Previous: with-c-syntax/libc/errno.lisp, Up: Lisp [Contents][Index]
libc (module).
Next: with-c-syntax/libc/iso646.lisp, Previous: with-c-syntax/libc/fenv.lisp, Up: Lisp [Contents][Index]
util.lisp (file).
libc (module).
mantissa-radix-change (function).
Next: with-c-syntax/libc/limits.lisp, Previous: with-c-syntax/libc/float.lisp, Up: Lisp [Contents][Index]
Next: with-c-syntax/libc/math.lisp, Previous: with-c-syntax/libc/iso646.lisp, Up: Lisp [Contents][Index]
util.lisp (file).
libc (module).
Next: with-c-syntax/libc/stdarg.lisp, Previous: with-c-syntax/libc/limits.lisp, Up: Lisp [Contents][Index]
libc (module).
Next: with-c-syntax/libc/stddef.lisp, Previous: with-c-syntax/libc/math.lisp, Up: Lisp [Contents][Index]
Next: with-c-syntax/libc/string.lisp, Previous: with-c-syntax/libc/stdarg.lisp, Up: Lisp [Contents][Index]
Previous: with-c-syntax/libc/stddef.lisp, Up: Lisp [Contents][Index]
util.lisp (file).
libc (module).
Next: with-c-syntax/include/stdarg.h, Previous: Static, Up: Static [Contents][Index]
include (module).
Next: with-c-syntax/include/stddef.h, Previous: with-c-syntax/include/iso646.h, Up: Static [Contents][Index]
include (module).
Previous: with-c-syntax/include/stdarg.h, Up: Static [Contents][Index]
include (module).
Next: Definitions, Previous: Files, Up: The with-c-syntax Reference Manual [Contents][Index]
Packages are listed by definition order.
Next: with-c-syntax.pragma-name.upcased, Previous: Packages, Up: Packages [Contents][Index]
Next: with-c-syntax.syntax, Previous: with-c-syntax.preprocessor-directive.upcased, Up: Packages [Contents][Index]
Next: with-c-syntax.predefined-macro, Previous: with-c-syntax.pragma-name.upcased, Up: Packages [Contents][Index]
Holds symbols denoting C operators and keywords.
Next: with-c-syntax.preprocess-operator, Previous: with-c-syntax.syntax, Up: Packages [Contents][Index]
Next: with-c-syntax.punctuator, Previous: with-c-syntax.predefined-macro, Up: Packages [Contents][Index]
Next: with-c-syntax.core, Previous: with-c-syntax.preprocess-operator, Up: Packages [Contents][Index]
C punctuators. Some symbols are from ‘with-c-syntax.syntax’ package.
Next: with-c-syntax.preprocessor-directive, Previous: with-c-syntax.punctuator, Up: Packages [Contents][Index]
with-c-syntax core package.
Next: with-c-syntax.libc-implementation, Previous: with-c-syntax.core, Up: Packages [Contents][Index]
Next: with-c-syntax, Previous: with-c-syntax.preprocessor-directive, Up: Packages [Contents][Index]
with-c-syntax libc implemetation package.
Next: with-c-syntax.preprocess-operator.upcased, Previous: with-c-syntax.libc-implementation, Up: Packages [Contents][Index]
The with-c-syntax package, holding public APIs.
Next: with-c-syntax.libc, Previous: with-c-syntax, Up: Packages [Contents][Index]
Next: with-c-syntax.syntax.upcased, Previous: with-c-syntax.preprocess-operator.upcased, Up: Packages [Contents][Index]
with-c-syntax libc package.
Next: with-c-syntax.pragma-name, Previous: with-c-syntax.libc, Up: Packages [Contents][Index]
Previous: with-c-syntax.syntax.upcased, Up: Packages [Contents][Index]
Next: Indexes, Previous: Packages, Up: The with-c-syntax Reference Manual [Contents][Index]
Definitions are sorted by export status, category, package, and then by lexicographic order.
Next: Internals, Previous: Definitions, Up: Definitions [Contents][Index]
Next: Special variables, Previous: Public Interface, Up: Public Interface [Contents][Index]
Used for saving newline chars from reader to preprocessor.
Used for saving whitespace chars from reader to preprocessor, for preprocessor directives.
with-c-syntax definition FP_ILOGBNAN
Holding ‘CL:NIL’ for acting NULL of C language.
Next: Macros, Previous: Constants, Up: Public Interface [Contents][Index]
Holds the readtable used by #‘ syntax.
This is bound by ’#{’ read macro to the ‘*readtable*’ at that time.
List of functions used for searching include files with ’#include <...>’ style. Each function should take one argument and returns a pathname, or nil if failed. See ‘find-include-<header>-file’.
Holds the readtable case used by ’#{’ reader function.
When this is not nil, it must be one of ‘:upcase’, ‘:downcase’,
‘:preserve’, or ‘:invert’. The specified case is used as the
readtable-case inside ’#{’ and ’}#’ and passed to the
wrapping ‘with-c-syntax’ form.
When this is nil, the ‘readtable-case’ of the current ‘*readtable*’ at ’#{’ is used.
Holds the reader level used by ’#{’ reader function.
The value is one of 0, 1 (default), 2.
For inside ’#{’ and ’}#’, three syntaxes are defined. These syntaxes
are selected by the infix parameter of the ’#{’ dispatching macro
character. If it not specified, the value of this variable is used.
Available syntaxes are below:
* Level 0 (conservative)
In level 0, these reader macros are installed.
- ’,’ :: ’,’ is read as a symbol. (In ANSI CL, a comma is defined as
an invalid char outside the backquote syntax.)
- ’:’ :: Reads a solely ’:’ as a symbol. Not a solely one (like
‘cl:cons’) works as a normal package marker.
Level 0 is almost compatible with the standard syntax. However, we need
many escapes for using C operators.
* Level 1 (aggressive).
In level 1, these reader macros are installed.
- ’0’ :: If followed by ’x’ or ’X’, hexadecimal integer (like
’0xdeadbeef’) and hexadecimal floating number (like ’0x1.ffp1’)
syntax are enabled. Otherwise, it is treated as a normal token of
Common Lisp.
- ’|’ :: If ’||’ appeared, it becomes a symbol. The ’empty symbol’
syntax is lost. If ’|’ appeared followed by a terminating char, it
becomes a single character symbol. Because ’|’ becomes a macro character,
it cannot be used for a multiple escape inside a symbol notation.
(e.g. Use ’|A B C|’ instead of ’a| |b| |c’).
- ’{’, ’}’, ’[’, ’]’ :: These become a terminating character, and read
as a symbol.
- ’‘’ :: ’‘’ reads a next s-exp in ‘*previous-readtable*’ readtable. This
works as an escape from ’#{’ and ’}#’. The ’backquote’ functionality
is lost.
- ’.’ :: Reads a solely ’.’ as a symbol. The ’consing dot’
functionality is lost.
- ’/’ :: ’//’ means a line comment, ’/* ... */’ means a block
comment. ’/’ is still non-terminating and it has special meanings only
if followed by ’/’ or ’*’. (Ex: ’a/b/c’ or ’/+aaa+/’ are still valid
symbols.)
- ’"’ :: The double-quote works as a string literal of C. Especially,
escaping is treated as C. The original functionality is lost.
- ’;’ :: ’;’ becomes a terminating character, and read as a
symbol. The ’comment’ functionality is lost.
- ’(’ and ’)’ :: parenthesis become a terminating character, and read
as a symbol. The ’reading a list’ functionality is lost.
Level 1 still mostly keeps the syntax of symbols, since many
constituent characters are left unchanged. But some major macro
characters are overwritten. Especially, ’(’ and ’)’ loses its
functionalities. For constructing a list of Lisp, the ’‘’ syntax must
be used.
* Level 2 (overkill)
In this level, these characters become terminating, and read as a
symbol listed below.
- ’?’ :: ’?’
- ’~’ :: ’~’
- ’:’ :: ’:’ or a (digraph ’:>’)
- ’=’ :: ’=’ or ’==’
- ’*’ :: ’*’ or ’*=’
- ’^’ :: ’^’ or ’^=’
- ’!’ :: ’!’ or ’!=’
- ’&’ :: ’&’, ’&&’, or ’&=’
- ’|’ :: ’|’, ’||’, or ’|=’
- ’+’ :: ’+’, ’++’, or ’+=’
- ’-’ :: ’-’, ’–’, ’-=’, or ’->’
- ’>’ :: ’>’, ’>>’, ’>=’, or ’>>=’
- ’<’ :: ’<’, ’<<’, ’<=’, ’<<=’, or digraphs (’<:’, ’<%’)
- ’/’ :: ’/’, or ’/=’. ’//’ means a line comment, and ’/* ... */’
means a block comment.
- ’.’ :: ’.’, ’...’, or a numeric literal of C language.
- ’%’ :: ’%’, ’%=’, or digraphs (’%>’, ’%:’, ’%:%:’)
And, these characters are changed:
- Digit characters (0,1,2,3,4,5,6,7,8,9) are read as a C numeric
literals.
- The single-quote (’) works as a character literal of C. The ‘quote’
functionality is lost. (This prevents the Lisp syntax extremely, so
enabled only in level 2).
In this level, there is no compatibilities between symbols of Common Lisp. Especially, for denoting a symbol consists of terminating characters, escapes are required. (ex. most-positive-fixnum)
A symbol denoting ’errno’ of C, or NIL.
If a function of ‘with-c-syntax.libc’ caught error, it will set the
error to this.
This variable is seen by |assert|. Please refer |assert|’s docstring.
Next: Compiler macros, Previous: Special variables, Up: Public Interface [Contents][Index]
This emulates ’assert’ of the C language.
If ‘NDEBUG’ is bound and its value is true, ‘|assert|’ will be
expanded to a no-op. If not (‘NDEBUG’ is unbound or bound to NIL),
‘|assert|’ will be expanded to ‘cl:assert’.
This macro sees ‘NDEBUG’ value only when macroexpanding-time, not in runtime. (If you want to change ‘NDEBUG’ locally, you should use ‘compiler-let’.)
It returns the variadic arguments of a function defined by
with-c-syntax. If this is called outside of a variadic function, an
error is signaled. When defining a variadic function, a local macro
has same name is established.
This is not intended for calling directly. The ‘va_start’ macro uses this.
This macro is a entry point of the with-c-syntax system. BODY will be
interpreted as C syntax, executed, and return values.
PREPROCESS specifies how to do preprocess. If nil, this macro compiles
BODY without preprocessing. If t, preprocesses and compiles BODY. If
‘:preprocess-only’, this macro preprocesses BODY and returns the
result as-is.
READER-LEVEL specifies the reader level (see ‘*with-c-syntax-reader-level*’).
This is used when ’#include’ or ’_Pragma()’ was used.
READTABLE-CASE specifies the readtable case of symbols in BODY when it
was read. This affects how to intern C keywords by the preprocessor.
INPUT-FILE-PATHNAME is passed to the preprocessor and used when
’__FILE__’ macro was used.
If RETURN is ‘:auto’, returns the last form’s value if BODY is a
compound statement. (If BODY is a compilation unit, this returns NIL
now, but this behavior may be changed.)
If RETURN is any other value, its valus is inserted after the
compilation result translation units. (This feature is intended to
access ’static’ variables.)
If TRY-ADD-{} is t and an error occurred at parsing, ‘with-c-syntax’
adds ’{’ and ’}’ into the head and tail of FORM respectively, and
tries to parse again.
In this macro, BODY is executed in a new environment for
pseudo-pointers.
A pointer made inside this macro is invalidated outside of this.
Next: Ordinary functions, Previous: Macros, Up: Public Interface [Contents][Index]
Next: Standalone methods, Previous: Compiler macros, Up: Public Interface [Contents][Index]
* Syntax
~add-struct-spec~ name sspec => struct-spec
* Arguments and Values
- name :: a symbol.
- sspec :: a struct-spec instance.
- struct-spec :: a struct-spec instance.
* Description
Establishes a new struct-spec definition named ~name~.
* Affected By
~with-c-compilation-unit~.
* Syntax
~add-typedef~ name spec => decl-spec
* Arguments and Values
- name :: a symbol
- spec :: a decl-specs instance, or a type specifier.
- decl-spec :: a decl-specs instance.
* Description
Establishes a new typedef definition named ~name~.
* Affected By
~with-c-compilation-unit~.
See ‘find-with-c-syntax-default-include-file’
* Syntax
~find-struct-spec~ name => struct-spec
* Arguments and Values
- name :: a symbol
- decl-spec :: a struct-spec instance, or nil.
* Description
Finds and returns a struct-spec. If no struct-specs are found, returns
nil.
* Affected By
~with-c-compilation-unit~.
* Syntax
~find-typedef~ name => decl-spec
* Arguments and Values
- name :: a symbol
- decl-spec :: a decl-specs instance, or nil.
* Description
Finds and returns a typedef definition. If no typedefs are found,
returns nil.
* Affected By
~with-c-compilation-unit~.
This function invalidates all pseudo-pointers in the scope it
called, and returns the number of invalidates pointers.
In ‘with-pseudo-pointer-scope’, this call invalidates pseudo-pointers
made in that.
If out of that, this call invalidates all pseudo-pointers.
Makes and returns a new pseudo-pointer points POINTEE. INITIAL-OFFSET is added to the result at making.
* Syntax
~make-struct~ spec-obj &rest init-args => new-struct
* Arguments and Values
- spec-obj :: a symbol, or an instance of struct-spec.
- init-args :: objects.
- new-struct :: an instance of struct.
* Description
Makes a new struct instance based on the specification of ~spec-obj~.
If ~spec-obj~ is a symbol, it must be a name of a globally defined struct or union. To define a struct or an union globally, use ~with-c-syntax~ and declare it in a toplevel of translation-unit.
If ~spec-obj~ is an instance of struct-spec, it is used directly.
~init-args~ is used for initializing members of the newly created instance. If the number of ~init-args~ is less than the number of members, the rest members are initialized with the default values specified by the ~spec-obj~.
An alias for ‘CL:NULL’.
This is for convenience using ’NULL’ as C constant and Lisp function
both when ‘intern’ the libc package.
Read a C numeric literal from ‘preprocessing-number’
This function preprocesses TOKEN-LIST before parsing.
Current workings are below:
- Interning a symbol into this package when it has a same name as C
keywords or operators, or libc symbols.
READTABLE-CASE affects how to do it.
- Concatenation of string literals.
- Expands preprocessor macros defined by ’#defined’. (Undocumented now.)
Dereferences the POINTER and returns the pointed object.
Makes the POINTER to point the NEW-OBJECT.
Makes the POINTER to point no objects. After that, calling ‘pseudo-pointer-dereference’ to this pointer will be error.
Returns whether the OBJECT can be held by pseudo-pointers.
* Syntax
~remove-struct-spec~ name => struct-spec
* Arguments and Values
- name :: a symbol
- struct-spec :: a struct-specs instance, or nil.
* Description
Removes a struct-spec definition named ~name~.
Returns the removed struct-spec definition. If no struct-specs are
found, returns nil.
* Affected By
~with-c-compilation-unit~.
* Syntax
~remove-typedef~ name => decl-spec
* Arguments and Values
- name :: a symbol
- decl-spec :: a decl-specs instance, or nil.
* Description
Removes a typedef definition named ~name~.
Returns the removed typedef definition. If no typedefs are found,
returns nil.
* Affected By
~with-c-compilation-unit~.
* Syntax
~struct-member~ struct member-name => object
* Arguments and Values
- struct :: an instance of struct
- member-name :: a symbol
- object :: an object
* Description
Returns the value of the member named ~member-name~ in the ~struct~.
* Syntax
(setf (~struct-member~ struct member-name) new-object)
* Arguments and Values
- struct :: an instance of struct
- member-name :: a symbol
- new-object :: an object
* Description
Sets the value of the member named ~member-name~ in the ~struct~.
Next: Conditions, Previous: Ordinary functions, Up: Public Interface [Contents][Index]
trivial-gray-streams.
trivial-gray-streams.
sb-gray.
sb-gray.
sb-gray.
Next: Structures, Previous: Standalone methods, Up: Public Interface [Contents][Index]
The root class of all errors in with-c-syntax system.
simple-error.
Signalled when ‘with-c-syntax’ saw a kind of ‘style-warning’.
style-warning.
:message
This slot is read-only.
The root type of all warnings in the with-c-syntax system.
simple-warning.
Next: Classes, Previous: Conditions, Up: Public Interface [Contents][Index]
A structure represents preprocessing-number token in the C standard.
Next: Types, Previous: Structures, Up: Public Interface [Contents][Index]
* Class Precedence List
struct, standard-object, ...
* Description
A representation of C structs or unions.
Previous: Public Interface, Up: Definitions [Contents][Index]
Next: Special variables, Previous: Internals, Up: Internals [Contents][Index]
* Value Type
a list :: consists of alists – (list-of-symbols . <lisp-type>)
* Description
Holds relationships between notations of C type and Common Lisp types.
* Notes
For each entry of alist, the car is sorted alphabetically.
A vector of month names following asctime() manner. Used by __DATE__
A fixnum represents the bitmask splits the pseudo-pointer bit
representation to the ’base part’ and the ’index part’.
The ’base part’ is used for a key of ‘*pseudo-pointee-table*’. The ’index part’ is used for a offset of the pointee value.
A fixnum specifies the ’sign bit’ of the ’index part’ of the
pseudo-pointer bit representation.
For the ’index part’, the representation is like here:
- #b1000000 :: 0
- #b1000001 - #b1111111 :: +1 ~ +63
- #b0111111 - #b0000000 :: -1 ~ -64
If the ’index part’ exceeds this limitation, the result is unpredictable.
* Value Type
a list :: consists of symbols.
* Description
Holds a list of symbols, which are pointed by a pointer.
If a pseudo-pointer is created for a symbol, the symbol is added to
here (Because such a symbol must be handled carefully).
* Notes
At the beginning of ~with-c-syntax~, it binds this variable to nil.
* Affected By
~with-c-compilation-unit~.
Internal storage of error flag for our floating-point error emulation.
* Value Type
a list :: consists of symbols.
* Description
Holds a list of symbols, which are declared as a pointer
to a function. (Because such a symbol is specially treated by the
function-calling expression.)
* Notes
At the beginning of ~with-c-syntax~, it binds this variable to nil.
* Affected By
~with-c-compilation-unit~.
A pseudo-pointer used for the next object.
A hash-table holds relations between the ’base part’ of a pseudo-pointer and the pointee object.
* Value Type
a boolean
* Description
Specifies which to return the last form’s value of compound statements.
* Notes
At the beginning of ~with-c-syntax~, it binds this variable depending
on its ~return~ argument.
* Affected By
~with-c-compilation-unit~.
Holds a character wanted to ‘unread-char’ secondarily. This is used for implementing ’...’ and ’%:%:’.
Used by |strtok|
* Value Type
a hashtable :: a symbol -> a list of struct-spec.
* Description
Holds definitions of structs or unions.
* Notes
At the beginning of ~with-c-syntax~, it binds this variable to the
values they held. This behavior limits the scope of local struct/union
definitions into the compilation unit.
* Affected By
~with-c-compilation-unit~.
* See Also
~find-struct-spec~, ~add-struct-spec~, ~remove-struct-spec~
* Value Type
a list
* Description
Holds a form inserted as an entry point.
This is used only when compiling a translation unit. Not used for
other cases.
* Notes
At the beginning of ~with-c-syntax~, it binds this variable depending
on its ~return~ argument.
* Affected By
~with-c-compilation-unit~.
* Value Type
a hashtable :: a symbol -> list of decl-specs
* Description
Holds definitions of typedefs.
* Notes
At the beginning of ~with-c-syntax~, it binds this variable to the
values they held. This behavior limits the scope of local typedefs
into the compilation unit.
* Affected By
~with-c-compilation-unit~.
* See Also
~find-typedef~, ~add-typedef~, ~remove-typedef~.
‘with-c-syntax’ bind this to ‘&environment’ argument.
Determines whether preprocessor replaces digraphs.
If this is true, replacement occurs but ‘with-c-syntax-style-warning’ is signalled.
If this is ‘:no-warn’, replacement occurs and the style-warning is not signalled.
Determines #{ }# reader deletes backslash-newline sequence. Deletion occurs if this is true.
Determines whether #{ }# reader replaces C trigraphs.
If this is true, replacement occurs but ‘with-c-syntax-style-warning’ is signalled.
If this is ‘:no-warn’, replacement occurs and the style-warning is not signalled.
Next: Ordinary functions, Previous: Special variables, Up: Internals [Contents][Index]
Used by ‘pop-preprocessor-directive-token’
Works like ‘cl:lambda’ macro except automatically ‘declare’s ‘ignore’ for required parameters beginning with ’_’ character.
Modify macro of ‘make-trimed-vector’
This is like the famous ’COND-LET’, but takes multiple values.
For #ifdef, #ifndef, and #undef
Pop the direcive’s newline for setting next line’s line-number to same.
Pops the next token in TOKEN-LIST ignoring ‘+whitespace-marker+’
A post increment version of ‘incf’.
Modify macro of ‘resize-string’
Works like ‘LABELS’ except if LOCAL-FUNCTIONS was empty this macro is expanded to ‘locally’. This macro is intended to make expansion of ‘with-c-syntax’ to be a top-level form.
Works like ‘LET*’ except if BINDINGS was empty this macro is expanded to ‘locally’. This macro is intended to make expansion of ‘with-c-syntax’ to be a top-level form.
Establishes variable bindings for a new compilation.
Inside this, passed symbols are dynamically bound to itself.
Next: Generic functions, Previous: Macros, Up: Internals [Contents][Index]
Resolves unspecified dimensions with an initializer.
Checks no preprocessing token is left in TOKEN-LIST.
tag.
Calculates max lengths per depth of a nested list, like ‘array-dimensions’
Calculates ’*earmuff*’ lengthes in STRING with EARMUFF-CHAR, and
returns it lengthes in front and in last.
e.g. (earmuff-lengthes "*foo**" #*) ; => (values 1 2)
id.
Used by ‘expand-macro-argument’, #line and #include.
Finds the specified type and the initialization form. Returns (values var-init var-type).
Expand preprocessor macro named TOKEN. If it is a function-like
macro, its arguments are taken from REST-TOKEN-LIST. MACRO-ALIST is an
alist of preprocessor macro definitions. PP-STATE is a
‘preprocessor-state’ object, used for expanding predefined macros.
Returns four values:
1. A list of tokens made by expansion.
2. A list, tail of REST-TOKEN-LIST, left after collecting function-like macro arguments.
3. An alist derived from MACRO-ALIST changed after expansion.
4. A boolean tells whether TOKEN is a function-like-macro but
REST-TOKEN-LIST is not a form of invocation.
This is a final compilation phase. Makes a toplevel form. ~mode~ is one of :statement or :translation-unit
A part of ‘expand-toplevel’.
Checks and fills the passed decl-specs.
Fills the decl-specs object referring the passed enum-spec.
Fills the passed init-declarator object.
Fills the decl-specs object referring the passed struct-or-union-spec. If required, makes a new struct-spec object.
A part of finalize-decl-specs. This processes type-spec.
Returns a readtable for tokenize C source. See ‘*with-c-syntax-reader-level*’.
Find a symbol in ‘WITH-C-SYNTAX.SYNTAX’ package having a same NAME. If not found, returns ‘nil’.
Finds a file specified by #include <...> style header-name with pathnames got by ‘*with-c-syntax-find-include-file-function-list*’.
Finds a file specified by #include "..." style header-name.
Current strategy is just to use ‘cl:probe-file’. So it will affected
by ‘*default-pathname-defaults*’.
If no file was found, ‘find-include-<header>-file’ is called.
Looks PP-NUMBER-STRING and returns its radix (integer) and a boolean whether its type is float or not.
This function tries to find OPERATOR in front of SYMBOL.
If found, it returns T and list of of splited symbols. If not found,
it returns NIL.
This function tries to find OPERATOR in back of SYMBOL.
If found, it returns T and list of of splited symbols. If not found,
it returns NIL.
Find a symbol in ‘WITH-C-SYNTAX.PREPROCESS-OPERATOR’ package having a same NAME. If not found, returns ‘nil’.
Find a symbol in ‘WITH-C-SYNTAX.PRAGMA-NAME’ package having a same NAME. If not found, returns ‘nil’.
Find a symbol in ‘WITH-C-SYNTAX.PREPROCESSOR-DIRECTIVE’ package having a same NAME. If not found, returns ‘nil’.
Makes a pathname of the directory containing with-c-syntax include files. This function is used for making the default value of ‘*with-c-syntax-find-include-file-function-list*’
Calculate the readtable-level (described in ‘*with-c-syntax-reader-level*’ docstring) of the READTABLE. If READTABLE is not for C syntax, returns NIL.
Constructs a nested list like ‘make-array’.
Makes a load form of a nested list.
Makes an alist of (<symbol> . <macro-argument>) for function-like-macro expansion.
Makes a displaced array which has a reduced dimensions.
Example: Consider what is returned by
(make-reduced-dimension-array (make-array ’(2 2 2)) ’(1))
Its dimension is ’(2 2), and it is a displaced array aliasing from ’(1 0 0) to ’(1 2 2) in the original array.
Trims the head TRIM-POSITION elements of VECTOR, using ‘displaced-array’.
If END supplied, its tail is also trimed (using ‘displaced-array’, too).
This function is used for emulating C string truncation with pointer movements.
Used for ’!=’ of C language.
Calls nreconc with reversed order args. A helper for ‘nreconcf’.
See ‘preprocessor’
Do the translation phase 6 – string concatenation.
Process preprocessor directives. This is tranlation phase 4.
This function tries to find some C operators in SYMBOL.
If found, it returns T and list of splited symbols. If not found, it
returns NIL.
Process pragmas affects with-c-syntax readers.
See ‘process-with-c-syntax-pragma’ for preprocessor pragmas.
A helper function used by ‘pseudo-pointer-dereference’, etc.
Read hexadecimal numeric literal of C.
Dot may be an ’.’ operator, ’...’, or a prefix of floating numbers.
Called by ’#{’ reader macro of ‘with-c-syntax-readtable’.
Inside ’#{’ and ’}#’, the reader uses completely different syntax, and
the result is wrapped with ‘with-c-syntax’.
See ‘*with-c-syntax-reader-level*’ and ‘*with-c-syntax-reader-case*’.
If the next character in STREAM is terminating, returns a symbol made of CHAR. If not, returns a next token by ‘cl:read’ after unreading CHAR.
Used by ‘read-escaped-char’.
For ’+’, ’&’, ’|’. They may be ’+’, ’++’, or ’+=’
Reads a preprocessing number token, defined in
"6.4.8 Preprocessing numbers" in ISO/IEC 9899:1999.
If FIRST-CHAR is supplied, it is read as the first char. This feature
is for the convension of reader macro functions.
Reads a token from STREAM until EOF or ’}#’ found. Newline is read
as ‘+newline-marker+’.
If KEEP-WHITESPACE is nil, whitespaces except newlines are
ignored. (This feature is intended to suppress ‘+whitespace-marker+’
in the macro expansion, for debugging.)
For ’<’, ’>’. They may be ’>’, ’>>’, and ’>=’, ’>>=’.
Reads unnnn or Unnnnnnnn syntax.
Accesses a nested list like ‘aref’, as a multi-dimensional array.
Accesses a nested list like ‘aref’, as a multi-dimensional array.
Resize STRING to SIZE using ‘adjust-array’ or ‘fill-pointer’.
This function is used for emulating C string truncation with NUL char.
Calls revappend with reversed order args. A helper for ‘revappendf’.
Makes a list for ‘:initial-contents’ of ‘make-array’, from initializer-list.
Skips C whitespaces except newline.
code.
Used by ‘|strchr|’ and ‘|strrchr|’
Used by ‘|strcmp|’ and ‘|strncmp|’
Finds the position of the end of rejected chars in STR. If no such chars, return NIL.
Finds the position of the end of acceptable chars in STR. If no such chars, return NIL.
bits.
Returns the index of ~member-name~ in the internal storage of ~struct~.
id.
type.
Returns T if CHAR is a terminating character in READTABLE.
Tokenize C source by doing translation phase 1, 2, and 3.
‘*readtable*’ must be bound to the C syntax readtable, got by ‘find-c-readtable’.
Next: Conditions, Previous: Ordinary functions, Up: Internals [Contents][Index]
Perform token concatenation caused by ’##’ operator.
Finds a readtable name by arguments. See ‘find-c-readtable’.
automatically generated reader method
automatically generated reader method
automatically generated reader method
name.
automatically generated reader method
Counts deleted newlines, for __LINE__ .
automatically generated reader method
automatically generated writer method
automatically generated reader method
automatically generated writer method
automatically generated reader method
automatically generated writer method
automatically generated reader method
automatically generated writer method
automatically generated reader method
automatically generated writer method
automatically generated reader method
automatically generated writer method
automatically generated reader method
automatically generated writer method
automatically generated reader method
automatically generated writer method
automatically generated reader method
automatically generated writer method
automatically generated reader method
automatically generated reader method
automatically generated reader method
Do translation phase 1 and 2, returns a character.
Next: Structures, Previous: Generic functions, Up: Internals [Contents][Index]
Used at compiling with-c-syntax forms.
:token-list
Used in the lexer.
:token
This slot is read-only.
Used in the preprocessor.
Used when an error occurred at the parser.
:yacc-error
Used when an error occurred at the parser.
Used when trying to use a dangling pointer.
Used at using pseudo-pointers.
:pointer
This slot is read-only.
:pointee
This slot is read-only.
:offset
This slot is read-only.
Used when trying to dereference a null pointer.
Used when trying to make a pointer to a un-pointable object.
Used when trying to write into a non-writable pointer.
Used at evaluating with-c-syntax forms.
Used when an error occurred at the parser.
:yacc-error
Used in the with-c-syntax reader. Not for the installer of the with-c-syntax reader.
Next: Classes, Previous: Conditions, Up: Internals [Contents][Index]
Represents ’decl-specs’ in C syntax BNF.
structure-object.
t
Represents ’enum-spec’ in C syntax BNF.
Represents ’enumerator’ in C syntax BNF.
Represents a function definition.
Represents ’init-declarator’ in C syntax BNF.
Represents ’spec-qualifier-list’ in C syntax BNF.
Represents statements in C syntax BNF.
Represents ’struct-declarator’ in C syntax BNF.
Represents ’struct-or-union-spec’ in C syntax BNF.
Represents a struct/union specification.
structure-object.
fixnum
0
Next: Types, Previous: Structures, Up: Internals [Contents][Index]
vector
(make-array 1 :fill-pointer 0 :adjustable t)
An input stream for doing translation phase 1 (replacing trigraph) and translation phase 2 (deleting backslash-newline sequence).
fundamental-character-input-stream.
The parental stream.
common-lisp.
with-c-syntax.core::input-stream
:stream
Used when ‘cl:unread-char’ called.
common-lisp.
(or null character)
A buffer for treating consective trigraphs. See ‘translation-early-phase’.
(or null character)
Counts deleted newlines, for __LINE__ .
integer
0
readtable
:target-readtable
with-c-syntax.core::*with-c-syntax-reader-process-trigraph*
:phase-1
with-c-syntax.core::*with-c-syntax-reader-process-backslash-newline*
:phase-2
:file-pathname
list
:token-list
list
integer
1
integer
0
list
list
:if-section-stack
This slot is read-only.
common-lisp.
package
:package
This slot is read-only.
common-lisp.
readtable
:readtable
This slot is read-only.
The base type of internal representation of non-null pointers in
with-c-syntax system.
Optional POINTEE-TYPE specifies the type of the object pointer by the
pointer.
Previous: Definitions, Up: The with-c-syntax Reference Manual [Contents][Index]
Jump to: | (
_
A B C D E F G H I L M N P R S T U V W |
---|