File: icalendar-ast.el.html
For an overview of the iCalendar library, see icalendar-shortdoc.el.
This file defines the abstract syntax tree representation for
iCalendar data. The AST is based on org-element-ast (which see;
that feature will eventually be renamed and moved out of the Org tree
into the main tree).
This file contains low-level functions for constructing and
manipulating the AST, most of which are minimal wrappers around the
functions provided by org-element-ast. This low-level API is
primarily used by icalendar-parser. It also contains a higher-level
API for constructing AST nodes in Lisp code. Finally, it defines
functions for validating AST nodes.
There are three main pieces of data in an AST node: its type, its value, and its child nodes. Nodes which represent iCalendar components have no values; they are simply containers for their children. Nodes which represent data of the base iCalendar data types have no children; they are the leaf nodes in the syntax tree. The main low-level accessors for these data in AST nodes are:
icalendar-ast-node-type
icalendar-ast-node-value
icalendar-ast-node-children
icalendar-ast-node-children-of
icalendar-ast-node-first-child-of
To construct AST nodes in Lisp code, see especially the high-level macros:
icalendar-make-vcalendar
icalendar-make-vtimezone
icalendar-make-vevent
icalendar-make-vtodo
icalendar-make-vjournal
icalendar-make-property
icalendar-make-param
These macros wrap the macro icalendar-make-node-from-templates,
which allows writing iCalendar syntax tree nodes as Lisp templates.
Constructing nodes with these macros automatically validates them
with the function icalendar-ast-node-valid-p, which signals an
icalendar-validation-error if the node is not valid according to
RFC5545.