icparse.yrl
来自「OTP是开放电信平台的简称」· YRL 代码 · 共 863 行 · 第 1/2 页
YRL
863 行
'<unary_expr>' -> '<unary_operator>' '<primary_expr>' : {'$1', '$2'} .'<unary_expr>' -> '<primary_expr>' : '$1' .%% (22)'<unary_operator>' -> '-' : '$1' .'<unary_operator>' -> '+' : '$1' .'<unary_operator>' -> '~' : '$1' .%% (23)'<primary_expr>' -> '<scoped_name>' : '$1' .'<primary_expr>' -> '<literal>' : '$1' .'<primary_expr>' -> '(' '<const_exp>' ')' : '$2' .%% (24)'<literal>' -> '<integer_literal>' : '$1' .'<literal>' -> '<wstring_literal>' : '$1' .'<literal>' -> '<string_literal>' : '$1' .'<literal>' -> '<character_literal>' : '$1' .'<literal>' -> '<wcharacter_literal>' : '$1' .'<literal>' -> '<fixed_pt_literal>' : '$1' .'<literal>' -> '<floating_pt_literal>' : '$1' .'<literal>' -> '<boolean_literal>' : '$1' .%% (25)'<boolean_literal>' -> 'TRUE' : '$1' .'<boolean_literal>' -> 'FALSE' : '$1' .%% (26)'<positive_int_const>' -> '<const_exp>' : '$1' .%% (27)'<type_dcl>' -> 'typedef' '<type_declarator>' : '$2' .'<type_dcl>' -> '<struct_type>' : '$1' .'<type_dcl>' -> '<union_type>' : '$1' .'<type_dcl>' -> '<enum_type>' : '$1' .%% (28) NIY multiple declarators (FIXED)'<type_declarator>' -> '<type_spec>' '<declarators>' : #typedef{type='$1', id='$2'} . %%%ic:unfold(#typedef{type='$1', id='$2'}) .%%'<type_declarator>' -> '<type_spec>' '<declarator>'%% : #typedef{type='$1', id='$2'} . %% (29)'<type_spec>' -> '<simple_type_spec>' : '$1' .'<type_spec>' -> '<constr_type_spec>' : '$1' .%% (30)'<simple_type_spec>' -> '<base_type_spec>' : '$1' .'<simple_type_spec>' -> '<template_type_spec>' : '$1' .'<simple_type_spec>' -> '<scoped_name>' : '$1' .%% (31)'<base_type_spec>' -> '<floating_pt_type>' : '$1' .'<base_type_spec>' -> '<integer_type>' : '$1' .'<base_type_spec>' -> '<char_type>' : '$1' .'<base_type_spec>' -> '<boolean_type>' : '$1' .'<base_type_spec>' -> '<octet_type>' : '$1' .'<base_type_spec>' -> '<any_type>' : '$1' .'<base_type_spec>' -> 'Object' : '$1' . %% NON Standard, isn't a base type%% (32)'<template_type_spec>' -> '<sequence_type>' : '$1' .'<template_type_spec>' -> '<string_type>' : '$1' .'<template_type_spec>' -> '<fixed_pt_type>' : '$1' .%% (33)'<constr_type_spec>' -> '<struct_type>' : '$1' .'<constr_type_spec>' -> '<union_type>' : '$1' .'<constr_type_spec>' -> '<enum_type>' : '$1' .%% (34)'<declarators>' -> '<declarator>' 'ZorM_<declarator>': ['$1' | reverse('$2')] .%% Added clause'ZorM_<declarator>' -> '$empty' : [] .'ZorM_<declarator>' -> 'ZorM_<declarator>' ',' '<declarator>': ['$3' | '$1'] .%% (35)'<declarator>' -> '<simple_declarator>' : '$1' .'<declarator>' -> '<complex_declarator>' : '$1' .%% (36)'<simple_declarator>' -> '<identifier>' : '$1' .%% (37)'<complex_declarator>' -> '<array_declarator>' : '$1' .%% (38)'<floating_pt_type>' -> 'float' : '$1' .'<floating_pt_type>' -> 'double' : '$1' .%% (39)'<integer_type>' -> '<signed_int>' : '$1' .'<integer_type>' -> '<unsigned_int>' : {'unsigned', '$1'} .%% (40)'<signed_int>' -> '<signed_long_int>' : '$1' .'<signed_int>' -> '<signed_short_int>' : '$1' .%% (41)'<signed_long_int>' -> 'long' : '$1' .'<signed_long_int>' -> 'long' 'long': {'long long', element(2,'$2')} .%% (42)'<signed_short_int>' -> 'short' : '$1' .%% (43)'<unsigned_int>' -> '<unsigned_long_int>' : '$1' .'<unsigned_int>' -> '<unsigned_short_int>' : '$1' .%% (44)'<unsigned_long_int>' -> 'unsigned' 'long' : '$2' .'<unsigned_long_int>' -> 'unsigned' 'long' 'long' : {'long long', element(2,'$2')} . %% ULLONG%% (45)'<unsigned_short_int>' -> 'unsigned' 'short' : '$2' .%% (46)'<char_type>' -> 'char' : '$1' .'<char_type>' -> 'wchar' : '$1' . %% WCHAR%% (47)'<boolean_type>' -> 'boolean' : '$1' .%% (48)'<octet_type>' -> 'octet' : '$1' .%% (49)'<any_type>' -> 'any' : '$1' .%%'<fixed_pt_const_type>' -> 'fixed' : '$1'.%% (50) NIY: unfolding of struct decls (FIXED)%%'<struct_type>' -> 'struct' '<identifier>' '{' '<member_list>' '}'%% : #struct{id='$2', body=ic:unfold('$4')} .'<struct_type>' -> 'struct' '<identifier>' '{' '<member_list>' '}' : #struct{id='$2', body='$4'} .%% (51)'<member_list>' -> 'OorM_<member>' : reverse('$1') .%% Added clause%%'OorM_<member>' -> '<member>' : ['$1'] .%%'OorM_<member>' -> 'OorM_<member>' '<member>'%% : ['$2' | '$1'] .'OorM_<member>' -> '<member>' : '$1' .'OorM_<member>' -> 'OorM_<member>' '<member>' : '$2' ++ '$1' .%% (52) NIY: member multiple declarators (FIXED)%%'<member>' -> '<type_spec>' '<declarators>' ';'%% : #member{type='$1', id='$2'} .'<member>' -> 'Ugly_pragmas' '<type_spec>' '<declarators>' 'Ugly_pragmas' ';' 'Ugly_pragmas' : '$1' ++ '$4' ++ '$6' ++ [#member{type='$2', id='$3'}] .%% (53) NIY: unfolding of union cases (FIXED)%%'<union_type>' -> 'union' '<identifier>' 'switch' %% '(' '<switch_type_spec>' ')' '{' '<switch_body>' '}'%% : #union{id='$2', type='$5', body=ic:unfold('$8')} .'<union_type>' -> 'union' '<identifier>' 'switch' '(' '<switch_type_spec>' ')' '{' '<switch_body>' '}' : #union{id='$2', type='$5', body='$8'} .%% (54)'<switch_type_spec>' -> '<integer_type>' : '$1' .'<switch_type_spec>' -> '<char_type>' : '$1' .'<switch_type_spec>' -> '<boolean_type>' : '$1' .'<switch_type_spec>' -> '<enum_type>' : '$1' .'<switch_type_spec>' -> '<scoped_name>' : '$1' .%% (55)'<switch_body>' -> 'OorM_<case>' : reverse(lists:flatten('$1')) .%%'<switch_body>' -> 'OorM_<case>' : '$1' .%% Added clause'OorM_<case>' -> '<case>' : ['$1'] .'OorM_<case>' -> 'OorM_<case>' '<case>' : ['$2' | '$1'] .%% (56) NIY thing: multiple case labels (FIXED)%%'<case>' -> 'OorM_<case_label>' '<element_spec>' ';'%% : '$2'#case_dcl{label=reverse('$1')} .'<case>' -> 'Ugly_pragmas' 'OorM_<case_label>' 'Ugly_pragmas' '<element_spec>' 'Ugly_pragmas' ';' 'Ugly_pragmas' : '$1' ++ '$3' ++ '$5' ++ '$7' ++ [ '$4'#case_dcl{label=reverse('$2')} ] . %% Added clause%%'OorM_<case_label>' -> '<case_label>' : ['$1'] .%%'OorM_<case_label>' -> 'OorM_<case_label>' '<case_label>' : ['$2' | '$1'] .'OorM_<case_label>' -> 'Ugly_pragmas' '<case_label>' 'Ugly_pragmas' : '$1' ++ ['$2'] ++ '$3' .'OorM_<case_label>' -> 'OorM_<case_label>' 'Ugly_pragmas' '<case_label>' 'Ugly_pragmas' : '$2' ++ ['$3'|'$1'] ++ '$4'.%% (57)'<case_label>' -> 'case' '<const_exp>' ':' : '$2' .'<case_label>' -> 'default' ':' : '$1' .%% (58)'<element_spec>' -> '<type_spec>' '<declarator>': #case_dcl{type='$1', id='$2'} .%% (59)%%'<enum_type>' -> 'enum' '<identifier>' %%'{' '<enumerator>' 'ZorM_<enumerator>' '}'%%: #enum{id='$2', body=['$4' | reverse('$5')]} .'<enum_type>' -> 'enum' '<identifier>' '{' 'Ugly_pragmas' '<enumerator>' 'Ugly_pragmas' 'ZorM_<enumerator>' 'Ugly_pragmas' '}': #enum{id='$2', body='$4'++'$6'++'$8'++['$5' | reverse('$7')]} .%% Added clause%%'ZorM_<enumerator>' -> '$empty' : [] .%%'ZorM_<enumerator>' -> 'ZorM_<enumerator>' ',' '<enumerator>' : ['$3' | '$1'] .'ZorM_<enumerator>' -> '$empty' : [] .'ZorM_<enumerator>' -> 'ZorM_<enumerator>' 'Ugly_pragmas' ',' 'Ugly_pragmas' '<enumerator>' : '$2'++'$4'++['$5' | '$1'] .%% (60)'<enumerator>' -> '<identifier>' : #enumerator{id='$1'} .%% (61)'<sequence_type>' -> 'sequence' '<' '<simple_type_spec>' ',' '<positive_int_const>' '>' : #sequence{type='$3', length='$5'} .'<sequence_type>' -> 'sequence' '<' '<simple_type_spec>' '>' : #sequence{type='$3'} .%% (62)'<string_type>' -> 'string' '<' '<positive_int_const>' '>' : #string{length='$3'} .'<string_type>' -> 'string' : #string{} .'<string_type>' -> 'wstring' '<' '<positive_int_const>' '>' %% WSTRING : #wstring{length='$3'} .'<string_type>' -> 'wstring' : #wstring{} . %% WSTRING%% (63)'<array_declarator>' -> '<identifier>' 'OorM_<fixed_array_size>' : #array{id='$1', size=reverse('$2')} .%% Added clause'OorM_<fixed_array_size>' -> '<fixed_array_size>' : ['$1'] .'OorM_<fixed_array_size>' -> 'OorM_<fixed_array_size>' '<fixed_array_size>' : ['$2' | '$1'] .%% (64)'<fixed_array_size>' -> '[' '<positive_int_const>' ']' : '$2' .%% (65) NIY: multiple attribute declarators (FIXED)'<attr_dcl>' -> 'Opt_readonly' 'attribute' '<param_type_spec>' '<simple_declarator>' 'ZorM_<simple_declarator>' : #attr{readonly='$1', type='$3', id=['$4' | reverse('$5')]} .%% : ic:unfold(#attr{readonly='$1', type='$3', id=['$4' | reverse('$5')]}) .%%'<attr_dcl>' -> 'Opt_readonly' 'attribute' '<param_type_spec>' %% '<simple_declarator>'%% (66) NIY: unfolding of exception bodies (FIXED)%%'<except_dcl>' -> 'exception' '<identifier>' '{' 'ZorM_<member>' '}'%% : #except{id='$2', body=ic:unfold('$4')} .'<except_dcl>' -> 'exception' '<identifier>' '{' 'ZorM_<member>' '}' : #except{id='$2', body=reverse('$4')} .%% (67)'<op_dcl>' -> 'Opt_<op_attribute>' '<op_type_spec>' '<identifier>' '<parameter_dcls>' 'Opt_<raises_expr>' 'Opt_<context_expr>' : #op{oneway='$1', type='$2', id='$3', params='$4', raises='$5', ctx='$6'} .%% Added clause'Opt_<op_attribute>' -> '$empty' : nil.'Opt_<op_attribute>' -> '<op_attribute>' : '$1'.%% (68)'<op_attribute>' -> 'oneway' : '$1' .%% (69)'<op_type_spec>' -> '<param_type_spec>' : '$1' .'<op_type_spec>' -> 'void' : '$1' .%% (70) Rewritten%'<parameter_dcls>' -> '(' '<param_dcl>' 'ZorM_<param_dcl>' ')'% : ['$2' | reverse('$3')] .%'<parameter_dcls>' -> '(' ')' : [] .'<parameter_dcls>' -> '(' 'Ugly_pragmas' '<param_dcl>' 'ZorM_<param_dcl>' ')' : '$2' ++ ['$3' | reverse('$4')] .'<parameter_dcls>' -> '(' 'Ugly_pragmas' ')' : '$2' .%% Added clause%'ZorM_<param_dcl>' -> '$empty' : [] .%'ZorM_<param_dcl>' -> 'ZorM_<param_dcl>' ',' '<param_dcl>' : ['$3' | '$1'] .'ZorM_<param_dcl>' -> 'Ugly_pragmas' : '$1' .'ZorM_<param_dcl>' -> 'ZorM_<param_dcl>' 'Ugly_pragmas' ',' 'Ugly_pragmas' '<param_dcl>' 'Ugly_pragmas' : '$2' ++ '$4' ++ '$6' ++ ['$5' | '$1'] .%% (71)'<param_dcl>' -> '<param_attribute>' '<param_type_spec>' '<simple_declarator>' : #param{inout='$1', type='$2', id='$3'} .%% (72)'<param_attribute>' -> 'in' : '$1' .'<param_attribute>' -> 'out' : '$1' .'<param_attribute>' -> 'inout' : '$1' .%% Added clause'Opt_<raises_expr>' -> '$empty' : [] .'Opt_<raises_expr>' -> '<raises_expr>' : '$1' .%% (73)'<raises_expr>' -> 'raises' '(' '<scoped_name>' 'ZorM_<scoped_name>' ')' : ['$3'| reverse('$4')] .%% Added clause'Opt_<context_expr>' -> '$empty' : [] .'Opt_<context_expr>' -> '<context_expr>' : '$1'.%% (74)'<context_expr>' -> 'context' '(' '<string_literal>' 'ZorM_<string_literal>'')' : ['$3' | reverse('$4')] .%% (75)'<param_type_spec>' -> '<base_type_spec>' : '$1' .'<param_type_spec>' -> '<string_type>' : '$1' .'<param_type_spec>' -> '<scoped_name>' : '$1' .%% (96)'<fixed_pt_type>' -> 'fixed' '<' '<positive_int_const>' ',' '<positive_int_const>' '>' : #fixed{digits='$3',scale='$5'} .%% Added clause'ZorM_<string_literal>' -> '$empty' : [] .'ZorM_<string_literal>' -> 'ZorM_<string_literal>' ',' '<string_literal>' : ['$3' | '$1'] .%% Added clause'ZorM_<simple_declarator>' -> '$empty' : [] .'ZorM_<simple_declarator>' -> 'ZorM_<simple_declarator>' ',' '<simple_declarator>' : ['$3' | '$1'] .%% Added clause%%'ZorM_<member>' -> '$empty' : [] .%%'ZorM_<member>' -> 'ZorM_<member>' '<member>' : ['$2' | '$1'] .'ZorM_<member>' -> 'Ugly_pragmas' : '$1' .'ZorM_<member>' -> 'ZorM_<member>' '<member>' : '$2' ++ '$1' .%% Added clause'Opt_readonly' -> '$empty' : nil.'Opt_readonly' -> 'readonly' : '$1'.Erlang code.%%-----------------------------------------------------------
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?