[previous] [up] [next]     [contents] [index]
Next: Parser Up: Reader Previous: Types

Procedures

tex2html_wrap_inline1697 read
[ (in-port+(() tex2html_wrap_inline1699 read U eof)) [ tex2html_wrap_inline1701 location [ tex2html_wrap_inline1701 boolean [ tex2html_wrap_inline1701 integer] ] ] ] tex2html_wrap_inline1699 ( tex2html_wrap_inline1699 ( read U eof) )

When invoked, the reader returns a thunk. This thunk is repeatedly invoked to obtain a series of read objects until an eof is returned. The names and the functionality of the optional arguments to the reader, in turn, are:

input port
This argument can be either an input port or a thunk from which to take the input. The thunk should return a char, eof or an object appropriate for external.

Default: (current-input-port).

initial location
The location used for the first character read from the port; subsequent characters are appropriately offset from it.

Default: default-initial-location.

script?
Whether or not the file is a script. In a script, if the first two chars from port are #!, then the reader will treat the first line as a comment. (This comment can span multiple lines if each preceding line ends in a \ before the newline.)

Default: #t.

first column
The first column of each line is can be changed by this argument. This is useful for treating the entire file as if it were indented by some amount. Note that this parameter is unrelated to the initial location parameter. Default: 1.

NOTE: It is an error to perform read-char on any port passed to the reader, since this may interfere with its operation.

tex2html_wrap_inline1697 structurize-syntax
mixed tex2html_wrap_inline1701 zodiac [ tex2html_wrap_inline1701 marks] tex2html_wrap_inline1699 read

The first argument is a raw Scheme s-expression that has read objects in one or more positions (type mixed). The second argument is any object that is an instance of a sub-type of zodiac. The output is a read representation of the input. All Scheme s-expressions in the input are recursively converted to read forms, while read forms are left untouched (and are not traversed further). For all raw inputs that are converted into read objects, the origin, start and finish information is extracted from the second argument to structurize-syntax. The optional marks argument is used to give symbols and list forms their initial set of marks. Ordinary users may ignore this argument.

tex2html_wrap_inline1697 sexp->raw
read tex2html_wrap_inline1699 raw

The input is a member of the read hierarchy. The body is recursively translated into raw Scheme s-expressions. For symbols, the value in the object field, not in the orig-name field, is used.

tex2html_wrap_inline1697 syntax-car
( list + improper-list) tex2html_wrap_inline1699 read
tex2html_wrap_inline1697 syntax-cdr
( list + improper-list) tex2html_wrap_inline1699 read
tex2html_wrap_inline1697 syntax-null?
( list + improper-list) tex2html_wrap_inline1699 boolean
tex2html_wrap_inline1697 syntax-map
fun tex2html_wrap_inline1701 list [ tex2html_wrap_inline1701 list] tex2html_wrap_inline1699 read

Given a list or improper-list object, these procedures should be used to manipulate them. The user should never directly extract the contents of a list using the read-object accessor, since it can sometimes yield incorrect information. As with Scheme's map, syntax-map can take more than one argument (currently, at most two are allowed). There is no syntax-cons since that functionality is subsumed by structurize-syntax.


[previous] [up] [next]     [contents] [index]
Next: Parser Up: Reader Previous: Types

PLT