Mercurial > ~dholland > hg > ag > index.cgi
comparison anagram/guisupport/keytabdc.cpp @ 0:13d2b8934445
Import AnaGram (near-)release tree into Mercurial.
author | David A. Holland |
---|---|
date | Sat, 22 Dec 2007 17:52:45 -0500 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:13d2b8934445 |
---|---|
1 /* | |
2 * AnaGram, A System for Syntax Directed Programming | |
3 * Copyright 1993-1999 Parsifal Software. All Rights Reserved. | |
4 * See the file COPYING for license and usage terms. | |
5 * | |
6 * keytabdc.cpp - keyword table | |
7 */ | |
8 | |
9 #include "dc.h" | |
10 #include "keytabdc.h" | |
11 #include "keyword.h" | |
12 #include "stacks.h" | |
13 #include "token.h" | |
14 #include "ws.h" | |
15 | |
16 //#define INCLUDE_LOGGING | |
17 #include "log.h" | |
18 | |
19 | |
20 #define PUREMARK '%' | |
21 | |
22 | |
23 static int key_tabs[] = {7,0}; | |
24 | |
25 keyword_table_dc::keyword_table_dc(void) | |
26 : dc("Keywords") | |
27 { | |
28 tab_stops = key_tabs; | |
29 columnHeadTitle = "Token\tKeyword"; | |
30 //des->d_size.y = key_dict->nsx - 1; | |
31 des->d_size.y = Keyword::count() - 1; | |
32 } | |
33 | |
34 | |
35 void keyword_table_dc::getLine(unsigned ln) const { | |
36 Keyword key = ln+1; | |
37 //int tn = map_key_word[key].token_number; | |
38 Token token = key->token_number; | |
39 | |
40 ssprintf("T%03d:\t",(int) token); | |
41 append_key(key); | |
42 //if (map_token_number[tn].pure) | |
43 if (token->pure) { | |
44 acs(PUREMARK); | |
45 } | |
46 } | |
47 | |
48 int keyword_table_dc::usage_ok(unsigned ln) { | |
49 //unsigned key = ln + 1; | |
50 Keyword key = ln+1; | |
51 //unsigned tn = map_key_word[key].token_number; | |
52 //return token_usage_window_ok(tn); | |
53 return token_usage_window_ok(key->token_number); | |
54 } | |
55 | |
56 dc_ref keyword_table_dc::usage(unsigned ln) { | |
57 //unsigned key = ln + 1; | |
58 Keyword key = ln+1; | |
59 //unsigned tn = map_key_word[key].token_number; | |
60 //return token_usage_window(tn); | |
61 return token_usage_window(key->token_number); | |
62 } |