static void Get () { for (;;) { t = la; la = Scanner.Scan(); if (la.kind <= maxT) { ++errDist; break; } /* ML return changed to break */ if (la.kind == 43) { Tab.SetDDT(la.val); } la = t; } }
Token NextToken() { while (ch == ' ' || ch >= 9 && ch <= 10 || ch == 13 ) NextCh(); if (ch == '/' && Comment0() ||ch == '/' && Comment1()) return NextToken(); int recKind = noSym; int recEnd = pos; t = new Token(); t.pos = pos; t.col = col; t.line = line; 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') {AddCh(); goto case 1;} else {t.kind = 1; t.val = new String(tval, 0, tlen); CheckLiteral(); return t;} case 2: recEnd = pos; recKind = 2; if (ch >= '0' && ch <= '9') {AddCh(); goto case 2;} else {t.kind = 2; break;} case 3: {t.kind = 3; break;} case 4: {t.kind = 4; break;} case 5: if (ch <= 9 || ch >= 11 && ch <= 12 || ch >= 14 && ch <= '&' || ch >= '(' && ch <= '[' || ch >= ']' && ch <= 65535) {AddCh(); goto case 6;} else if (ch == 92) {AddCh(); goto case 7;} else {goto case 0;} case 6: if (ch == 39) {AddCh(); goto case 9;} else {goto case 0;} case 7: if (ch >= ' ' && ch <= '~') {AddCh(); goto case 8;} else {goto case 0;} case 8: if (ch >= '0' && ch <= '9' || ch >= 'a' && ch <= 'f') {AddCh(); goto case 8;} else if (ch == 39) {AddCh(); goto case 9;} else {goto case 0;} case 9: {t.kind = 5; break;} case 10: recEnd = pos; recKind = 44; if (ch >= '0' && ch <= '9' || ch >= 'A' && ch <= 'Z' || ch == '_' || ch >= 'a' && ch <= 'z') {AddCh(); goto case 10;} else {t.kind = 44; break;} case 11: recEnd = pos; recKind = 45; if (ch >= '-' && ch <= '.' || ch >= '0' && ch <= ':' || ch >= 'A' && ch <= 'Z' || ch == '_' || ch >= 'a' && ch <= 'z') {AddCh(); goto case 11;} else {t.kind = 45; break;} case 12: if (ch <= 9 || ch >= 11 && ch <= 12 || ch >= 14 && ch <= '!' || ch >= '#' && ch <= '[' || ch >= ']' && ch <= 65535) {AddCh(); goto case 12;} else if (ch == 10 || ch == 13) {AddCh(); goto case 4;} else if (ch == '"') {AddCh(); goto case 3;} else if (ch == 92) {AddCh(); goto case 14;} else {goto case 0;} case 13: recEnd = pos; recKind = 44; if (ch >= '0' && ch <= '9') {AddCh(); goto case 10;} else if (ch >= 'A' && ch <= 'Z' || ch == '_' || ch >= 'a' && ch <= 'z') {AddCh(); goto case 15;} else {t.kind = 44; break;} case 14: if (ch >= ' ' && ch <= '~') {AddCh(); goto case 12;} else {goto case 0;} case 15: recEnd = pos; recKind = 44; if (ch >= '0' && ch <= '9') {AddCh(); goto case 10;} else if (ch >= 'A' && ch <= 'Z' || ch == '_' || ch >= 'a' && ch <= 'z') {AddCh(); goto case 15;} else if (ch == '=') {AddCh(); goto case 11;} else {t.kind = 44; break;} case 16: if (ch == 'o') {AddCh(); goto case 17;} else {goto case 0;} case 17: if (ch == 'p') {AddCh(); goto case 18;} else {goto case 0;} case 18: if (ch == 'y') {AddCh(); goto case 19;} else {goto case 0;} case 19: if (ch == ']') {AddCh(); goto case 20;} else {goto case 0;} case 20: {t.kind = 6; break;} case 21: if (ch == 'c') {AddCh(); goto case 22;} else {goto case 0;} case 22: if (ch == 'o') {AddCh(); goto case 23;} else {goto case 0;} case 23: if (ch == 'p') {AddCh(); goto case 24;} else {goto case 0;} case 24: if (ch == 'y') {AddCh(); goto case 25;} else {goto case 0;} case 25: if (ch == ']') {AddCh(); goto case 26;} else {goto case 0;} case 26: {t.kind = 7; break;} case 27: {t.kind = 19; break;} case 28: {t.kind = 22; break;} case 29: {t.kind = 23; break;} case 30: {t.kind = 24; break;} case 31: {t.kind = 27; break;} case 32: {t.kind = 28; break;} case 33: {t.kind = 29; break;} case 34: {t.kind = 30; break;} case 35: {t.kind = 33; break;} case 36: {t.kind = 35; break;} case 37: {t.kind = 36; break;} case 38: {t.kind = 37; break;} case 39: {t.kind = 41; break;} case 40: {t.kind = 42; break;} case 41: recEnd = pos; recKind = 34; if (ch == 'c') {AddCh(); goto case 16;} else if (ch == '/') {AddCh(); goto case 21;} else {t.kind = 34; break;} case 42: recEnd = pos; recKind = 20; if (ch == '.') {AddCh(); goto case 30;} else if (ch == '>') {AddCh(); goto case 33;} else if (ch == ')') {AddCh(); goto case 40;} else {t.kind = 20; break;} case 43: recEnd = pos; recKind = 26; if (ch == '.') {AddCh(); goto case 32;} else {t.kind = 26; break;} case 44: recEnd = pos; recKind = 32; if (ch == '.') {AddCh(); goto case 39;} else {t.kind = 32; break;} } t.val = new String(tval, 0, tlen); return t; }
void Init() { pos = -1; line = 1; col = 0; 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; NextCh(); } pt = tokens = new Token(); // first token is a dummy }
// 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; } }
// make sure that peeking starts at the current scan position public void ResetPeek() { pt = tokens; }
public static void Parse() { Errors.SynErr = new ErrorCodeProc(SynErr); la = new Token(); la.val = ""; Get(); Coco(); }
public void Parse() { la = new Token(); la.val = ""; Get(); Coco(); Expect(0); // expect end-of-file automatically added }
void Get () { for (;;) { t = la; la = scanner.Scan(); if (la.kind <= maxT) { ++errDist; break; } #line default //END FRAME -->pragmas if (la.kind == 45) { #line 79 "Coco.atg" //SOURCE beg=2789,len=20,col=45 tab.SetDDT(la.val); #line default //END SOURCE } #line 67 "F:\DotNetProjects\Prexonite\PxCoco\Parser.frame" //FRAME la = t; } }
/* AW 2003-03-07 get the next token, move on and synch peek token with current */ public static Token Scan () { t = pt = t.next; return t; }
/* AW Scan() renamed to NextToken() */ static Token NextToken() { while (ignore[ch]) NextCh(); if (ch == '/' && Comment0()) return NextToken(); t = new Token(); t.pos = pos; t.col = pos - lineStart + 1; t.line = line; int state = start[ch]; StringBuilder buf = new StringBuilder(16); buf.Append(ch); NextCh(); switch (state) { case 0: { t.kind = noSym; goto done; } // NextCh already done case 1: if ((ch >= '0' && ch <= '9' || ch >= 'A' && ch <= 'Z' || ch >= 'a' && ch <= 'z')) {buf.Append(ch); NextCh(); goto case 1;} else {t.kind = 1; t.val = buf.ToString(); CheckLiteral(); return t;} case 2: if ((ch >= '0' && ch <= '9')) {buf.Append(ch); NextCh(); goto case 2;} else {t.kind = 2; goto done;} case 3: {t.kind = 3; goto done;} case 4: {t.kind = 4; goto done;} case 5: if ((ch >= 1 && ch <= 9 || ch >= 11 && ch <= 12 || ch >= 14 && ch <= '&' || ch >= '(' && ch <= '[' || ch >= ']')) {buf.Append(ch); NextCh(); goto case 6;} else if (ch == 92) {buf.Append(ch); NextCh(); goto case 7;} else {t.kind = noSym; goto done;} case 6: if (ch == 39) {buf.Append(ch); NextCh(); goto case 9;} else {t.kind = noSym; goto done;} case 7: if ((ch >= ' ' && ch <= '~')) {buf.Append(ch); NextCh(); goto case 8;} else {t.kind = noSym; goto done;} case 8: if ((ch >= '0' && ch <= '9' || ch >= 'a' && ch <= 'f')) {buf.Append(ch); NextCh(); goto case 8;} else if (ch == 39) {buf.Append(ch); NextCh(); goto case 9;} else {t.kind = noSym; goto done;} case 9: {t.kind = 5; goto done;} case 10: if ((ch >= '0' && ch <= '9' || ch >= 'A' && ch <= 'Z' || ch >= 'a' && ch <= 'z')) {buf.Append(ch); NextCh(); goto case 10;} else {t.kind = 43; goto done;} case 11: if ((ch >= 1 && ch <= 9 || ch >= 11 && ch <= 12 || ch >= 14 && ch <= '!' || ch >= '#' && ch <= '[' || ch >= ']')) {buf.Append(ch); NextCh(); goto case 11;} else if ((ch == 10 || ch == 13)) {buf.Append(ch); NextCh(); goto case 4;} else if (ch == '"') {buf.Append(ch); NextCh(); goto case 3;} else if (ch == 92) {buf.Append(ch); NextCh(); goto case 12;} else {t.kind = noSym; goto done;} case 12: if ((ch >= ' ' && ch <= '~')) {buf.Append(ch); NextCh(); goto case 11;} else {t.kind = noSym; goto done;} case 13: {t.kind = 8; goto done;} case 14: if (ch == '.') {buf.Append(ch); NextCh(); goto case 17;} else if (ch == ')') {buf.Append(ch); NextCh(); goto case 30;} else {t.kind = 9; goto done;} case 15: {t.kind = 20; goto done;} case 16: {t.kind = 21; goto done;} case 17: {t.kind = 22; goto done;} case 18: {t.kind = 24; goto done;} case 19: {t.kind = 25; goto done;} case 20: {t.kind = 26; goto done;} case 21: if (ch == '.') {buf.Append(ch); NextCh(); goto case 29;} else {t.kind = 28; goto done;} case 22: {t.kind = 29; goto done;} case 23: {t.kind = 30; goto done;} case 24: {t.kind = 31; goto done;} case 25: {t.kind = 32; goto done;} case 26: {t.kind = 33; goto done;} case 27: if (ch == '=') {buf.Append(ch); NextCh(); goto case 28;} else {t.kind = noSym; goto done;} case 28: {t.kind = 36; goto done;} case 29: {t.kind = 38; goto done;} case 30: {t.kind = 39; goto done;} case 31: {t.kind = 41; goto done;} case 32: {t.kind = 0; goto done;} } done: t.val = buf.ToString(); return t; }
public static void Init (String fileName) { Buffer.Fill(fileName); pos = -1; line = 1; lineStart = 0; oldEols = 0; NextCh(); ignore = new BitArray(256); ignore[9] = true; ignore[10] = true; ignore[13] = true; ignore[32] = true; /* AW 2003-03-07 fill token list */ tokens = new Token(); // first token is a dummy Token node = tokens; do { node.next = NextToken(); node = node.next; } while (node.kind != 0); /* AW: 0 => EOF */ t = pt = tokens; }
Token NextToken() { while (ch == ' ' || ch >= 9 && ch <= 10 || ch == 13) NextCh(); if (ch == '/' && Comment0() ||ch == '/' && Comment1()) return NextToken(); t = new Token(); t.pos = pos; t.col = col; t.line = line; int state; try { state = start[ch]; } catch (KeyNotFoundException) { state = 0; } tlen = 0; AddCh(); switch (state) { case -1: { t.kind = eofSym; break; } // NextCh already done case 0: { t.kind = noSym; break; } // NextCh already done case 1: if (ch >= '0' && ch <= '9' || ch >= 'A' && ch <= 'Z' || 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 2;} else {t.kind = 2; break;} case 3: {t.kind = 3; break;} case 4: {t.kind = 4; break;} case 5: if (ch <= 9 || ch >= 11 && ch <= 12 || ch >= 14 && ch <= '&' || ch >= '(' && ch <= '[' || ch >= ']' && ch <= 65535) {AddCh(); goto case 6;} else if (ch == 92) {AddCh(); goto case 7;} else {t.kind = noSym; break;} case 6: if (ch == 39) {AddCh(); goto case 9;} else {t.kind = noSym; break;} case 7: if (ch >= ' ' && ch <= '~') {AddCh(); goto case 8;} else {t.kind = noSym; break;} case 8: if (ch >= '0' && ch <= '9' || ch >= 'a' && ch <= 'f') {AddCh(); goto case 8;} else if (ch == 39) {AddCh(); goto case 9;} else {t.kind = noSym; break;} case 9: {t.kind = 5; break;} case 10: if (ch == 'f') {AddCh(); goto case 11;} else {t.kind = noSym; break;} case 11: if (ch == 'i') {AddCh(); goto case 12;} else {t.kind = noSym; break;} case 12: if (ch == 'l') {AddCh(); goto case 13;} else {t.kind = noSym; break;} case 13: if (ch == 'e') {AddCh(); goto case 14;} else {t.kind = noSym; break;} case 14: if (ch == ':') {AddCh(); goto case 15;} else {t.kind = noSym; break;} case 15: if (ch <= 9 || ch >= 11 && ch <= 12 || ch >= 14 && ch <= '"' || ch >= '$' && ch <= 65535) {AddCh(); goto case 15;} else if (ch == '#') {AddCh(); goto case 16;} else {t.kind = noSym; break;} case 16: {t.kind = 6; break;} case 17: if (ch >= '0' && ch <= '9' || ch >= 'A' && ch <= 'Z' || ch >= 'a' && ch <= 'z') {AddCh(); goto case 17;} else {t.kind = 45; break;} case 18: if (ch <= 9 || ch >= 11 && ch <= 12 || ch >= 14 && ch <= '!' || ch >= '#' && ch <= '[' || ch >= ']' && ch <= 65535) {AddCh(); goto case 18;} else if (ch == 10 || ch == 13) {AddCh(); goto case 4;} else if (ch == '"') {AddCh(); goto case 3;} else if (ch == 92) {AddCh(); goto case 19;} else {t.kind = noSym; break;} case 19: if (ch >= ' ' && ch <= '~') {AddCh(); goto case 18;} else {t.kind = noSym; break;} case 20: {t.kind = 18; break;} case 21: {t.kind = 21; break;} case 22: {t.kind = 22; break;} case 23: {t.kind = 23; break;} case 24: {t.kind = 26; break;} case 25: {t.kind = 27; break;} case 26: {t.kind = 28; break;} case 27: {t.kind = 29; break;} case 28: {t.kind = 32; break;} case 29: {t.kind = 33; break;} case 30: {t.kind = 34; break;} case 31: {t.kind = 35; break;} case 32: {t.kind = 36; break;} case 33: {t.kind = 40; break;} case 34: {t.kind = 41; break;} case 35: {t.kind = 43; break;} case 36: if (ch == '.') {AddCh(); goto case 23;} else if (ch == '>') {AddCh(); goto case 26;} else if (ch == ')') {AddCh(); goto case 34;} else {t.kind = 19; break;} case 37: if (ch == '.') {AddCh(); goto case 25;} else {t.kind = 25; break;} case 38: if (ch == '.') {AddCh(); goto case 33;} else {t.kind = 31; break;} } t.val = new String(tval, 0, tlen); return t; }
void Init() { pos = -1; line = 1; col = 0; 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; NextCh(); } start = new Dictionary<int, int>(128); for (int i = 65; i <= 90; ++i) start[i] = 1; for (int i = 97; i <= 122; ++i) start[i] = 1; for (int i = 48; i <= 57; ++i) start[i] = 2; start[34] = 18; start[39] = 5; start[35] = 10; start[36] = 17; start[61] = 20; start[46] = 36; start[43] = 21; start[45] = 22; start[60] = 37; start[62] = 24; start[124] = 27; start[40] = 38; start[41] = 28; start[91] = 29; start[93] = 30; start[123] = 31; start[125] = 32; start[59] = 35; start[Buffer.EOF] = -1; pt = tokens = new Token(); // first token is a dummy }
Token NextToken() { while (ch == ' ' || ch >= 9 && ch <= 10 || ch == 13 ) NextCh(); if (ch == '/' && Comment0() ||ch == '/' && Comment1()) return NextToken(); int recKind = noSym; int recEnd = pos; t = new Token(); t.pos = pos; t.col = col; t.line = line; int state; if (!start.TryGetValue(ch, out state)) 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') {AddCh(); goto case 1;} else {t.kind = 1; t.val = new String(tval, 0, tlen); CheckLiteral(); return t;} case 2: recEnd = pos; recKind = 2; if (ch >= '0' && ch <= '9') {AddCh(); goto case 2;} else {t.kind = 2; break;} case 3: {t.kind = 3; break;} case 4: {t.kind = 4; break;} case 5: if (ch <= 9 || ch >= 11 && ch <= 12 || ch >= 14 && ch <= '&' || ch >= '(' && ch <= '[' || ch >= ']' && ch <= 65535) {AddCh(); goto case 6;} else if (ch == 92) {AddCh(); goto case 7;} else {goto case 0;} case 6: if (ch == 39) {AddCh(); goto case 9;} else {goto case 0;} case 7: if (ch >= ' ' && ch <= '~') {AddCh(); goto case 8;} else {goto case 0;} case 8: if (ch >= '0' && ch <= '9' || ch >= 'a' && ch <= 'f') {AddCh(); goto case 8;} else if (ch == 39) {AddCh(); goto case 9;} else {goto case 0;} case 9: {t.kind = 5; break;} case 10: recEnd = pos; recKind = 51; if (ch >= '0' && ch <= '9' || ch >= 'A' && ch <= 'Z' || ch == '_' || ch >= 'a' && ch <= 'z') {AddCh(); goto case 10;} else {t.kind = 51; break;} case 11: recEnd = pos; recKind = 52; if (ch >= '-' && ch <= ':' || ch >= 'A' && ch <= 'Z' || ch == 92 || ch == '_' || ch >= 'a' && ch <= 'z') {AddCh(); goto case 11;} else {t.kind = 52; break;} case 12: if (ch == 'e') {AddCh(); goto case 13;} else {goto case 0;} case 13: if (ch == 'g') {AddCh(); goto case 14;} else {goto case 0;} case 14: if (ch == 'i') {AddCh(); goto case 15;} else {goto case 0;} case 15: if (ch == 'o') {AddCh(); goto case 16;} else {goto case 0;} case 16: if (ch == 'n') {AddCh(); goto case 17;} else {goto case 0;} case 17: recEnd = pos; recKind = 53; if (ch >= ' ' && ch <= '~') {AddCh(); goto case 17;} else {t.kind = 53; break;} case 18: if (ch == 'n') {AddCh(); goto case 19;} else {goto case 0;} case 19: if (ch == 'd') {AddCh(); goto case 20;} else {goto case 0;} case 20: if (ch == 'r') {AddCh(); goto case 21;} else {goto case 0;} case 21: if (ch == 'e') {AddCh(); goto case 22;} else {goto case 0;} case 22: if (ch == 'g') {AddCh(); goto case 23;} else {goto case 0;} case 23: if (ch == 'i') {AddCh(); goto case 24;} else {goto case 0;} case 24: if (ch == 'o') {AddCh(); goto case 25;} else {goto case 0;} case 25: if (ch == 'n') {AddCh(); goto case 26;} else {goto case 0;} case 26: {t.kind = 54; break;} case 27: if (ch <= 9 || ch >= 11 && ch <= 12 || ch >= 14 && ch <= '!' || ch >= '#' && ch <= '[' || ch >= ']' && ch <= 65535) {AddCh(); goto case 27;} else if (ch == 10 || ch == 13) {AddCh(); goto case 4;} else if (ch == '"') {AddCh(); goto case 3;} else if (ch == 92) {AddCh(); goto case 30;} else {goto case 0;} case 28: recEnd = pos; recKind = 51; if (ch >= '0' && ch <= '9') {AddCh(); goto case 10;} else if (ch >= 'A' && ch <= 'Z' || ch == '_' || ch >= 'a' && ch <= 'z') {AddCh(); goto case 31;} else {t.kind = 51; break;} case 29: if (ch == 'r') {AddCh(); goto case 12;} else if (ch == 'e') {AddCh(); goto case 18;} else {goto case 0;} case 30: if (ch >= ' ' && ch <= '~') {AddCh(); goto case 27;} else {goto case 0;} case 31: recEnd = pos; recKind = 51; if (ch >= '0' && ch <= '9') {AddCh(); goto case 10;} else if (ch >= 'A' && ch <= 'Z' || ch == '_' || ch >= 'a' && ch <= 'z') {AddCh(); goto case 31;} else if (ch == '=') {AddCh(); goto case 11;} else {t.kind = 51; break;} case 32: if (ch == 'o') {AddCh(); goto case 33;} else {goto case 0;} case 33: if (ch == 'p') {AddCh(); goto case 34;} else {goto case 0;} case 34: if (ch == 'y') {AddCh(); goto case 35;} else {goto case 0;} case 35: if (ch == ']') {AddCh(); goto case 36;} else {goto case 0;} case 36: {t.kind = 6; break;} case 37: if (ch == 'c') {AddCh(); goto case 38;} else {goto case 0;} case 38: if (ch == 'o') {AddCh(); goto case 39;} else {goto case 0;} case 39: if (ch == 'p') {AddCh(); goto case 40;} else {goto case 0;} case 40: if (ch == 'y') {AddCh(); goto case 41;} else {goto case 0;} case 41: if (ch == ']') {AddCh(); goto case 42;} else {goto case 0;} case 42: {t.kind = 7; break;} case 43: {t.kind = 22; break;} case 44: {t.kind = 25; break;} case 45: {t.kind = 26; break;} case 46: {t.kind = 27; break;} case 47: if (ch == 'u') {AddCh(); goto case 48;} else {goto case 0;} case 48: if (ch == 't') {AddCh(); goto case 49;} else {goto case 0;} case 49: if (ch == 'o') {AddCh(); goto case 50;} else {goto case 0;} case 50: if (ch == '>') {AddCh(); goto case 51;} else {goto case 0;} case 51: {t.kind = 29; break;} case 52: {t.kind = 31; break;} case 53: {t.kind = 32; break;} case 54: {t.kind = 33; break;} case 55: {t.kind = 34; break;} case 56: {t.kind = 38; break;} case 57: {t.kind = 40; break;} case 58: {t.kind = 41; break;} case 59: {t.kind = 42; break;} case 60: {t.kind = 46; break;} case 61: {t.kind = 48; break;} case 62: {t.kind = 49; break;} case 63: recEnd = pos; recKind = 39; if (ch == 'c') {AddCh(); goto case 32;} else if (ch == '/') {AddCh(); goto case 37;} else {t.kind = 39; break;} case 64: recEnd = pos; recKind = 23; if (ch == '.') {AddCh(); goto case 46;} else if (ch == '>') {AddCh(); goto case 54;} else if (ch == ')') {AddCh(); goto case 62;} else {t.kind = 23; break;} case 65: recEnd = pos; recKind = 30; if (ch == 'a') {AddCh(); goto case 47;} else if (ch == '.') {AddCh(); goto case 53;} else {t.kind = 30; break;} case 66: recEnd = pos; recKind = 37; if (ch == '.') {AddCh(); goto case 61;} else {t.kind = 37; break;} } t.val = new String(tval, 0, tlen); return t; }
public void Parse() { la = new Token(); la.val = ""; Get(); Coco(); Expect(0); }
void Get () { for (;;) { t = la; la = scanner.Scan(); if (la.kind <= maxT) { ++errDist; break; } if (la.kind == 42) { tab.SetDDT(la.val); } la = t; } }
/* AW 2003-03-07 get the next token, ignore pragmas */ public static Token Peek () { do { // skip pragmas while peeking pt = pt.next; } while (pt != null && pt.kind > maxT); return pt; }
public void Parse() { la = new Token(); la.val = ""; Get(); #line default //END FRAME -->parseRoot Coco(); #line 108 "F:\DotNetProjects\Prexonite\PxCoco\Parser.frame" //FRAME Expect(0); }
/* AW 2003-03-11 to make sure peek start at current scan position */ public static void StartPeek () { pt = t; }
void Get() { for (;;) { t = la; la = scanner.Scan(); if (la.kind <= maxT) { ++errDist; break; } if (la.kind == 51) { tab.SetDDT(la.val); } if (la.kind == 52) { tab.DispatchDirective(la.val); } if (la.kind == 53) { } if (la.kind == 54) { } la = t; } }
// 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; }