diff --git a/clc/dll/src/OperConv.cpp b/clc/dll/src/OperConv.cpp index 8faa74f39..bd943fe94 100644 --- a/clc/dll/src/OperConv.cpp +++ b/clc/dll/src/OperConv.cpp @@ -1266,13 +1266,51 @@ namespace #define PI 3.14159265358979323846 - CommonOperGroup cog_true("true"); - CommonOperGroup cog_false("false"); - CommonOperGroup cog_pi("pi"); + CommonOperGroup cog_true(token::true_); + CommonOperGroup cog_false(token::false_); + CommonOperGroup cog_greekpi(token::pi); + CommonOperGroup cog_funcpi("pi"); + + CommonOperGroup cog_null_b(token::null_b); + CommonOperGroup cog_null_w(token::null_w); + CommonOperGroup cog_null_u(token::null_u); + CommonOperGroup cog_null_u64(token::null_u64); + CommonOperGroup cog_null_c(token::null_c); + CommonOperGroup cog_null_s(token::null_s); + CommonOperGroup cog_null_i(token::null_i); + CommonOperGroup cog_null_i64(token::null_i64); + CommonOperGroup cog_null_f(token::null_f); + CommonOperGroup cog_null_d(token::null_d); + CommonOperGroup cog_null_sp(token::null_sp); + CommonOperGroup cog_null_wp(token::null_wp); + CommonOperGroup cog_null_ip(token::null_ip); + CommonOperGroup cog_null_up(token::null_up); + CommonOperGroup cog_null_fp(token::null_fp); + CommonOperGroup cog_null_dp(token::null_dp); ConstParamOperator cpt(&cog_true, true); ConstParamOperator cpf(&cog_false, false); - ConstParamOperator cppi(&cog_pi, PI); + ConstParamOperator cppig(&cog_greekpi, PI); + ConstParamOperator cppif(&cog_funcpi, PI); + + ConstParamOperator cpp_null_b(&cog_null_b, UNDEFINED_VALUE(UInt8)); + ConstParamOperator cpp_null_w(&cog_null_w, UNDEFINED_VALUE(UInt16)); + ConstParamOperator cpp_null_u(&cog_null_u, UNDEFINED_VALUE(UInt32)); + ConstParamOperator cpp_null_u64(&cog_null_u64, UNDEFINED_VALUE(UInt64)); + ConstParamOperator cpp_null_c(&cog_null_c, UNDEFINED_VALUE(Int8)); + ConstParamOperator cpp_null_s(&cog_null_s, UNDEFINED_VALUE(Int16)); + ConstParamOperator cpp_null_i(&cog_null_i, UNDEFINED_VALUE(Int32)); + ConstParamOperator cpp_null_i64(&cog_null_i64, UNDEFINED_VALUE(Int64)); + + ConstParamOperator cpp_null_f(&cog_null_f, UNDEFINED_VALUE(Float32)); + ConstParamOperator cpp_null_d(&cog_null_d, UNDEFINED_VALUE(Float64)); + + ConstParamOperator cpp_null_sp(&cog_null_sp, UNDEFINED_VALUE(SPoint)); + ConstParamOperator cpp_null_wp(&cog_null_wp, UNDEFINED_VALUE(WPoint)); + ConstParamOperator cpp_null_ip(&cog_null_ip, UNDEFINED_VALUE(IPoint)); + ConstParamOperator cpp_null_up(&cog_null_up, UNDEFINED_VALUE(UPoint)); + ConstParamOperator cpp_null_fp(&cog_null_fp, UNDEFINED_VALUE(FPoint)); + ConstParamOperator cpp_null_dp(&cog_null_dp, UNDEFINED_VALUE(DPoint)); CommonOperGroup cog_asDataString("asDataString"); AsDataStringOperator g_AsDataString(&cog_asDataString); diff --git a/stx/dll/src/ExprParse.h b/stx/dll/src/ExprParse.h index 96eb4f5f1..8bf2f477a 100644 --- a/stx/dll/src/ExprParse.h +++ b/stx/dll/src/ExprParse.h @@ -1,31 +1,8 @@ -//
-/* -Data & Model Server (DMS) is a server written in C++ for DSS applications. -Version: see srv/dms/rtc/dll/src/RtcVersion.h for version info. +// Copyright (C) 2023 Object Vision b.v. +// License: GNU GPL 3 +///////////////////////////////////////////////////////////////////////////// -Copyright (C) 1998-2004 YUSE GSO Object Vision BV. - -Documentation on using the Data & Model Server software can be found at: -http://www.ObjectVision.nl/DMS/ - -See additional guidelines and notes in srv/dms/Readme-srv.txt - -This library is free software; you can use, redistribute, and/or -modify it under the terms of the GNU General Public License version 2 -(the License) as published by the Free Software Foundation, -provided that this entire header notice and readme-srv.txt is preserved. - -See LICENSE.TXT for terms of distribution or look at our web site: -http://www.objectvision.nl/DMS/License.txt -or alternatively at: http://www.gnu.org/copyleft/gpl.html - -This library is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -General Public License for more details. However, specific warranties might be -granted by an additional written contract for support, assistance and/or development -*/ -//
+#pragma once #if !defined(__STX_EXPRPARSE_H) #define __STX_EXPRPARSE_H @@ -106,9 +83,6 @@ struct expr_grammar : public boost::spirit::grammar> chlit<> COMMA(','); chlit<> UNDERSCORE('_'); - strlit<> TRUE("true"); - strlit<> FALSE("false"); - chlit<> LPAREN('('); chlit<> RPAREN(')'); diff --git a/stx/dll/src/ExprProd.cpp b/stx/dll/src/ExprProd.cpp index c13bf6264..d51ba3dde 100644 --- a/stx/dll/src/ExprProd.cpp +++ b/stx/dll/src/ExprProd.cpp @@ -104,7 +104,7 @@ void ExprProd::ProdFunctionCall() void ExprProd::ProdIdentifier(iterator_t first, iterator_t last) { - dms_assert(first != last); + assert(first != last); m_Result.push_back(LispRef(GetTokenID_mt(&*first, &*last))); } diff --git a/tic/dll/src/AbstrCalculator.cpp b/tic/dll/src/AbstrCalculator.cpp index 6223b4355..8a03f33ae 100644 --- a/tic/dll/src/AbstrCalculator.cpp +++ b/tic/dll/src/AbstrCalculator.cpp @@ -579,7 +579,7 @@ SharedStr AbstrCalculator::EvaluateExpr(const TreeItem* context, CharPtrRange ex { AbstrCalculatorRef calculator = ConstructFromDirectStr(context, resultStr, cr); auto res = CalcResult(calculator, DataArray::GetStaticClass()); - dms_assert(res); + assert(res); if (res->WasFailed(FR_Data)) res->ThrowFail(); @@ -594,7 +594,7 @@ SharedStr AbstrCalculator::EvaluateExpr(const TreeItem* context, CharPtrRange ex if (res->WasFailed(FR_Data)) res->ThrowFail(); - dms_assert(resDataItem); + assert(resDataItem); if (resDataItem->WasFailed(FR_Data)) resDataItem->ThrowFail(); if (resDataItem->WasFailed()) context->Fail(resDataItem); resultStr = GetValue(resDataItem, 0); diff --git a/tic/dll/src/LispTreeType.cpp b/tic/dll/src/LispTreeType.cpp index 470d31122..cf2e4d332 100644 --- a/tic/dll/src/LispTreeType.cpp +++ b/tic/dll/src/LispTreeType.cpp @@ -108,6 +108,29 @@ namespace token { TIC_CALL TokenID true_ = GetTokenID_st("true"); TIC_CALL TokenID false_ = GetTokenID_st("false"); + TIC_CALL TokenID pi = GetTokenID_st("?"); + TIC_CALL TokenID null_b = GetTokenID_st("null_b"); + TIC_CALL TokenID null_w = GetTokenID_st("null_w"); + TIC_CALL TokenID null_u = GetTokenID_st("null_u"); + TIC_CALL TokenID null_u64 = GetTokenID_st("null_u64"); + TIC_CALL TokenID null_c = GetTokenID_st("null_c"); + TIC_CALL TokenID null_s = GetTokenID_st("null_s"); + TIC_CALL TokenID null_i = GetTokenID_st("null_i"); + TIC_CALL TokenID null_i64 = GetTokenID_st("null_i64"); + TIC_CALL TokenID null_f = GetTokenID_st("null_f"); + TIC_CALL TokenID null_d = GetTokenID_st("null_d"); + TIC_CALL TokenID null_sp = GetTokenID_st("null_sp"); + TIC_CALL TokenID null_wp = GetTokenID_st("null_wp"); + TIC_CALL TokenID null_ip = GetTokenID_st("null_ip"); + TIC_CALL TokenID null_up = GetTokenID_st("null_up"); + TIC_CALL TokenID null_fp = GetTokenID_st("null_fp"); + TIC_CALL TokenID null_dp = GetTokenID_st("null_dp"); + + TIC_CALL bool isConst(TokenID t) + { + assert(true_.GetNr() + 19 == null_dp.GetNr()); + return t >= true_ && t <= null_dp; + } TIC_CALL TokenID arrow = GetTokenID_st("arrow"); TIC_CALL TokenID lookup = GetTokenID_st("lookup"); diff --git a/tic/dll/src/LispTreeType.h b/tic/dll/src/LispTreeType.h index d2773211e..f37eb931c 100644 --- a/tic/dll/src/LispTreeType.h +++ b/tic/dll/src/LispTreeType.h @@ -67,10 +67,29 @@ namespace token { extern TIC_CALL TokenID not_; extern TIC_CALL TokenID iif; + extern TIC_CALL TokenID true_; extern TIC_CALL TokenID false_; - - inline bool isConst(TokenID t) { return t == true_ || t == false_; } + extern TIC_CALL TokenID pi; + + extern TIC_CALL TokenID null_b; + extern TIC_CALL TokenID null_w; + extern TIC_CALL TokenID null_u; + extern TIC_CALL TokenID null_u64; + extern TIC_CALL TokenID null_c; + extern TIC_CALL TokenID null_s; + extern TIC_CALL TokenID null_i; + extern TIC_CALL TokenID null_i64; + extern TIC_CALL TokenID null_f; + extern TIC_CALL TokenID null_d; + extern TIC_CALL TokenID null_sp; + extern TIC_CALL TokenID null_wp; + extern TIC_CALL TokenID null_ip; + extern TIC_CALL TokenID null_up; + extern TIC_CALL TokenID null_fp; + extern TIC_CALL TokenID null_dp; + + TIC_CALL bool isConst(TokenID t); extern TIC_CALL TokenID arrow; extern TIC_CALL TokenID lookup;