1 Parsing and Specifying Syntax

The syntax/parse library provides a framework for writing macros and processing syntax. The library provides a powerful language of syntax patterns, used by the pattern-matching form syntax-parse and the specification form define-syntax-class. Macros that use syntax-parse automatically generate error messages based on descriptions and messages embedded in the macro’s syntax patterns.
 (require syntax/parse) package: base

    1.1 Introduction

    1.2 Examples

      1.2.1 Phases and Reusable Syntax Classes

      1.2.2 Optional Keyword Arguments

      1.2.3 Variants with Uniform Meanings

      1.2.4 Variants with Varied Meanings Syntactic Normalization Non-syntax-valued Attributes

      1.2.5 More Keyword Arguments

      1.2.6 Contracts on Macro Sub-expressions

    1.3 Parsing Syntax

    1.4 Specifying Syntax with Syntax Classes

      1.4.1 Pattern Directives

      1.4.2 Pattern Variables and Attributes

    1.5 Syntax Patterns

      1.5.1 Single-term Patterns

      1.5.2 Head Patterns

      1.5.3 Ellipsis-head Patterns

      1.5.4 Action Patterns

      1.5.5 Pattern Expanders

    1.6 Defining Simple Macros

    1.7 Literal Sets and Conventions

    1.8 Library Syntax Classes and Literal Sets

      1.8.1 Syntax Classes

      1.8.2 Literal Sets

      1.8.3 Function Headers

    1.9 Unwindable State

    1.10 Debugging and Inspection Tools

    1.11 Experimental

      1.11.1 Contracts for Macro Sub-expressions

      1.11.2 Contracts for Syntax Classes

      1.11.3 Reflection

      1.11.4 Procedural Splicing Syntax Classes

      1.11.5 Ellipsis-head Alternative Sets

      1.11.6 Syntax Class Specialization

      1.11.7 Syntax Templates