OMG--IDL(Interface Definition Language)

news2024/10/7 11:21:36

OMG--IDL(Interface Definition Language)

  • 1 概述
  • 2 内容
    • 缩写
    • IDL 语法和语义概述
    • 词法约定
      • ISO Latin-1的字母字符如下表
      • 十进制数字字符
      • 图形字符
      • 格式化字符
      • Tokens
      • 注释
      • 标识符
      • 冲突规则
      • 转义标识符
      • 关键字
      • IDL识别的其他字符
      • 字面量
    • 预处理
    • IDL 语法
      • 构建块核心数据类型
      • 构建任何块
      • 构建块基本接口
      • 构建块完整接口
      • 构建块数据类型
      • 构建块CORBA实现--接口
      • 构建块CORBA实现--数据类型
      • 构建块组件--基本
      • 构建块组件--homes
      • 构建块CCM实现
      • 构建块组件--端口和连接器
      • 构建模板模块
      • 构建块扩展数据类型
      • 构建块匿名类型
      • 构建块注释
      • 构建模块之间的关系
  • 3 补充
    • 3.1 OMG介绍
    • 3.2 CORBA
      • XML-RPC / SOAP
      • REST
      • CORBA 和 gRPC 比较
    • 3.3 EBNF(扩展巴科斯范式)
  • 参考

1 概述

如下介绍,OMG组织定义的IDL(Interface Definition Language)。

  • Version: 4.2
  • OMG Document Number: formal/18-01-05
  • Release Date: March 2018
  • Standard Document URL: http://www.omg.org/spec/IDL/4.2/

2 内容

缩写

AcronymMeaning
ASCIIAmerican Standard Code for Information Interchange
BIPMBureau International des Poids et Mesures
CCMCORBA Component Model
CORBACommon Object Request Broker Architecture
DDSData Distribution Service
EBNFExtended Backus Naur Form
IDLInterface Definition Language
ISOInternational Organization for Standardization
LwCCMLightweight CCM
OMGObject Management Group
ORBObject Request Broker
XTypeseXtensible and dynamic topic Types (for DDS)

IDL 语法和语义概述

  • OMG IDL是一种语言,它允许对客户端对象可能使用的接口进行明确的规范(服务器)对象实现提供了所有需要的相关结构,如异常和数据类型。数据需要类型来指定接口操作的参数和返回值。
  • IDL是一种纯粹的描述性语言。
  • 包含用 IDL 编写的规范的源文件应具有“.idl”扩展名。

列出了EBNF格式中使用的符号及其含义:
在这里插入图片描述

词法约定

词法约定在IDL规范中定义令牌(tokens)并描述注释、标识符、关键字和字面值——整数、字符、浮点常量和字符串字面值。
IDL使用ASCII字符集,除了字符串文字和字符文字,它们使用ISO Latin-1 (8859-1)字符集。ISO Latin-1字符集分为字母(字母)数字、图形字符、字符空格(空白)字符和格式化字符。

ISO Latin-1的字母字符如下表

在这里插入图片描述
在这里插入图片描述

十进制数字字符

在这里插入图片描述

图形字符

在这里插入图片描述
在这里插入图片描述

格式化字符

在这里插入图片描述

Tokens

有五种tokens:标识符、关键字、文字、操作符和其他分隔符。

注释

字符/开始一个注释,注释以字符/结束。这些注释不能嵌套。
字符//开始一个注释,该注释在它们出现的行结束。

标识符

标识符是由ASCII字母、数字和下划线(_)字符组成的任意长序列。第一个字符必须是ASCII字母字符。所有字符都是重要的。IDL标识符不区分大小写。但是,对定义的所有引用必须使用与定义相同的大小写发生。这允许对区分大小写的语言进行自然映射。

冲突规则

  • 大写字母和小写字母被视为相同的字母。
  • 在每个作用域中,IDL标识符只有一个名称空间。使用相同的标识符用于常量和接口,例如,会产生编译错误。
module M {
	typedef long Foo;
	const long thing = 1;
	interface thing { 						// Error: reuse of identifier thing
		void doit (
			in Foo foo 						// Error: Foo and foo collide…
		); 									// … and refer to different things
		readonly attribute long Attribute;	// Error: Attribute collides with keyword…
											// … attribute
	};
};

转义标识符

  • 和所有语言一样,IDL使用一些保留字,称为关键字。
  • 随着IDL的发展,添加到IDL语言中的新关键字可能会无意中与中使用的标识符冲突现有的IDL和使用该IDL的程序。修复这些冲突不仅需要修改IDL,还需要依赖于该IDL的编程语言代码也必须更改。的语言映射规则重命名的IDL标识符将导致映射的标识符名称(例如,方法名称)被更改。
  • 为了尽量减少工作量,用户可以在词法上通过在an前面加上下划线(_)来“转义”标识符标识符。这是一个纯粹的词法约定,只关闭关键字检查。结果标识符紧随其后标识符处理的其他规则。例如,标识符_AnIdentifier被当作AnIdentifier来处理。
