mirror of
https://forge.fsky.io/lda/Parsee.git
synced 2026-03-14 02:15:10 +00:00
[ADD/WIP] Start making a simple SAX parser, ASwerk
This commit is contained in:
parent
0fa95c2d14
commit
79217d3608
14 changed files with 1066 additions and 26 deletions
36
src/include/XML.h
Normal file
36
src/include/XML.h
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
#ifndef PARSEE_XML_H
|
||||
#define PARSEE_XML_H
|
||||
|
||||
#include <Cytoplasm/HashMap.h>
|
||||
#include <Cytoplasm/Stream.h>
|
||||
|
||||
typedef struct XMLexer XMLexer;
|
||||
typedef struct XMLEvent {
|
||||
enum {
|
||||
XML_LEXER_UNKNOWN = 0,
|
||||
XML_LEXER_STARTELEM,
|
||||
XML_LEXER_ELEM, /* Empty attr */
|
||||
XML_LEXER_DATA,
|
||||
XML_LEXER_ENDELEM,
|
||||
|
||||
XML_RELAX
|
||||
} type;
|
||||
|
||||
int line, col;
|
||||
size_t offset;
|
||||
|
||||
/* The element name */
|
||||
char *element;
|
||||
|
||||
/* Attributes hashmap */
|
||||
HashMap *attrs;
|
||||
|
||||
/* The decoded data */
|
||||
char *data;
|
||||
} XMLEvent;
|
||||
|
||||
extern XMLexer * XMLCreateLexer(Stream *, bool);
|
||||
extern XMLEvent * XMLCrank(XMLexer *);
|
||||
extern void XMLFreeEvent(XMLEvent *);
|
||||
extern void XMLFreeLexer(XMLexer *);
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue