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 int wordcharacters[256]; // for detection of the word boundaries
30 char line[MAXPREVLINE][MAXLNLEN]; // parsed and previous lines
31 char urlline[MAXLNLEN]; // mask for url detection
33 int actual; // actual line
34 int head; // head position
35 int token; // begin of token
36 int state; // state of automata
37 int utf8; // UTF-8 character encoding
38 int next_char(char * line, int * pos);
39 unsigned short * wordchars_utf16;
45 TextParser(unsigned short * wordchars, int len);
46 TextParser(const char * wc);
47 void init(const char *);
48 void init(unsigned short * wordchars, int len);
49 virtual ~TextParser();
51 void put_line(char * line);
53 char * get_prevline(int n);
54 virtual char * next_token();
55 virtual int change_token(const char * word);
56 void set_url_checking(int check);
59 int is_wordchar(char * w);
60 inline int is_utf8() { return utf8; }
61 const char * get_latin1(char * s);
65 int get_url(int token_pos, int * head);
66 char * alloc_token(int token, int * head);