module M {
	interface thing {
		attribute boolean abstract;		// Error: abstract collides with keyword abstract
		attribute boolean _abstract;	// OK: abstract is an identifier
	};
};

关键字

在这里插入图片描述

module M {
	typedef Long Foo;			// Error: keyword is long not Long
	typedef boolean BOOLEAN;	// Error: BOOLEAN collides with the keyword…
								// …boolean;
};

IDL识别的其他字符

  • 标点符号
    在这里插入图片描述
  • 记号
    在这里插入图片描述

字面量

  • Integer
  • Character
  • Floating-point
  • String
  • Fixed-point

转义字符
在这里插入图片描述
在这里插入图片描述

字符串是以空结尾的字符序列。如果字符串由非宽字符组成,则为字符串类型;如果字符串由宽字符组成,则为wstring(宽字符串)类型。

const string S1 = "Hello";
const wstring S2 = L"Hello";

预处理

IDL应按照ISO/IEC 14882:2003中预处理器的规范进行预处理。预处理器可以作为单独的进程实现,也可以内置于IDL编译器中。

IDL 语法

格式良好的IDL规范的语法是用扩展巴科斯范式表示的规则来描述的(EBNF)。

构建块核心数据类型

The following set of rules form the building block:

(1) <specification>				::= <definition>+
(2) <definition>				::= <module_dcl> ";"
								| <const_dcl> ";"
								| <type_dcl> ";"
(3) <module_dcl>				::= "module" <identifier> "{" <definition>+ "}"
(4) <scoped_name>				::= <identifier>
								| "::" <identifier>
								| <scoped_name> "::" <identifier>
(5) <const_dcl> 				::= "const" <const_type> <identifier> "=" <const_expr>
(6) <const_type> 				::= <integer_type>
								| <floating_pt_type>
								| <fixed_pt_const_type>
								| <char_type>
								| <wide_char_type>
								| <boolean_type>
								| <octet_type>
								| <string_type>
								| <wide_string_type>
								| <scoped_name>
(7) <const_expr> 				::= <or_expr>
(8) <or_expr> 					::= <xor_expr>
								| <or_expr> "|" <xor_expr>
(9) <xor_expr> 					::= <and_expr>
								| <xor_expr> "^" <and_expr>
(10) <and_expr> 				::= <shift_expr>
								| <and_expr> "&" <shift_expr>
(11) <shift_expr> 				::= <add_expr>
								| <shift_expr> ">>" <add_expr>
								| <shift_expr> "<<" <add_expr>
(12) <add_expr> 				::= <mult_expr>
								| <add_expr> "+" <mult_expr>
								| <add_expr> "-" <mult_expr>
(13) <mult_expr> 				::= <unary_expr>
								| <mult_expr> "*" <unary_expr>
								| <mult_expr> "/" <unary_expr>
								| <mult_expr> "%" <unary_expr>
(14) <unary_expr> 				::= <unary_operator> <primary_expr>
								| <primary_expr>
(15) <unary_operator> 			::= "-"
								| "+"
								| "~"
(16) <primary_expr> 			::= <scoped_name>
								| <literal>
								| "(" <const_expr>")"
(17) <literal> 					::= <integer_literal>
								| <floating_pt_literal>
								| <fixed_pt_literal>
								| <character_literal>
								| <wide_character_literal>
								| <boolean_literal>
								| <string_literal>
								| <wide_string_literal>
(18) <boolean_literal> 			::= "TRUE"
								| "FALSE"
(19) <positive_int_const> 		::= <const_expr>
(20) <type_dcl> 				::= <constr_type_dcl>
								| <native_dcl> 
								| <typedef_dcl>
(21) <type_spec> 				::= <simple_type_spec>
(22) <simple_type_spec> 		::= <base_type_spec>
								| <scoped_name>
(23) <base_type_spec> 			::= <integer_type>
								| <floating_pt_type>
								| <char_type>
								| <wide_char_type>
								| <boolean_type>
								| <octet_type>
(24) <floating_pt_type> 		::="float"
								| "double"
								| "long" "double"
(25) <integer_type> 			::= <signed_int>
								| <unsigned_int>
(26) <signed_int> 				::= <signed_short_int>
								| <signed_long_int>
								| <signed_longlong_int>
(27) <signed_short_int> 		::="short"
(28) <signed_long_int> 			::="long"
(29) <signed_longlong_int> 		::="long""long"
(30) <unsigned_int> 			::= <unsigned_short_int>
								| <unsigned_long_int>
								| <unsigned_longlong_int>
