| 7866 | |
| 7867 | |
| 7868 | CppiaExpr *createCppiaExpr(CppiaStream &stream) |
| 7869 | { |
| 7870 | int fileId = stream.getFileId(); |
| 7871 | int line = stream.getLineId(); |
| 7872 | std::string tok = stream.getToken(); |
| 7873 | //DBGLOG(" expr %s\n", tok.c_str() ); |
| 7874 | |
| 7875 | CppiaExpr *result = 0; |
| 7876 | if (tok=="FUN") |
| 7877 | result = new ScriptCallable(stream); |
| 7878 | else if (tok=="BLOCK") |
| 7879 | result = new BlockExpr(stream); |
| 7880 | else if (tok=="IFELSE") |
| 7881 | result = new IfElseExpr(stream); |
| 7882 | else if (tok=="IF") |
| 7883 | result = new IfExpr(stream); |
| 7884 | else if (tok=="ISNULL") |
| 7885 | result = new CppiaIsNull(stream); |
| 7886 | else if (tok=="NOTNULL") |
| 7887 | result = new CppiaIsNotNull(stream); |
| 7888 | else if (tok=="CALLSTATIC") |
| 7889 | result = new CallStatic(stream); |
| 7890 | else if (tok=="CALLTHIS") |
| 7891 | result = new CallMember(stream,callThis); |
| 7892 | else if (tok=="CALLSUPERNEW") |
| 7893 | result = new CallMember(stream,callSuperNew); |
| 7894 | else if (tok=="CALLSUPER") |
| 7895 | result = new CallMember(stream,callSuper); |
| 7896 | else if (tok=="CALLMEMBER") |
| 7897 | result = new CallMember(stream,callObject); |
| 7898 | else if (tok=="CALLGLOBAL") |
| 7899 | result = new CallGlobal(stream); |
| 7900 | else if (tok=="true") |
| 7901 | result = new DataVal<bool>(true); |
| 7902 | else if (tok=="false") |
| 7903 | result = new DataVal<bool>(false); |
| 7904 | else if (tok=="s") |
| 7905 | result = new StringVal(stream.getInt()); |
| 7906 | else if (tok=="f") |
| 7907 | result = new DataVal<Float>(atof( stream.module->strings[stream.getInt()].out_str() )); |
| 7908 | else if (tok=="i") |
| 7909 | result = new DataVal<int>(stream.getInt()); |
| 7910 | else if (tok=="POSINFO") |
| 7911 | result = new PosInfo(stream); |
| 7912 | else if (tok=="VAR") |
| 7913 | result = new VarRef(stream); |
| 7914 | else if (tok=="WHILE") |
| 7915 | result = new WhileExpr(stream); |
| 7916 | else if (tok=="FOR") |
| 7917 | result = new ForExpr(stream); |
| 7918 | else if (tok=="RETVAL") |
| 7919 | result = new RetVal(stream,true); |
| 7920 | else if (tok=="RETURN") |
| 7921 | result = new RetVal(stream,false); |
| 7922 | else if (tok=="THROW") |
| 7923 | result = new ThrowExpr(stream); |
| 7924 | else if (tok=="CALL") |
| 7925 | result = new Call(stream); |
no test coverage detected