Mercurial > ~dholland > hg > ag > index.cgi
view anagram/guisupport/tokentabdc.cpp @ 8:ec2b657edf13
Add explicit lint-comment-style fallthrough annotations.
GCC now assumes that if you don't have these you're making a mistake,
which is annoying.
XXX: This changeset updates the AG output files only (by hand) and is
XXX: abusive - rebuilding them will erase the change. However, I need
XXX: to get things to build before I can try to get AG to issue the
XXX: annotations itself, so this seems like a reasonable expedient.
author | David A. Holland |
---|---|
date | Mon, 30 May 2022 23:51:43 -0400 |
parents | 13d2b8934445 |
children |
line wrap: on
line source
/* * AnaGram, A System for Syntax Directed Programming * Copyright 1993-2002 Parsifal Software. All Rights Reserved. * See the file COPYING for license and usage terms. * * tokentabdc.cpp */ #include "dc.h" #include "items.h" #include "q1glbl.h" #include "rule.h" #include "stacks.h" #include "tokentabdc.h" #include "ut.h" #include "ws.h" static int token_table_tabs[] = {6,9,13,21,0}; token_table_dc::token_table_dc(void) : dc("Token Table") { tab_stops = token_table_tabs; columnHeadTitle = "Token\tFlags\tPrec\tType\tName"; //des->c_size = cursor_bar_size; des->d_size.y = ntkns; //getWidth(); //resize_window(); } void token_table_dc::getLine(unsigned ln) const { token_number_map tm; const char *zl; char as; char *ts; char prbuf[20] = " "; ln++; tm = map_token_number[ln]; zl = tm.zero_length_flag ? "zl" : tm.non_terminal_flag ? "nt" : " "; if (tm.precedence_level) { as = tm.left_associative ? 'l' : tm.right_associative ? 'r' : 'n'; sprintf(prbuf, "%c%02d", as, tm.precedence_level); } else if (tm.sticky) { strcpy(prbuf, "s "); } //ts = dict_str(cast_dict,tm.value_type); ts = Cast(tm.value_type)->pointer(); ssprintf("T%03d\t%s\t%s\t(%s)\t", ln, zl, prbuf, ts); atkn(ln); } int token_table_dc::expansion_rules_ok(unsigned ln) { return build_item_list_ok(ln+1); } dc_ref token_table_dc::expansion_rules(unsigned ln) { return build_item_list(ln+1); } int token_table_dc::productions_ok(unsigned ln) { return productions_window_ok(ln+1); } dc_ref token_table_dc::productions(unsigned ln) { return productions_window(ln+1); } int token_table_dc::set_elements_ok(unsigned ln) { return token_set_window_ok(ln+1); } dc_ref token_table_dc::set_elements(unsigned ln) { return token_set_window(ln+1); } int token_table_dc::usage_ok(unsigned ln) { return token_usage_window_ok(ln+1); } dc_ref token_table_dc::usage(unsigned ln) { return token_usage_window(ln+1); }