Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

syntax.cc File Reference

#include <ctype.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include "htexcept.h"
#include "regex.h"
#include "syntax.h"
#include "htpal.h"

Go to the source code of this file.

Defines

#define LSTSET(state)   (1<<(state))
#define SL_RULE_ANYCHAR(needstates, token)
#define SL_RULE_LINEEND(needstates, state)
#define LEX_CST_NORMAL   1
#define LEX_CST_STRING   2
#define LEX_CST_PREPROCESS   3
#define LEX_CST_COMMENT   4
#define LEX_CST_COMMENT_EOL   5
#define LEX_CTOK_ERROR   1
#define LEX_CTOK_WHITESPACE   2
#define LEX_CTOK_COMMENT   3
#define LEX_CTOK_PREPROCESS   4
#define LEX_CTOK_IDENTIFIER   5
#define LEX_CTOK_RIDENTIFIER   6
#define LEX_CTOK_NUMBER   7
#define LEX_CTOK_FNUMBER   8
#define LEX_CTOK_STRING   9
#define LEX_CTOK_CHAR   10
#define LEX_CTOK_SYMBOL   11
#define palkey_syntax_c_default   "c/default"
#define LEX_HTMLST_NORMAL   1
#define LEX_HTMLST_TAG_OPEN   2
#define LEX_HTMLST_TAG   3
#define LEX_HTMLST_COMMENT   4
#define LEX_HTMLST_CSS   5
#define LEX_HTMLST_SCRIPT   6
#define LEX_HTMLTOK_ERROR   1
#define LEX_HTMLTOK_WHITESPACE   2
#define LEX_HTMLTOK_NORMAL   3
#define LEX_HTMLTOK_COMMENT   4
#define LEX_HTMLTOK_TAG   5
#define LEX_HTMLTOK_ATTRIBUTE   6
#define LEX_HTMLTOK_SYMBOL   7
#define LEX_HTMLTOK_CDATA   8
#define LEX_HTMLTOK_ENTITY   9

Functions

bool regmatch (char *str, regex_t *preg, int *len)
bool match_sorted_stringtable (char *s, UINT slen, char **strings, UINT strings_count)
int qsort_stringlist (const void *e1, const void *e2)
char ** create_sorted_stringtable (char **table)

Variables

syntax_lexer_rule c_syntax_lexer_rules []
char * c_reserved []
syntax_lexer_rule html_syntax_lexer_rules []


Define Documentation

#define LEX_CST_COMMENT   4
 

Definition at line 249 of file syntax.cc.

#define LEX_CST_COMMENT_EOL   5
 

Definition at line 250 of file syntax.cc.

#define LEX_CST_NORMAL   1
 

Definition at line 246 of file syntax.cc.

Referenced by ht_c_syntax_lexer::getinitstate().

#define LEX_CST_PREPROCESS   3
 

Definition at line 248 of file syntax.cc.

#define LEX_CST_STRING   2
 

Definition at line 247 of file syntax.cc.

#define LEX_CTOK_CHAR   10
 

Definition at line 262 of file syntax.cc.

Referenced by ht_c_syntax_lexer::gettoken_color().

#define LEX_CTOK_COMMENT   3
 

Definition at line 255 of file syntax.cc.

Referenced by ht_c_syntax_lexer::gettoken_color().

#define LEX_CTOK_ERROR   1
 

Definition at line 253 of file syntax.cc.

Referenced by ht_c_syntax_lexer::geterrortoken().

#define LEX_CTOK_FNUMBER   8
 

Definition at line 260 of file syntax.cc.

Referenced by ht_c_syntax_lexer::gettoken_color().

#define LEX_CTOK_IDENTIFIER   5
 

Definition at line 257 of file syntax.cc.

Referenced by ht_c_syntax_lexer::gettoken(), and ht_c_syntax_lexer::gettoken_color().

#define LEX_CTOK_NUMBER   7
 

Definition at line 259 of file syntax.cc.

Referenced by ht_c_syntax_lexer::gettoken_color().

#define LEX_CTOK_PREPROCESS   4
 

Definition at line 256 of file syntax.cc.

Referenced by ht_c_syntax_lexer::gettoken_color().

#define LEX_CTOK_RIDENTIFIER   6
 

Definition at line 258 of file syntax.cc.

Referenced by ht_c_syntax_lexer::gettoken(), and ht_c_syntax_lexer::gettoken_color().

#define LEX_CTOK_STRING   9
 

Definition at line 261 of file syntax.cc.

Referenced by ht_c_syntax_lexer::gettoken_color().

#define LEX_CTOK_SYMBOL   11
 

Definition at line 263 of file syntax.cc.

Referenced by ht_c_syntax_lexer::gettoken_color().

#define LEX_CTOK_WHITESPACE   2
 

Definition at line 254 of file syntax.cc.

Referenced by ht_c_syntax_lexer::gettoken_color().

#define LEX_HTMLST_COMMENT   4
 

