summaryrefslogtreecommitdiff
path: root/test/multiregion1.exp
blob: 35413bc812bc6677e2c4db4e5ba4cfb9a070cce7 (plain)
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
Index: fsmrun.cpp
===================================================================
--- newfilename.cpp (revision 4555)
+++ fsmrun.cpp	(working copy)
@@ -150,7 +150,7 @@
 	peof = 0;
 	if ( parser != 0 ) {
 		region = parser->getNextRegion();
-		cs = getStateFromNextRegion();
+		cs = tables->entryByRegion[region];
 	}
 	else {
 		region = 0;
@@ -189,7 +189,7 @@
 
 	tokstart = 0;
 	region = parser->getNextRegion();
-	cs = getStateFromNextRegion();
+	cs = tables->entryByRegion[region];
 }
 
 void FsmRun::sendToken( int id )
@@ -222,7 +222,7 @@
 		parser = newParser;
 
 		region = parser->getNextRegion();
-		cs = getStateFromNextRegion();
+		cs = tables->entryByRegion[region];
 	}
 	else {
 		#ifdef LOG_ACTIONS
@@ -355,7 +355,7 @@
 
 			/* Set the current state from the next region. */
 			region = parser->getNextRegion();
-			cs = getStateFromNextRegion();
+			cs = tables->entryByRegion[region];
 		}
 	}
 
@@ -452,7 +452,7 @@
 		/* First thing check for error. */
 		if ( cs == tables->errorState ) {
 			if ( parser != 0 ) {
-				if ( getStateFromNextRegion( 1 ) != 0 ) {
+				if ( parser->getNextRegion( 1 ) != 0 ) {
 					#ifdef LOG_BACKTRACK
 					cerr << "scanner failed, trying next region" << endl;
 					#endif
@@ -462,7 +462,7 @@
 
 					parser->nextRegionInd += 1;
 					region = parser->getNextRegion();
-					cs = getStateFromNextRegion();
+					cs = tables->entryByRegion[region];
 					cerr << "new token region: " << 
 							parser->tables->gbl->regionInfo[region].name << endl;
 					continue;
@@ -495,7 +495,7 @@
 					}
 					else {
 						region = parser->getNextRegion();
-						cs = getStateFromNextRegion();
+						cs = tables->entryByRegion[region];
 						cerr << "new token region: " << 
 								parser->tables->gbl->regionInfo[region].name << endl;
 						continue;
Index: junk.cpp
===================================================================
--- 
+++ junk.cpp	(working copy)
Index: fsmrun.h
===================================================================
--- fsmrun.h	(revision 4557)
+++ fsmrun.h	(working copy)
@@ -197,10 +197,6 @@
 	void runOnInputStream( PdaRun *parser, InputStream &in );
 	void execute();
 
-	/* Offset can be used to look at the next nextRegionInd. */
-	int getStateFromNextRegion( int offset = 0 )
-		{ return tables->entryByRegion[parser->getNextRegion(offset)]; }
-
 	FsmTables *tables;
 	PdaRun *parser;
 	InputStream *inputStream;