(31) <unsigned_short_int> 		::="unsigned""short"
(32) <unsigned_long_int> 		::="unsigned""long"
(33) <unsigned_longlong_int> 	::="unsigned""long""long"
(34) <char_type> 				::="char"
(35) <wide_char_type> 			::="wchar"
(36) <boolean_type> 			::="boolean"
(37) <octet_type> 				::="octet"
(38) <template_type_spec> 		::= <sequence_type>
								| <string_type>
								| <wide_string_type>
								| <fixed_pt_type>
(39) <sequence_type> 			::= "sequence" "<" <type_spec> "," <positive_int_const> ">"
								| "sequence" "<" <type_spec> ">"
(40) <string_type> 				::= "string" "<" <positive_int_const> ">"
								| "string"
(41) <wide_string_type> 		::= "wstring" "<" <positive_int_const> ">"
								| "wstring"
(42) <fixed_pt_type> 			::= "fixed" "<" <positive_int_const> "," <positive_int_const> ">"
(43) <fixed_pt_const_type> 		::= "fixed"
(44) <constr_type_dcl> 			::= <struct_dcl>
								| <union_dcl>
								| <enum_dcl>
(45) <struct_dcl> 				::= <struct_def>
								| <struct_forward_dcl>
(46) <struct_def> 				::= "struct" <identifier> "{" <member>+ "}"
(47) <member> 					::= <type_spec> <declarators> ";"
(48) <struct_forward_dcl> 		::= "struct" <identifier>
(49) <union_dcl> 				::= <union_def>
								| <union_forward_dcl>
(50) <union_def> 				::= "union" <identifier> "switch" "(" <switch_type_spec> ")"
								"{" <switch_body> "}"
(51) <switch_type_spec> 		::= <integer_type>
								| <char_type>
								| <boolean_type>
								| <scoped_name>
(52) <switch_body> 				::= <case>+
(53) <case> 					::= <case_label>+ <element_spec> ";"
(54) <case_label> 				::= "case" <const_expr> ":"
								| "default" ":"
(55) <element_spec> 			::= <type_spec> <declarator>
(56) <union_forward_dcl> 		::= "union" <identifier>
(57) <enum_dcl> 				::= "enum" <identifier>
								"{" <enumerator> { "," <enumerator> } * "}"
(58) <enumerator> 				::= <identifier>
(59) <array_declarator> 		::= <identifier> <fixed_array_size>+
(60) <fixed_array_size> 		::= "[" <positive_int_const> "]"
(61) <native_dcl> 				::= "native" <simple_declarator>
(62) <simple_declarator> 		::= <identifier>
(63) <typedef_dcl> 				::= "typedef" <type_declarator>
(64) <type_declarator> 			::= { <simple_type_spec>
								| <template_type_spec>
								| <constr_type_dcl>
								} <any_declarators>
(65) <any_declarators> 			::= <any_declarator> { "," <any_declarator> }*
(66) <any_declarator> 			::= <simple_declarator>
								| <array_declarator>
(67) <declarators> 				::= <declarator> { "," <declarator> }*
(68) <declarator> 				::= <simple_declarator>

构建任何块

(69) <base_type_spec> 			::+ <any_type>
(70) <any_type> 				::= "any"

构建块基本接口

(71) <definition> 				::+ <except_dcl> ";"
| <interface_dcl> 				";"
(72) <except_dcl> 				::= "exception" <identifier> "{" <member>* "}"
(73) <interface_dcl> 			::= <interface_def>
								| <interface_forward_dcl>
(74) <interface_def> 			::= <interface_header> "{" <interface_body> "}"
(75) <interface_forward_dcl> 	::= <interface_kind> <identifier>
(76) <interface_header> 		::= <interface_kind> <identifier>
								[ <interface_inheritance_spec> ]
(77) <interface_kind> 			::= "interface"
(78) <interface_inheritance_spec>
								::= ":" <interface_name> { "," <interface_name> }*
(79) <interface_name> 			::= <scoped_name>
(80) <interface_body> 			::= <export>*
(81) <export> 					::= <op_dcl> ";"
								| <attr_dcl> ";"
(82) <op_dcl> 					::= <op_type_spec> <identifier> "(" [ <parameter_dcls> ] ")" [ <raises_expr> ]
(83) <op_type_spec> 			::= <type_spec>
								| "void"
(84) <parameter_dcls> 			::= <param_dcl> { "," <param_dcl> } *
(85) <param_dcl> 				::= <param_attribute> <type_spec> <simple_declarator>
(86) <param_attribute> 			::= "in"
								| "out"
								| "inout"
(87) <raises_expr> 				::= "raises" "(" <scoped_name> { "," <scoped_name> } * ")"
(88) <attr_dcl> 				::= <readonly_attr_spec>
								| <attr_spec>
