Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | * generic/tclParseExpr.c (removed): Moved all the code of * generic/tclCompExpr.c: tclParseExpr.c into tclCompExpr.c. * unix/Makefile.in: This sets the stage for expr compiling to * win/Makefile.in: work directly with the full parse tree * win/makefile.bc: structures, and not have to pass through * win/makefile.vc: the information lossy format of an array * win/tcl.dsp: of Tcl_Tokens. |
|---|---|
| Timelines: | family | ancestors | descendants | both | trunk |
| Files: | files | file ages | folders |
| SHA1: |
503e4857a2bdae34586a3f6631db5df5 |
| User & Date: | dgp 2006-11-09 16:52:25.000 |
Context
|
2006-11-10
| ||
| 01:55 | * tests/fCmd.test (fCmd-6.26): fix failure when env(HOME) path contains symlinks. * macosx/Tcl.x... check-in: 22b6ae1be7 user: das tags: trunk | |
|
2006-11-09
| ||
| 16:52 | * generic/tclParseExpr.c (removed): Moved all the code of * generic/tclCompExpr.... check-in: 503e4857a2 user: dgp tags: trunk | |
| 16:11 | Optimize for the unshared case. check-in: 81b71d3d1d user: dkf tags: trunk | |
Changes
Changes to ChangeLog.
1 2 3 4 5 6 7 | 2006-11-09 Donal K. Fellows <donal.k.fellows@manchester.ac.uk> TIP#272 IMPLEMENTATION * generic/tclCmdMZ.c (Tcl_StringObjCmd): Implementation of the * tests/string.test, tests/stringComp.test: [string reverse] command * doc/string.n: from TIP#272. | > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | 2006-11-09 Don Porter <dgp@users.sourceforge.net> * generic/tclParseExpr.c (removed): Moved all the code of * generic/tclCompExpr.c: tclParseExpr.c into tclCompExpr.c. * unix/Makefile.in: This sets the stage for expr compiling to * win/Makefile.in: work directly with the full parse tree * win/makefile.bc: structures, and not have to pass through * win/makefile.vc: the information lossy format of an array * win/tcl.dsp: of Tcl_Tokens. 2006-11-09 Donal K. Fellows <donal.k.fellows@manchester.ac.uk> TIP#272 IMPLEMENTATION * generic/tclCmdMZ.c (Tcl_StringObjCmd): Implementation of the * tests/string.test, tests/stringComp.test: [string reverse] command * doc/string.n: from TIP#272. |
| ︙ | ︙ |
Changes to generic/tclCompExpr.c.
1 2 3 4 5 6 7 8 9 10 11 | /* * tclCompExpr.c -- * * This file contains the code to compile Tcl expressions. * * Copyright (c) 1997 Sun Microsystems, Inc. * Copyright (c) 1998-2000 by Scriptics Corporation. * * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * | > | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 |
/*
* tclCompExpr.c --
*
* This file contains the code to compile Tcl expressions.
*
* Copyright (c) 1997 Sun Microsystems, Inc.
* Copyright (c) 1998-2000 by Scriptics Corporation.
* Contributions from Don Porter, NIST, 2006. (not subject to US copyright)
*
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
* RCS: @(#) $Id: tclCompExpr.c,v 1.35 2006/11/09 16:52:30 dgp Exp $
*/
#include "tclInt.h"
#include "tclCompile.h"
/*
* The ExprNode structure represents one node of the parse tree produced
* as an interim structure by the expression parser.
*/
typedef struct ExprNode {
unsigned char lexeme; /* Code that identifies the type of this node */
int left; /* Index of the left operand of this operator node */
int right; /* Index of the right operand of this operator node */
int parent; /* Index of the operator of this operand node */
int token; /* Index of the Tcl_Tokens of this leaf node */
} ExprNode;
/*
* Set of lexeme codes stored in ExprNode structs to label and categorize
* the lexemes found.
*/
#define LEAF (1<<7)
#define UNARY (1<<6)
#define BINARY (1<<5)
#define NODE_TYPE ( LEAF | UNARY | BINARY)
#define PLUS 1
#define MINUS 2
#define BAREWORD 3
#define INCOMPLETE 4
#define INVALID 5
#define NUMBER ( LEAF | 1)
#define SCRIPT ( LEAF | 2)
#define BOOLEAN ( LEAF | BAREWORD)
#define BRACED ( LEAF | 4)
#define VARIABLE ( LEAF | 5)
#define QUOTED ( LEAF | 6)
#define EMPTY ( LEAF | 7)
#define UNARY_PLUS ( UNARY | PLUS)
#define UNARY_MINUS ( UNARY | MINUS)
#define FUNCTION ( UNARY | BAREWORD)
#define START ( UNARY | 4)
#define OPEN_PAREN ( UNARY | 5)
#define NOT ( UNARY | 6)
#define BIT_NOT ( UNARY | 7)
#define BINARY_PLUS ( BINARY | PLUS)
#define BINARY_MINUS ( BINARY | MINUS)
#define COMMA ( BINARY | 3)
#define MULT ( BINARY | 4)
#define DIVIDE ( BINARY | 5)
#define MOD ( BINARY | 6)
#define LESS ( BINARY | 7)
#define GREATER ( BINARY | 8)
#define BIT_AND ( BINARY | 9)
#define BIT_XOR ( BINARY | 10)
#define BIT_OR ( BINARY | 11)
#define QUESTION ( BINARY | 12)
#define COLON ( BINARY | 13)
#define LEFT_SHIFT ( BINARY | 14)
#define RIGHT_SHIFT ( BINARY | 15)
#define LEQ ( BINARY | 16)
#define GEQ ( BINARY | 17)
#define EQUAL ( BINARY | 18)
#define NEQ ( BINARY | 19)
#define AND ( BINARY | 20)
#define OR ( BINARY | 21)
#define STREQ ( BINARY | 22)
#define STRNEQ ( BINARY | 23)
#define EXPON ( BINARY | 24)
#define IN_LIST ( BINARY | 25)
#define NOT_IN_LIST ( BINARY | 26)
#define CLOSE_PAREN ( BINARY | 27)
#define END ( BINARY | 28)
/*
* Declarations for local functions to this file:
*/
static void GenerateTokens(ExprNode *nodes, Tcl_Parse *scratchPtr,
Tcl_Parse *parsePtr);
static int ParseLexeme(CONST char *start, int numBytes,
unsigned char *lexemePtr);
/*
*----------------------------------------------------------------------
*
* Tcl_ParseExpr --
*
* Given a string, the numBytes bytes starting at start, this function
* parses it as a Tcl expression and stores information about the
* structure of the expression in the Tcl_Parse struct indicated by the
* caller.
*
* Results:
* If the string is successfully parsed as a valid Tcl expression,
* TCL_OK is returned, and data about the expression structure is
* written to *parsePtr. If the string cannot be parsed as a valid
* Tcl expression, TCL_ERROR is returned, and if interp is non-NULL,
* an error message is written to interp.
*
* Side effects:
* If there is insufficient space in parsePtr to hold all the information
* about the expression, then additional space is malloc-ed. If the
* function returns TCL_OK then the caller must eventually invoke
* Tcl_FreeParse to release any additional space that was allocated.
*
*----------------------------------------------------------------------
*/
int
Tcl_ParseExpr(
Tcl_Interp *interp, /* Used for error reporting. */
CONST char *start, /* Start of source string to parse. */
int numBytes, /* Number of bytes in string. If < 0, the
* string consists of all bytes up to the
* first null character. */
Tcl_Parse *parsePtr) /* Structure to fill with information about
* the parsed expression; any previous
* information in the structure is ignored. */
{
#define NUM_STATIC_NODES 64
ExprNode staticNodes[NUM_STATIC_NODES];
ExprNode *lastOrphanPtr, *nodes = staticNodes;
int nodesAvailable = NUM_STATIC_NODES;
int nodesUsed = 0;
Tcl_Parse scratch; /* Parsing scratch space */
Tcl_Obj *msg = NULL, *post = NULL;
int scanned = 0, code = TCL_OK, insertMark = 0;
CONST char *mark = "_@_";
CONST int limit = 25;
static CONST unsigned char prec[80] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 15, 15, 5, 16, 16, 16, 13, 13, 11, 10, 9, 6, 6, 14, 14,
13, 13, 12, 12, 8, 7, 12, 12, 17, 12, 12, 3, 1, 0, 0, 0,
0, 18, 18, 18, 2, 4, 18, 18, 0, 0, 0, 0, 0, 0, 0, 0,
};
if (numBytes < 0) {
numBytes = (start ? strlen(start) : 0);
}
TclParseInit(interp, start, numBytes, &scratch);
TclParseInit(interp, start, numBytes, parsePtr);
/* Initialize the parse tree with the special "START" node */
nodes->lexeme = START;
nodes->left = -1;
nodes->right = -1;
nodes->parent = -1;
nodes->token = -1;
lastOrphanPtr = nodes;
nodesUsed++;
while ((code == TCL_OK) && (lastOrphanPtr->lexeme != END)) {
ExprNode *nodePtr, *lastNodePtr;
Tcl_Token *tokenPtr;
/*
* Each pass through this loop adds one more ExprNode.
* Allocate space for one if required.
*/
if (nodesUsed >= nodesAvailable) {
int lastOrphanIdx = lastOrphanPtr - nodes;
int size = nodesUsed * 2;
ExprNode *newPtr;
if (nodes == staticNodes) {
nodes = NULL;
}
do {
newPtr = (ExprNode *) attemptckrealloc( (char *) nodes,
(unsigned int) (size * sizeof(ExprNode)) );
} while ((newPtr == NULL)
&& ((size -= (size - nodesUsed) / 2) > nodesUsed));
if (newPtr == NULL) {
msg = Tcl_NewStringObj(
"not enough memory to parse expression", -1);
code = TCL_ERROR;
continue;
}
nodesAvailable = size;
if (nodes == NULL) {
memcpy((VOID *) newPtr, (VOID *) staticNodes,
(size_t) (nodesUsed * sizeof(ExprNode)));
}
nodes = newPtr;
lastOrphanPtr = nodes + lastOrphanIdx;
}
nodePtr = nodes + nodesUsed;
lastNodePtr = nodePtr - 1;
/* Skip white space between lexemes */
scanned = TclParseAllWhiteSpace(start, numBytes);
start += scanned;
numBytes -= scanned;
scanned = ParseLexeme(start, numBytes, &(nodePtr->lexeme));
/* Use context to categorize the lexemes that are ambiguous */
if ((NODE_TYPE & nodePtr->lexeme) == 0) {
switch (nodePtr->lexeme) {
case INVALID:
msg = TclObjPrintf(
"invalid character \"%.*s\"", scanned, start);
code = TCL_ERROR;
continue;
case INCOMPLETE:
msg = TclObjPrintf(
"incomplete operator \"%.*s\"", scanned, start);
code = TCL_ERROR;
continue;
case BAREWORD:
if (start[scanned+TclParseAllWhiteSpace(
start+scanned, numBytes-scanned)] == '(') {
nodePtr->lexeme = FUNCTION;
} else {
Tcl_Obj *objPtr = Tcl_NewStringObj(start, scanned);
Tcl_IncrRefCount(objPtr);
code = Tcl_ConvertToType(NULL, objPtr, &tclBooleanType);
Tcl_DecrRefCount(objPtr);
if (code == TCL_OK) {
nodePtr->lexeme = BOOLEAN;
} else {
msg = TclObjPrintf(
"invalid bareword \"%.*s%s\"",
(scanned < limit) ? scanned : limit - 3, start,
(scanned < limit) ? "" : "...");
post = TclObjPrintf(
"should be \"$%.*s%s\" or \"{%.*s%s}\"",
(scanned < limit) ? scanned : limit - 3,
start, (scanned < limit) ? "" : "...",
(scanned < limit) ? scanned : limit - 3,
start, (scanned < limit) ? "" : "...");
TclAppendPrintfToObj(post,
" or \"%.*s%s(...)\" or ...",
(scanned < limit) ? scanned : limit - 3,
start, (scanned < limit) ? "" : "...");
continue;
}
}
break;
case PLUS:
case MINUS:
if ((NODE_TYPE & lastNodePtr->lexeme) == LEAF) {
nodePtr->lexeme |= BINARY;
} else {
nodePtr->lexeme |= UNARY;
}
}
}
/* Add node to parse tree based on category */
switch (NODE_TYPE & nodePtr->lexeme) {
case LEAF: {
CONST char *end;
if ((NODE_TYPE & lastNodePtr->lexeme) == LEAF) {
CONST char *operand =
scratch.tokenPtr[lastNodePtr->token].start;
msg = TclObjPrintf("missing operator at %s", mark);
if (operand[0] == '0') {
Tcl_Obj *copy = Tcl_NewStringObj(operand,
start + scanned - operand);
if (TclCheckBadOctal(NULL, Tcl_GetString(copy))) {
post = Tcl_NewStringObj(
"looks like invalid octal number", -1);
}
Tcl_DecrRefCount(copy);
}
scanned = 0;
insertMark = 1;
code = TCL_ERROR;
continue;
}
if (scratch.numTokens+1 >= scratch.tokensAvailable) {
TclExpandTokenArray(&scratch);
}
nodePtr->token = scratch.numTokens;
tokenPtr = scratch.tokenPtr + nodePtr->token;
tokenPtr->type = TCL_TOKEN_SUB_EXPR;
tokenPtr->start = start;
scratch.numTokens++;
switch (nodePtr->lexeme) {
case NUMBER:
case BOOLEAN:
tokenPtr = scratch.tokenPtr + scratch.numTokens;
tokenPtr->type = TCL_TOKEN_TEXT;
tokenPtr->start = start;
tokenPtr->size = scanned;
tokenPtr->numComponents = 0;
scratch.numTokens++;
break;
case QUOTED:
code = Tcl_ParseQuotedString(interp, start, numBytes,
&scratch, 1, &end);
if (code != TCL_OK) {
scanned = scratch.term - start;
scanned += (scanned < numBytes);
continue;
}
scanned = end - start;
break;
case BRACED:
code = Tcl_ParseBraces(interp, start, numBytes,
&scratch, 1, &end);
if (code != TCL_OK) {
continue;
}
scanned = end - start;
break;
case VARIABLE:
code = Tcl_ParseVarName(interp, start, numBytes, &scratch, 1);
if (code != TCL_OK) {
scanned = scratch.term - start;
scanned += (scanned < numBytes);
continue;
}
tokenPtr = scratch.tokenPtr + nodePtr->token + 1;
if (tokenPtr->type != TCL_TOKEN_VARIABLE) {
msg = Tcl_NewStringObj("invalid character \"$\"", -1);
code = TCL_ERROR;
continue;
}
scanned = tokenPtr->size;
break;
case SCRIPT:
tokenPtr = scratch.tokenPtr + scratch.numTokens;
tokenPtr->type = TCL_TOKEN_COMMAND;
tokenPtr->start = start;
tokenPtr->numComponents = 0;
end = start + numBytes;
start++;
while (1) {
Tcl_Parse nested;
code = Tcl_ParseCommand(interp,
start, (end - start), 1, &nested);
if (code != TCL_OK) {
parsePtr->term = nested.term;
parsePtr->errorType = nested.errorType;
parsePtr->incomplete = nested.incomplete;
break;
}
start = (nested.commandStart + nested.commandSize);
Tcl_FreeParse(&nested);
if ((nested.term < end) && (*nested.term == ']')
&& !nested.incomplete) {
break;
}
if (start == end) {
msg = Tcl_NewStringObj("missing close-bracket", -1);
parsePtr->term = tokenPtr->start;
parsePtr->errorType = TCL_PARSE_MISSING_BRACKET;
parsePtr->incomplete = 1;
code = TCL_ERROR;
break;
}
}
end = start;
start = tokenPtr->start;
if (code != TCL_OK) {
scanned = parsePtr->term - start;
scanned += (scanned < numBytes);
continue;
}
scanned = end - start;
tokenPtr->size = scanned;
scratch.numTokens++;
break;
}
tokenPtr = scratch.tokenPtr + nodePtr->token;
tokenPtr->size = scanned;
tokenPtr->numComponents = scratch.numTokens - nodePtr->token - 1;
nodePtr->left = -1;
nodePtr->right = -1;
nodePtr->parent = -1;
lastOrphanPtr = nodePtr;
nodesUsed++;
break;
}
case UNARY:
if ((NODE_TYPE & lastNodePtr->lexeme) == LEAF) {
msg = TclObjPrintf("missing operator at %s", mark);
scanned = 0;
insertMark = 1;
code = TCL_ERROR;
continue;
}
nodePtr->left = -1;
nodePtr->right = -1;
nodePtr->parent = -1;
if (scratch.numTokens >= scratch.tokensAvailable) {
TclExpandTokenArray(&scratch);
}
nodePtr->token = scratch.numTokens;
tokenPtr = scratch.tokenPtr + nodePtr->token;
tokenPtr->type = TCL_TOKEN_OPERATOR;
tokenPtr->start = start;
tokenPtr->size = scanned;
tokenPtr->numComponents = 0;
scratch.numTokens++;
lastOrphanPtr = nodePtr;
nodesUsed++;
break;
case BINARY: {
ExprNode *otherPtr = NULL;
unsigned char precedence = prec[nodePtr->lexeme];
if ((nodePtr->lexeme == CLOSE_PAREN)
&& (lastNodePtr->lexeme == OPEN_PAREN)) {
if (lastNodePtr[-1].lexeme == FUNCTION) {
/* Normally, "()" is a syntax error, but as a special
* case accept it as an argument list for a function */
scanned = 0;
nodePtr->lexeme = EMPTY;
nodePtr->left = -1;
nodePtr->right = -1;
nodePtr->parent = -1;
nodePtr->token = -1;
lastOrphanPtr = nodePtr;
nodesUsed++;
break;
}
msg = TclObjPrintf("empty subexpression at %s", mark);
scanned = 0;
insertMark = 1;
code = TCL_ERROR;
continue;
}
if ((NODE_TYPE & lastNodePtr->lexeme) != LEAF) {
if (prec[lastNodePtr->lexeme] > precedence) {
if (lastNodePtr->lexeme == OPEN_PAREN) {
msg = Tcl_NewStringObj("unbalanced open paren", -1);
} else if (lastNodePtr->lexeme == COMMA) {
msg = TclObjPrintf(
"missing function argument at %s", mark);
scanned = 0;
insertMark = 1;
} else if (lastNodePtr->lexeme == START) {
msg = Tcl_NewStringObj("empty expression", -1);
}
} else {
if (nodePtr->lexeme == CLOSE_PAREN) {
msg = Tcl_NewStringObj("unbalanced close paren", -1);
} else if ((nodePtr->lexeme == COMMA)
&& (lastNodePtr->lexeme == OPEN_PAREN)
&& (lastNodePtr[-1].lexeme == FUNCTION)) {
msg = TclObjPrintf(
"missing function argument at %s", mark);
scanned = 0;
insertMark = 1;
}
}
if (msg == NULL) {
msg = TclObjPrintf("missing operand at %s", mark);
scanned = 0;
insertMark = 1;
}
code = TCL_ERROR;
continue;
}
while (1) {
if (lastOrphanPtr->parent >= 0) {
otherPtr = nodes + lastOrphanPtr->parent;
} else if (lastOrphanPtr->left >= 0) {
Tcl_Panic("Tcl_ParseExpr: left closure programming error");
} else {
lastOrphanPtr->parent = lastOrphanPtr - nodes;
otherPtr = lastOrphanPtr;
}
otherPtr--;
if (prec[otherPtr->lexeme] < precedence) {
break;
}
if (prec[otherPtr->lexeme] == precedence) {
/* Special association rules for the ternary operators. */
if ((otherPtr->lexeme == QUESTION)
&& (lastOrphanPtr->lexeme != COLON)) {
break;
}
if ((otherPtr->lexeme == COLON)
&& (nodePtr->lexeme == QUESTION)) {
break;
}
/* Right association rules for exponentiation. */
if (nodePtr->lexeme == EXPON) {
break;
}
}
/* Some checks before linking */
if ((otherPtr->lexeme == OPEN_PAREN)
&& (nodePtr->lexeme != CLOSE_PAREN)) {
lastOrphanPtr = otherPtr;
msg = Tcl_NewStringObj("unbalanced open paren", -1);
code = TCL_ERROR;
break;
}
if ((otherPtr->lexeme == QUESTION)
&& (lastOrphanPtr->lexeme != COLON)) {
msg = TclObjPrintf(
"missing operator \":\" at %s", mark);
scanned = 0;
insertMark = 1;
code = TCL_ERROR;
break;
}
if ((lastOrphanPtr->lexeme == COLON)
&& (otherPtr->lexeme != QUESTION)) {
msg = Tcl_NewStringObj(
"unexpected operator \":\" without preceding \"?\"",
-1);
code = TCL_ERROR;
break;
}
/* Link orphan as right operand of otherPtr */
otherPtr->right = lastOrphanPtr - nodes;
lastOrphanPtr->parent = otherPtr - nodes;
lastOrphanPtr = otherPtr;
if (otherPtr->lexeme == OPEN_PAREN) {
/* CLOSE_PAREN can only close one OPEN_PAREN */
tokenPtr = scratch.tokenPtr + otherPtr->token;
tokenPtr->size = start + scanned - tokenPtr->start;
break;
}
if (otherPtr->lexeme == START) {
/* Don't backtrack beyond the start */
break;
}
}
if (code != TCL_OK) {
continue;
}
if (nodePtr->lexeme == CLOSE_PAREN) {
if (otherPtr->lexeme == START) {
msg = Tcl_NewStringObj("unbalanced close paren", -1);
code = TCL_ERROR;
continue;
}
/* Create no node for a CLOSE_PAREN lexeme */
break;
}
if ((nodePtr->lexeme == COMMA) && ((otherPtr->lexeme != OPEN_PAREN)
|| (otherPtr[-1].lexeme != FUNCTION))) {
msg = Tcl_NewStringObj(
"unexpected \",\" outside function argument list", -1);
code = TCL_ERROR;
continue;
}
if (lastOrphanPtr->lexeme == COLON) {
msg = Tcl_NewStringObj(
"unexpected operator \":\" without preceding \"?\"",
-1);
code = TCL_ERROR;
continue;
}
/* Link orphan as left operand of new node */
nodePtr->right = -1;
if (scratch.numTokens >= scratch.tokensAvailable) {
TclExpandTokenArray(&scratch);
}
nodePtr->token = scratch.numTokens;
tokenPtr = scratch.tokenPtr + nodePtr->token;
tokenPtr->type = TCL_TOKEN_OPERATOR;
tokenPtr->start = start;
tokenPtr->size = scanned;
tokenPtr->numComponents = 0;
scratch.numTokens++;
nodePtr->left = lastOrphanPtr - nodes;
nodePtr->parent = lastOrphanPtr->parent;
lastOrphanPtr->parent = nodePtr - nodes;
lastOrphanPtr = nodePtr;
nodesUsed++;
break;
}
}
start += scanned;
numBytes -= scanned;
}
if (code == TCL_OK) {
/* Shift tokens from scratch space to caller space */
GenerateTokens(nodes, &scratch, parsePtr);
} else {
if (parsePtr->errorType == TCL_PARSE_SUCCESS) {
parsePtr->errorType = TCL_PARSE_SYNTAX;
parsePtr->term = start;
}
if (interp == NULL) {
if (msg) {
Tcl_DecrRefCount(msg);
}
} else {
if (msg == NULL) {
msg = Tcl_GetObjResult(interp);
}
TclAppendPrintfToObj(msg, "\nin expression \"%s%.*s%.*s%s%s%.*s%s\"",
((start - limit) < scratch.string) ? "" : "...",
((start - limit) < scratch.string)
? (start - scratch.string) : limit - 3,
((start - limit) < scratch.string)
? scratch.string : start - limit + 3,
(scanned < limit) ? scanned : limit - 3, start,
(scanned < limit) ? "" : "...",
insertMark ? mark : "",
(start + scanned + limit > scratch.end)
? scratch.end - (start + scanned) : limit-3,
start + scanned,
(start + scanned + limit > scratch.end) ? "" : "..."
);
if (post != NULL) {
Tcl_AppendToObj(msg, ";\n", -1);
Tcl_AppendObjToObj(msg, post);
Tcl_DecrRefCount(post);
}
Tcl_SetObjResult(interp, msg);
numBytes = scratch.end - scratch.string;
TclAppendObjToErrorInfo(interp, TclObjPrintf(
"\n (parsing expression \"%.*s%s\")",
(numBytes < limit) ? numBytes : limit - 3,
scratch.string, (numBytes < limit) ? "" : "..."));
}
}
if (nodes != staticNodes) {
ckfree((char *)nodes);
}
Tcl_FreeParse(&scratch);
return code;
}
/*
*----------------------------------------------------------------------
*
* GenerateTokens --
*
* Routine that generates Tcl_Tokens that represent a Tcl expression
* and writes them to *parsePtr. The parse tree of the expression
* is in the array of ExprNodes, nodes. Some of the Tcl_Tokens are
* copied from scratch space at *scratchPtr, where the parsing pass
* that constructed the parse tree left them.
*
*----------------------------------------------------------------------
*/
static void
GenerateTokens(
ExprNode *nodes,
Tcl_Parse *scratchPtr,
Tcl_Parse *parsePtr)
{
ExprNode *nodePtr = nodes + nodes->right;
Tcl_Token *sourcePtr, *destPtr, *tokenPtr = scratchPtr->tokenPtr;
int toCopy;
CONST char *end = tokenPtr->start + tokenPtr->size;
while (nodePtr->lexeme != START) {
switch (NODE_TYPE & nodePtr->lexeme) {
case BINARY:
if (nodePtr->left >= 0) {
if ((nodePtr->lexeme != COMMA) && (nodePtr->lexeme != COLON)) {
sourcePtr = scratchPtr->tokenPtr + nodePtr->token;
if (parsePtr->numTokens + 1 >= parsePtr->tokensAvailable) {
TclExpandTokenArray(parsePtr);
}
destPtr = parsePtr->tokenPtr + parsePtr->numTokens;
nodePtr->token = parsePtr->numTokens;
destPtr->type = TCL_TOKEN_SUB_EXPR;
destPtr->start = tokenPtr->start;
destPtr++;
*destPtr = *sourcePtr;
parsePtr->numTokens += 2;
}
nodePtr = nodes + nodePtr->left;
nodes[nodePtr->parent].left = -1;
} else if (nodePtr->right >= 0) {
tokenPtr += tokenPtr->numComponents + 1;
nodePtr = nodes + nodePtr->right;
nodes[nodePtr->parent].right = -1;
} else {
if ((nodePtr->lexeme != COMMA) && (nodePtr->lexeme != COLON)) {
destPtr = parsePtr->tokenPtr + nodePtr->token;
destPtr->size = end - destPtr->start;
destPtr->numComponents =
parsePtr->numTokens - nodePtr->token - 1;
}
nodePtr = nodes + nodePtr->parent;
}
break;
case UNARY:
if (nodePtr->right >= 0) {
sourcePtr = scratchPtr->tokenPtr + nodePtr->token;
if (nodePtr->lexeme != OPEN_PAREN) {
if (parsePtr->numTokens + 1 >= parsePtr->tokensAvailable) {
TclExpandTokenArray(parsePtr);
}
destPtr = parsePtr->tokenPtr + parsePtr->numTokens;
nodePtr->token = parsePtr->numTokens;
destPtr->type = TCL_TOKEN_SUB_EXPR;
destPtr->start = tokenPtr->start;
destPtr++;
*destPtr = *sourcePtr;
parsePtr->numTokens += 2;
}
if (tokenPtr == sourcePtr) {
tokenPtr += tokenPtr->numComponents + 1;
}
nodePtr = nodes + nodePtr->right;
nodes[nodePtr->parent].right = -1;
} else {
if (nodePtr->lexeme != OPEN_PAREN) {
destPtr = parsePtr->tokenPtr + nodePtr->token;
destPtr->size = end - destPtr->start;
destPtr->numComponents =
parsePtr->numTokens - nodePtr->token - 1;
} else {
sourcePtr = scratchPtr->tokenPtr + nodePtr->token;
end = sourcePtr->start + sourcePtr->size;
}
nodePtr = nodes + nodePtr->parent;
}
break;
case LEAF:
switch (nodePtr->lexeme) {
case EMPTY:
break;
case BRACED:
case QUOTED:
sourcePtr = scratchPtr->tokenPtr + nodePtr->token;
end = sourcePtr->start + sourcePtr->size;
if (sourcePtr->numComponents > 1) {
toCopy = sourcePtr->numComponents;
if (tokenPtr == sourcePtr) {
tokenPtr += toCopy + 1;
}
sourcePtr->numComponents++;
while (parsePtr->numTokens + toCopy + 1
>= parsePtr->tokensAvailable) {
TclExpandTokenArray(parsePtr);
}
destPtr = parsePtr->tokenPtr + parsePtr->numTokens;
*destPtr++ = *sourcePtr;
*destPtr = *sourcePtr++;
destPtr->type = TCL_TOKEN_WORD;
destPtr->numComponents = toCopy;
destPtr++;
memcpy((VOID *) destPtr, (VOID *) sourcePtr,
(size_t) (toCopy * sizeof(Tcl_Token)));
parsePtr->numTokens += toCopy + 2;
break;
}
default:
sourcePtr = scratchPtr->tokenPtr + nodePtr->token;
end = sourcePtr->start + sourcePtr->size;
toCopy = sourcePtr->numComponents + 1;
if (tokenPtr == sourcePtr) {
tokenPtr += toCopy;
}
while (parsePtr->numTokens + toCopy - 1
>= parsePtr->tokensAvailable) {
TclExpandTokenArray(parsePtr);
}
destPtr = parsePtr->tokenPtr + parsePtr->numTokens;
memcpy((VOID *) destPtr, (VOID *) sourcePtr,
(size_t) (toCopy * sizeof(Tcl_Token)));
parsePtr->numTokens += toCopy;
break;
}
nodePtr = nodes + nodePtr->parent;
break;
}
}
}
/*
*----------------------------------------------------------------------
*
* ParseLexeme --
*
* Parse a single lexeme from the start of a string, scanning no
* more than numBytes bytes.
*
* Results:
* Returns the number of bytes scanned to produce the lexeme.
*
* Side effects:
* Code identifying lexeme parsed is writen to *lexemePtr.
*
*----------------------------------------------------------------------
*/
static int
ParseLexeme(
CONST char *start, /* Start of lexeme to parse. */
int numBytes, /* Number of bytes in string. */
unsigned char *lexemePtr) /* Write code of parsed lexeme to this
* storage. */
{
CONST char *end;
int scanned;
Tcl_UniChar ch;
if (numBytes == 0) {
*lexemePtr = END;
return 0;
}
switch (*start) {
case '[':
*lexemePtr = SCRIPT;
return 1;
case '{':
*lexemePtr = BRACED;
return 1;
case '(':
*lexemePtr = OPEN_PAREN;
return 1;
case ')':
*lexemePtr = CLOSE_PAREN;
return 1;
case '$':
*lexemePtr = VARIABLE;
return 1;
case '\"':
*lexemePtr = QUOTED;
return 1;
case ',':
*lexemePtr = COMMA;
return 1;
case '/':
*lexemePtr = DIVIDE;
return 1;
case '%':
*lexemePtr = MOD;
return 1;
case '+':
*lexemePtr = PLUS;
return 1;
case '-':
*lexemePtr = MINUS;
return 1;
case '?':
*lexemePtr = QUESTION;
return 1;
case ':':
*lexemePtr = COLON;
return 1;
case '^':
*lexemePtr = BIT_XOR;
return 1;
case '~':
*lexemePtr = BIT_NOT;
return 1;
case '*':
if ((numBytes > 1) && (start[1] == '*')) {
*lexemePtr = EXPON;
return 2;
}
*lexemePtr = MULT;
return 1;
case '=':
if ((numBytes > 1) && (start[1] == '=')) {
*lexemePtr = EQUAL;
return 2;
}
*lexemePtr = INCOMPLETE;
return 1;
case '!':
if ((numBytes > 1) && (start[1] == '=')) {
*lexemePtr = NEQ;
return 2;
}
*lexemePtr = NOT;
return 1;
case '&':
if ((numBytes > 1) && (start[1] == '&')) {
*lexemePtr = AND;
return 2;
}
*lexemePtr = BIT_AND;
return 1;
case '|':
if ((numBytes > 1) && (start[1] == '|')) {
*lexemePtr = OR;
return 2;
}
*lexemePtr = BIT_OR;
return 1;
case '<':
if (numBytes > 1) {
switch (start[1]) {
case '<':
*lexemePtr = LEFT_SHIFT;
return 2;
case '=':
*lexemePtr = LEQ;
return 2;
}
}
*lexemePtr = LESS;
return 1;
case '>':
if (numBytes > 1) {
switch (start[1]) {
case '>':
*lexemePtr = RIGHT_SHIFT;
return 2;
case '=':
*lexemePtr = GEQ;
return 2;
}
}
*lexemePtr = GREATER;
return 1;
case 'i':
if ((numBytes > 1) && (start[1] == 'n')
&& ((numBytes == 2) || !isalpha(UCHAR(start[2])))) {
/*
* Must make this check so we can tell the difference between
* the "in" operator and the "int" function name and the
* "infinity" numeric value.
*/
*lexemePtr = IN_LIST;
return 2;
}
break;
case 'e':
if ((numBytes > 1) && (start[1] == 'q')
&& ((numBytes == 2) || !isalpha(UCHAR(start[2])))) {
*lexemePtr = STREQ;
return 2;
}
break;
case 'n':
if ((numBytes > 1) && ((numBytes == 2) || !isalpha(UCHAR(start[2])))) {
switch (start[1]) {
case 'e':
*lexemePtr = STRNEQ;
return 2;
case 'i':
*lexemePtr = NOT_IN_LIST;
return 2;
}
}
}
if (TclParseNumber(NULL, NULL, NULL, start, numBytes, &end,
TCL_PARSE_NO_WHITESPACE) == TCL_OK) {
*lexemePtr = NUMBER;
return (end-start);
}
if (Tcl_UtfCharComplete(start, numBytes)) {
scanned = Tcl_UtfToUniChar(start, &ch);
} else {
char utfBytes[TCL_UTF_MAX];
memcpy(utfBytes, start, (size_t) numBytes);
utfBytes[numBytes] = '\0';
scanned = Tcl_UtfToUniChar(utfBytes, &ch);
}
if (!isalpha(UCHAR(ch))) {
*lexemePtr = INVALID;
return scanned;
}
end = start;
while (isalnum(UCHAR(ch)) || (UCHAR(ch) == '_')) {
end += scanned;
numBytes -= scanned;
if (Tcl_UtfCharComplete(end, numBytes)) {
scanned = Tcl_UtfToUniChar(end, &ch);
} else {
char utfBytes[TCL_UTF_MAX];
memcpy(utfBytes, end, (size_t) numBytes);
utfBytes[numBytes] = '\0';
scanned = Tcl_UtfToUniChar(utfBytes, &ch);
}
}
*lexemePtr = BAREWORD;
return (end-start);
}
/*
* Boolean variable that controls whether expression compilation tracing is
* enabled.
*/
#ifdef TCL_COMPILE_DEBUG
|
| ︙ | ︙ |
Deleted generic/tclParseExpr.c.
|
| < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < < |
Changes to unix/Makefile.in.
1 2 3 4 5 6 7 | # # This file is a Makefile for Tcl. If it has the name "Makefile.in" # then it is a template for a Makefile; to generate the actual Makefile, # run "./configure", which is a configuration script generated by the # "autoconf" program (constructs like "@foo@" will get replaced in the # actual Makefile. # | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | # # This file is a Makefile for Tcl. If it has the name "Makefile.in" # then it is a template for a Makefile; to generate the actual Makefile, # run "./configure", which is a configuration script generated by the # "autoconf" program (constructs like "@foo@" will get replaced in the # actual Makefile. # # RCS: @(#) $Id: Makefile.in,v 1.197 2006/11/09 16:52:30 dgp Exp $ VERSION = @TCL_VERSION@ MAJOR_VERSION = @TCL_MAJOR_VERSION@ MINOR_VERSION = @TCL_MINOR_VERSION@ PATCH_LEVEL = @TCL_PATCH_LEVEL@ #---------------------------------------------------------------- |
| ︙ | ︙ | |||
306 307 308 309 310 311 312 | tclAsync.o tclBasic.o tclBinary.o tclCkalloc.o tclClock.o \ tclCmdAH.o tclCmdIL.o tclCmdMZ.o tclCompCmds.o tclCompExpr.o \ tclCompile.o tclConfig.o tclDate.o tclDictObj.o tclEncoding.o \ tclEnv.o tclEvent.o tclExecute.o tclFCmd.o tclFileName.o tclGet.o \ tclHash.o tclHistory.o tclIndexObj.o tclInterp.o tclIO.o tclIOCmd.o \ tclIORChan.o tclIOGT.o tclIOSock.o tclIOUtil.o tclLink.o tclListObj.o \ tclLiteral.o tclLoad.o tclMain.o tclNamesp.o tclNotify.o \ | | | 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 | tclAsync.o tclBasic.o tclBinary.o tclCkalloc.o tclClock.o \ tclCmdAH.o tclCmdIL.o tclCmdMZ.o tclCompCmds.o tclCompExpr.o \ tclCompile.o tclConfig.o tclDate.o tclDictObj.o tclEncoding.o \ tclEnv.o tclEvent.o tclExecute.o tclFCmd.o tclFileName.o tclGet.o \ tclHash.o tclHistory.o tclIndexObj.o tclInterp.o tclIO.o tclIOCmd.o \ tclIORChan.o tclIOGT.o tclIOSock.o tclIOUtil.o tclLink.o tclListObj.o \ tclLiteral.o tclLoad.o tclMain.o tclNamesp.o tclNotify.o \ tclObj.o tclPanic.o tclParse.o tclPathObj.o tclPipe.o \ tclPkg.o tclPkgConfig.o tclPosixStr.o \ tclPreserve.o tclProc.o tclRegexp.o \ tclResolve.o tclResult.o tclScan.o tclStringObj.o \ tclStrToD.o tclThread.o \ tclThreadAlloc.o tclThreadJoin.o tclThreadStorage.o tclStubInit.o \ tclStubLib.o tclTimer.o tclTrace.o tclUtf.o tclUtil.o tclVar.o \ tclTomMathInterface.o |
| ︙ | ︙ | |||
406 407 408 409 410 411 412 |
$(GENERIC_DIR)/tclLiteral.c \
$(GENERIC_DIR)/tclLoad.c \
$(GENERIC_DIR)/tclMain.c \
$(GENERIC_DIR)/tclNamesp.c \
$(GENERIC_DIR)/tclNotify.c \
$(GENERIC_DIR)/tclObj.c \
$(GENERIC_DIR)/tclParse.c \
| < | 406 407 408 409 410 411 412 413 414 415 416 417 418 419 |
$(GENERIC_DIR)/tclLiteral.c \
$(GENERIC_DIR)/tclLoad.c \
$(GENERIC_DIR)/tclMain.c \
$(GENERIC_DIR)/tclNamesp.c \
$(GENERIC_DIR)/tclNotify.c \
$(GENERIC_DIR)/tclObj.c \
$(GENERIC_DIR)/tclParse.c \
$(GENERIC_DIR)/tclPathObj.c \
$(GENERIC_DIR)/tclPipe.c \
$(GENERIC_DIR)/tclPkg.c \
$(GENERIC_DIR)/tclPkgConfig.c \
$(GENERIC_DIR)/tclPosixStr.c \
$(GENERIC_DIR)/tclPreserve.c \
$(GENERIC_DIR)/tclProc.c \
|
| ︙ | ︙ | |||
1110 1111 1112 1113 1114 1115 1116 | tclNotify.o: $(GENERIC_DIR)/tclNotify.c $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclNotify.c tclParse.o: $(GENERIC_DIR)/tclParse.c $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclParse.c | < < < | 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 | tclNotify.o: $(GENERIC_DIR)/tclNotify.c $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclNotify.c tclParse.o: $(GENERIC_DIR)/tclParse.c $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclParse.c tclPanic.o: $(GENERIC_DIR)/tclPanic.c $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclPanic.c tclPathObj.o: $(GENERIC_DIR)/tclPathObj.c $(FSHDR) $(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tclPathObj.c tclPipe.o: $(GENERIC_DIR)/tclPipe.c |
| ︙ | ︙ |
Changes to win/Makefile.in.
1 2 3 4 5 6 7 | # # This file is a Makefile for Tcl. If it has the name "Makefile.in" # then it is a template for a Makefile; to generate the actual Makefile, # run "./configure", which is a configuration script generated by the # "autoconf" program (constructs like "@foo@" will get replaced in the # actual Makefile. # | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | # # This file is a Makefile for Tcl. If it has the name "Makefile.in" # then it is a template for a Makefile; to generate the actual Makefile, # run "./configure", which is a configuration script generated by the # "autoconf" program (constructs like "@foo@" will get replaced in the # actual Makefile. # # RCS: @(#) $Id: Makefile.in,v 1.109 2006/11/09 16:52:31 dgp Exp $ VERSION = @TCL_VERSION@ #---------------------------------------------------------------- # Things you can change to personalize the Makefile for your own # site (you can make these changes in either Makefile.in or # Makefile, but changes to Makefile will get lost if you re-run |
| ︙ | ︙ | |||
251 252 253 254 255 256 257 | tclLoad.$(OBJEXT) \ tclMain.$(OBJEXT) \ tclNamesp.$(OBJEXT) \ tclNotify.$(OBJEXT) \ tclObj.$(OBJEXT) \ tclPanic.$(OBJEXT) \ tclParse.$(OBJEXT) \ | < | 251 252 253 254 255 256 257 258 259 260 261 262 263 264 | tclLoad.$(OBJEXT) \ tclMain.$(OBJEXT) \ tclNamesp.$(OBJEXT) \ tclNotify.$(OBJEXT) \ tclObj.$(OBJEXT) \ tclPanic.$(OBJEXT) \ tclParse.$(OBJEXT) \ tclPathObj.$(OBJEXT) \ tclPipe.$(OBJEXT) \ tclPkg.$(OBJEXT) \ tclPkgConfig.$(OBJEXT) \ tclPosixStr.$(OBJEXT) \ tclPreserve.$(OBJEXT) \ tclProc.$(OBJEXT) \ |
| ︙ | ︙ |
Changes to win/makefile.bc.
| ︙ | ︙ | |||
232 233 234 235 236 237 238 | $(TMPDIR)\tclLoad.obj \ $(TMPDIR)\tclMain.obj \ $(TMPDIR)\tclNamesp.obj \ $(TMPDIR)\tclNotify.obj \ $(TMPDIR)\tclObj.obj \ $(TMPDIR)\tclPanic.obj \ $(TMPDIR)\tclParse.obj \ | < | 232 233 234 235 236 237 238 239 240 241 242 243 244 245 | $(TMPDIR)\tclLoad.obj \ $(TMPDIR)\tclMain.obj \ $(TMPDIR)\tclNamesp.obj \ $(TMPDIR)\tclNotify.obj \ $(TMPDIR)\tclObj.obj \ $(TMPDIR)\tclPanic.obj \ $(TMPDIR)\tclParse.obj \ $(TMPDIR)\tclPipe.obj \ $(TMPDIR)\tclPkg.obj \ $(TMPDIR)\tclPkgConfig.obj \ $(TMPDIR)\tclPosixStr.obj \ $(TMPDIR)\tclPreserve.obj \ $(TMPDIR)\tclProc.obj \ $(TMPDIR)\tclRegexp.obj \ |
| ︙ | ︙ |
Changes to win/makefile.vc.
| ︙ | ︙ | |||
8 9 10 11 12 13 14 | # # Copyright (c) 1995-1996 Sun Microsystems, Inc. # Copyright (c) 1998-2000 Ajuba Solutions. # Copyright (c) 2001-2005 ActiveState Corporation. # Copyright (c) 2001-2004 David Gravereaux. # #------------------------------------------------------------------------------ | | | 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | # # Copyright (c) 1995-1996 Sun Microsystems, Inc. # Copyright (c) 1998-2000 Ajuba Solutions. # Copyright (c) 2001-2005 ActiveState Corporation. # Copyright (c) 2001-2004 David Gravereaux. # #------------------------------------------------------------------------------ # RCS: @(#) $Id: makefile.vc,v 1.155 2006/11/09 16:52:31 dgp Exp $ #------------------------------------------------------------------------------ # Check to see we are configured to build with MSVC (MSDEVDIR or MSVCDIR) # or with the MS Platform SDK (MSSDK). Visual Studio .NET 2003 and 2005 define # VCINSTALLDIR instead. !if !defined(MSDEVDIR) && !defined(MSVCDIR) && !defined(MSSDK) && !defined(VCINSTALLDIR) MSG = ^ |
| ︙ | ︙ | |||
292 293 294 295 296 297 298 | $(TMP_DIR)\tclLoad.obj \ $(TMP_DIR)\tclMain.obj \ $(TMP_DIR)\tclNamesp.obj \ $(TMP_DIR)\tclNotify.obj \ $(TMP_DIR)\tclObj.obj \ $(TMP_DIR)\tclPanic.obj \ $(TMP_DIR)\tclParse.obj \ | < | 292 293 294 295 296 297 298 299 300 301 302 303 304 305 | $(TMP_DIR)\tclLoad.obj \ $(TMP_DIR)\tclMain.obj \ $(TMP_DIR)\tclNamesp.obj \ $(TMP_DIR)\tclNotify.obj \ $(TMP_DIR)\tclObj.obj \ $(TMP_DIR)\tclPanic.obj \ $(TMP_DIR)\tclParse.obj \ $(TMP_DIR)\tclPathObj.obj \ $(TMP_DIR)\tclPipe.obj \ $(TMP_DIR)\tclPkg.obj \ $(TMP_DIR)\tclPkgConfig.obj \ $(TMP_DIR)\tclPosixStr.obj \ $(TMP_DIR)\tclPreserve.obj \ $(TMP_DIR)\tclProc.obj \ |
| ︙ | ︙ |
Changes to win/tcl.dsp.
| ︙ | ︙ | |||
1238 1239 1240 1241 1242 1243 1244 | SOURCE=..\generic\tclPanic.c # End Source File # Begin Source File SOURCE=..\generic\tclParse.c # End Source File | < < < < | 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 | SOURCE=..\generic\tclPanic.c # End Source File # Begin Source File SOURCE=..\generic\tclParse.c # End Source File # Begin Source File SOURCE=..\generic\tclPipe.c # End Source File # Begin Source File SOURCE=..\generic\tclPkg.c |
| ︙ | ︙ |