当前位置: 首页>>代码示例>>C#>>正文


C# DesignScriptParser.Token类代码示例

本文整理汇总了C#中ProtoCore.DesignScriptParser.Token的典型用法代码示例。如果您正苦于以下问题:C# Token类的具体用法?C# Token怎么用?C# Token使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Token类属于ProtoCore.DesignScriptParser命名空间,在下文中一共展示了Token类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Scan

	// get the next token (possibly a token already seen during peeking)
	public Token Scan () {
		if (tokens.next == null) {
			return NextToken();
		} else {
			pt = tokens = tokens.next;
			return tokens;
		}
	}
开发者ID:AutodeskFractal,项目名称:Dynamo,代码行数:9,代码来源:Scanner.cs

示例2: Peek

	// peek for the next token, ignore pragmas
	public Token Peek () {
		do {
			if (pt.next == null) {
				pt.next = NextToken();
			}
			pt = pt.next;
		} while (pt.kind > maxT); // skip pragmas
	
		return pt;
	}
开发者ID:AutodeskFractal,项目名称:Dynamo,代码行数:11,代码来源:Scanner.cs

示例3: Init

	void Init() {
		pos = -1; line = 1; col = 0; charPos = -1;
		oldEols = 0;
		NextCh();
		if (ch == 0xEF) { // check optional byte order mark for UTF-8
			NextCh(); int ch1 = ch;
			NextCh(); int ch2 = ch;
			if (ch1 != 0xBB || ch2 != 0xBF) {
				throw new FatalError(String.Format("illegal byte order mark: EF {0,2:X} {1,2:X}", ch1, ch2));
			}
			buffer = new UTF8Buffer(buffer); col = 0; charPos = -1;
			NextCh();
		}
		pt = tokens = new Token();  // first token is a dummy
	}
开发者ID:AutodeskFractal,项目名称:Dynamo,代码行数:15,代码来源:Scanner.cs