Definition at line 497 of file syntax.cc.

#define LEX_HTMLST_CSS   5
 

Definition at line 498 of file syntax.cc.

#define LEX_HTMLST_NORMAL   1
 

Definition at line 494 of file syntax.cc.

Referenced by ht_html_syntax_lexer::getinitstate().

#define LEX_HTMLST_SCRIPT   6
 

Definition at line 499 of file syntax.cc.

#define LEX_HTMLST_TAG   3
 

Definition at line 496 of file syntax.cc.

#define LEX_HTMLST_TAG_OPEN   2
 

Definition at line 495 of file syntax.cc.

#define LEX_HTMLTOK_ATTRIBUTE   6
 

Definition at line 507 of file syntax.cc.

Referenced by ht_html_syntax_lexer::gettoken_color().

#define LEX_HTMLTOK_CDATA   8
 

Definition at line 509 of file syntax.cc.

Referenced by ht_html_syntax_lexer::gettoken_color().

#define LEX_HTMLTOK_COMMENT   4
 

Definition at line 505 of file syntax.cc.

Referenced by ht_html_syntax_lexer::gettoken_color().

#define LEX_HTMLTOK_ENTITY   9
 

Definition at line 510 of file syntax.cc.

Referenced by ht_html_syntax_lexer::gettoken_color().

#define LEX_HTMLTOK_ERROR   1
 

Definition at line 502 of file syntax.cc.

Referenced by ht_html_syntax_lexer::geterrortoken(), and ht_html_syntax_lexer::gettoken_color().

#define LEX_HTMLTOK_NORMAL   3
 

Definition at line 504 of file syntax.cc.

Referenced by ht_html_syntax_lexer::gettoken_color().

#define LEX_HTMLTOK_SYMBOL   7
 

Definition at line 508 of file syntax.cc.

Referenced by ht_html_syntax_lexer::gettoken_color().

#define LEX_HTMLTOK_TAG   5
 

Definition at line 506 of file syntax.cc.

Referenced by ht_html_syntax_lexer::gettoken_color().

#define LEX_HTMLTOK_WHITESPACE   2
 

Definition at line 503 of file syntax.cc.

Referenced by ht_html_syntax_lexer::gettoken_color().

#define LSTSET state   )     (1<<(state))
 

Definition at line 72 of file syntax.cc.

Referenced by ht_lang_syntax_lexer::gettoken().

#define palkey_syntax_c_default   "c/default"
 

Definition at line 342 of file syntax.cc.

Referenced by ht_c_syntax_lexer::reloadpalette().

#define SL_RULE_ANYCHAR needstates,
token   ) 
 

Value:

{ needstates,\
          false, LRST_ANYCHAR, NULL, 0, token }

Definition at line 74 of file syntax.cc.

#define SL_RULE_LINEEND needstates,
state   ) 
 

Value:

{ needstates,\
          false, LRST_REGEX, "$", state, 0 }

Definition at line 78 of file syntax.cc.


Function Documentation

char** create_sorted_stringtable char **  table  ) 
 

Definition at line 650 of file syntax.cc.

References malloc(), and qsort_stringlist().

Referenced by ht_c_syntax_lexer::init().

bool match_sorted_stringtable char *  s,
UINT  slen,
char **  strings,
UINT  strings_count
 

Definition at line 45 of file syntax.cc.

References UINT.

Referenced by ht_c_syntax_lexer::gettoken().

int qsort_stringlist const void *  e1,
const void *  e2
 

Definition at line 645 of file syntax.cc.

Referenced by create_sorted_stringtable().

bool regmatch char *  str,
regex_t preg,
int *  len
 

Definition at line 33 of file syntax.cc.

References len, regex_t, regexec(), regmatch_t::rm_eo, and regmatch_t::rm_so.

Referenced by ht_lang_syntax_lexer::gettoken().


Variable Documentation

char* c_reserved[]
 

Initial value:

{

        "bool", "char", "void", "int", "short", "long",
        "unsigned", "signed", "float", "double",

        "true", "false",

        "return", "if", "else", "while", "do", "goto", "asm",
        "switch", "case", "default", "break", "continue", "for",

        "new", "delete", "this",

        "struct", "union", "enum", "class", "template", "operator",
        "typedef",

        "public", "protected", "private", "friend", "const",
        "extern", "inline", "register", "static", "volatile", "virtual",

        "try", "catch", "throw",

        "sizeof",

        NULL
}

Definition at line 316 of file syntax.cc.

Referenced by ht_c_syntax_lexer::init().

syntax_lexer_rule c_syntax_lexer_rules[]
 

Definition at line 265 of file syntax.cc.

Referenced by ht_c_syntax_lexer::init().

syntax_lexer_rule html_syntax_lexer_rules[]
 

Definition at line 512 of file syntax.cc.

Referenced by ht_html_syntax_lexer::init().


Generated on Fri May 7 21:15:52 2004 by doxygen 1.3.5