Renaming to avoid name conflicts following the merge of the frontend and backend.
[external/ragel.git] / redfsm / xmlparse.kh
index 431e329..8a5aff5 100644 (file)
 
 #include "vector.h"
 #include "gendata.h"
+#include "buffer.h"
 #include <iostream>
 
+using std::istream;
 using std::ostream;
 
+#define XML_BUFSIZE 4096
+
 struct AttrMarker
 {
        char *id;
@@ -81,11 +85,7 @@ struct XMLTagHashPair
     int id;
 };
 
-struct Token
-{
-       XMLTag *tag;
-       GenInputLoc loc;
-};
+struct Token;
 
 struct GenInlineItem;
 struct GenInlineList;
@@ -93,6 +93,37 @@ struct GenInlineList;
 struct LmSwitchVect;
 struct LmSwitchAction;
 
+struct XmlScanner
+{
+       XmlScanner( const char *fileName, istream &input );
+
+       int scan();
+       void adjustAttrPointers( int distance );
+       std::ostream &error();
+
+       const char *fileName;
+       istream &input;
+
+       /* Scanner State. */
+       int cs, act, have, curline, curcol;
+       char *ts, *te;
+       char *p, *pe;
+       int done;
+
+       /* Token data */
+       char *data;
+       int data_len;
+       int value;
+       AttrMkList attrMkList;
+       Buffer buffer;
+       char *tag_id_start;
+       int tag_id_len;
+       int token_col, token_line;
+
+       char buf[XML_BUFSIZE];
+};
+
+
 struct XmlParser
 {
        %%{