scriptreader.h

changeset 34
0a9a5902beaa
parent 33
fd35f6cb5f28
child 35
3d3f6ed40171
equal deleted inserted replaced
33:fd35f6cb5f28 34:0a9a5902beaa
60 unsigned int curline[MAX_FILESTACK]; 60 unsigned int curline[MAX_FILESTACK];
61 unsigned int curchar[MAX_FILESTACK]; 61 unsigned int curchar[MAX_FILESTACK];
62 long savedpos[MAX_FILESTACK]; // filepointer cursor position 62 long savedpos[MAX_FILESTACK]; // filepointer cursor position
63 str token; 63 str token;
64 int commentmode; 64 int commentmode;
65 long prevpos;
66 str prevtoken;
65 67
66 // ==================================================================== 68 // ====================================================================
67 // METHODS 69 // METHODS
68 // scriptreader.cxx: 70 // scriptreader.cxx:
69 ScriptReader (str path); 71 ScriptReader (str path);
71 void OpenFile (str path); 73 void OpenFile (str path);
72 void CloseFile (unsigned int u = MAX_FILESTACK); 74 void CloseFile (unsigned int u = MAX_FILESTACK);
73 char ReadChar (); 75 char ReadChar ();
74 char PeekChar (int offset = 0); 76 char PeekChar (int offset = 0);
75 bool Next (bool peek = false); 77 bool Next (bool peek = false);
76 str PeekNext (); 78 void Prev ();
79 str PeekNext (int offset = 0);
77 void Seek (unsigned int n, int origin); 80 void Seek (unsigned int n, int origin);
78 void MustNext (const char* c = ""); 81 void MustNext (const char* c = "");
79 void MustString (); 82 void MustThis (const char* c);
83 void MustString (bool gotquote = false);
80 void MustNumber (); 84 void MustNumber ();
81 void MustBool (); 85 void MustBool ();
82 void MustValue (int type); 86 void MustValue (int type);
83 bool BoolValue (); 87 bool BoolValue ();
84 88
87 91
88 void FinalChecks (); 92 void FinalChecks ();
89 93
90 // parser.cxx: 94 // parser.cxx:
91 void BeginParse (ObjWriter* w); 95 void BeginParse (ObjWriter* w);
92 void ParseCommand (CommandDef* comm, ObjWriter* w); 96 DataBuffer* ParseCommand (CommandDef* comm);
97 DataBuffer* ParseExpression (int reqtype);
98 int ParseOperator ();
99 DataBuffer* ParseExprValue (int reqtype);
93 100
94 // preprocessor.cxx: 101 // preprocessor.cxx:
95 void PreprocessDirectives (); 102 void PreprocessDirectives ();
96 void PreprocessMacros (); 103 void PreprocessMacros ();
97 104
104 char PPReadChar (); 111 char PPReadChar ();
105 void PPMustChar (char c); 112 void PPMustChar (char c);
106 str PPReadWord (char &term); 113 str PPReadWord (char &term);
107 }; 114 };
108 115
116 enum {
117 TYPE_VOID = 0,
118 TYPE_INT,
119 TYPE_STRING,
120 TYPE_FLOAT
121 };
122
123 // Operators
124 enum {
125 OPER_ADD,
126 OPER_SUBTRACT,
127 OPER_MULTIPLY,
128 OPER_DIVIDE,
129 OPER_MODULUS,
130 OPER_ASSIGN,
131 OPER_ASSIGNADD,
132 OPER_ASSIGNSUB,
133 OPER_ASSIGNMUL,
134 OPER_ASSIGNDIV,
135 OPER_ASSIGNMOD
136 };
137
109 #endif // __SCRIPTREADER_H__ 138 #endif // __SCRIPTREADER_H__

mercurial