Этот парсер будет болванкой для парсеров таблиц, полей, рисунков и проч.

--HG--
rename : c/tex_parser/tables4.tex => c/tex_parser/ex1.tex
rename : c/tex_parser/tables5.tex => c/tex_parser/ex2.tex
rename : c/tex_parser/tex_table.c => c/tex_parser/tex_parser.c
rename : c/tex_parser/tex_table.geany => c/tex_parser/tex_parser.geany
rename : c/tex_parser/tex_table.h => c/tex_parser/tex_parser.h
rename : c/tex_parser/tex_table_tags.h => c/tex_parser/tex_parser_tags.h
rename : c/tex_parser/tex_table_test.c => c/tex_parser/tex_parser_test.c
This commit is contained in:
Kolan Sh 2011-06-29 11:02:59 +04:00
parent e291dbca64
commit 4dfff10806
8 changed files with 18 additions and 24 deletions

View File

@ -31,7 +31,7 @@ CFLAGS += -Wall
LDFLAGS += -Wall
#~ $(shell pkg-config --libs liblist) -lpthread -lexpat
all: tex_table_test
all: tex_parser_test
ifneq ($(mode),debug)
ifneq ($(mode),profile)
@ -53,13 +53,13 @@ endif
%.o :
$(CC) -c $(CFLAGS) $(LDFLAGS) $(INCLUDE) -o $@ $<
tex_table_test_obj = tex_table_test.o tex_table.o zalloc_ext.o zalloc.o xalloc.o xerror.o
tex_table_test: $(tex_table_test_obj)
$(CC) $(CFLAGS) $(LDFLAGS) $(INCLUDE) -o $@ $(tex_table_test_obj)
tex_parser_test_obj = tex_parser_test.o tex_parser.o zalloc_ext.o zalloc.o xalloc.o xerror.o
tex_parser_test: $(tex_parser_test_obj)
$(CC) $(CFLAGS) $(LDFLAGS) $(INCLUDE) -o $@ $(tex_parser_test_obj)
tex_table_test.o: tex_table_test.c tex_table.o
tex_parser_test.o: tex_parser_test.c tex_parser.o
tex_table.o: tex_table.c tex_table.h zalloc_ext.o zalloc.o xalloc.o
tex_parser.o: tex_parser.c tex_parser.h zalloc_ext.o zalloc.o xalloc.o
zalloc_ext.o: $(KOLAN_INCLUDE)/zalloc_ext.c $(KOLAN_INCLUDE)/zalloc_ext.h zalloc.o xerror.o
@ -70,6 +70,6 @@ xalloc.o: $(KOLAN_INCLUDE)/xalloc.c $(KOLAN_INCLUDE)/xalloc.h xerror.o
xerror.o: $(KOLAN_INCLUDE)/xerror.c $(KOLAN_INCLUDE)/xerror.h
clean:
$(RM) *.o *.out callgrind.out.* *.gcno tex_table_test
$(RM) *.o *.out callgrind.out.* *.gcno tex_parser_test
.PHONY: all clean

View File

@ -1,8 +1,8 @@
#include "tex_table.h"
#include "tex_parser.h"
#include <string.h>
#include <ctype.h>
#include "tex_table_tags.h"
#include "tex_parser_tags.h"
#include "zalloc_ext.h"
#include "zalloc.h"
#include "c_const.h"
@ -83,7 +83,6 @@ int parse_table(const char *table_source, size_t len, struct table_s *table, str
error->message = "unexpected symbol (IN_UDEF)";
return error->code;
}
break;
case IN_COMMENT:

View File

@ -7,7 +7,7 @@ detect_indent=false
indent_mode=2
[project]
name=tex_table_class
name=tex_parser
base_path=/home/kolan/dev/c/tex_parser/
description=
@ -16,13 +16,8 @@ long_line_behaviour=1
long_line_column=72
[files]
current_page=1
FILE_NAME_0=0;C;0;16;1;1;1;/home/kolan/dev/c/tex_parser/tex_table_test.c;0
FILE_NAME_1=1308;C;0;16;1;1;1;/home/kolan/dev/c/tex_parser/tex_table.c;0
FILE_NAME_2=2399;C;0;16;1;1;1;/home/kolan/dev/c/tex_parser/tex_table.h;0
FILE_NAME_3=599;C;0;16;1;1;1;/home/kolan/dev/c/tex_parser/tex_table_tags.h;0
FILE_NAME_4=1762;C;0;16;1;1;1;/home/kolan/projects/include/zalloc_ext.h;0
FILE_NAME_5=1859;Make;0;16;1;1;1;/home/kolan/dev/c/tex_parser/Makefile;0
current_page=0
FILE_NAME_0=1859;Make;0;16;1;1;1;/home/kolan/dev/c/tex_parser/Makefile;0
[build-menu]
NF_00_LB=_Сделать
@ -45,5 +40,5 @@ CFT_02_CM=
CFT_02_WD=%p
filetypes=C;
EX_00_LB=_Выполнить
EX_00_CM=./tex_table_test tables4.tex
EX_00_CM=./tex_parser_test ex1.tex
EX_00_WD=%p

View File

@ -1,5 +1,5 @@
#ifndef _TEX_TABLE_H
#define _TEX_TABLE_H
#ifndef _TEX_PARSER_H
#define _TEX_PARSER_H
#include <sys/types.h>

View File

@ -1,5 +1,5 @@
#ifndef TEX_TABLE_TAGS_H
#define TEX_TABLE_TAGS_H
#ifndef TEX_PARSER_TAGS_H
#define TEX_PARSER_TAGS_H
const char * const TEX_TAG_BEGIN = "begin";
const char * const TEX_TAG_CLINE = "cline";

View File

@ -5,7 +5,7 @@
#include <string.h>
//~ #include <locale.h>
#include "tex_table.h"
#include "tex_parser.h"
#include "zalloc.h"
#include "xalloc.h"
#include "xerror.h"