aboutsummaryrefslogtreecommitdiffstats
path: root/libparser-generate.1
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2021-04-17 23:41:01 +0200
committerMattias Andrée <maandree@kth.se>2021-04-17 23:41:01 +0200
commitc04509285946bc045f60a9e0633d818a49718fc0 (patch)
treecb9b83a4f83d3a606da7a32bf29dd78973a253d2 /libparser-generate.1
parentreadme: no left recursion (diff)
downloadlibparser-c04509285946bc045f60a9e0633d818a49718fc0.tar.gz
libparser-c04509285946bc045f60a9e0633d818a49718fc0.tar.bz2
libparser-c04509285946bc045f60a9e0633d818a49718fc0.tar.xz
Add libparser.7 and libparser-generate.1
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r--libparser-generate.163
1 files changed, 63 insertions, 0 deletions
diff --git a/libparser-generate.1 b/libparser-generate.1
new file mode 100644
index 0000000..47ef367
--- /dev/null
+++ b/libparser-generate.1
@@ -0,0 +1,63 @@
+.TH LIBPARSER-GENERATE 7 LIBPARSER
+.SH NAME
+libparser-generate \- Generate grammar definition for libparser
+
+.SH SYNPOSIS
+.B libparser-generate
+.I main-rule
+
+.SH DESCRIPTION
+The
+.B libparser-generate
+utility parsers the standard input according to the
+grammar specified in
+.BR libparser (7)
+and prints to the standard output a C source file
+containing the definition for
+.B libparser_rule
+that is declared in
+.B <libparser.h>
+as
+.PP
+.RS
+.nf
+.I extern const struct libparser_rule *const libparser_rule_table[];
+.fi
+.RE
+.PP
+This table will contain all defined rules, plus three
+special rules:
+.TP
+.B @start
+.nf
+.BI "@start = " main-rule ", (@eof | @noeof);"
+.fi
+
+where
+.I main-rule
+is the value of the
+.I main-rule
+operand in the command line. This
+.RB [ @start ]
+is the rule the
+.BR libparser_parse_file (3)
+function will use when parsing input.
+.TP
+.B @eof
+This rule has a special definition, it is
+matched if the end of the file has been
+reached.
+.TP
+.B @noeof
+.nf
+.B "@noeof = -;"
+.fi
+
+This rule is simple defined as an exception,
+causing the parsing to terminate at the end
+with an exception of it didn't reach the end
+of the file.
+
+.SH SEE ALSO
+.BR libparser (7),
+.BR libparser_parse_file (3)