From 6bcdad20c24457393c0d9eeb385d0ff5aa872cd0 Mon Sep 17 00:00:00 2001 From: Lars Thorsen Date: Wed, 25 Apr 2018 15:09:14 +0200 Subject: Move the corba applcations to separate repository All corba applications are moved to a separate repository. E.g. orber, ic, cosEvent, cosEventDomain, cosNotifications cosTime, cosTransactions, cosProperty and cosFileTransfer. --- lib/ic/src/ic_constant_java.erl | 100 ---------------------------------------- 1 file changed, 100 deletions(-) delete mode 100644 lib/ic/src/ic_constant_java.erl (limited to 'lib/ic/src/ic_constant_java.erl') diff --git a/lib/ic/src/ic_constant_java.erl b/lib/ic/src/ic_constant_java.erl deleted file mode 100644 index 49150f96ac..0000000000 --- a/lib/ic/src/ic_constant_java.erl +++ /dev/null @@ -1,100 +0,0 @@ -%% -%% %CopyrightBegin% -%% -%% Copyright Ericsson AB 1999-2016. All Rights Reserved. -%% -%% Licensed under the Apache License, Version 2.0 (the "License"); -%% you may not use this file except in compliance with the License. -%% You may obtain a copy of the License at -%% -%% http://www.apache.org/licenses/LICENSE-2.0 -%% -%% Unless required by applicable law or agreed to in writing, software -%% distributed under the License is distributed on an "AS IS" BASIS, -%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -%% See the License for the specific language governing permissions and -%% limitations under the License. -%% -%% %CopyrightEnd% -%% -%% --module(ic_constant_java). - - --include("icforms.hrl"). --include("ic.hrl"). --include("ic_debug.hrl"). -%%----------------------------------------------------------------- -%% External exports -%%----------------------------------------------------------------- --export([gen/3]). - -%%----------------------------------------------------------------- -%% Internal exports -%%----------------------------------------------------------------- --export([]). - -%%----------------------------------------------------------------- -%% External functions -%%----------------------------------------------------------------- - -%%----------------------------------------------------------------- -%% Func: gen/3 -%%----------------------------------------------------------------- -gen(G, N, X) when is_record(X, const) -> - ConstantName = ic_forms:get_java_id(X), - case inInterface(G, N) of - true -> - emit_constant(G, N, X, ConstantName); - false -> - emit_constant_interface(G, N, X, ConstantName) - end; -gen(_G, _N, _X) -> - ok. - - -%%----------------------------------------------------------------- -%% Internal functions -%%----------------------------------------------------------------- - -%%----------------------------------------------------------------- -%% Func: emit_constant/4 -%%----------------------------------------------------------------- -emit_constant(G, N, X, ConstantName) -> - Fd = ic_genobj:interfacefiled(G), - %%?PRINTDEBUG2("~p", [Fd]), - Type = ic_java_type:getType(G, N, ic_forms:get_type(X)), - ic_codegen:emit(Fd, " public static final ~s ~s = (~s) ~p;\n", - [Type, ConstantName, Type, X#const.val]), - ic_codegen:nl(Fd). - -%%----------------------------------------------------------------- -%% Func: emit_constant_interface/4 -%%----------------------------------------------------------------- -emit_constant_interface(G, N, X, ConstantName) -> - {Fd, _} = ic_file:open_java_file(G, N, ConstantName), - - ic_codegen:emit(Fd, "final public class ~s {\n",[ConstantName]), - - Type = ic_java_type:getType(G, N, ic_forms:get_type(X)), - ic_codegen:emit(Fd, " public static final ~s value = (~s) ~p;\n", - [Type, Type, X#const.val]), - ic_codegen:emit(Fd, "}\n", []), - file:close(Fd). - -%%----------------------------------------------------------------- -%% Func: emit_constant_interface/4 -%%----------------------------------------------------------------- -inInterface(_G, []) -> % Global constant - false; -inInterface(G, N) -> - [N1 |Ns] = N, - {_FullScopedName, T, _TK, _} = - ic_symtab:get_full_scoped_name(G, Ns, ic_symtab:scoped_id_new(N1)), - case T of - interface -> % Constant declare in an interface - true; - _ -> % Constant declared in a module - false - end. - -- cgit v1.2.3