-/* $Id: mdoc.h,v 1.74 2010/03/31 07:13:53 kristaps Exp $ */
+/* $Id: mdoc.h,v 1.79 2010/05/15 16:24:38 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
SEC_SYNOPSIS,
SEC_DESCRIPTION,
SEC_IMPLEMENTATION,
- SEC_EXIT_STATUS,
SEC_RETURN_VALUES,
SEC_ENVIRONMENT,
SEC_FILES,
+ SEC_EXIT_STATUS,
SEC_EXAMPLES,
SEC_DIAGNOSTICS,
SEC_COMPATIBILITY,
SEC_CAVEATS,
SEC_BUGS,
SEC_SECURITY,
- SEC_CUSTOM /* User-defined. */
+ SEC_CUSTOM, /* User-defined. */
+ SEC__MAX
};
/* Information from prologue. */
struct mdoc_meta {
- int msec;
+ char *msec;
char *vol;
char *arch;
time_t date;
/* Node in AST. */
struct mdoc_node {
- struct mdoc_node *parent;
- struct mdoc_node *child;
- struct mdoc_node *next;
- struct mdoc_node *prev;
- int nchild;
- int line;
- int pos;
- enum mdoct tok;
+ struct mdoc_node *parent; /* parent AST node */
+ struct mdoc_node *child; /* first child AST node */
+ struct mdoc_node *next; /* sibling AST node */
+ struct mdoc_node *prev; /* prior sibling AST node */
+ int nchild; /* number children */
+ int line; /* parse line */
+ int pos; /* parse column */
+ enum mdoct tok; /* tok or MDOC__MAX if none */
int flags;
-#define MDOC_VALID (1 << 0)
-#define MDOC_ACTED (1 << 1)
- enum mdoc_type type;
- enum mdoc_sec sec;
-
+#define MDOC_VALID (1 << 0) /* has been validated */
+#define MDOC_ACTED (1 << 1) /* has been acted upon */
+#define MDOC_EOS (1 << 2) /* at sentence boundary */
+#define MDOC_LINE (1 << 3) /* first macro/text on line */
+ enum mdoc_type type; /* AST node type */
+ enum mdoc_sec sec; /* current named section */
struct mdoc_arg *args; /* BLOCK/ELEM */
#ifdef UGLY
struct mdoc_node *pending; /* BLOCK */
#define MDOC_IGN_SCOPE (1 << 0) /* Ignore scope violations. */
#define MDOC_IGN_ESCAPE (1 << 1) /* Ignore bad escape sequences. */
#define MDOC_IGN_MACRO (1 << 2) /* Ignore unknown macros. */
-#define MDOC_IGN_CHARS (1 << 3) /* Ignore disallowed chars. */
/* Call-backs for parse messages. */