view anagram/guisupport/keytabdc.cpp @ 12:aab9ff6af791

Strengthen the build hack for non-DOS targets.
author David A. Holland
date Tue, 31 May 2022 00:58:42 -0400
parents 13d2b8934445
children
line wrap: on
line source

/*
 * 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);
}