(89) <readonly_attr_spec> 		::= "readonly" "attribute" <type_spec> <readonly_attr_declarator>
(90) <readonly_attr_declarator>
								::= <simple_declarator> <raises_expr>
								| <simple_declarator> { "," <simple_declarator> }*
(91) <attr_spec> 				::= "attribute" <type_spec> <attr_declarator>
(92) <attr_declarator> 			::= <simple_declarator> <attr_raises_expr>
								| <simple_declarator> { "," <simple_declarator> }*
(93) <attr_raises_expr> 		::= <get_excep_expr> [ <set_excep_expr> ]
								| <set_excep_expr>
(94) <get_excep_expr> 			::= "getraises" <exception_list>
(95) <set_excep_expr> 			::= "setraises" <exception_list>
(96) <exception_list> 			::= "(" <scoped_name> { "," <scoped_name> } * ")"

构建块完整接口

(97) <export> 					::+ <type_dcl> ";"
								| <const_dcl> ";"
								| <except_dcl> ";"

构建块数据类型

(98) <definition> 				::+ <value_dcl> ";"
(99) <value_dcl> 				::= <value_def>
								| <value_forward_dcl>
(100) <value_def> 				::= <value_header> "{" <value_element>* "}"
(101) <value_header> 			::= <value_kind> <identifier> [ <value_inheritance_spec> ]
(102) <value_kind> 				::= "valuetype"
(103) <value_inheritance_spec>
								::= [ ":" <value_name> ] [ "supports" <interface_name> ]
(104) <value_name> 				::= <scoped_name>
(105) <value_element> 			::= <export>
								| <state_member>
								| <init_dcl>
(106) <state_member> 			::= ( "public" | "private" ) <type_spec> <declarators> ";"
(107) <init_dcl> 				::= "factory" <identifier> "(" [ <init_param_dcls> ] ")" [ <raises_expr> ] ";"
(108) <init_param_dcls> 		::= <init_param_dcl> { "," <init_param_dcl>}*
(109) <init_param_dcl> 			::= "in" <type_spec> <simple_declarator>
(110) <value_forward_dcl> 		::= <value_kind> <identifier>

构建块CORBA实现–接口

(113) <type_id_dcl> 			::= "typeid" <scoped_name> <string_literal>
(114) <type_prefix_dcl> 		::= "typeprefix" <scoped_name> <string_literal>
(115) <import_dcl> 				::= "import" <imported_scope>
(116) <imported_scope> 			::= <scoped_name> | <string_literal>
(117) <base_type_spec> 			::+ <object_type>
(118) <object_type> 			::= "Object"
(119) <interface_kind> 			::+ "local" "interface"
(120) <op_oneway_dcl> 			::= "oneway" "void" <identifier> "(" [ <in_parameter_dcls> ] ")"
(121) <in_parameter_dcls> 		::= <in_param_dcl> { "," <in_param_dcl> } *
(122) <in_param_dcl> 			::= "in" <type_spec> <simple_declarator>
(123) <op_with_context> 		::= {<op_dcl> | <op_oneway_dcl>} <context_expr>
(124) <context_expr> 			::= "context" "(" <string_literal> { "," <string_literal>* } ")"

构建块CORBA实现–数据类型

(125) <value_dcl> 				::+ <value_box_def>
								| <value_abs_def>
(126) <value_box_def> 			::= "valuetype" <identifier> <type_spec>
(127) <value_abs_def> 			::= "abstract" "valuetype" <identifier> [ <value_inheritance_spec> ]
								"{" <export>* "}"
(128) <value_kind> 				::+ "custom" "valuetype"
(129) <interface_kind> 			::+ "abstract" "interface"
(130) <value_inheritance_spec>
								::+ ":" ["truncatable"] <value_name> { "," <value_name> }*
								[ "supports" <interface_name> { "," <interface_name> }* ]
(131) <base_type_spec> 			::+ <value_base_type>
(132) <value_base_type> 		::= "ValueBase"

构建块组件–基本

(133) <definition> 				::+ <component_dcl> ";"
(134) <component_dcl> 			::= <component_def>
								| <component_forward_dcl>
(135) <component_forward_dcl>
								::= "component" <identifier>
(136) <component_def> 			::= <component_header> "{" <component_body> "}"
(137) <component_header> 		::= "component" <identifier> [ <component_inheritance_spec> ]
(138) <component_inheritance_spec>
								::= ":" <scoped_name> 
(139) <component_body> 			::= <component_export>*
(140) <component_export> 		::= <provides_dcl> ";"
								| <uses_dcl> ";"
								| <attr_dcl> ";"
(141) <provides_dcl> 			::= "provides" <interface_type> <identifier>
(142) <interface_type> 			::= <scoped_name>
(143) <uses_dcl> 				::= "uses" <interface_type> <identifier>

