From 41f6ac46e7b6ef3fa6733d3d75dd787a4c6e4a0d Mon Sep 17 00:00:00 2001 From: Kolan Sh Date: Fri, 17 Jun 2011 19:03:06 +0400 Subject: [PATCH] =?UTF-8?q?=D0=B4=D0=BE=D0=BC=D0=BE=D0=B9=20=D0=BF=D0=BE?= =?UTF-8?q?=D1=80=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- c/tex_parser/tex_table.c | 24 ++++++++++++++++++++---- c/tex_parser/tex_table.geany | 12 +++++++----- c/tex_parser/tex_table.h | 6 +++--- tex/tables/tables5.lyx | 2 +- 4 files changed, 31 insertions(+), 13 deletions(-) diff --git a/c/tex_parser/tex_table.c b/c/tex_parser/tex_table.c index 6d5a125..8a1859b 100644 --- a/c/tex_parser/tex_table.c +++ b/c/tex_parser/tex_table.c @@ -6,6 +6,8 @@ #include "zalloc_ext.h" #include "zalloc.h" +#define MAX_TEX_STACK_LEVEL 128 + int parse_table(const char *table_source, size_t len, struct table_s *table, struct xerror_s *error) { if (!len) @@ -16,18 +18,32 @@ int parse_table(const char *table_source, size_t len, struct table_s *table, str enum where_e { - IN_GLOBAL, + IN_GLOBAL = 0, + IN_COMMENT, IN_TAG, + IN_TAG_CRLBRACEPAR, + IN_TAG_SQRBRACEPAR, + IN_TAG_SQUAREBRACE_COMMA, + + + + IN_TAGCLOSE, + + //~ IN_TAG, IN_TAG_END, IN_TAG_BEGIN_END, IN_TAG_PARAM, IN_TAG_BEGIN_PARAM - } where = IN_GLOBAL; + } where_stack[MAX_TEX_STACK_LEVEL] = {IN_GLOBAL}; + + int tex_level = 0; + + //~ where_e where_stack[32] = ; /* Ищем первое вхождение * \begin{longtable} */ - for (i = 0; i < len; i++) { +/* for (i = 0; i < len; i++) { char c = table_source[i]; switch (where) { @@ -79,7 +95,7 @@ int parse_table(const char *table_source, size_t len, struct table_s *table, str break; } - } + }*/ table->id = "Drossel1.Table1"; diff --git a/c/tex_parser/tex_table.geany b/c/tex_parser/tex_table.geany index fa8fd3b..8fbacd7 100644 --- a/c/tex_parser/tex_table.geany +++ b/c/tex_parser/tex_table.geany @@ -17,11 +17,13 @@ long_line_column=72 [files] current_page=1 -FILE_NAME_0=375;C;0;16;1;1;1;/home/kolan/dev/c/tex_parser/tex_table_test.c;0 -FILE_NAME_1=665;C;0;16;1;1;1;/home/kolan/dev/c/tex_parser/tex_table.c;0 -FILE_NAME_2=2213;C;0;16;1;1;1;/home/kolan/dev/c/tex_parser/tex_table.h;0 -FILE_NAME_3=0;C;0;16;1;1;1;/home/kolan/dev/c/tex_parser/tex_table_tags.h;0 -FILE_NAME_4=1725;Make;0;16;1;1;1;/home/kolan/dev/c/tex_parser/Makefile;0 +FILE_NAME_0=216;C;0;16;1;1;1;/home/kolan/dev/c/tex_parser/tex_table_test.c;0 +FILE_NAME_1=415;C;0;16;1;1;1;/home/kolan/dev/c/tex_parser/tex_table.c;0 +FILE_NAME_2=2117;LaTeX;0;45;1;1;1;/home/kolan/dev/c/tex_parser/tables4.tex;0 +FILE_NAME_3=9842;LaTeX;0;45;1;1;1;/home/kolan/dev/c/tex_parser/tables5.tex;0 +FILE_NAME_4=2352;C;0;16;1;1;1;/home/kolan/dev/c/tex_parser/tex_table.h;0 +FILE_NAME_5=612;C;0;16;1;1;1;/home/kolan/dev/c/tex_parser/tex_table_tags.h;0 +FILE_NAME_6=1740;Make;0;16;1;1;1;/home/kolan/dev/c/tex_parser/Makefile;0 [build-menu] NF_00_LB=_Сделать diff --git a/c/tex_parser/tex_table.h b/c/tex_parser/tex_table.h index 7783f16..d6f4ff3 100644 --- a/c/tex_parser/tex_table.h +++ b/c/tex_parser/tex_table.h @@ -1,5 +1,5 @@ -#ifndef TEX_TABLE_H -#define TEX_TABLE_H +#ifndef _TEX_TABLE_H +#define _TEX_TABLE_H #include @@ -51,4 +51,4 @@ struct table_s { int parse_table(const char *table_source, size_t len, struct table_s *table, struct xerror_s *error); -#endif // TEX_TABLE_H +#endif diff --git a/tex/tables/tables5.lyx b/tex/tables/tables5.lyx index 201e616..0f36bb8 100644 --- a/tex/tables/tables5.lyx +++ b/tex/tables/tables5.lyx @@ -122,7 +122,7 @@ mbox{C}$ \begin_layout Standard \lang russian -от +от__________ \begin_inset ERT status open