save input stream with cached results

This commit is contained in:
Sven M. Hallberg 2012-06-02 02:39:00 +02:00
parent 5668b46f97
commit 80ad3476e2
2 changed files with 25 additions and 16 deletions

View file

@ -108,6 +108,12 @@ typedef struct HLeftRec_ {
HRecursionHead *head;
} HLeftRec;
/* Result and remaining input, for rerunning from a cached position. */
typedef struct HCachedResult_ {
HParseResult *result;
HInputStream input_stream;
} HCachedResult;
/* Tagged union for values in the cache: either HLeftRec's (Left) or
* HParseResult's (Right).
*/
@ -115,7 +121,7 @@ typedef struct HParserCacheValue_t {
HParserCacheValueType value_type;
union {
HLeftRec *left;
HParseResult *right;
HCachedResult *right;
};
} HParserCacheValue;