构建块组件–homes

(144) <definition> 				::+ <home_dcl> ";"
(145) <home_dcl> 				::= <home_header> "{" <home_body> "}"
(146) <home_header> 			::= "home" <identifier> [ <home_inheritance_spec> ]
								"manages" <scoped_name>
(147) <home_inheritance_spec> 	::= ":" <scoped_name>
(148) <home_body> 				::= <home_export>*
(149) <home_export> 			::= <export>
								| <factory_dcl> ";"
(150) <factory_dcl> 			::= "factory" <identifier> "(" [ <factory_param_dcls> ] ")" [ <raises_expr> ]
(151) <factory_param_dcls> 		::= <factory_param_dcl> {"," <factory_param_dcl>}*
(152) <factory_param_dcl> 		::= "in" <type_spec> <simple_declarator>

构建块CCM实现

(153) <definition> 				::+ <event_dcl> ";"
(154) <component_header> 		::+ "component" <identifier> [ <component_inheritance_spec> ]
									<supported_interface_spec>
(155) <supported_interface_spec>
								::= "supports" <scoped_name> { "," <scoped_name> }*
(156) <component_export> 		::+ <emits_dcl> ";"
								| <publishes_dcl> ";"
								| <consumes_dcl> ";"
(157) <interface_type> 			::+ "Object"
(158) <uses_dcl> 				::+ "uses" "multiple" <interface_type> <identifier>
(159) <emits_dcl> 				::= "emits" <scoped_name> <identifier>
(160) <publishes_dcl> 			::= "publishes" <scoped_name> <identifier>
(161) <consumes_dcl> 			::= "consumes" <scoped_name> <identifier>
(162) <home_header> 			::+ "home" <identifier> [ <home_inheritance_spec> ]
									[ <supported_interface_spec> ]
									"manages" <scoped_name> [ <primary_key_spec> ]
(163) <primary_key_spec> 		::= "primarykey" <scoped_name>
(164) <home_export> 			::+ <finder_dcl> ";"
(165) <finder_dcl> 				::= "finder" <identifier> "(" [ <init_param_dcls> ] ")" [ <raises_expr> ]
(166) <event_dcl> 				::= ( <event_def>
								| <event_abs_def>
								| <event_forward_dcl> )
(167) <event_forward_dcl> 		::= [ "abstract" ] "eventtype" <identifier>
(168) <event_abs_def> 			::= "abstract" "eventtype" <identifier> [ <value_inheritance_spec> ]
								"{" <export>* "}"
(169) <event_def> 				::= <event_header> "{" <value_element> * "}"
(170) <event_header> 			::= [ "custom" ] "eventtype" <identifier> [ <value_inheritance_spec> ]

构建块组件–端口和连接器

(171) <definition> 				::+ <porttype_dcl> ";"
								| <connector_dcl> ";"
(172) <porttype_dcl> 			::= <porttype_def>
								| <porttype_forward_dcl>
(173) <porttype_forward_dcl> 	::= "porttype" <identifier>
(174) <porttype_def> 			::= "porttype" <identifier> "{" <port_body> "}"
(175) <port_body> 				::= <port_ref> <port_export>*
(176) <port_ref> 				::= <provides_dcl> ";"
								| <uses_dcl> ";"
								| <port_dcl> ";"
(177) <port_export> 			::= <port_ref>
								| <attr_dcl> ";"
(178) <port_dcl> 				::= {"port" | "mirrorport"} <scoped_name> <identifier>
(179) <component_export> 		::+ <port_dcl> ";"
(180) <connector_dcl> 			::= <connector_header> "{" <connector_export>+ "}"
(181) <connector_header> 		::= "connector" <identifier> [ <connector_inherit_spec> ]
(182) <connector_inherit_spec> 	::= ":" <scoped_name>
(183) <connector_export> 		::= <port_ref>
								| <attr_dcl> ";"

构建模板模块

(184) <definition> 				::+ <template_module_dcl> ";"
								| <template_module_inst> ";"
(185) <template_module_dcl> 	::= "module" <identifier> "<" <formal_parameters> ">"
								"{" <tpl_definition> +"}"
(186) <formal_parameters> 		::= <formal_parameter> {"," <formal_parameter>}*
(187) <formal_parameter> 		::= <formal_parameter_type> <identifier>
(188) <formal_parameter_type> 	::= "typename" | "interface" | "valuetype" | "eventtype"
								| "struct" | "union" | "exception" | "enum" | "sequence"
								| "const" <const_type>
								| <sequence_type>
(189) <tpl_definition> 			::= <definition>
								| <template_module_ref> ";"
(190) <template_module_inst> 	::= "module" <scoped_name> "<" <actual_parameters> ">" <identifier>
(191) <actual_parameters> 		::= <actual_parameter> { "," <actual_parameter>}*
(192) <actual_parameter> 		::= <type_spec>
								| <const_expr>
