Next: , Previous: , Up: Developer manual   [Contents][Index]


2.2 Reader module

is responsible for parsing input either from the interactive prompt or a file. (It only supports parsing string, other functionallity is implemented in the See Main module.

Hscheme uses Parsec library to parse input. Parsec is somewhat special, as it consumes input even if it eventually fails the match. The architecture of hscheme’s parser is modified to that architecture from the default Scheme parser and lexer.

readStr

Read one expression from the string and parse it.

readMany

Read all the expressions in the string and parse them.

datum

This is the root rule, all syntactic concepts are defined here.

syntax

Parse #'expr into (syntax expr).

stringElement

Parse string elements, automatically unescape characters.

quote

Parse 'expr into (quote expr).

quasiquote

Parse `expr into (quasiquote expr).

unquote

Parse ,expr into (unquote expr).

unquoteSplicing

Parse ,@expr into (unquote-splicing expr).

pair

Parse pairs and improper lists into ScmPair.

list

Parse lists.

vector

Parse vectors.

peculiar

Parse peculiar identifiers.

sym

Parse symbols.

subsequent
initial
specialInitial
specialSubsequent

Helper functions for sym

number

Parse numbers. Currently only integers are supported.

space'

Modified Parsec space that matches multiline scheme comments.

spaces1, spaces

Helpers for matching multiple spaces.

readInBase
readFloat

Currently unused. For a future use when other number types are supported.


Next: , Previous: , Up: Developer manual   [Contents][Index]