ScummVM API documentation
as_compiler.h
1 /*
2  AngelCode Scripting Library
3  Copyright (c) 2003-2020 Andreas Jonsson
4 
5  This software is provided 'as-is', without any express or implied
6  warranty. In no event will the authors be held liable for any
7  damages arising from the use of this software.
8 
9  Permission is granted to anyone to use this software for any
10  purpose, including commercial applications, and to alter it and
11  redistribute it freely, subject to the following restrictions:
12 
13  1. The origin of this software must not be misrepresented; you
14  must not claim that you wrote the original software. If you use
15  this software in a product, an acknowledgment in the product
16  documentation would be appreciated but is not required.
17 
18  2. Altered source versions must be plainly marked as such, and
19  must not be misrepresented as being the original software.
20 
21  3. This notice may not be removed or altered from any source
22  distribution.
23 
24  The original version of this library can be located at:
25  http://www.angelcode.com/angelscript/
26 
27  Andreas Jonsson
28  andreas@angelcode.com
29 */
30 
31 
32 //
33 // as_compiler.h
34 //
35 // The class that does the actual compilation of the functions
36 //
37 
38 
39 
40 #ifndef AS_COMPILER_H
41 #define AS_COMPILER_H
42 
43 #include "as_config.h"
44 
45 #ifndef AS_NO_COMPILER
46 
47 #include "as_builder.h"
48 #include "as_scriptfunction.h"
49 #include "as_variablescope.h"
50 #include "as_bytecode.h"
51 #include "as_memory.h"
52 #include "as_datatype.h"
53 
54 BEGIN_AS_NAMESPACE
55 
56 // This class represents the value of an expression as evaluated by the compiler.
57 // It holds information such as the type of the value, stack offset for a local
58 // variable, value of constants, whether the value can be modified (i.e. lvalue), etc.
59 struct asCExprValue {
60  asCExprValue();
61  void Set(const asCDataType &dataType);
62 
63  void SetVariable(const asCDataType &dataType, int stackOffset, bool isTemporary);
64  void SetConstantB(const asCDataType &dataType, asBYTE value);
65  void SetConstantQW(const asCDataType &dataType, asQWORD value);
66  void SetConstantDW(const asCDataType &dataType, asDWORD value);
67  void SetConstantW(const asCDataType &dataType, asWORD value);
68  void SetConstantF(const asCDataType &dataType, float value);
69  void SetConstantD(const asCDataType &dataType, double value);
70  void SetConstantB(asBYTE value);
71  void SetConstantW(asWORD value);
72  void SetConstantQW(asQWORD value);
73  void SetConstantDW(asDWORD value);
74  void SetConstantF(float value);
75  void SetConstantD(double value);
76  asBYTE GetConstantB();
77  asWORD GetConstantW();
78  asQWORD GetConstantQW();
79  asDWORD GetConstantDW();
80  float GetConstantF();
81  double GetConstantD();
82 
83  void SetConstantData(const asCDataType &dataType, asQWORD value);
84  asQWORD GetConstantData();
85 
86  void SetNullConstant();
87  void SetUndefinedFuncHandle(asCScriptEngine *engine);
88  void SetVoid();
89  void SetDummy();
90 
91  bool IsUndefinedFuncHandle() const;
92  bool IsNullConstant() const;
93  bool IsVoid() const;
94 
95  asCDataType dataType;
96  bool isLValue : 1; // Can this value be updated in assignment, or increment operators, etc
97  bool isTemporary : 1;
98  bool isConstant : 1;
99  bool isVariable : 1;
100  bool isExplicitHandle : 1;
101  bool isRefToLocal : 1; // The reference may be to a local variable
102  bool isRefSafe : 1; // the life-time of the ref is guaranteed for the duration of the access
103  short dummy : 9;
104  short stackOffset;
105 
106 private:
107  // These values must not be accessed directly in order to avoid problems with endianess.
108  // Use the appropriate accessor methods instead
109  union {
110  asQWORD qwordValue;
111  double doubleValue;
112  asDWORD dwordValue;
113  float floatValue;
114  asWORD wordValue;
115  asBYTE byteValue;
116  };
117 };
118 
119 struct asCExprContext;
120 
121 // This class holds information for arguments that needs to be
122 // cleaned up after the result of a function has been evaluated.
124  asSDeferredParam() {
125  argNode = 0;
126  origExpr = 0;
127  }
128 
129  asCScriptNode *argNode;
130  asCExprValue argType;
131  int argInOutFlags;
132  asCExprContext *origExpr;
133 };
134 
135 // TODO: refactor: asCExprContext should have indicators to inform where the value is,
136 // i.e. if the reference to an object is pushed on the stack or not, etc
137 
138 // This class holds information about an expression that is being evaluated, e.g.
139 // the current bytecode, ambiguous symbol names, property accessors, etc.
142  ~asCExprContext();
143  void Clear();
144  bool IsClassMethod() const;
145  bool IsGlobalFunc() const;
146  void SetLambda(asCScriptNode *funcDecl);
147  bool IsLambda() const;
148  void SetVoidExpression();
149  bool IsVoidExpression() const;
150  void Merge(asCExprContext *after);
151  void Copy(asCExprContext *other);
152  void SetAnonymousInitList(asCScriptNode *initList, asCScriptCode *script);
153  bool IsAnonymousInitList() const;
154 
155  asCByteCode bc;
156  asCExprValue type;
157  int property_get;
158  int property_set;
159  bool property_const; // If the object that is being accessed through property accessor is read-only
160  bool property_handle; // If the property accessor is called on an object stored in a handle
161  bool property_ref; // If the property accessor is called on a reference
162  bool isVoidExpression; // Set to true if the expression is an explicit 'void', e.g. used to ignore out parameters in func calls
163  bool isCleanArg; // Set to true if the expression has only been initialized with default constructor
164  asCExprContext *property_arg;
165  asCArray<asSDeferredParam> deferredParams;
166  asCScriptNode *exprNode;
167  asCExprContext *origExpr;
168  asCScriptCode *origCode;
169  // TODO: cleanup: use ambiguousName and an enum to say if it is a method, global func, or enum value
170  asCString methodName;
171  asCString enumValue;
172  asSNameSpace *symbolNamespace; // The namespace in which the ambiguous symbol was found
173  bool isAnonymousInitList; // Set to true if the expression is an init list for which the type has not yet been determined
174 };
175 
177  asSOverloadCandidate() : funcId(0), cost(0) {}
178  asSOverloadCandidate(int _id, asUINT _cost) : funcId(_id), cost(_cost) {}
179  int funcId;
180  asUINT cost;
181 };
182 
184  asCString name;
185  asCExprContext *ctx;
186  asUINT match;
187 };
188 
189 enum EImplicitConv {
190  asIC_IMPLICIT_CONV,
191  asIC_EXPLICIT_REF_CAST,
192  asIC_EXPLICIT_VAL_CAST
193 };
194 
195 enum EConvCost {
196  asCC_NO_CONV = 0,
197  asCC_CONST_CONV = 1,
198  asCC_ENUM_SAME_SIZE_CONV = 2,
199  asCC_ENUM_DIFF_SIZE_CONV = 3,
200  asCC_PRIMITIVE_SIZE_CONV = 4,
201  asCC_SIGNED_CONV = 5,
202  asCC_INT_FLOAT_CONV = 6,
203  asCC_REF_CONV = 7,
204  asCC_OBJ_TO_PRIMITIVE_CONV = 8,
205  asCC_TO_OBJECT_CONV = 9,
206  asCC_VARIABLE_CONV = 10
207 };
208 
209 class asCCompiler {
210 public:
211  asCCompiler(asCScriptEngine *engine);
212  ~asCCompiler();
213 
214  int CompileFunction(asCBuilder *builder, asCScriptCode *script, asCArray<asCString> &parameterNames, asCScriptNode *func, asCScriptFunction *outFunc, sClassDeclaration *classDecl);
215  int CompileDefaultConstructor(asCBuilder *builder, asCScriptCode *script, asCScriptNode *node, asCScriptFunction *outFunc, sClassDeclaration *classDecl);
216  int CompileFactory(asCBuilder *builder, asCScriptCode *script, asCScriptFunction *outFunc);
217  int CompileGlobalVariable(asCBuilder *builder, asCScriptCode *script, asCScriptNode *expr, sGlobalVariableDescription *gvar, asCScriptFunction *outFunc);
218 
219 protected:
220  friend class asCBuilder;
221 
222  void Reset(asCBuilder *builder, asCScriptCode *script, asCScriptFunction *outFunc);
223 
224  // Statements
225  void CompileStatementBlock(asCScriptNode *block, bool ownVariableScope, bool *hasReturn, asCByteCode *bc);
226  void CompileDeclaration(asCScriptNode *decl, asCByteCode *bc);
227  void CompileStatement(asCScriptNode *statement, bool *hasReturn, asCByteCode *bc);
228  void CompileIfStatement(asCScriptNode *node, bool *hasReturn, asCByteCode *bc);
229  void CompileSwitchStatement(asCScriptNode *node, bool *hasReturn, asCByteCode *bc);
230  void CompileCase(asCScriptNode *node, asCByteCode *bc);
231  void CompileForStatement(asCScriptNode *node, asCByteCode *bc);
232  void CompileWhileStatement(asCScriptNode *node, asCByteCode *bc);
233  void CompileDoWhileStatement(asCScriptNode *node, asCByteCode *bc);
234  void CompileBreakStatement(asCScriptNode *node, asCByteCode *bc);
235  void CompileContinueStatement(asCScriptNode *node, asCByteCode *bc);
236  void CompileReturnStatement(asCScriptNode *node, asCByteCode *bc);
237  void CompileExpressionStatement(asCScriptNode *node, asCByteCode *bc);
238  void CompileTryCatch(asCScriptNode *node, bool *hasReturn, asCByteCode *bc);
239 
240  // Expressions
241  int CompileAssignment(asCScriptNode *expr, asCExprContext *out);
242  int CompileCondition(asCScriptNode *expr, asCExprContext *out);
243  int CompileExpression(asCScriptNode *expr, asCExprContext *out);
244  int CompilePostFixExpression(asCArray<asCScriptNode *> *postfix, asCExprContext *out);
245  int CompileExpressionTerm(asCScriptNode *node, asCExprContext *out);
246  int CompileExpressionPreOp(asCScriptNode *node, asCExprContext *out);
247  int CompileExpressionPostOp(asCScriptNode *node, asCExprContext *out);
248  int CompileExpressionValue(asCScriptNode *node, asCExprContext *out);
249  int CompileFunctionCall(asCScriptNode *node, asCExprContext *out, asCObjectType *objectType, bool objIsConst, const asCString &scope = "");
250  int CompileConstructCall(asCScriptNode *node, asCExprContext *out);
251  int CompileConversion(asCScriptNode *node, asCExprContext *out);
252  int CompileOperator(asCScriptNode *node, asCExprContext *l, asCExprContext *r, asCExprContext *out, eTokenType opToken = ttUnrecognizedToken, bool leftToRight = true);
253  void CompileOperatorOnHandles(asCScriptNode *node, asCExprContext *l, asCExprContext *r, asCExprContext *out, eTokenType opToken = ttUnrecognizedToken);
254  void CompileMathOperator(asCScriptNode *node, asCExprContext *l, asCExprContext *r, asCExprContext *out, eTokenType opToken = ttUnrecognizedToken);
255  void CompileBitwiseOperator(asCScriptNode *node, asCExprContext *l, asCExprContext *r, asCExprContext *out, eTokenType opToken = ttUnrecognizedToken);
256  void CompileComparisonOperator(asCScriptNode *node, asCExprContext *l, asCExprContext *r, asCExprContext *out, eTokenType opToken = ttUnrecognizedToken);
257  void CompileBooleanOperator(asCScriptNode *node, asCExprContext *l, asCExprContext *r, asCExprContext *out, eTokenType opToken = ttUnrecognizedToken);
258  bool CompileOverloadedDualOperator(asCScriptNode *node, asCExprContext *l, asCExprContext *r, bool leftToRight, asCExprContext *out, bool isHandle = false, eTokenType opToken = ttUnrecognizedToken);
259  int CompileOverloadedDualOperator2(asCScriptNode *node, const char *methodName, asCExprContext *l, asCExprContext *r, bool leftToRight, asCExprContext *out, bool specificReturn = false, const asCDataType &returnType = asCDataType::CreatePrimitive(ttVoid, false));
260 
261  void CompileInitList(asCExprValue *var, asCScriptNode *node, asCByteCode *bc, int isVarGlobOrMem);
262  int CompileInitListElement(asSListPatternNode *&patternNode, asCScriptNode *&valueNode, int bufferTypeId, short bufferVar, asUINT &bufferSize, asCByteCode &byteCode, int &elementsInSubList);
263  int CompileAnonymousInitList(asCScriptNode *listNode, asCExprContext *ctx, const asCDataType &dt);
264 
265  int CallDefaultConstructor(const asCDataType &type, int offset, bool isObjectOnHeap, asCByteCode *bc, asCScriptNode *node, int isVarGlobOrMem = 0, bool derefDest = false);
266  int CallCopyConstructor(asCDataType &type, int offset, bool isObjectOnHeap, asCByteCode *bc, asCExprContext *arg, asCScriptNode *node, bool isGlobalVar = false, bool derefDestination = false);
267  void CallDestructor(asCDataType &type, int offset, bool isObjectOnHeap, asCByteCode *bc);
268  int CompileArgumentList(asCScriptNode *node, asCArray<asCExprContext *> &args, asCArray<asSNamedArgument> &namedArgs);
269  int CompileDefaultAndNamedArgs(asCScriptNode *node, asCArray<asCExprContext *> &args, int funcId, asCObjectType *type, asCArray<asSNamedArgument> *namedArgs = 0);
270  asUINT MatchFunctions(asCArray<int> &funcs, asCArray<asCExprContext *> &args, asCScriptNode *node, const char *name, asCArray<asSNamedArgument> *namedArgs = NULL, asCObjectType *objectType = NULL, bool isConstMethod = false, bool silent = false, bool allowObjectConstruct = true, const asCString &scope = "");
271  int CompileVariableAccess(const asCString &name, const asCString &scope, asCExprContext *ctx, asCScriptNode *errNode, bool isOptional = false, asCObjectType *objType = 0);
272  void CompileMemberInitialization(asCByteCode *bc, bool onlyDefaults);
273  bool CompileAutoType(asCDataType &autoType, asCExprContext &compiledCtx, asCScriptNode *exprNode, asCScriptNode *errNode);
274  bool CompileInitialization(asCScriptNode *node, asCByteCode *bc, const asCDataType &type, asCScriptNode *errNode, int offset, asQWORD *constantValue, int isVarGlobOrMem, asCExprContext *preCompiled = 0);
275  void CompileInitAsCopy(asCDataType &type, int offset, asCByteCode *bc, asCExprContext *arg, asCScriptNode *node, bool derefDestination);
276 
277  // Helper functions
278  void ConvertToPostFix(asCScriptNode *expr, asCArray<asCScriptNode *> &postfix);
279  int ProcessPropertyGetAccessor(asCExprContext *ctx, asCScriptNode *node);
280  int ProcessPropertySetAccessor(asCExprContext *ctx, asCExprContext *arg, asCScriptNode *node);
281  int ProcessPropertyGetSetAccessor(asCExprContext *ctx, asCExprContext *lctx, asCExprContext *rctx, eTokenType op, asCScriptNode *errNode);
282  int FindPropertyAccessor(const asCString &name, asCExprContext *ctx, asCScriptNode *node, asSNameSpace *ns, bool isThisAccess = false);
283  int FindPropertyAccessor(const asCString &name, asCExprContext *ctx, asCExprContext *arg, asCScriptNode *node, asSNameSpace *ns, bool isThisAccess = false);
284  void PrepareTemporaryVariable(asCScriptNode *node, asCExprContext *ctx, bool forceOnHeap = false);
285  void PrepareOperand(asCExprContext *ctx, asCScriptNode *node);
286  void PrepareForAssignment(asCDataType *lvalue, asCExprContext *rvalue, asCScriptNode *node, bool toTemporary, asCExprContext *lvalueExpr = 0);
287  int PerformAssignment(asCExprValue *lvalue, asCExprValue *rvalue, asCByteCode *bc, asCScriptNode *node);
288  bool IsVariableInitialized(asCExprValue *type, asCScriptNode *node);
289  void Dereference(asCExprContext *ctx, bool generateCode);
290  bool CompileRefCast(asCExprContext *ctx, const asCDataType &to, bool isExplicit, asCScriptNode *node, bool generateCode = true);
291  asUINT MatchArgument(asCArray<int> &funcs, asCArray<asSOverloadCandidate> &matches, const asCExprContext *argExpr, int paramNum, bool allowObjectConstruct = true);
292  int MatchArgument(asCScriptFunction *desc, const asCExprContext *argExpr, int paramNum, bool allowObjectConstruct = true);
293  void PerformFunctionCall(int funcId, asCExprContext *out, bool isConstructor = false, asCArray<asCExprContext *> *args = 0, asCObjectType *objTypeForConstruct = 0, bool useVariable = false, int varOffset = 0, int funcPtrVar = 0);
294  void MoveArgsToStack(int funcId, asCByteCode *bc, asCArray<asCExprContext *> &args, bool addOneToOffset);
295  int MakeFunctionCall(asCExprContext *ctx, int funcId, asCObjectType *objectType, asCArray<asCExprContext *> &args, asCScriptNode *node, bool useVariable = false, int stackOffset = 0, int funcPtrVar = 0);
296  int PrepareFunctionCall(int funcId, asCByteCode *bc, asCArray<asCExprContext *> &args);
297  void AfterFunctionCall(int funcId, asCArray<asCExprContext *> &args, asCExprContext *ctx, bool deferAll);
298  void ProcessDeferredParams(asCExprContext *ctx);
299  int PrepareArgument(asCDataType *paramType, asCExprContext *ctx, asCScriptNode *node, bool isFunction = false, int refType = 0, bool isMakingCopy = false);
300  int PrepareArgument2(asCExprContext *ctx, asCExprContext *arg, asCDataType *paramType, bool isFunction = false, int refType = 0, bool isMakingCopy = false);
301  bool IsLValue(asCExprValue &type);
302  int DoAssignment(asCExprContext *out, asCExprContext *lctx, asCExprContext *rctx, asCScriptNode *lexpr, asCScriptNode *rexpr, eTokenType op, asCScriptNode *opNode);
303  void MergeExprBytecode(asCExprContext *before, asCExprContext *after);
304  void MergeExprBytecodeAndType(asCExprContext *before, asCExprContext *after);
305  void FilterConst(asCArray<int> &funcs, bool removeConst = true);
306  void ConvertToVariable(asCExprContext *ctx);
307  void ConvertToVariableNotIn(asCExprContext *ctx, asCExprContext *exclude);
308  void ConvertToTempVariable(asCExprContext *ctx);
309  void ConvertToTempVariableNotIn(asCExprContext *ctx, asCExprContext *exclude);
310  void ConvertToReference(asCExprContext *ctx);
311  void PushVariableOnStack(asCExprContext *ctx, bool asReference);
312  void DestroyVariables(asCByteCode *bc);
313  asSNameSpace *DetermineNameSpace(const asCString &scope);
314  int SetupParametersAndReturnVariable(asCArray<asCString> &parameterNames, asCScriptNode *func);
315 
316  enum SYMBOLTYPE {
317  SL_NOMATCH,
318  SL_LOCALCONST,
319  SL_LOCALVAR,
320  SL_THISPTR,
321  SL_CLASSPROPACCESS,
322  SL_CLASSPROP,
323  SL_CLASSMETHOD,
324  SL_CLASSTYPE,
325  SL_GLOBALPROPACCESS,
326  SL_GLOBALCONST,
327  SL_GLOBALVAR,
328  SL_GLOBALFUNC,
329  SL_GLOBALTYPE,
330  SL_ENUMVAL,
331  SL_ERROR = -1
332  };
333 
334  SYMBOLTYPE SymbolLookup(const asCString &name, const asCString &scope, asCObjectType *objType, asCExprContext *outResult);
335  SYMBOLTYPE SymbolLookupLocalVar(const asCString &name, asCExprContext *outResult);
336  SYMBOLTYPE SymbolLookupMember(const asCString &name, asCObjectType *objType, asCExprContext *outResult);
337 
338  void DetermineSingleFunc(asCExprContext *ctx, asCScriptNode *node);
339 
340  // Returns the cost of the conversion (the sum of the EConvCost performed)
341  asUINT ImplicitConversion(asCExprContext *ctx, const asCDataType &to, asCScriptNode *node, EImplicitConv convType, bool generateCode = true, bool allowObjectConstruct = true);
342  asUINT ImplicitConvPrimitiveToPrimitive(asCExprContext *ctx, const asCDataType &to, asCScriptNode *node, EImplicitConv convType, bool generateCode = true);
343  asUINT ImplicitConvObjectToPrimitive(asCExprContext *ctx, const asCDataType &to, asCScriptNode *node, EImplicitConv convType, bool generateCode = true);
344  asUINT ImplicitConvPrimitiveToObject(asCExprContext *ctx, const asCDataType &to, asCScriptNode *node, EImplicitConv convType, bool generateCode = true, bool allowObjectConstruct = true);
345  asUINT ImplicitConvObjectToObject(asCExprContext *ctx, const asCDataType &to, asCScriptNode *node, EImplicitConv convType, bool generateCode = true, bool allowObjectConstruct = true);
346  asUINT ImplicitConvObjectRef(asCExprContext *ctx, const asCDataType &to, asCScriptNode *node, EImplicitConv convType, bool generateCode);
347  asUINT ImplicitConvObjectValue(asCExprContext *ctx, const asCDataType &to, asCScriptNode *node, EImplicitConv convType, bool generateCode);
348  void ImplicitConversionConstant(asCExprContext *ctx, const asCDataType &to, asCScriptNode *node, EImplicitConv convType);
349  void ImplicitConvObjectToBestMathType(asCExprContext *ctx, asCScriptNode *node);
350  asUINT ImplicitConvLambdaToFunc(asCExprContext *ctx, const asCDataType &to, asCScriptNode *node, EImplicitConv convType, bool generateCode = true);
351 
352  void LineInstr(asCByteCode *bc, size_t pos);
353 
354  asUINT ProcessStringConstant(asCString &str, asCScriptNode *node, bool processEscapeSequences = true);
355  void ProcessHeredocStringConstant(asCString &str, asCScriptNode *node);
356  int GetPrecedence(asCScriptNode *op);
357  void Error(const asCString &msg, asCScriptNode *node);
358  void Warning(const asCString &msg, asCScriptNode *node);
359  void Information(const asCString &msg, asCScriptNode *node);
360  void PrintMatchingFuncs(asCArray<int> &funcs, asCScriptNode *node, asCObjectType *inType = 0);
361  void AddVariableScope(bool isBreakScope = false, bool isContinueScope = false);
362  void RemoveVariableScope();
363  void FinalizeFunction();
364 
365  asCByteCode byteCode;
366 
367  bool hasCompileErrors;
368 
369  int nextLabel;
370  int numLambdas;
371 
372  asCVariableScope *variables;
373  asCBuilder *builder;
374  asCScriptEngine *engine;
375  asCScriptCode *script;
376  asCScriptFunction *outFunc;
377 
378  bool m_isConstructor;
379  bool m_isConstructorCalled;
380  sClassDeclaration *m_classDecl;
381  sGlobalVariableDescription *m_globalVar;
382 
383  asCArray<int> breakLabels;
384  asCArray<int> continueLabels;
385 
386  int AllocateVariable(const asCDataType &type, bool isTemporary, bool forceOnHeap = false, bool asReference = false);
387  int AllocateVariableNotIn(const asCDataType &type, bool isTemporary, bool forceOnHeap, asCExprContext *ctx);
388  int GetVariableOffset(int varIndex);
389  int GetVariableSlot(int varOffset);
390  void DeallocateVariable(int pos);
391  void ReleaseTemporaryVariable(asCExprValue &t, asCByteCode *bc);
392  void ReleaseTemporaryVariable(int offset, asCByteCode *bc);
393  bool IsVariableOnHeap(int offset);
394 
395  // This ordered array indicates the type of each variable
396  asCArray<asCDataType> variableAllocations;
397 
398  // This ordered array indicates which variables are temporaries or not
399  asCArray<bool> variableIsTemporary;
400 
401  // This unordered array gives the offsets of all temporary variables, whether currently allocated or not
402  asCArray<int> tempVariableOffsets;
403 
404  // This ordered array indicated if the variable is on the heap or not
405  asCArray<bool> variableIsOnHeap;
406 
407  // This unordered array gives the indexes of the currently unused variables
408  asCArray<int> freeVariables;
409 
410  // This array holds the offsets of the currently allocated temporary variables
411  asCArray<int> tempVariables;
412 
413  // This array holds the indices of variables that must not be used in an allocation
414  asCArray<int> reservedVariables;
415 
416  // This array holds the string constants that were allocated during the compilation,
417  // so they can be released upon completion, whether the compilation was successful or not.
418  asCArray<void *> usedStringConstants;
419 
420  // This array holds the nodes that have been allocated temporarily
421  asCArray<asCScriptNode *> nodesToFreeUponComplete;
422 
423  bool isCompilingDefaultArg;
424  bool isProcessingDeferredParams;
425  int noCodeOutput;
426 };
427 
428 END_AS_NAMESPACE
429 
430 #endif // AS_NO_COMPILER
431 
432 #endif
Definition: as_compiler.h:59
Definition: as_builder.h:140
Definition: as_compiler.h:176
Definition: as_scriptcode.h:48
Definition: as_bytecode.h:59
Definition: as_scriptfunction.h:146
Definition: as_compiler.h:123
Definition: as_objecttype.h:100
Definition: as_namespace.h:39
Definition: as_compiler.h:140
Definition: as_compiler.h:209
Definition: as_scriptfunction.h:74
Definition: as_builder.h:103
Definition: as_datatype.h:60
Definition: as_variablescope.h:62
Definition: as_builder.h:71
Definition: as_scriptengine.h:64
Definition: as_scriptnode.h:104
Definition: as_string.h:41
Definition: as_compiler.h:183