(193) <template_module_ref> 	::= "alias" <scoped_name> "<" <formal_parameter_names> ">" <identifier>
(194) <formal_parameter_names>
								::= <identifier> { "," <identifier>}

构建块扩展数据类型

(195) <struct_def> 				::+ "struct" <identifier> ":" <scoped_name> "{" <member>* "}"
								| "struct" <identifier> "{" "}"
(196) <switch_type_spec> 		::+ <wide_char_type>
								| <octet_type>
(197) <template_type_spec> 		::+ <map_type>
(198) <constr_type_dcl> 		::+ <bitset_dcl>
								| <bitmask_dcl>
(199) <map_type> 				::= "map" "<" <type_spec> "," <type_spec> "," <positive_int_const> ">"
								| "map" "<" <type_spec> "," <type_spec> ">"
(200) <bitset_dcl> 				::= "bitset" <identifier> [":" <scoped_name>] "{" <bitfield>* "}"
(201) <bitfield> 				::= <bitfield_spec> <identifier>* ";"
(202) <bitfield_spec> 			::= "bitfield" "<" <positive_int_const> ">"
								| "bitfield" "<" <positive_int_const> "," <destination_type> ">"
(203) <destination_type> 		::= <boolean_type> | <octet_type> | <integer_type>
(204) <bitmask_dcl> 			::= "bitmask" <identifier> "{" <bit_value> { "," <bit_value> }* "}"
(205) <bit_value> 				::= <identifier>
(206) <signed_int> 				::+ <signed_tiny_int>
(207) <unsigned_int> 			::+ <unsigned_tiny_int>
(208) <signed_tiny_int> 		::= “int8”
(209) <unsigned_tiny_int> 		::= “uint8”
(210) <signed_short_int> 		::+ “int16”
(211) <signed_long_int> 		::+ “int32”
(212) <signed_longlong_int> 	::+ “int64”
(213) <unsigned_short_int> 		::+ “uint16”
(214) <unsigned_long_int> 		::+ “uint32”
(215) <unsigned_longlong_int> 	::+ “uint64”

构建块匿名类型

(216) <type_spec> 				::+ <template_type_spec>
(217) <declarator> 				::+ <array_declarator>

构建块注释

(218) <definition> 				::+ <annotation_dcl> " ;"
(219) <annotation_dcl> 			::= <annotation_header> "{" <annotation_body> "}"
(220) <annotation_header> 		::= "@annotation" <identifier>
(221) <annotation_body> 		::= { <annotation_member>
								| <enum_dcl> ";"
								| <const_dcl> ";"
								| <typedef_dcl> ";" }*
(222) <annotation_member> 		::= <annotation_member_type> <simple_declarator>
								[ "default" <const_expr> ] ";"
(223) <annotation_member_type>
								::= <const_type> | <any_const_type> | <scoped_name>
(224) <any_const_type> 			::= "any"
(225) <annotation_appl> 		::= "@" <scoped_name> [ "(" <annotation_appl_params> ")" ]
(226) <annotation_appl_params>
								::= <const_expr>
								| <annotation_appl_param> { "," <annotation_appl_param> }*
(227) <annotation_appl_param>
								::= <identifier> "=" <const_expr>

构建模块之间的关系

即使构建块被设计得尽可能独立,它们也被一些依赖关系联系在一起。
在这里插入图片描述

3 补充

3.1 OMG介绍

OMG成立于1989年,是一个开放的会员制、非盈利的计算机行业标准联盟。为可互操作、可便携和可复用的分布式、异构环境下的企业应用程序,制定和维护计算机行业规范。会员包括资讯科技供应商、终端用户、政府机构和学术界。
OMG的成员公司按照成熟、开放的流程编写、采用和维护其规范。OMG的规范实现模型驱动架构(MDA),通过对企业的全生命周期方法最大化ROI集成,包括多种操作系统、编程语言、中间件和网络基础设施,以及软件开发环境。
详见:http://www.omg.org/

3.2 CORBA

  • CORBA,Common Object Request Broker Architecture,公共对象请求代理体系结构。由OMG组织制订的一种标准的面向对象应用程序体系规范。或者说 CORBA体系结构是OMG为解决分布式处理环境(DCE)中,硬件和软件系统的互连而提出的一种解决方案。
  • 现在CORBA用的已经很少了,基本上只有一些大的电信项目还在用,现在同类的解决方案中WebService是比较流行的。
    在这里插入图片描述

XML-RPC / SOAP

XML-RPC发表于1998年,由UserLand Software(UserLand Software)的Dave Winer及Microsoft共同发表。后来在新的功能不断被引入下,这个标准慢慢演变成为今日的SOAP协议。

