scriptreader.h

changeset 41
47e686c96d8f
parent 40
9e4f785501db
child 43
1b35c9985989
--- a/scriptreader.h	Mon Jul 30 11:34:57 2012 +0300
+++ b/scriptreader.h	Sat Aug 11 19:35:47 2012 +0300
@@ -51,6 +51,17 @@
 
 class ScriptVar;
 
+// ============================================================================
+// Meta-data about blocks
+struct BlockInformation {
+	unsigned int mark1;
+	unsigned int mark2;
+	unsigned int type;
+};
+
+// ============================================================================
+// The script reader reads the script, parses it and tells the object writer
+// the bytecode it needs to write to file.
 class ScriptReader {
 public:
 	// ====================================================================
@@ -62,7 +73,7 @@
 	unsigned int pos[MAX_FILESTACK];
 	unsigned int curline[MAX_FILESTACK];
 	unsigned int curchar[MAX_FILESTACK];
-	unsigned int blockstack[MAX_STRUCTSTACK];
+	BlockInformation blockstack[MAX_STRUCTSTACK];
 	long savedpos[MAX_FILESTACK]; // filepointer cursor position
 	str token;
 	int commentmode;
@@ -99,7 +110,7 @@
 	DataBuffer* ParseAssignment (ScriptVar* var);
 	int ParseOperator (bool peek = false);
 	DataBuffer* ParseExprValue (int reqtype);
-	void AddBlockMark (ObjWriter* w, word dataheader);
+	void PushBlockStack ();
 	
 	// preprocessor.cxx:
 	void PreprocessDirectives ();
@@ -151,4 +162,10 @@
 	MARKTYPE_INTERNAL, // internal structures
 };
 
+// Block types
+enum {
+	BLOCKTYPE_IF,
+	BLOCKTYPE_WHILE
+};
+
 #endif // __SCRIPTREADER_H__
\ No newline at end of file

mercurial