示例4: NextToken

	Token NextToken() {
		while (ch == ' ' ||
			ch >= 9 && ch <= 10 || ch == 13
		) NextCh();

		int recKind = noSym;
		int recEnd = pos;
		t = new Token();
		t.pos = pos; t.col = col; t.line = line; t.charPos = charPos;
		int state;
		if (start.ContainsKey(ch)) { state = (int) start[ch]; }
		else { state = 0; }
		tlen = 0; AddCh();
		
		switch (state) {
			case -1: { t.kind = eofSym; break; } // NextCh already done
			case 0: {
				if (recKind != noSym) {
					tlen = recEnd - t.pos;
					SetScannerBehindT();
				}
				t.kind = recKind; break;
			} // NextCh already done
			case 1:
				recEnd = pos; recKind = 1;
				if (ch >= '0' && ch <= '9' || ch >= 'A' && ch <= 'Z' || ch == '_' || ch >= 'a' && ch <= 'z' || ch == 170 || ch == 181 || ch == 186 || ch >= 192 && ch <= 214 || ch >= 216 && ch <= 246 || ch >= 248 && ch <= 705 || ch >= 710 && ch <= 721 || ch >= 736 && ch <= 740 || ch == 748 || ch == 750 || ch >= 768 && ch <= 884 || ch >= 886 && ch <= 887 || ch >= 890 && ch <= 893 || ch == 902 || ch >= 904 && ch <= 906 || ch == 908 || ch >= 910 && ch <= 929 || ch >= 931 && ch <= 1013 || ch >= 1015 && ch <= 1153 || ch >= 1155 && ch <= 1159 || ch >= 1162 && ch <= 1319 || ch >= 1329 && ch <= 1366 || ch == 1369 || ch >= 1377 && ch <= 1415 || ch >= 1425 && ch <= 1469 || ch == 1471 || ch >= 1473 && ch <= 1474 || ch >= 1476 && ch <= 1477 || ch == 1479 || ch >= 1488 && ch <= 1514 || ch >= 1520 && ch <= 1522 || ch >= 1552 && ch <= 1562 || ch >= 1568 && ch <= 1641 || ch >= 1646 && ch <= 1747 || ch >= 1749 && ch <= 1756 || ch >= 1759 && ch <= 1768 || ch >= 1770 && ch <= 1788 || ch == 1791 || ch >= 1808 && ch <= 1866 || ch >= 1869 && ch <= 1969 || ch >= 1984 && ch <= 2037 || ch == 2042 || ch >= 2048 && ch <= 2093 || ch >= 2112 && ch <= 2139 || ch == 2208 || ch >= 2210 && ch <= 2220 || ch >= 2276 && ch <= 2302 || ch >= 2304 && ch <= 2403 || ch >= 2406 && ch <= 2415 || ch >= 2417 && ch <= 2423 || ch >= 2425 && ch <= 2431 || ch >= 2433 && ch <= 2435 || ch >= 2437 && ch <= 2444 || ch >= 2447 && ch <= 2448 || ch >= 2451 && ch <= 2472 || ch >= 2474 && ch <= 2480 || ch == 2482 || ch >= 2486 && ch <= 2489 || ch >= 2492 && ch <= 2500 || ch >= 2503 && ch <= 2504 || ch >= 2507 && ch <= 2510 || ch == 2519 || ch >= 2524 && ch <= 2525 || ch >= 2527 && ch <= 2531 || ch >= 2534 && ch <= 2545 || ch >= 2561 && ch <= 2563 || ch >= 2565 && ch <= 2570 || ch >= 2575 && ch <= 2576 || ch >= 2579 && ch <= 2600 || ch >= 2602 && ch <= 2608 || ch >= 2610 && ch <= 2611 || ch >= 2613 && ch <= 2614 || ch >= 2616 && ch <= 2617 || ch == 2620 || ch >= 2622 && ch <= 2626 || ch >= 2631 && ch <= 2632 || ch >= 2635 && ch <= 2637 || ch == 2641 || ch >= 2649 && ch <= 2652 || ch == 2654 || ch >= 2662 && ch <= 2677 || ch >= 2689 && ch <= 2691 || ch >= 2693 && ch <= 2701 || ch >= 2703 && ch <= 2705 || ch >= 2707 && ch <= 2728 || ch >= 2730 && ch <= 2736 || ch >= 2738 && ch <= 2739 || ch >= 2741 && ch <= 2745 || ch >= 2748 && ch <= 2757 || ch >= 2759 && ch <= 2761 || ch >= 2763 && ch <= 2765 || ch == 2768 || ch >= 2784 && ch <= 2787 || ch >= 2790 && ch <= 2799 || ch >= 2817 && ch <= 2819 || ch >= 2821 && ch <= 2828 || ch >= 2831 && ch <= 2832 || ch >= 2835 && ch <= 2856 || ch >= 2858 && ch <= 2864 || ch >= 2866 && ch <= 2867 || ch >= 2869 && ch <= 2873 || ch >= 2876 && ch <= 2884 || ch >= 2887 && ch <= 2888 || ch >= 2891 && ch <= 2893 || ch >= 2902 && ch <= 2903 || ch >= 2908 && ch <= 2909 || ch >= 2911 && ch <= 2915 || ch >= 2918 && ch <= 2927 || ch == 2929 || ch >= 2946 && ch <= 2947 || ch >= 2949 && ch <= 2954 || ch >= 2958 && ch <= 2960 || ch >= 2962 && ch <= 2965 || ch >= 2969 && ch <= 2970 || ch == 2972 || ch >= 2974 && ch <= 2975 || ch >= 2979 && ch <= 2980 || ch >= 2984 && ch <= 2986 || ch >= 2990 && ch <= 3001 || ch >= 3006 && ch <= 3010 || ch >= 3014 && ch <= 3016 || ch >= 3018 && ch <= 3021 || ch == 3024 || ch == 3031 || ch >= 3046 && ch <= 3055 || ch >= 3073 && ch <= 3075 || ch >= 3077 && ch <= 3084 || ch >= 3086 && ch <= 3088 || ch >= 3090 && ch <= 3112 || ch >= 3114 && ch <= 3123 || ch >= 3125 && ch <= 3129 || ch >= 3133 && ch <= 3140 || ch >= 3142 && ch <= 3144 || ch >= 3146 && ch <= 3149 || ch >= 3157 && ch <= 3158 || ch >= 3160 && ch <= 3161 || ch >= 3168 && ch <= 3171 || ch >= 3174 && ch <= 3183 || ch >= 3202 && ch <= 3203 || ch >= 3205 && ch <= 3212 || ch >= 3214 && ch <= 3216 || ch >= 3218 && ch <= 3240 || ch >= 3242 && ch <= 3251 || ch >= 3253 && ch <= 3257 || ch >= 3260 && ch <= 3268 || ch >= 3270 && ch <= 3272 || ch >= 3274 && ch <= 3277 || ch >= 3285 && ch <= 3286 || ch == 3294 || ch >= 3296 && ch <= 3299 || ch >= 3302 && ch <= 3311 || ch >= 3313 && ch <= 3314 || ch >= 3330 && ch <= 3331 || ch >= 3333 && ch <= 3340 || ch >= 3342 && ch <= 3344 || ch >= 3346 && ch <= 3386 || ch >= 3389 && ch <= 3396 || ch >= 3398 && ch <= 3400 || ch >= 3402 && ch <= 3406 || ch == 3415 || ch >= 3424 && ch <= 3427 || ch >= 3430 && ch <= 3439 || ch >= 3450 && ch <= 3455 || ch >= 3458 && ch <= 3459 || ch >= 3461 && ch <= 3478 || ch >= 3482 && ch <= 3505 || ch >= 3507 && ch <= 3515 || ch == 3517 || ch >= 3520 && ch <= 3526 || ch == 3530 || ch >= 3535 && ch <= 3540 || ch == 3542 || ch >= 3544 && ch <= 3551 || ch >= 3570 && ch <= 3571 || ch >= 3585 && ch <= 3642 || ch >= 3648 && ch <= 3662 || ch >= 3664 && ch <= 3673 || ch >= 3713 && ch <= 3714 || ch == 3716 || ch >= 3719 && ch <= 3720 || ch == 3722 || ch == 3725 || ch >= 3732 && ch <= 3735 || ch >= 3737 && ch <= 3743 || ch >= 3745 && ch <= 3747 || ch == 3749 || ch == 3751 || ch >= 3754 && ch <= 3755 || ch >= 3757 && ch <= 3769 || ch >= 3771 && ch <= 3773 || ch >= 3776 && ch <= 3780 || ch == 3782 || ch >= 3784 && ch <= 3789 || ch >= 3792 && ch <= 3801 || ch >= 3804 && ch <= 3807 || ch == 3840 || ch >= 3864 && ch <= 3865 || ch >= 3872 && ch <= 3881 || ch == 3893 || ch == 3895 || ch == 3897 || ch >= 3902 && ch <= 3911 || ch >= 3913 && ch <= 3948 || ch >= 3953 && ch <= 3972 || ch >= 3974 && ch <= 3991 || ch >= 3993 && ch <= 4028 || ch == 4038 || ch >= 4096 && ch <= 4169 || ch >= 4176 && ch <= 4253 || ch >= 4256 && ch <= 4293 || ch == 4295 || ch == 4301 || ch >= 4304 && ch <= 4346 || ch >= 4348 && ch <= 4680 || ch >= 4682 && ch <= 4685 || ch >= 4688 && ch <= 4694 || ch == 4696 || ch >= 4698 && ch <= 4701 || ch >= 4704 && ch <= 4744 || ch >= 4746 && ch <= 4749 || ch >= 4752 && ch <= 4784 || ch >= 4786 && ch <= 4789 || ch >= 4792 && ch <= 4798 || ch == 4800 || ch >= 4802 && ch <= 4805 || ch >= 4808 && ch <= 4822 || ch >= 4824 && ch <= 4880 || ch >= 4882 && ch <= 4885 || ch >= 4888 && ch <= 4954 || ch >= 4957 && ch <= 4959 || ch >= 4992 && ch <= 5007 || ch >= 5024 && ch <= 5108 || ch >= 5121 && ch <= 5740 || ch >= 5743 && ch <= 5759 || ch >= 5761 && ch <= 5786 || ch >= 5792 && ch <= 5866 || ch >= 5870 && ch <= 5872 || ch >= 5888 && ch <= 5900 || ch >= 5902 && ch <= 5908 || ch >= 5920 && ch <= 5940 || ch >= 5952 && ch <= 5971 || ch >= 5984 && ch <= 5996 || ch >= 5998 && ch <= 6000 || ch >= 6002 && ch <= 6003 || ch >= 6016 && ch <= 6099 || ch == 6103 || ch >= 6108 && ch <= 6109 || ch >= 6112 && ch <= 6121 || ch >= 6155 && ch <= 6157 || ch >= 6160 && ch <= 6169 || ch >= 6176 && ch <= 6263 || ch >= 6272 && ch <= 6314 || ch >= 6320 && ch <= 6389 || ch >= 6400 && ch <= 6428 || ch >= 6432 && ch <= 6443 || ch >= 6448 && ch <= 6459 || ch >= 6470 && ch <= 6509 || ch >= 6512 && ch <= 6516 || ch >= 6528 && ch <= 6571 || ch >= 6576 && ch <= 6601 || ch >= 6608 && ch <= 6617 || ch >= 6656 && ch <= 6683 || ch >= 6688 && ch <= 6750 || ch >= 6752 && ch <= 6780 || ch >= 6783 && ch <= 6793 || ch >= 6800 && ch <= 6809 || ch == 6823 || ch >= 6912 && ch <= 6987 || ch >= 6992 && ch <= 7001 || ch >= 7019 && ch <= 7027 || ch >= 7040 && ch <= 7155 || ch >= 7168 && ch <= 7223 || ch >= 7232 && ch <= 7241 || ch >= 7245 && ch <= 7293 || ch >= 7376 && ch <= 7378 || ch >= 7380 && ch <= 7414 || ch >= 7424 && ch <= 7654 || ch >= 7676 && ch <= 7957 || ch >= 7960 && ch <= 7965 || ch >= 7968 && ch <= 8005 || ch >= 8008 && ch <= 8013 || ch >= 8016 && ch <= 8023 || ch == 8025 || ch == 8027 || ch == 8029 || ch >= 8031 && ch <= 8061 || ch >= 8064 && ch <= 8116 || ch >= 8118 && ch <= 8124 || ch == 8126 || ch >= 8130 && ch <= 8132 || ch >= 8134 && ch <= 8140 || ch >= 8144 && ch <= 8147 || ch >= 8150 && ch <= 8155 || ch >= 8160 && ch <= 8172 || ch >= 8178 && ch <= 8180 || ch >= 8182 && ch <= 8188 || ch >= 8204 && ch <= 8205 || ch >= 8255 && ch <= 8256 || ch == 8276 || ch == 8305 || ch == 8319 || ch >= 8336 && ch <= 8348 || ch >= 8400 && ch <= 8412 || ch == 8417 || ch >= 8421 && ch <= 8432 || ch == 8450 || ch == 8455 || ch >= 8458 && ch <= 8467 || ch == 8469 || ch >= 8473 && ch <= 8477 || ch == 8484 || ch == 8486 || ch == 8488 || ch >= 8490 && ch <= 8493 || ch >= 8495 && ch <= 8505 || ch >= 8508 && ch <= 8511 || ch >= 8517 && ch <= 8521 || ch == 8526 || ch >= 8544 && ch <= 8584 || ch >= 11264 && ch <= 11310 || ch >= 11312 && ch <= 11358 || ch >= 11360 && ch <= 11492 || ch >= 11499 && ch <= 11507 || ch >= 11520 && ch <= 11557 || ch == 11559 || ch == 11565 || ch >= 11568 && ch <= 11623 || ch == 11631 || ch >= 11647 && ch <= 11670 || ch >= 11680 && ch <= 11686 || ch >= 11688 && ch <= 11694 || ch >= 11696 && ch <= 11702 || ch >= 11704 && ch <= 11710 || ch >= 11712 && ch <= 11718 || ch >= 11720 && ch <= 11726 || ch >= 11728 && ch <= 11734 || ch >= 11736 && ch <= 11742 || ch >= 11744 && ch <= 11775 || ch == 11823 || ch >= 12293 && ch <= 12295 || ch >= 12321 && ch <= 12335 || ch >= 12337 && ch <= 12341 || ch >= 12344 && ch <= 12348 || ch >= 12353 && ch <= 12438 || ch >= 12441 && ch <= 12442 || ch >= 12445 && ch <= 12447 || ch >= 12449 && ch <= 12538 || ch >= 12540 && ch <= 12543 || ch >= 12549 && ch <= 12589 || ch >= 12593 && ch <= 12686 || ch >= 12704 && ch <= 12730 || ch >= 12784 && ch <= 12799 || ch >= 13312 && ch <= 19893 || ch >= 19968 && ch <= 40908 || ch >= 40960 && ch <= 42124 || ch >= 42192 && ch <= 42237 || ch >= 42240 && ch <= 42508 || ch >= 42512 && ch <= 42539 || ch >= 42560 && ch <= 42607 || ch >= 42612 && ch <= 42621 || ch >= 42623 && ch <= 42647 || ch >= 42655 && ch <= 42737 || ch >= 42775 && ch <= 42783 || ch >= 42786 && ch <= 42888 || ch >= 42891 && ch <= 42894 || ch >= 42896 && ch <= 42899 || ch >= 42912 && ch <= 42922 || ch >= 43000 && ch <= 43047 || ch >= 43072 && ch <= 43123 || ch >= 43136 && ch <= 43204 || ch >= 43216 && ch <= 43225 || ch >= 43232 && ch <= 43255 || ch == 43259 || ch >= 43264 && ch <= 43309 || ch >= 43312 && ch <= 43347 || ch >= 43360 && ch <= 43388 || ch >= 43392 && ch <= 43456 || ch >= 43471 && ch <= 43481 || ch >= 43520 && ch <= 43574 || ch >= 43584 && ch <= 43597 || ch >= 43600 && ch <= 43609 || ch >= 43616 && ch <= 43638 || ch >= 43642 && ch <= 43643 || ch >= 43648 && ch <= 43714 || ch >= 43739 && ch <= 43741 || ch >= 43744 && ch <= 43759 || ch >= 43762 && ch <= 43766 || ch >= 43777 && ch <= 43782 || ch >= 43785 && ch <= 43790 || ch >= 43793 && ch <= 43798 || ch >= 43808 && ch <= 43814 || ch >= 43816 && ch <= 43822 || ch >= 43968 && ch <= 44010 || ch >= 44012 && ch <= 44013 || ch >= 44016 && ch <= 44025 || ch >= 44032 && ch <= 55203 || ch >= 55216 && ch <= 55238 || ch >= 55243 && ch <= 55291 || ch >= 63744 && ch <= 64109 || ch >= 64112 && ch <= 64217 || ch >= 64256 && ch <= 64262 || ch >= 64275 && ch <= 64279 || ch >= 64285 && ch <= 64296 || ch >= 64298 && ch <= 64310 || ch >= 64312 && ch <= 64316 || ch == 64318 || ch >= 64320 && ch <= 64321 || ch >= 64323 && ch <= 64324 || ch >= 64326 && ch <= 64433 || ch >= 64467 && ch <= 64829 || ch >= 64848 && ch <= 64911 || ch >= 64914 && ch <= 64967 || ch >= 65008 && ch <= 65019 || ch >= 65024 && ch <= 65039 || ch >= 65056 && ch <= 65062 || ch >= 65075 && ch <= 65076 || ch >= 65101 && ch <= 65103 || ch >= 65136 && ch <= 65140 || ch >= 65142 && ch <= 65276 || ch >= 65296 && ch <= 65305 || ch >= 65313 && ch <= 65338 || ch == 65343 || ch >= 65345 && ch <= 65370 || ch >= 65382 && ch <= 65470 || ch >= 65474 && ch <= 65479 || ch >= 65482 && ch <= 65487 || ch >= 65490 && ch <= 65495 || ch >= 65498 && ch <= 65500) {AddCh(); goto case 1;}
				else {t.kind = 1; t.val = new String(tval, 0, tlen); CheckLiteral(); return t;}
			case 2:
				if (ch >= '0' && ch <= '9') {AddCh(); goto case 3;}
				else {goto case 0;}
			case 3:
				recEnd = pos; recKind = 3;
				if (ch >= '0' && ch <= '9') {AddCh(); goto case 3;}
				else if (ch == 'E' || ch == 'e') {AddCh(); goto case 4;}
				else {t.kind = 3; break;}
			case 4:
				if (ch >= '0' && ch <= '9') {AddCh(); goto case 6;}
				else if (ch == '+' || ch == '-') {AddCh(); goto case 5;}
				else {goto case 0;}
			case 5:
				if (ch >= '0' && ch <= '9') {AddCh(); goto case 6;}
				else {goto case 0;}
			case 6:
				recEnd = pos; recKind = 3;
				if (ch >= '0' && ch <= '9') {AddCh(); goto case 6;}
				else {t.kind = 3; break;}
			case 7:
				if (ch <= '!' || ch >= '#' && ch <= '[' || ch >= ']' && ch <= 65535) {AddCh(); goto case 7;}
				else if (ch == '"') {AddCh(); goto case 8;}
				else if (ch == 92) {AddCh(); goto case 34;}
				else {goto case 0;}
			case 8:
				{t.kind = 4; break;}
			case 9:
				if (ch <= '&' || ch >= '(' && ch <= '[' || ch >= ']' && ch <= 65535) {AddCh(); goto case 10;}
				else if (ch == 92) {AddCh(); goto case 35;}
				else {goto case 0;}
			case 10:
				if (ch == 39) {AddCh(); goto case 11;}
				else {goto case 0;}
			case 11:
				{t.kind = 5; break;}
			case 12:
				{t.kind = 7; break;}
			case 13:
				{t.kind = 9; break;}
			case 14:
				{t.kind = 10; break;}
			case 15:
				{t.kind = 11; break;}
			case 16:
				{t.kind = 12; break;}
			case 17:
				{t.kind = 13; break;}
			case 18:
				{t.kind = 15; break;}
			case 19:
				{t.kind = 19; break;}
			case 20:
				{t.kind = 20; break;}
			case 21:
				{t.kind = 21; break;}
			case 22:
				{t.kind = 22; break;}
			case 23:
				{t.kind = 23; break;}
			case 24:
				{t.kind = 24; break;}
			case 25:
				recEnd = pos; recKind = 67;
				if (ch <= 9 || ch >= 11 && ch <= 65535) {AddCh(); goto case 25;}
				else {t.kind = 67; break;}
			case 26:
				if (ch <= ')' || ch >= '+' && ch <= 65535) {AddCh(); goto case 26;}
				else if (ch == '*') {AddCh(); goto case 36;}
				else {goto case 0;}
			case 27:
				{t.kind = 68; break;}
			case 28:
				recEnd = pos; recKind = 2;
//.........这里部分代码省略.........
开发者ID:AutodeskFractal,项目名称:Dynamo,代码行数:101,代码来源:Scanner.cs

示例5: NextToken

	Token NextToken() {
		while (ch == ' ' ||
			ch >= 9 && ch <= 10 || ch == 13
		) NextCh();

		int recKind = noSym;
		int recEnd = pos;
		t = new Token();
		t.pos = pos; t.col = col; t.line = line; t.charPos = charPos;
		int state;
		if (start.ContainsKey(ch)) { state = (int) start[ch]; }
		else { state = 0; }
		tlen = 0; AddCh();
		
		switch (state) {
			case -1: { t.kind = eofSym; break; } // NextCh already done
			case 0: {
				if (recKind != noSym) {
					tlen = recEnd - t.pos;
					SetScannerBehindT();
				}
				t.kind = recKind; break;
			} // NextCh already done
			case 1:
				recEnd = pos; recKind = 1;
				if (ch >= '0' && ch <= '9' || ch >= '@' && ch <= 'Z' || ch == '_' || ch >= 'a' && ch <= 'z') {AddCh(); goto case 1;}
				else {t.kind = 1; t.val = new String(tval, 0, tlen); CheckLiteral(); return t;}
			case 2:
				if (ch >= '0' && ch <= '9') {AddCh(); goto case 3;}
				else {goto case 0;}
			case 3:
				recEnd = pos; recKind = 3;
				if (ch >= '0' && ch <= '9') {AddCh(); goto case 3;}
				else if (ch == 'E' || ch == 'e') {AddCh(); goto case 4;}
				else {t.kind = 3; break;}
			case 4:
				if (ch >= '0' && ch <= '9') {AddCh(); goto case 6;}
				else if (ch == '+' || ch == '-') {AddCh(); goto case 5;}
				else {goto case 0;}
			case 5:
				if (ch >= '0' && ch <= '9') {AddCh(); goto case 6;}
				else {goto case 0;}
			case 6:
				recEnd = pos; recKind = 3;
				if (ch >= '0' && ch <= '9') {AddCh(); goto case 6;}
				else {t.kind = 3; break;}
			case 7:
				if (ch <= '!' || ch >= '#' && ch <= '[' || ch >= ']' && ch <= 65535) {AddCh(); goto case 7;}
				else if (ch == '"') {AddCh(); goto case 8;}
				else if (ch == 92) {AddCh(); goto case 31;}
				else {goto case 0;}
			case 8:
				{t.kind = 4; break;}
			case 9:
				if (ch <= '&' || ch >= '(' && ch <= '[' || ch >= ']' && ch <= 65535) {AddCh(); goto case 10;}
				else if (ch == 92) {AddCh(); goto case 32;}
				else {goto case 0;}
			case 10:
				if (ch == 39) {AddCh(); goto case 11;}
				else {goto case 0;}
			case 11:
				{t.kind = 5; break;}
			case 12:
				{t.kind = 7; break;}
			case 13:
				{t.kind = 8; break;}
			case 14:
				{t.kind = 9; break;}
			case 15:
				{t.kind = 10; break;}
			case 16:
				{t.kind = 11; break;}
			case 17:
				{t.kind = 17; break;}
			case 18:
				{t.kind = 18; break;}
			case 19:
				{t.kind = 19; break;}
			case 20:
				{t.kind = 20; break;}
			case 21:
				{t.kind = 21; break;}
			case 22:
				{t.kind = 22; break;}
			case 23:
				recEnd = pos; recKind = 73;
				if (ch <= 9 || ch >= 11 && ch <= 65535) {AddCh(); goto case 23;}
				else {t.kind = 73; break;}
			case 24:
				if (ch <= ')' || ch >= '+' && ch <= 65535) {AddCh(); goto case 24;}
				else if (ch == '*') {AddCh(); goto case 33;}
				else {goto case 0;}
			case 25:
				{t.kind = 74; break;}
			case 26:
				recEnd = pos; recKind = 2;
				if (ch >= '0' && ch <= '9') {AddCh(); goto case 26;}
				else if (ch == '.') {AddCh(); goto case 2;}
				else if (ch == 'L') {AddCh(); goto case 12;}
				else {t.kind = 2; break;}
//.........这里部分代码省略.........
开发者ID:whztt07,项目名称:Dynamo,代码行数:101,代码来源:Scanner.cs

示例6: IsNotAttributeFunction

	 // used by imperative
	 private bool IsNotAttributeFunction()
	 {
	    if (la.val == "[")
		{
		    Token t = scanner.Peek();
            while (t.val != "]" && t.kind != _EOF)
            {
                t = scanner.Peek();
               
            }
          
            if (t.val == "]")
            {
                Token next = scanner.Peek(); 
                scanner.ResetPeek();
                return (next.val == "{");
            }
            else
            {
                scanner.ResetPeek();
                return false;
            }
		}

        return la.kind != _kw_def;
	 }
开发者ID:limrzx,项目名称:Dynamo,代码行数:27,代码来源:Parser.cs

示例7: Parse

	public void Parse() {
		la = new Token();
		la.val = "";		
		Get();
		DesignScriptParser();
		Expect(0);

	}
开发者ID:limrzx,项目名称:Dynamo,代码行数:8,代码来源:Parser.cs

示例8: IsVariableDeclaration

    private bool IsVariableDeclaration()
    {
        Token t = la;
        if (_ident == t.kind) {
            t = scanner.Peek();
            if (":" == t.val) {
                t = scanner.Peek();
                if (_ident == t.kind) {
                    t = scanner.Peek();
                    scanner.ResetPeek();
                    return (_endline == t.kind || "[" == t.val);
                }
                scanner.ResetPeek();
                return false;
            }
            else if (_endline == t.kind) {
                scanner.ResetPeek();
                return true;
            }

            scanner.ResetPeek();
            return false;
        }
        return false;
    }
开发者ID:limrzx,项目名称:Dynamo,代码行数:25,代码来源:Parser.cs

示例9: IsNotAttributeFunctionClass

	 // use by associative
	 private bool IsNotAttributeFunctionClass()
	 {
		if (la.val == "[")
		{
		    Token t = scanner.Peek();
            while (t.val != "]" && t.kind != _EOF)
            {
                t = scanner.Peek();
            }
          
            if (t.val == "]")
            {
                Token next = scanner.Peek(); 
                scanner.ResetPeek();
                return (next.val == "{");
            }
            else
            {
                scanner.ResetPeek();
                return false;
            }
		}

		if (la.kind != _kw_class && la.kind != _kw_def && la.kind != _kw_external)
			return true;
		return false;
	 }
开发者ID:maajor,项目名称:Dynamo,代码行数:28,代码来源:Parser.cs

示例10: CreateIdentifierNode

        public IdentifierNode CreateIdentifierNode(Token token, AssociativeNode leftNode)
        {
            if (null == token || (string.IsNullOrEmpty(token.val)))
                return null;

            IdentifierNode leftIdentifier = leftNode as IdentifierNode;
            if (null == leftIdentifier)
                return null;

            IdentifierNode identNode = new IdentifierNode
            {
                Value = token.val,
                Name = token.val,
                datatype = leftIdentifier.datatype
            };

            ProtoCore.Utils.NodeUtils.SetNodeLocation(identNode, token);
            return identNode;
        }
开发者ID:qingemeng,项目名称:designscript,代码行数:19,代码来源:AssociativeAST.cs

示例11: ResetPeek

	// make sure that peeking starts at the current scan position
	public void ResetPeek () { pt = tokens; }
开发者ID:AutodeskFractal,项目名称:Dynamo,代码行数:2,代码来源:Scanner.cs

示例12: Get

	void Get () {
		for (;;) {
			t = la;
			la = scanner.Scan();
			if (la.kind <= maxT) { ++errDist; break; }
				if (la.kind == 67) {
				CommentNode cNode = new CommentNode(la.col, la.line, la.val, CommentNode.CommentType.Inline); 
				commentNode.Body.Add(cNode); 
				}
				if (la.kind == 68) {
				CommentNode cNode = new CommentNode(la.col, la.line, la.val, CommentNode.CommentType.Block); 
				commentNode.Body.Add(cNode); 
				}

			la = t;
		}
	}
开发者ID:limrzx,项目名称:Dynamo,代码行数:17,代码来源:Parser.cs


注:本文中的ProtoCore.DesignScriptParser.Token类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。