REST

REST是当今最为流行的API。因为大量的Web应用采用REST作为其API的选择。REST是 Representational State Transfer 的缩写。是Roy Thomas Fielding博士于2000年在他的博士论文中提出来的一种万维网软件架构风格。
在这里插入图片描述

CORBA 和 gRPC 比较

CORBA 和 gRPC 二者的设计,都是为了使客户端相信服务器在同一台机器。客户机在桩(Stub)上调用一个方法(method),调用过程由底层协议透明地处理。
在这里插入图片描述

3.3 EBNF(扩展巴科斯范式)

  • 扩展巴科斯-瑙尔范式(Extended Backus–Naur Form,EBNF)是一种用于描述计算机编程语言等正式语言的与上下文无关语法的元语法(metasyntax)符号表示法。简而言之,它是一种描述语言的语言。它是基本巴科斯范式(BNF)元语法符号表示法的一种扩展。
  • 最初由尼克劳斯·维尔特开发,最常用的EBNF变体由标准是 ISO-14977 所定义。

EBNF的基本语法形式如下,这个形式也被叫做production:

左式(LeftHandSide) = 右式(RightHandSide).

标准ISO/IEC 14977 所定义的符号:
在这里插入图片描述

参考

1、OMG–IDL-4.2-PDF
2、wiki-扩展巴克斯-诺尔范式
3、CORBA的简单介绍及HelloWorld
4、扩展巴科斯范式(EBNF)简介
5、架构师该如何为应用选择合适的API
6、远程通信协议:从 CORBA 到 gRPC

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/632681.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

dubbo流量录制异常(dubbo2.7.3)的问题解决排查

背景 我们自己基于jvm-sandbox-repeater做的流量录制出现了如下的问题, 从这个问题的堆栈信息来看&#xff0c;是在针对dubbo的调用的时候判断这个dubbo的返回是否有异常的时候&#xff0c;报了空指针异常了。 分析 我们看下具体出错的代码地方是怎么样的吧。 Overridepro…

chatgpt赋能python:Python怎么判断素数:一篇完整指南

Python怎么判断素数&#xff1a;一篇完整指南 Python是一种广泛应用于编程领域的语言&#xff0c;它非常适合初学者。在许多编程任务中&#xff0c;一个常见问题是需要判断一个数字是否是素数。本篇文章将介绍Python是如何判断素数的&#xff0c;并带领读者详细了解其中的细节…

Java入门之String 学习随记(一)

一. 前置知识 API-Application Programming Interface-应用程序编程接口,接口可以简单理解为别人写好的东西,我们拿过来直接使用即可.顾名思义,JavaAPI指的就是JDK提供的各种功能的Java类,它们将底层的实现封装了起来. 二. java.lang.String 该类为字符串,在Java中所有字符串…

chatgpt赋能python:如何正确删掉Python代码

如何正确删掉Python代码 介绍 在编写Python代码时&#xff0c;难免会出现一些多余或者错误的代码。为了保持代码的整洁和高效&#xff0c;我们需要学会如何正确地删掉Python代码。本文将介绍一些实用的方法和技巧&#xff0c;帮助您轻松删除不必要的代码。 方法 1. 手动删除…

前端基于radio增强单选框组件

前端基于radio增强单选框组件, 下载完整代码请访问uni-app插件市场地址:https://ext.dcloud.net.cn/plugin?id12977 效果图如下: # #### 使用方法 使用方法 <!-- radioData:单选数据 curIndex&#xff1a;当前选择序列 change&#xff1a;单选事件 --> <ccRadio…

软考A计划-系统架构师-学习笔记-第一弹

点击跳转专栏>Unity3D特效百例点击跳转专栏>案例项目实战源码点击跳转专栏>游戏脚本-辅助自动化点击跳转专栏>Android控件全解手册点击跳转专栏>Scratch编程案例点击跳转>软考全系列 &#x1f449;关于作者 专注于Android/Unity和各种游戏开发技巧&#xff…

QNX交叉编译及运行摆脱IDE

工具链及Demo工程介绍 把交叉编译工具链qnx_cross_compile_toolchain.zip拷贝到交叉编译主机目录下&#xff0c;用unzip命令解压&#xff08;不会unzip可以自行百度linux 下unzip命令&#xff09;&#xff0c;如Ubuntu22.04等。 解压后可以用vscode打开交叉编译工具链的目录。…

JavaScript 流程控制-分支 流程控制-循环

3.1分支结构 由上到下执行代码的过程中&#xff0c;根据不同的条件&#xff0c;执行不同的路径代码(执行代码多选一的过程&#xff09;&#xff0c;从而得到不同的结果。 JS语言提供了两种分支语句 if语句switch 语句 3.2 if 语句 1.语句结构 //条件成立执行代码&#xff…

