-/* $Id: mdoc.h,v 1.4 2008/12/23 05:30:49 kristaps Exp $ */
+/* $Id: mdoc.h,v 1.13 2009/01/03 18:38:39 kristaps Exp $ */
/*
* Copyright (c) 2008 Kristaps Dzonsons <kristaps@kth.se>
*
#ifndef MDOC_H
#define MDOC_H
-#define MDOC_LINEARG_MAX 9
+#define MDOC_LINEARG_MAX 8
#define MDOC___ 0
#define MDOC_Dd 1
#define MDOC_svid4 57
#define MDOC_Filled 58
#define MDOC_Words 59
-#define MDOC_ARG_MAX 60
+#define MDOC_Emphasis 60
+#define MDOC_Symbolic 61
+#define MDOC_ARG_MAX 62
enum mdoc_err {
- ERR_SYNTAX_QUOTE,
+ ERR_SYNTAX_QUOTE, /* NOTUSED */
ERR_SYNTAX_UNQUOTE,
+ ERR_SYNTAX_NOPUNCT,
ERR_SYNTAX_WS,
- ERR_SYNTAX_ARGS,
- ERR_SYNTAX_BADARG,
+ ERR_SYNTAX_ARG,
+ ERR_SYNTAX_ARGFORM,
ERR_SYNTAX_ARGVAL,
+ ERR_SYNTAX_ARGBAD,
ERR_SYNTAX_ARGMANY,
ERR_MACRO_NOTSUP,
ERR_MACRO_NOTCALL,
ERR_SCOPE_BREAK,
ERR_SCOPE_NOCTX,
+ ERR_SCOPE_NONEST,
ERR_SEC_PROLOGUE,
ERR_SEC_NPROLOGUE,
ERR_SEC_PROLOGUE_OO,
ERR_SEC_PROLOGUE_REP,
ERR_SEC_NAME,
+ ERR_ARGS_EQ0,
+ ERR_ARGS_EQ1,
ERR_ARGS_GE1,
- ERR_ARGS_MANY
+ ERR_ARGS_LE2,
+ ERR_ARGS_MANY,
+ ERR_SYNTAX_CHILDHEAD,
+ ERR_SYNTAX_CHILDBODY,
+ ERR_SYNTAX_EMPTYBODY,
+ ERR_SYNTAX_EMPTYHEAD
+};
+
+enum mdoc_att {
+ ATT_DEFAULT = 0,
+ ATT_v1,
+ ATT_v2,
+ ATT_v3,
+ ATT_v4,
+ ATT_v5,
+ ATT_v6,
+ ATT_v7,
+ ATT_32v,
+ ATT_V1,
+ ATT_V2,
+ ATT_V3,
+ ATT_V4
};
enum mdoc_warn {
WARN_SYNTAX_WS_EOLN,
WARN_SYNTAX_MACLIKE,
+ WARN_SYNTAX_ARGLIKE,
+ WARN_SYNTAX_QUOTED,
+ WARN_SYNTAX_EMPTYBODY,
+ WARN_IGN_AFTER_BLK,
+ WARN_IGN_BEFORE_BLK,
+ WARN_IGN_OBSOLETE,
WARN_SEC_OO,
WARN_ARGS_GE1,
- WARN_SYNTAX_ARGLIKE
+ WARN_ARGS_EQ0,
+ WARN_COMPAT_TROFF
};
struct mdoc_arg {
struct mdoc_node *parent;
struct mdoc_node *child;
struct mdoc_node *next;
+ struct mdoc_node *prev;
enum mdoc_type type;
union mdoc_data data;
};