Lhogho  0.0.028
 All Data Structures Files Functions Variables Typedefs Macros Pages
parser.h
Go to the documentation of this file.
1 //
2 // Project: Lhogho
3 // File: parser.c
4 //
5 // Copyright (C) 2007 P.Boytchev
6 //
7 // Revision history:
8 // 2006-10-26 - file created (from atom.h)
9 // 2007-02-15 - command tokenization
10 // 2007-02-26 - changed tokenization to microprogramming
11 // - ERROR_WINDOW_CHRACTER
12 // - trim_shell_comment()
13 // - purify()
14 // 2007-03-22 - ERROR_HUNGRY_LEFT
15 // 2007-05-17 - license info
16 // 2007-05-22 - doxygen-friendly documentation
17 // 2007-05-27 - preparse()
18 // - ERROR_VACUUM_TO_END, ERROR_WHERES_NAME
19 // 2007-05-29 - deexternalize parse...()
20 // - ERROR_ONE_NAME_ONLY
21 // 2007-06-01 - ERROR_BEG_ME_PARDON
22 // - error codes moved to errors.h
23 // 2007-06-05 - definitions spread to where they belong
24 // 2007-11-26 - barrization, ENBAR, DEBAR
25 //
26 //
27 // This program is free software; you can redistribute it and/or modify
28 // it under the terms of the GNU General Public License as published by
29 // the Free Software Foundation; either version 2 of the License, or
30 // (at your option) any later version.
31 //
32 // This program is distributed in the hope that it will be useful,
33 // but WITHOUT ANY WARRANTY; without even the implied warranty of
34 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
35 // GNU General Public License for more details.
36 //
37 // You should have received a copy of the GNU General Public License
38 // along with this program; if not, write to the Free Software
39 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
40 //
41 
42 
43 #ifndef LHOGHO_PARSER_H
44 #define LHOGHO_PARSER_H
45 
46 #include "stdint.h"
47 #include "globals.h"
48 
49 
50 
51 
52 //===================================================
54 //===================================================
55 #define TOKENIZE_DATA 0
56 #define TOKENIZE_COMMANDS 1
57 #define TOKENIZE_READWORD 2
58 #define TOKENIZE_READLIST 3
59 
60 
61 
62 
63 
64 #ifdef UNICODE
65  #define ENBAR(ch) ((ch)>127 ? (ch) : enbar[ch])
66  #define DEBAR(ch) ((ch)>31 ? (ch) : debar[ch])
67 #else
68  #define ENBAR(ch) (((unsigned char)ch)>127 ? (ch) : enbar[(unsigned char)ch])
69  #define DEBAR(ch) ((ch)>31 ? (ch) : debar[(unsigned char)ch])
70 #endif
71 
72 extern char_t enbar[128];
73 extern char_t debar[32];
74 extern void init_parser( );
75 
76 
77 extern atom_t tokenize( atom_t input, int method );
78 extern atom_t trim_shell_comment( atom_t word );
79 extern atom_t purify( atom_t word );
80 extern atom_t build_syntax_tree( atom_t function );
81 
82 
83 
84 
85 #endif //LHOGHO_PARSER_H

[ HOME | INDEX | ATOMS | VARS | REFERENCE ]
Lhogho Developer's Documentation
Wed Jul 10 2013