This is an ANTLR4 grammar for subset of R7RS Scheme datum and an example parser written in Java.
Supported syntaxes are:
-
boolean,
-
character,
-
integer (binary, octal, decimal, and hexadecimal),
-
flonum,
-
infnan (represented as a symbol in the grammar),
-
string,
-
symbol,
-
bytevector,
-
proper- and dotted-list,
-
vector,
-
abbreviation,
-
line comment,
-
block comment, and
-
datum comment.
Unsupported syntaxes are:
-
exactness prefix,
-
complex,
-
rational, and
-
datum label.