2 * parser classes for MySpell
4 * implemented: text, HTML, TeX
6 * Copyright (C) 2002, Laszlo Nemeth
10 #ifndef _TEXTPARSER_HXX_
11 #define _TEXTPARSER_HXX_
13 // set sum of actual and previous lines
29 void init(const char *);
30 void init(unsigned short * wordchars
, int len
);
31 int wordcharacters
[256]; // for detection of the word boundaries
32 char line
[MAXPREVLINE
][MAXLNLEN
]; // parsed and previous lines
33 char urlline
[MAXLNLEN
]; // mask for url detection
35 int actual
; // actual line
36 int head
; // head position
37 int token
; // begin of token
38 int state
; // state of automata
39 int utf8
; // UTF-8 character encoding
40 int next_char(char * line
, int * pos
);
41 unsigned short * wordchars_utf16
;
47 TextParser(unsigned short * wordchars
, int len
);
48 TextParser(const char * wc
);
49 virtual ~TextParser();
51 void put_line(char * line
);
53 char * get_prevline(int n
);
54 virtual char * next_token();
55 int change_token(const char * word
);
56 void set_url_checking(int check
);
59 int is_wordchar(char * w
);
60 const char * get_latin1(char * s
);
64 int get_url(int token_pos
, int * head
);
65 char * alloc_token(int token
, int * head
);