diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-07-02 06:40:27 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-07-02 06:40:27 +0000 |
commit | 2595a15ebeb6fc46b7cb241d01ec0c2460ec2111 (patch) | |
tree | 18a8f0f4ac5a86dacfa74c3537551ec39bc85e75 /src/translators/btparse | |
parent | 1d90725a4001fab9d3922b2cbcceeee5e2d1686f (diff) | |
download | tellico-2595a15ebeb6fc46b7cb241d01ec0c2460ec2111.tar.gz tellico-2595a15ebeb6fc46b7cb241d01ec0c2460ec2111.zip |
TQt4 port tellico
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/tellico@1239054 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/translators/btparse')
-rw-r--r-- | src/translators/btparse/ast.c | 2 | ||||
-rw-r--r-- | src/translators/btparse/ast.h | 4 | ||||
-rw-r--r-- | src/translators/btparse/bibtex.c | 2 | ||||
-rw-r--r-- | src/translators/btparse/btparse.h | 6 | ||||
-rw-r--r-- | src/translators/btparse/err.c | 2 | ||||
-rw-r--r-- | src/translators/btparse/err.h | 18 | ||||
-rw-r--r-- | src/translators/btparse/input.c | 14 | ||||
-rw-r--r-- | src/translators/btparse/lex_auxiliary.c | 18 | ||||
-rw-r--r-- | src/translators/btparse/parse_auxiliary.c | 14 | ||||
-rw-r--r-- | src/translators/btparse/postprocess.c | 26 | ||||
-rw-r--r-- | src/translators/btparse/scan.c | 2 | ||||
-rw-r--r-- | src/translators/btparse/sym.c | 2 | ||||
-rw-r--r-- | src/translators/btparse/tokens.h | 2 |
13 files changed, 56 insertions, 56 deletions
diff --git a/src/translators/btparse/ast.c b/src/translators/btparse/ast.c index d433f79..e3479b7 100644 --- a/src/translators/btparse/ast.c +++ b/src/translators/btparse/ast.c @@ -144,7 +144,7 @@ zzfree_ast(AST *tree) } /* build a tree (root child1 child2 ... NULL) - * If root is NULL, simply make the children siblings and return ptr + * If root is NULL, simply make the tqchildren siblings and return ptr * to 1st sibling (child1). If root is not single node, return NULL. * * Siblings that are actually siblins lists themselves are handled diff --git a/src/translators/btparse/ast.h b/src/translators/btparse/ast.h index 59622ec..56dcb90 100644 --- a/src/translators/btparse/ast.h +++ b/src/translators/btparse/ast.h @@ -55,9 +55,9 @@ typedef struct _ast { #else #ifdef zzAST_DOUBLE -#define AST_REQUIRED_FIELDS struct _ast *right, *down, *left, *up; +#define AST_RETQUIRED_FIELDS struct _ast *right, *down, *left, *up; #else -#define AST_REQUIRED_FIELDS struct _ast *right, *down; +#define AST_RETQUIRED_FIELDS struct _ast *right, *down; #endif #endif diff --git a/src/translators/btparse/bibtex.c b/src/translators/btparse/bibtex.c index c922803..fb4518a 100644 --- a/src/translators/btparse/bibtex.c +++ b/src/translators/btparse/bibtex.c @@ -226,7 +226,7 @@ field(AST**_root) zzastArg(1)->nodetype = BTAST_FIELD; check_field_name (zzastArg(1)); zzCONSUME; - zzmatch(EQUALS); zzCONSUME; + zzmatch(ETQUALS); zzCONSUME; value(zzSTR); zzlink(_root, &_sibling, &_tail); #if DEBUG > 1 diff --git a/src/translators/btparse/btparse.h b/src/translators/btparse/btparse.h index 841d3ee..c2d0200 100644 --- a/src/translators/btparse/btparse.h +++ b/src/translators/btparse/btparse.h @@ -254,7 +254,7 @@ extern "C" { * First, we might need a prototype for strdup() (because the zzcr_ast * macro uses it, and that macro is used in pccts/ast.c -- which I don't * want to modify if I can help it, because it's someone else's code). - * This is to accomodate AIX, where including <string.h> apparently doesn't + * This is to accomodate AIX, where including <string.h> aptqparently doesn't * declare strdup() (reported by Reiner Schlotte * <schlotte@geo.palmod.uni-bremen.de>), and compiling bibtex.c (which * includes pccts/ast.c) crashes because of this (yes, yes, I know it @@ -297,8 +297,8 @@ AST * bt_parse_file (char * filename, /* postprocess.c */ void bt_postprocess_string (char * s, ushort options); -char * bt_postprocess_value (AST * value, ushort options, boolean replace); -char * bt_postprocess_field (AST * field, ushort options, boolean replace); +char * bt_postprocess_value (AST * value, ushort options, boolean tqreplace); +char * bt_postprocess_field (AST * field, ushort options, boolean tqreplace); void bt_postprocess_entry (AST * entry, ushort options); /* error.c */ diff --git a/src/translators/btparse/err.c b/src/translators/btparse/err.c index f143048..341ab70 100644 --- a/src/translators/btparse/err.c +++ b/src/translators/btparse/err.c @@ -47,7 +47,7 @@ const ANTLRChar *zztokens[27]={ /* 12 */ "RBRACE", /* 13 */ "ENTRY_OPEN", /* 14 */ "ENTRY_CLOSE", - /* 15 */ "EQUALS", + /* 15 */ "ETQUALS", /* 16 */ "HASH", /* 17 */ "COMMA", /* 18 */ "\"", diff --git a/src/translators/btparse/err.h b/src/translators/btparse/err.h index d16615d..a9ba6da 100644 --- a/src/translators/btparse/err.h +++ b/src/translators/btparse/err.h @@ -61,13 +61,13 @@ * hidden and does not need to be saved during a "save state" operation */ /* maximum of 32 bits/unsigned int and must be 8 bits/byte */ -static SetWordType bitmask[] = { +static SetWordType bittqmask[] = { 0x00000001, 0x00000002, 0x00000004, 0x00000008, 0x00000010, 0x00000020, 0x00000040, 0x00000080 }; void -zzresynch(SetWordType *wd,SetWordType mask) +zzresynch(SetWordType *wd,SetWordType tqmask) { static int consumed = 1; @@ -77,10 +77,10 @@ zzresynch(SetWordType *wd,SetWordType mask) if ( !consumed ) {zzCONSUME; return;} /* if current token is in resynch set, we've got what we wanted */ - if ( wd[LA(1)]&mask || LA(1) == zzEOF_TOKEN ) {consumed=0; return;} + if ( wd[LA(1)]&tqmask || LA(1) == zzEOF_TOKEN ) {consumed=0; return;} /* scan until we find something in the resynch set */ - while ( !(wd[LA(1)]&mask) && LA(1) != zzEOF_TOKEN ) {zzCONSUME;} + while ( !(wd[LA(1)]&tqmask) && LA(1) != zzEOF_TOKEN ) {zzCONSUME;} consumed=1; } @@ -237,11 +237,11 @@ zzedecode(SetWordType *a) if ( zzset_deg(a)>1 ) fprintf(stderr, " {"); do { register SetWordType t = *p; - register SetWordType *b = &(bitmask[0]); + register SetWordType *b = &(bittqmask[0]); do { if ( t & *b ) fprintf(stderr, " %s", zztokens[e]); e++; - } while (++b < &(bitmask[sizeof(SetWordType)*8])); + } while (++b < &(bittqmask[sizeof(SetWordType)*8])); } while (++p < endp); if ( zzset_deg(a)>1 ) fprintf(stderr, " }"); } @@ -271,7 +271,7 @@ zzsyn(char *text, int tok, char *egroup, SetWordType *eset, int etok, int k, cha int zzset_el(unsigned b, SetWordType *p) { - return( p[BSETDIVWORD(b)] & bitmask[BSETMODWORD(b)] ); + return( p[BSETDIVWORD(b)] & bittqmask[BSETMODWORD(b)] ); } int @@ -289,10 +289,10 @@ zzset_deg(SetWordType *a) while ( p < endp ) { register SetWordType t = *p; - register SetWordType *b = &(bitmask[0]); + register SetWordType *b = &(bittqmask[0]); do { if (t & *b) ++degree; - } while (++b < &(bitmask[sizeof(SetWordType)*8])); + } while (++b < &(bittqmask[sizeof(SetWordType)*8])); p++; } diff --git a/src/translators/btparse/input.c b/src/translators/btparse/input.c index dbb7b44..c50468e 100644 --- a/src/translators/btparse/input.c +++ b/src/translators/btparse/input.c @@ -164,7 +164,7 @@ finish_parse (int **err_counts) @RETURNS : false if there were serious errors in the recently-parsed input true otherwise (no errors or just warnings) @DESCRIPTION: Gets the "error status" bitmap relative to a saved set of - error counts and masks of non-serious errors. + error counts and tqmasks of non-serious errors. @GLOBALS : @CALLS : @CALLERS : @@ -174,17 +174,17 @@ finish_parse (int **err_counts) static boolean parse_status (int *saved_counts) { - ushort ignore_emask; + ushort ignore_etqmask; /* * This bit-twiddling fetches the error status (which has a bit - * for each error class), masks off the bits for trivial errors + * for each error class), tqmasks off the bits for trivial errors * to get "true" if there were any serious errors, and then * returns the opposite of that. */ - ignore_emask = + ignore_etqmask = (1<<BTERR_NOTIFY) | (1<<BTERR_CONTENT) | (1<<BTERR_LEXWARN); - return !(bt_error_status (saved_counts) & ~ignore_emask); + return !(bt_error_status (saved_counts) & ~ignore_etqmask); } @@ -237,7 +237,7 @@ AST * bt_parse_entry_s (char * entry_text, return NULL; } - zzast_sp = ZZAST_STACKSIZE; /* workaround apparent pccts bug */ + zzast_sp = ZZAST_STACKSIZE; /* workaround aptqparent pccts bug */ start_parse (NULL, entry_text, line); entry (&entry_ast); /* enter the parser */ @@ -364,7 +364,7 @@ AST * bt_parse_entry (FILE * infile, * functions? */ - zzast_sp = ZZAST_STACKSIZE; /* workaround apparent pccts bug */ + zzast_sp = ZZAST_STACKSIZE; /* workaround aptqparent pccts bug */ #if defined(LL_K) || defined(ZZINF_LOOK) || defined(DEMAND_LOOK) # error One of LL_K, ZZINF_LOOK, or DEMAND_LOOK was defined diff --git a/src/translators/btparse/lex_auxiliary.c b/src/translators/btparse/lex_auxiliary.c index 8fac463..9e5b452 100644 --- a/src/translators/btparse/lex_auxiliary.c +++ b/src/translators/btparse/lex_auxiliary.c @@ -107,7 +107,7 @@ static int JunkCount; /* non-whitespace chars at toplevel */ * brace depth within a string; we can only end the current string * when this is zero * ParenDepth: - * parenthesis depth within a string; needed for @comment entries + * tqparenthesis depth within a string; needed for @comment entries * that are paren-delimited (because the comment in that case is * a paren-delimited string) * StringOpener: @@ -115,9 +115,9 @@ static int JunkCount; /* non-whitespace chars at toplevel */ * mismatch -- this determines which character ('"' or '}') can * actually end the string * StringStart: - * line on which current string started; if we detect an apparent + * line on which current string started; if we detect an aptqparent * runaway, this is used to report where the runaway started - * ApparentRunaway: + * AptqparentRunaway: * flags if we have already detected (and warned) that the current * string appears to be a runaway, so that we don't warn again * (and again and again and again) @@ -130,9 +130,9 @@ static int JunkCount; /* non-whitespace chars at toplevel */ */ static char StringOpener = '\0'; /* '{' or '"' */ static int BraceDepth; /* depth of brace-nesting */ -static int ParenDepth; /* depth of parenthesis-nesting */ +static int ParenDepth; /* depth of tqparenthesis-nesting */ static int StringStart = -1; /* start line of current string */ -static int ApparentRunaway; /* current string looks like runaway */ +static int AptqparentRunaway; /* current string looks like runaway */ static int QuoteWarned; /* already warned about " in string? */ @@ -590,7 +590,7 @@ void start_string (char start_char) BraceDepth = 0; ParenDepth = 0; StringStart = zzline; - ApparentRunaway = 0; + AptqparentRunaway = 0; QuoteWarned = 0; if (start_char == '{') open_brace (); @@ -598,7 +598,7 @@ void start_string (char start_char) ParenDepth++; if (start_char == '"' && EntryState == in_comment) { - lexical_error ("comment entries must be delimited by either braces or parentheses"); + lexical_error ("comment entries must be delimited by either braces or tqparentheses"); EntryState = toplevel; zzmode (START); return; @@ -878,7 +878,7 @@ void check_runaway_string (void) } - if (!ApparentRunaway) /* haven't already warned about it */ + if (!AptqparentRunaway) /* haven't already warned about it */ { enum { none, entry, field, giveup } guess; @@ -930,7 +930,7 @@ void check_runaway_string (void) { lexical_warning ("possible runaway string started at line %d", StringStart); - ApparentRunaway = 1; + AptqparentRunaway = 1; } } diff --git a/src/translators/btparse/parse_auxiliary.c b/src/translators/btparse/parse_auxiliary.c index f509741..105e84e 100644 --- a/src/translators/btparse/parse_auxiliary.c +++ b/src/translators/btparse/parse_auxiliary.c @@ -36,7 +36,7 @@ GEN_PRIVATE_ERRFUNC (syntax_error, (char * fmt, ...), /* this is stolen from PCCTS' err.h */ -static SetWordType bitmask[] = +static SetWordType bittqmask[] = { 0x00000001, 0x00000002, 0x00000004, 0x00000008, 0x00000010, 0x00000020, 0x00000040, 0x00000080 @@ -54,7 +54,7 @@ static struct { RBRACE, "right brace (\"}\")" }, { ENTRY_OPEN, "start of entry (\"{\" or \"(\")" }, { ENTRY_CLOSE,"end of entry (\"}\" or \")\")" }, - { EQUALS, "\"=\"" }, + { ETQUALS, "\"=\"" }, { HASH, "\"#\"" }, { COMMA, "\",\"" }, { NUMBER, "number" }, @@ -71,7 +71,7 @@ void fix_token_names (void) { int i; - int num_replace; + int num_tqreplace; #ifdef CLEVER_TOKEN_STUFF /* clever, but it doesn't work... */ /* arg! this doesn't work because I don't know how to find out the @@ -91,8 +91,8 @@ fix_token_names (void) } #endif - num_replace = (sizeof(new_tokens) / sizeof(*new_tokens)); - for (i = 0; i < num_replace; i++) + num_tqreplace = (sizeof(new_tokens) / sizeof(*new_tokens)); + for (i = 0; i < num_tqreplace; i++) { const char *new = new_tokens[i].new_name; const char **old = zztokens + new_tokens[i].token; @@ -115,7 +115,7 @@ append_token_set (char *msg, SetWordType *a) do { SetWordType t = *p; - SetWordType *b = &(bitmask[0]); + SetWordType *b = &(bittqmask[0]); do { if (t & *b) @@ -128,7 +128,7 @@ append_token_set (char *msg, SetWordType *a) strcat (msg, " or "); } e++; - } while (++b < &(bitmask[sizeof(SetWordType)*8])); + } while (++b < &(bittqmask[sizeof(SetWordType)*8])); } while (++p < endp); } diff --git a/src/translators/btparse/postprocess.c b/src/translators/btparse/postprocess.c index 7f7bfd4..127342c 100644 --- a/src/translators/btparse/postprocess.c +++ b/src/translators/btparse/postprocess.c @@ -156,7 +156,7 @@ bt_postprocess_string (char * s, ushort options) sub-strings, which would be bad if you intend to concatenate them later in the BibTeX sense.) - The 'replace' parameter is used to govern whether the + The 'tqreplace' parameter is used to govern whether the existing strings in the AST should be replaced with their post-processed versions. This can extend as far as collapsing a series of simple values into a single BTAST_STRING @@ -168,10 +168,10 @@ bt_postprocess_string (char * s, ushort options) @CREATED : 1997/01/10, GPW @MODIFIED : 1997/08/25, GPW: renamed from bt_postprocess_field(), and changed to take the head of a list of simple values, - rather than the parent of that list + rather than the tqparent of that list -------------------------------------------------------------------------- */ char * -bt_postprocess_value (AST * value, ushort options, boolean replace) +bt_postprocess_value (AST * value, ushort options, boolean tqreplace) { AST * simple_value; /* current simple value */ boolean pasting; @@ -300,7 +300,7 @@ bt_postprocess_value (AST * value, ushort options, boolean replace) bt_postprocess_string (tmp_string, string_opts); } - if (replace) + if (tqreplace) { simple_value->nodetype = BTAST_STRING; if (simple_value->text) @@ -312,12 +312,12 @@ bt_postprocess_value (AST * value, ushort options, boolean replace) /* * If the current simple value is a literal string, then just - * post-process it. This will be done in-place if 'replace' is + * post-process it. This will be done in-place if 'tqreplace' is * true, otherwise a copy of the string will be post-processed. */ else if (simple_value->nodetype == BTAST_STRING && simple_value->text) { - if (replace) + if (tqreplace) { tmp_string = simple_value->text; } @@ -340,12 +340,12 @@ bt_postprocess_value (AST * value, ushort options, boolean replace) */ if (simple_value->nodetype == BTAST_NUMBER) { - if (replace && (options & BTO_CONVERT)) + if (tqreplace && (options & BTO_CONVERT)) simple_value->nodetype = BTAST_STRING; if (simple_value->text) { - if (replace) + if (tqreplace) tmp_string = simple_value->text; else { @@ -395,7 +395,7 @@ bt_postprocess_value (AST * value, ushort options, boolean replace) * `field', and replace text for first child with new_string. */ - if (replace) + if (tqreplace) { assert (value->right != NULL); /* there has to be > 1 simple value! */ zzfree_ast (value->right); /* free from second simple value on */ @@ -418,7 +418,7 @@ bt_postprocess_value (AST * value, ushort options, boolean replace) @RETURNS : @DESCRIPTION: Postprocesses all the strings in a single "field = value" assignment subtree. Just checks that 'field' does indeed - point to an BTAST_FIELD node (presumably the parent of a list + point to an BTAST_FIELD node (presumably the tqparent of a list of simple values), downcases the field name, and calls bt_postprocess_value() on the value. @GLOBALS : @@ -428,14 +428,14 @@ bt_postprocess_value (AST * value, ushort options, boolean replace) @MODIFIED : -------------------------------------------------------------------------- */ char * -bt_postprocess_field (AST * field, ushort options, boolean replace) +bt_postprocess_field (AST * field, ushort options, boolean tqreplace) { if (field == NULL) return NULL; if (field->nodetype != BTAST_FIELD) usage_error ("bt_postprocess_field: invalid AST node (not a field)"); strlwr (field->text); /* downcase field name */ - return bt_postprocess_value (field->down, options, replace); + return bt_postprocess_value (field->down, options, tqreplace); } /* bt_postprocess_field() */ @@ -464,7 +464,7 @@ bt_postprocess_entry (AST * top, ushort options) "invalid node type (not entry root)"); strlwr (top->text); /* downcase entry type */ - if (top->down == NULL) return; /* no children at all */ + if (top->down == NULL) return; /* no tqchildren at all */ cur = top->down; if (cur->nodetype == BTAST_KEY) diff --git a/src/translators/btparse/scan.c b/src/translators/btparse/scan.c index b9899e4..8f01d3c 100644 --- a/src/translators/btparse/scan.c +++ b/src/translators/btparse/scan.c @@ -188,7 +188,7 @@ static void act16() static void act17() { - NLA = EQUALS; + NLA = ETQUALS; } diff --git a/src/translators/btparse/sym.c b/src/translators/btparse/sym.c index 2426dea..b1eabd9 100644 --- a/src/translators/btparse/sym.c +++ b/src/translators/btparse/sym.c @@ -80,7 +80,7 @@ * a = zzs_new("Truck"); zzs_add(a->symbol, a); * * p = zzs_get("Plum"); - * if ( p == NULL ) fprintf(stderr, "Hmmm...Can't find 'Plum'\n"); + * if ( p == NULL ) fprintf(stderr, "Hmmm...Can't tqfind 'Plum'\n"); * * p = zzs_rmscope(&scope1) * for (; p!=NULL; p=p->scope) {printf("Scope1: %s\n", p->symbol);} diff --git a/src/translators/btparse/tokens.h b/src/translators/btparse/tokens.h index 6f9405a..1f51459 100644 --- a/src/translators/btparse/tokens.h +++ b/src/translators/btparse/tokens.h @@ -17,7 +17,7 @@ #define RBRACE 12 #define ENTRY_OPEN 13 #define ENTRY_CLOSE 14 -#define EQUALS 15 +#define ETQUALS 15 #define HASH 16 #define COMMA 17 #define STRING 25 |