aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2011-05-15 13:51:03 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2011-05-15 14:05:39 +0300
commita0826b4c7cd66c4862d9b61bb7e14d73fcba28f6 (patch)
tree71762fca263967e5803ce803b0a0aa94555e125d /doc
parentfd64fa62bc68d8c2e0d693033e874fcc1f023544 (diff)
downloadgrecs-a0826b4c7cd66c4862d9b61bb7e14d73fcba28f6.tar.gz
grecs-a0826b4c7cd66c4862d9b61bb7e14d73fcba28f6.tar.bz2
Provide a framework for multiple parsers. Implement meta1 parser.
* Makefile.am (EXTRA_DIST): Add build-aux/yyrename * am/grecs.m4: New options: parser-meta1 and all-parsers * src/.gitignore: Update. * src/Make.am [GRECS_COND_META1_PARSER]: Set GRECS_PARSER_META1 and GRECS_EXTRA_META1 (GRECS_SRC): Add new files. (EXTRA_DIST): Add GRECS_EXTRA_META1. (LEXCOMPILE,YACCCOMPILE): Redefine * src/grecs-gram.y: Don't include yygrecs.h (grecs_vasprintf,grecs_asprintf): Move to a separate file. (grecs_parse): Rename to grecs_grecs_parser. Actual grecs_parse is defined in parser.c (grecs_gram_trace): Move to parser.c * src/grecs-lex.l: Don't include yygrecs.h Use line_acc functions. * src/grecs.h (grecs_trace_flags): New extern. (GRECS_TRACE_GRAM, GRECS_TRACE_LEX): New flags. (grecs_lex_begin): Change signature. (grecs_grecs_parser,grecs_meta1_parser): New protos. (grecs_line_acc_create) (grecs_line_acc_free,grecs_line_acc_grow_char) (grecs_line_acc_grow_char_unescape) (grecs_line_acc_grow) (grecs_line_acc_grow_unescape_last): New protos. (GRECS_TXTACC_BUFSIZE): New const (grecs_txtacc_create,grecs_txtacc_free) (grecs_txtacc_grow,grecs_txtacc_finish) (grecs_txtacc_free_string): New protos. (grecs_value_match): New proto. * src/wordsplit.c (quote_transtab): Translate \" * src/yygrecs.h: Remove. * src/yytrans: New file. * build-aux/yyrename: New file. * src/asprintf.c: New file. * src/lineacc.c: New file. * src/meta1-gram.y: New file. * src/meta1-lex.l: New file. * src/parser.c: New file. * src/txtacc.c: New file. * doc/grecs_parse.3: Update. * doc/GRECS_SETUP.3: Update.
Diffstat (limited to 'doc')
-rw-r--r--doc/GRECS_SETUP.38
-rw-r--r--doc/grecs_parse.38
2 files changed, 10 insertions, 6 deletions
diff --git a/doc/GRECS_SETUP.3 b/doc/GRECS_SETUP.3
index c24399e..13b568e 100644
--- a/doc/GRECS_SETUP.3
+++ b/doc/GRECS_SETUP.3
@@ -14,7 +14,7 @@
.\" You should have received a copy of the GNU General Public License
.\" along with Grecs. If not, see <http://www.gnu.org/licenses/>.
.\"
-.TH GRECS_SETUP 3 "May 8, 2011" "GRECS" "Grecs User Reference"
+.TH GRECS_SETUP 3 "May 15, 2011" "GRECS" "Grecs User Reference"
.SH NAME
GRECS_SETUP \- Initialize \fBgrecs\fR submodule.
.SH SYNOPSIS
@@ -44,6 +44,12 @@ The
argument is a space-separated list of options. The following options
are understood:
.TP
+.B all-parsers
+Compile all available parsers.
+.TP
+.B parser-meta1
+Build the parser for MeTA1 configuration files.
+.TP
.B no-preproc
Disable the use of preprocessor.
.TP
diff --git a/doc/grecs_parse.3 b/doc/grecs_parse.3
index 2abc417..dff6759 100644
--- a/doc/grecs_parse.3
+++ b/doc/grecs_parse.3
@@ -149,13 +149,11 @@ screen:
int
main(int argc, char **argv)
{
- struct grecs_node *tree, *node;
+ struct grecs_node *tree;
tree = grecs_parse(argv[1]);
- for (node = tree; node; node = node->next) {
- grecs_format_node(node, GRECS_NODE_FLAG_DEFAULT, stdout);
- fputc('\n', stdout);
- }
+ grecs_format_node(tree, GRECS_NODE_FLAG_DEFAULT, stdout);
+ fputc('\\n', stdout);
grecs_tree_free(tree);
exit(0);
}

Return to:

Send suggestions and report system problems to the System administrator.