On this page:
typedef
struct
union
enum
array
pointer

4 Parenthetical C

 (require (planet dherman/c:3:3/pc))

For now, this library only provides a few convenience forms for constructing AST nodes. Eventually I intend to create a “Parenthetical C” language with an S-Expression-based alternative syntax for the whole of C.

(typedef type alias-id)
 
type = struct
  | type-id
(struct tag-id)
(struct tag-id (struct-field ...))
(struct (struct-field ...))
 
struct-field = [type field-id]
  | field-id
(union tag-id)
(union tag-id (union-variant ...))
(union (union-variant ...))
 
union-variant = [type variant-id]
  | variant-id
(enum tag-id)
(enum tag-id (enum-variant ...))
(enum (enum-variant ...))
 
enum-variant = [variant-id expr]
  | variant-id

(array type size)  type:array?
  type : type?
  size : expr?
(pointer type)  type:pointer?
  type : type?