@@ -28,8 +28,8 @@ create or replace package body ut_utils is
2828 * Constants use in postfix and infix transformations
2929 */
3030 gc_operators constant ut_varchar2_list := ut_varchar2_list('|','&','!');
31- gc_unary_operator constant ut_varchar2_list := ut_varchar2_list('!'); -- right side associative operator
32- gc_binary_operator constant ut_varchar2_list := ut_varchar2_list('|','&'); -- left side associative operator
31+ gc_unary_operators constant ut_varchar2_list := ut_varchar2_list('!'); -- right side associative operator
32+ gc_binary_operators constant ut_varchar2_list := ut_varchar2_list('|','&'); -- left side associative operator
3333
3434 type t_precedence_table is table of number index by varchar2(1);
3535 g_precedence t_precedence_table;
@@ -1027,9 +1027,9 @@ create or replace package body ut_utils is
10271027 --Exuecute modified shunting algorithm
10281028 WHILE (l_idx is not null) loop
10291029 l_token := l_input_tokens(l_idx);
1030- if (l_token member of gc_operators and l_token member of gc_binary_operator ) then
1030+ if (l_token member of gc_operators and l_token member of gc_binary_operators ) then
10311031 if not(l_expect_operator) then
1032- raise ex_invalid_tag_expression;
1032+ raise_application_error(gc_invalid_tag_expression, 'Invalid Tag expression');
10331033 end if;
10341034 while l_operator_stack.top > 0 and (g_precedence(l_operator_stack.peek) > g_precedence(l_token)) loop
10351035 l_rnp_tokens.extend;
@@ -1038,23 +1038,23 @@ create or replace package body ut_utils is
10381038 l_operator_stack.push(l_input_tokens(l_idx));
10391039 l_expect_operand := true;
10401040 l_expect_operator:= false;
1041- elsif (l_token member of gc_operators and l_token member of gc_unary_operator ) then
1041+ elsif (l_token member of gc_operators and l_token member of gc_unary_operators ) then
10421042 if not(l_expect_operand) then
1043- raise ex_invalid_tag_expression;
1043+ raise_application_error(gc_invalid_tag_expression, 'Invalid Tag expression');
10441044 end if;
10451045 l_operator_stack.push(l_input_tokens(l_idx));
10461046 l_expect_operand := true;
10471047 l_expect_operator:= false;
10481048 elsif l_token = '(' then
10491049 if not(l_expect_operand) then
1050- raise ex_invalid_tag_expression;
1050+ raise_application_error(gc_invalid_tag_expression, 'Invalid Tag expression');
10511051 end if;
10521052 l_operator_stack.push(l_input_tokens(l_idx));
10531053 l_expect_operand := true;
10541054 l_expect_operator:= false;
10551055 elsif l_token = ')' then
10561056 if not(l_expect_operator) then
1057- raise ex_invalid_tag_expression;
1057+ raise_application_error(gc_invalid_tag_expression, 'Invalid Tag expression');
10581058 end if;
10591059 while l_operator_stack.peek <> '(' loop
10601060 l_rnp_tokens.extend;
@@ -1065,7 +1065,7 @@ create or replace package body ut_utils is
10651065 l_expect_operator:= true;
10661066 else
10671067 if not(l_expect_operand) then
1068- raise ex_invalid_tag_expression;
1068+ raise_application_error(gc_invalid_tag_expression, 'Invalid Tag expression');
10691069 end if;
10701070 l_rnp_tokens.extend;
10711071 l_rnp_tokens(l_rnp_tokens.last) :=l_token;
@@ -1078,7 +1078,7 @@ create or replace package body ut_utils is
10781078
10791079 while l_operator_stack.peek is not null loop
10801080 if l_operator_stack.peek in ('(',')') then
1081- raise ex_invalid_tag_expression;
1081+ raise_application_error(gc_invalid_tag_expression, 'Invalid Tag expression');
10821082 end if;
10831083 l_rnp_tokens.extend;
10841084 l_rnp_tokens(l_rnp_tokens.last):=l_operator_stack.pop;
@@ -1087,37 +1087,6 @@ create or replace package body ut_utils is
10871087 return l_rnp_tokens;
10881088 end shunt_logical_expression;
10891089
1090- function convert_postfix_to_infix(a_postfix_exp in ut_varchar2_list)
1091- return varchar2 is
1092- l_infix_stack ut_stack := ut_stack();
1093- l_right_side varchar2(32767);
1094- l_left_side varchar2(32767);
1095- l_infix_exp varchar2(32767);
1096- l_idx pls_integer;
1097- begin
1098- l_idx := a_postfix_exp.first;
1099- while (l_idx is not null) loop
1100- --If token is operand but also single tag
1101- if a_postfix_exp(l_idx) not member of gc_operators then --its operand
1102- l_infix_stack.push(a_postfix_exp(l_idx));
1103- --If token is unary operator not
1104- elsif a_postfix_exp(l_idx) member of gc_unary_operator then
1105- l_right_side := l_infix_stack.pop;
1106- l_infix_exp := '('||a_postfix_exp(l_idx)||l_right_side||')';
1107- l_infix_stack.push(l_infix_exp);
1108- --If token is binary operator
1109- elsif a_postfix_exp(l_idx) member of gc_binary_operator then
1110- l_right_side := l_infix_stack.pop;
1111- l_left_side := l_infix_stack.pop;
1112- l_infix_exp := '('||l_left_side||a_postfix_exp(l_idx)||l_right_side||')';
1113- l_infix_stack.push(l_infix_exp);
1114- end if;
1115- l_idx := a_postfix_exp.next(l_idx);
1116- end loop;
1117-
1118- return l_infix_stack.pop;
1119- end convert_postfix_to_infix;
1120-
11211090 function conv_postfix_to_infix_sql(a_postfix_exp in ut_varchar2_list)
11221091 return varchar2 is
11231092 l_infix_stack ut_stack := ut_stack();
@@ -1136,12 +1105,12 @@ create or replace package body ut_utils is
11361105 elsif a_postfix_exp(l_idx) not member of gc_operators then
11371106 l_infix_stack.push(a_postfix_exp(l_idx));
11381107 --If token is unary operator not
1139- elsif a_postfix_exp(l_idx) member of gc_unary_operator then
1108+ elsif a_postfix_exp(l_idx) member of gc_unary_operators then
11401109 l_right_side := l_infix_stack.pop;
11411110 l_infix_exp := a_postfix_exp(l_idx)||'('||l_right_side||')';
11421111 l_infix_stack.push(l_infix_exp);
11431112 --If token is binary operator
1144- elsif a_postfix_exp(l_idx) member of gc_binary_operator then
1113+ elsif a_postfix_exp(l_idx) member of gc_binary_operators then
11451114 l_right_side := l_infix_stack.pop;
11461115 l_left_side := l_infix_stack.pop;
11471116 l_infix_exp := '('||l_left_side||a_postfix_exp(l_idx)||l_right_side||')';
0 commit comments