Mercurial > ~dholland > hg > ag > index.cgi
diff 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 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/anagram/guisupport/keytabdc.cpp Sat Dec 22 17:52:45 2007 -0500 @@ -0,0 +1,62 @@ +/* + * AnaGram, A System for Syntax Directed Programming + * Copyright 1993-1999 Parsifal Software. All Rights Reserved. + * See the file COPYING for license and usage terms. + * + * keytabdc.cpp - keyword table + */ + +#include "dc.h" +#include "keytabdc.h" +#include "keyword.h" +#include "stacks.h" +#include "token.h" +#include "ws.h" + +//#define INCLUDE_LOGGING +#include "log.h" + + +#define PUREMARK '%' + + +static int key_tabs[] = {7,0}; + +keyword_table_dc::keyword_table_dc(void) +: dc("Keywords") +{ + tab_stops = key_tabs; + columnHeadTitle = "Token\tKeyword"; + //des->d_size.y = key_dict->nsx - 1; + des->d_size.y = Keyword::count() - 1; +} + + +void keyword_table_dc::getLine(unsigned ln) const { + Keyword key = ln+1; + //int tn = map_key_word[key].token_number; + Token token = key->token_number; + + ssprintf("T%03d:\t",(int) token); + append_key(key); + //if (map_token_number[tn].pure) + if (token->pure) { + acs(PUREMARK); + } +} + +int keyword_table_dc::usage_ok(unsigned ln) { + //unsigned key = ln + 1; + Keyword key = ln+1; + //unsigned tn = map_key_word[key].token_number; + //return token_usage_window_ok(tn); + return token_usage_window_ok(key->token_number); +} + +dc_ref keyword_table_dc::usage(unsigned ln) { + //unsigned key = ln + 1; + Keyword key = ln+1; + //unsigned tn = map_key_word[key].token_number; + //return token_usage_window(tn); + return token_usage_window(key->token_number); +}