добавлены модули graphics и table
This commit is contained in:
parent
848b51ee9c
commit
6806be37ce
|
@ -8,7 +8,7 @@ LIBRARIES=
|
||||||
#-lexpat $(shell pkg-config --cflags liblist)
|
#-lexpat $(shell pkg-config --cflags liblist)
|
||||||
TARGET=tex_parser_test
|
TARGET=tex_parser_test
|
||||||
|
|
||||||
#_______________________________________
|
#________________________________________
|
||||||
# BUILD SCRIPT (don't change) |
|
# BUILD SCRIPT (don't change) |
|
||||||
#_______________________________________|
|
#_______________________________________|
|
||||||
# Compiler flags
|
# Compiler flags
|
||||||
|
|
|
@ -7,6 +7,8 @@
|
||||||
#include "zalloc_ext.h"
|
#include "zalloc_ext.h"
|
||||||
#include "zalloc.h"
|
#include "zalloc.h"
|
||||||
#include "c_const.h"
|
#include "c_const.h"
|
||||||
|
#include "xerror.h"
|
||||||
|
#include "zerror.h"
|
||||||
|
|
||||||
/* only for debug */
|
/* only for debug */
|
||||||
#define __TEX_PARSER_DEBUG 0
|
#define __TEX_PARSER_DEBUG 0
|
||||||
|
@ -42,7 +44,7 @@ void tex_parse(const char *source, size_t len, struct zerror_s **error)
|
||||||
|
|
||||||
} where_stack[MAX_TEX_STACK_LEVEL] = {IN_UNDEF};
|
} where_stack[MAX_TEX_STACK_LEVEL] = {IN_UNDEF};
|
||||||
|
|
||||||
char *tag = NULL;
|
char *tag = NULL, *param = NULL;
|
||||||
size_t i = 0;
|
size_t i = 0;
|
||||||
size_t tex_level = 0;
|
size_t tex_level = 0;
|
||||||
|
|
||||||
|
@ -66,7 +68,7 @@ void tex_parse(const char *source, size_t len, struct zerror_s **error)
|
||||||
switch (where_stack[tex_level]) {
|
switch (where_stack[tex_level]) {
|
||||||
case IN_UNDEF:
|
case IN_UNDEF:
|
||||||
if (c == '\\') {
|
if (c == '\\') {
|
||||||
tag = zfree_null(tag);
|
zclear(&tag);
|
||||||
where_stack[++tex_level] = IN_TAG;
|
where_stack[++tex_level] = IN_TAG;
|
||||||
|
|
||||||
|
|
||||||
|
@ -143,7 +145,7 @@ void tex_parse(const char *source, size_t len, struct zerror_s **error)
|
||||||
#ifdef __TEX_PARSER_DEBUG
|
#ifdef __TEX_PARSER_DEBUG
|
||||||
printf("\\%s\n", tag);
|
printf("\\%s\n", tag);
|
||||||
#endif
|
#endif
|
||||||
tag = zfree_null(tag);
|
zclear(&tag);
|
||||||
|
|
||||||
i--;
|
i--;
|
||||||
}
|
}
|
||||||
|
@ -164,7 +166,7 @@ void tex_parse(const char *source, size_t len, struct zerror_s **error)
|
||||||
where_stack[tex_level--] = IN_UNDEF;
|
where_stack[tex_level--] = IN_UNDEF;
|
||||||
|
|
||||||
} else if (c == '\\') { // new tag
|
} else if (c == '\\') { // new tag
|
||||||
tag = zfree_null(tag);
|
zclear(&tag);
|
||||||
where_stack[++tex_level] = IN_TAG;
|
where_stack[++tex_level] = IN_TAG;
|
||||||
|
|
||||||
} else if (isspace(c)) {
|
} else if (isspace(c)) {
|
||||||
|
@ -194,7 +196,7 @@ void tex_parse(const char *source, size_t len, struct zerror_s **error)
|
||||||
case IN_TAG_MULTICOLUMN:
|
case IN_TAG_MULTICOLUMN:
|
||||||
case IN_TAG_MULTIROW:
|
case IN_TAG_MULTIROW:
|
||||||
case IN_TAG_TABULARNEWLINE:
|
case IN_TAG_TABULARNEWLINE:
|
||||||
switch(where_stack[tex_level]) {
|
/*switch (where_stack[tex_level]) {
|
||||||
|
|
||||||
case IN_TAG_UNKNOWN:
|
case IN_TAG_UNKNOWN:
|
||||||
|
|
||||||
|
@ -247,7 +249,7 @@ void tex_parse(const char *source, size_t len, struct zerror_s **error)
|
||||||
where_stack[tex_level], source[i], (u_int8_t)source[i], i);
|
where_stack[tex_level], source[i], (u_int8_t)source[i], i);
|
||||||
return;
|
return;
|
||||||
break;
|
break;
|
||||||
}
|
}//*/
|
||||||
|
|
||||||
if (c == '{' || c == '[')
|
if (c == '{' || c == '[')
|
||||||
where_stack[++tex_level] = IN_TAGPARM;
|
where_stack[++tex_level] = IN_TAGPARM;
|
||||||
|
@ -257,7 +259,7 @@ void tex_parse(const char *source, size_t len, struct zerror_s **error)
|
||||||
i--;
|
i--;
|
||||||
|
|
||||||
} else if (c == '\\') {
|
} else if (c == '\\') {
|
||||||
tag = zfree_null(tag);
|
zclear(&tag);
|
||||||
where_stack[tex_level] = IN_TAG;
|
where_stack[tex_level] = IN_TAG;
|
||||||
|
|
||||||
} else if (isspace(c))
|
} else if (isspace(c))
|
||||||
|
|
|
@ -16,18 +16,16 @@ long_line_behaviour=1
|
||||||
long_line_column=72
|
long_line_column=72
|
||||||
|
|
||||||
[files]
|
[files]
|
||||||
current_page=7
|
current_page=0
|
||||||
FILE_NAME_0=846;C;0;16;1;1;1;/home/kolan/dev/c/tex_parser/tex_parser_test.c;0
|
FILE_NAME_0=79;C;0;16;1;1;1;/home/kolan/dev/c/tex_parser/tex_parser_test.c;0
|
||||||
FILE_NAME_1=284;C;0;16;1;1;1;/home/kolan/dev/c/tex_parser/tex_parser.c;0
|
FILE_NAME_1=5881;C;0;16;1;1;1;/home/kolan/dev/c/tex_parser/tex_parser.c;0
|
||||||
FILE_NAME_2=655;C;0;16;1;1;1;/home/kolan/dev/c/tex_parser/tex_parser_tags.h;0
|
FILE_NAME_2=298;C;0;16;1;1;1;/home/kolan/dev/c/tex_parser/tex_parser.h;0
|
||||||
FILE_NAME_3=1952;Make;0;16;1;1;1;/home/kolan/dev/c/tex_parser/Makefile;0
|
FILE_NAME_3=525;C;0;16;1;1;1;/home/kolan/dev/c/tex_parser/tex_parser_tags.h;0
|
||||||
FILE_NAME_4=410;C;0;16;1;1;1;/home/kolan/dev/c/tex_parser/tex_parser.h;0
|
FILE_NAME_4=50;C;0;16;1;1;1;/home/kolan/dev/c/tex_parser/tex_parser_table.c;0
|
||||||
FILE_NAME_5=1858;C;0;16;1;1;1;/home/kolan/projects/include/xerror.c;0
|
FILE_NAME_5=57;C;0;16;1;1;1;/home/kolan/dev/c/tex_parser/tex_parser_table.h;0
|
||||||
FILE_NAME_6=877;C;0;16;1;1;1;/home/kolan/projects/include/xerror.h;0
|
FILE_NAME_6=97;C;0;16;1;1;1;/home/kolan/dev/c/tex_parser/tex_parser_const.h;0
|
||||||
FILE_NAME_7=1049;C;0;16;1;1;1;/home/kolan/projects/include/zerror.c;0
|
FILE_NAME_7=3556;Make;0;16;1;1;1;/home/kolan/dev/c/tex_parser/Makefile;0
|
||||||
FILE_NAME_8=1912;C;0;16;1;1;1;/home/kolan/projects/include/zerror.h;0
|
FILE_NAME_8=0;C;0;16;1;1;1;/home/kolan/projects/include/zerror.h;0
|
||||||
FILE_NAME_9=1649;C;0;16;1;1;1;/home/kolan/projects/include/xalloc.c;0
|
|
||||||
FILE_NAME_10=4903;C;0;16;1;1;1;/home/kolan/projects/include/xalloc.h;0
|
|
||||||
|
|
||||||
[build-menu]
|
[build-menu]
|
||||||
NF_00_LB=_Сделать
|
NF_00_LB=_Сделать
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
#ifndef _TEX_PARSER_CONST_H
|
||||||
|
#define _TEX_PARSER_CONST_H
|
||||||
|
|
||||||
|
#define MAX_TEX_STACK_LEVEL 128
|
||||||
|
|
||||||
|
#endif
|
|
@ -0,0 +1,6 @@
|
||||||
|
#include "tex_parser_graphics.h"
|
||||||
|
|
||||||
|
void sssttuubbsdf()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,4 @@
|
||||||
|
#ifndef _TEX_PARSER_GRAPHICS_H
|
||||||
|
#define _TEX_PARSER_GRAPHICS_H
|
||||||
|
|
||||||
|
#endif
|
|
@ -0,0 +1,6 @@
|
||||||
|
#include "tex_parser_table.h"
|
||||||
|
|
||||||
|
void sssttuubbasfsd()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,6 @@
|
||||||
|
#ifndef _TEX_PARSER_TABLE_H
|
||||||
|
#define _TEX_PARSER_TABLE_H
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endif
|
Loading…
Reference in New Issue