Java入门之String学习随记(二)

一. 字符串的常用方法 public char charAt(int index) 根据索引返回字符 public int length() 返回字符串的长度 注意:获得字符串的长度和获得数组的长度不同,数组的长度是数组的属性 数组名.length() 属性 字符串.length() …

通知神器——java调用钉钉群自定义机器人----Jay

其中webhook非常重要&#xff0c;下文详述。点击设置说明可以看相关使用文档&#xff0c;文档链接见本文末尾 创建群自定义机器人 其中webhook非常重要&#xff0c;下文详述。点击设置说明可以看相关使用文档&#xff0c;文档链接见本文末尾 使用HTTP POST请求发送消息…

如何从linux社区下载和合入内核patch?

参考 git - How do I get a linux kernel patch set from the mailing list? - Unix & Linux Stack Exchangehttps://unix.stackexchange.com/questions/80519/how-do-i-get-a-linux-kernel-patch-set-from-the-mailing-list 方法 发现使用b4这个工具非常合适。 下面是…

【MySQL】数据库的查询语言DQL

目录 前言&#xff1a; 一.基本查询 1.1查询多个字段 1.2设置别名 1.3去除字段中重复的值 二.条件查询 2.1条件的种类 2.1.1比较运算符 2.1.2逻辑运算符 三.结尾 前言&#xff1a; 在前面讲完了如何增删改数据表中的记录后&#xff0c;那么如何使用这些数据就成了另一…

chatgpt赋能python:Python如何加断点

Python如何加断点 什么是断点 在程序执行时&#xff0c;开发人员可以设置断点&#xff0c;使得程序在断点处暂停执行&#xff0c;从而方便调试程序。当程序停在断点处时&#xff0c;可以查看变量的值、执行语句等&#xff0c;以找出程序中的错误。 Python加断点的方法 在Py…

chatgpt赋能python:Python中的元组及其自身的特性说明

Python 中的元组及其自身的特性说明 在 Python 中&#xff0c;元组是一组有序的值&#xff0c;可以存储各种不同类型的数据。与列表不同的是&#xff0c;元组是不可变的&#xff0c;一旦创建就不能修改。由于元组不可更改&#xff0c;因此它们的值在创建后是固定的。 由于元组…

C语言之预处理那点事

文章目录 一、程序的翻译和执行环境二、预定义符号的介绍1.预定义符号2.#define3.宏和函数的比较4.条件编译 总结 在C语言中&#xff0c;曾出现各种各样新的标准&#xff0c;有的昙花一现&#xff0c;有的则源远流传。我们这篇来看流传下来的&#xff0c;简化开发者编程和提升性…

FFmpeg音视频处理工具介绍及应用

1 FFmpeg介绍 FFmpeg项目由 Fabrice Bellard在2000年创立。到目前为止&#xff0c;FFmpeg项目的开发者仍然与VLC、MPV、dav1d、x264等多媒体开源项目有着广泛的重叠。Ffmpeg&#xff08;FastForward Mpeg&#xff09;是一款遵循GPL的开源软件&#xff0c;在音视频处理方面表现…

算法刷题-数组-移除元素

27. 移除元素 力扣题目链接 给你一个数组 nums 和一个值 val&#xff0c;你需要 原地 移除所有数值等于 val 的元素&#xff0c;并返回移除后数组的新长度。 不要使用额外的数组空间&#xff0c;你必须仅使用 O(1) 额外空间并原地修改输入数组。 元素的顺序可以改变。你不需…

chatgpt赋能python:Python如何编写优化SEO的软件

Python如何编写优化SEO的软件 作为一种功能强大且易于学习的编程语言&#xff0c;Python已经成为广泛使用的开发工具之一&#xff0c;其用户群体涵盖从初学者到专业开发人员。然而&#xff0c;在Python编写SEO相关软件时&#xff0c;开发人员需要遵循一些最佳实践&#xff0c;…

chatgpt赋能python:Python中如何加空格

Python中如何加空格 Python是一门广泛应用于科学计算、数据分析、人工智能、Web开发等领域的高级编程语言。在Python编程过程中&#xff0c;经常需要使用到空格&#xff0c;以实现程序的格式化和美观&#xff0c;同时也有助于提高代码的可读性和可维护性。本文主要介绍Python中…

人工蜂群算法(Artificial Bee Colony (ABC) Algorithm,附简单案例及详细matlab源码)

作者&#xff1a;非妃是公主 专栏&#xff1a;《智能优化算法》 博客地址&#xff1a;https://blog.csdn.net/myf_666 个性签&#xff1a;顺境不惰&#xff0c;逆境不馁&#xff0c;以心制境&#xff0c;万事可成。——曾国藩 文章目录 专栏推荐一、人工蜂群算法二、伪代码三…