summaryrefslogtreecommitdiff
path: root/conf/cf-lex.l
diff options
context:
space:
mode:
authorMartin Mares <mj@ucw.cz>2000-06-04 15:22:20 +0000
committerMartin Mares <mj@ucw.cz>2000-06-04 15:22:20 +0000
commit58f9453776dff92b4ee4c81f6ca3601b6ee9f041 (patch)
tree6a10f32998b11766a71f91f715d20ac0ce8c60be /conf/cf-lex.l
parentcdb898cfd40fe866a1835689814113075b7b5a67 (diff)
Moved parser docs to cf-lex.l, so that the parser compiles.
Diffstat (limited to 'conf/cf-lex.l')
-rw-r--r--conf/cf-lex.l32
1 files changed, 32 insertions, 0 deletions
diff --git a/conf/cf-lex.l b/conf/cf-lex.l
index e7cb2c8a..8f8fcfbd 100644
--- a/conf/cf-lex.l
+++ b/conf/cf-lex.l
@@ -424,3 +424,35 @@ cf_symbol_class_name(struct symbol *sym)
return "unknown type";
}
}
+
+
+/**
+ * DOC: Parser
+ *
+ * Both the configuration and CLI commands are analysed using a syntax
+ * driven parser generated by the |bison| tool from a grammar which
+ * is constructed from information gathered from grammar snippets by
+ * the |gen_parser.m4| script.
+ *
+ * Grammar snippets are files (usually with extension |.Y|) contributed
+ * by various BIRD modules to provide information about syntax of their
+ * configuration and their CLI commands. Each snipped consists of several
+ * section, each of them starting with a special keyword: |CF_HDR| for
+ * a list of |#include| directives needed by the C code, |CF_DEFINES|
+ * for a list of C declarations, |CF_DECLS| for |bison| declarations
+ * including keyword definitions specified as |CF_KEYWORDS|, |CF_GRAMMAR|
+ * for the grammar rules, |CF_CODE| for auxillary C code and finally
+ * |CF_END| at the end of the snippet.
+ *
+ * To create references between the snippets, it's possible to define
+ * multi-part rules by utilizing the |CF_ADDTO| macro which adds a new
+ * alternative to a multi-part rule.
+ *
+ * CLI commands are defined using a |CF_CLI| macro. Its parameters are:
+ * the list of keywords determining the command, the list of paramaters,
+ * help text for the parameters and help text for the command.
+ *
+ * Values of |enum| filter types can be defined using |CF_ENUM| with
+ * the following parameters: name of filter type, prefix common for all
+ * literals of this type, names of all the possible values.
+ */