00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef CMD_H
00021 #define CMD_H
00022
00023 #include "config.h"
00024 #include "vm.h"
00025
00030 class CmdFactory {
00031 public:
00032 typedef Value::VType VType;
00033
00035 CmdFactory(Vm *vm);
00036 ~CmdFactory();
00037
00038 PCmd createAssign(Token, FncDefinition *, VType &dstType);
00039 PCmd createIf(Token, PCmd ifCmd, PCmd elseCmd);
00040 PCmd createWhile(Token, PCmd whileExpr, PCmd whileStat);
00041 PCmd createPush(Token, FncDefinition *, VType &dstType);
00042 PCmd createUnary(Token);
00043 PCmd createBinary(Token, VType t1, VType t2, VType &dstType);
00044 PCmd createCall(Token, unsigned nArgs, bool pushResult);
00045 PCmd createPrint(Token, EToken valType, VType &srcType);
00046 PCmd createInput(Token, Value::VType type, bool pushResult);
00047 private:
00048 struct Private;
00049 Private *d;
00050 };
00051
00052 #endif
00053