📄 psdl.yy
字号:
storagehome_member : key_dcl TAO_PSDL_SEMI
{ $$ = new TAO_PSDL_Storagehome_Member ($1); }
|
primary_key_dcl TAO_PSDL_SEMI
{ $$ = new TAO_PSDL_Storagehome_Member ($1); }
;
storagehome_inh_spec : TAO_PSDL_COLON storagehome_name
{ $$ = new TAO_PSDL_Storagehome_Inh_Spec ($2); }
;
storagehome_name : scoped_name
{ $$ = new TAO_PSDL_Storagehome_Name ($1); }
;
storagehome_impl_spec : TAO_PSDL_IMPLEMENTS abstract_storagehome_name
{ $$ = new TAO_PSDL_Storagehome_Impl_Spec ($2); }
;
primary_key_dcl : TAO_PSDL_PRIMARY TAO_PSDL_KEY identifier
{ $$ = new TAO_PSDL_Primary_Key_Dcl ($3); }
|
TAO_PSDL_PRIMARY TAO_PSDL_KEY TAO_PSDL_REF
{ $$ = new TAO_PSDL_Primary_Key_Dcl (); }
;
identifier: TAO_PSDL_IDENT
{ $$ = $1; }
;
type_dcl : TAO_PSDL_TYPEDEF type_declarator
{ $$ = new TAO_PSDL_Type_Dcl (TAO_PSDL_TYPEDEF, $2); }
|
struct_type
{ $$ = new TAO_PSDL_Type_Dcl ($1); }
|
union_type
{ $$ = new TAO_PSDL_Type_Dcl ($1); }
|
enum_type
{ $$ = new TAO_PSDL_Type_Dcl ($1); }
|
TAO_PSDL_NATIVE simple_declarator
{ $$ = new TAO_PSDL_Type_Dcl (TAO_PSDL_NATIVE, $2); }
|
constr_forward_decl
{ $$ = new TAO_PSDL_Type_Dcl ($1); }
;
type_declarator : type_spec declarators
{ $$ = new TAO_PSDL_Type_Declarator ($1, $2); }
;
type_spec : simple_type_spec
{ $$ = new TAO_PSDL_Type_Spec ($1); }
|
constr_type_spec
{ $$ = new TAO_PSDL_Type_Spec ($1); }
;
simple_type_spec : base_type_spec
{ $$ = new TAO_PSDL_Simple_Type_Spec ($1); }
|
template_type_spec
{ $$ = new TAO_PSDL_Simple_Type_Spec ($1); }
|
scoped_name
{ $$ = new TAO_PSDL_Simple_Type_Spec ($1); }
;
base_type_spec : floating_pt_type
{ $$ = new TAO_PSDL_Base_Type_Spec ($1); }
|
integer_type
{ $$ = new TAO_PSDL_Base_Type_Spec ($1); }
|
char_type
{ $$ = new TAO_PSDL_Base_Type_Spec ($1); }
|
wide_char_type
{ $$ = new TAO_PSDL_Base_Type_Spec ($1); }
|
boolean_type
{ $$ = new TAO_PSDL_Base_Type_Spec ($1); }
|
octet_type
{ $$ = new TAO_PSDL_Base_Type_Spec ($1); }
|
any_type
{ $$ = new TAO_PSDL_Base_Type_Spec ($1); }
|
object_type
{ $$ = new TAO_PSDL_Base_Type_Spec ($1); }
|
value_base_type
{ $$ = new TAO_PSDL_Base_Type_Spec ($1); }
;
template_type_spec : sequence_type
{ $$ = new TAO_PSDL_Template_Type_Spec ($1); }
|
string_type
{ $$ = new TAO_PSDL_Template_Type_Spec ($1); }
|
wide_string_type
{ $$ = new TAO_PSDL_Template_Type_Spec ($1); }
|
fixed_pt_type
{ $$ = new TAO_PSDL_Template_Type_Spec ($1); }
;
constr_type_spec : struct_type
{ $$ = new TAO_PSDL_Constr_Type_Spec ($1); }
|
union_type
{ $$ = new TAO_PSDL_Constr_Type_Spec ($1); }
|
enum_type
{ $$ = new TAO_PSDL_Constr_Type_Spec ($1); }
;
declarators : declarator
{ $$ = new TAO_PSDL_Declarators ($1); }
|
declarator TAO_PSDL_COMMA declarators
{ $$ = new TAO_PSDL_Declarators ($1, $3); }
;
declarator : simple_declarator
{ $$ = new TAO_PSDL_Declarator ($1); }
|
complex_declarator
{ $$ = new TAO_PSDL_Declarator ($1); }
;
simple_declarator : identifier
{ $$ = $1; }
;
simple_declarator_list : simple_declarator
{ $$ = new TAO_PSDL_Simple_Declarator_List ($1); }
|
simple_declarator_list TAO_PSDL_COMMA simple_declarator
{ $$ = new TAO_PSDL_Simple_Declarator_List ($1, $3); }
;
complex_declarator : array_declarator
{ $$ = new TAO_PSDL_Complex_Declarator ($1); }
;
floating_pt_type : TAO_PSDL_FLOAT
{ $$ = new TAO_PSDL_Predefined_Type (TAO_PSDL_FLOAT); }
|
TAO_PSDL_DOUBLE
{ $$ = new TAO_PSDL_Predefined_Type (TAO_PSDL_DOUBLE); }
|
TAO_PSDL_LONG TAO_PSDL_DOUBLE
{ $$ = new TAO_PSDL_Predefined_Type (TAO_PSDL_LONG, TAO_PSDL_DOUBLE); }
;
integer_type : signed_int
{ $$ = $1; }
|
unsigned_int
{ $$ = $1; }
;
signed_int : signed_short_int
{ $$ = $1; }
|
signed_long_int
{ $$ = $1; }
|
signed_longlong_int
{ $$ = $1; }
;
signed_short_int : TAO_PSDL_SHORT
{ $$ = new TAO_PSDL_Predefined_Type (TAO_PSDL_SHORT); }
;
signed_long_int : TAO_PSDL_LONG
{ $$ = new TAO_PSDL_Predefined_Type (TAO_PSDL_LONG); }
;
signed_longlong_int : TAO_PSDL_LONG TAO_PSDL_LONG
{ $$ = new TAO_PSDL_Predefined_Type (TAO_PSDL_LONG, TAO_PSDL_LONG); }
;
unsigned_int : unsigned_short_int
{ $$ = new TAO_PSDL_Predefined_Type ($1); }
|
unsigned_long_int
{ $$ = new TAO_PSDL_Predefined_Type ($1); }
|
unsigned_longlong_int
{ $$ = new TAO_PSDL_Predefined_Type ($1); }
;
unsigned_short_int : TAO_PSDL_UNSIGNED TAO_PSDL_SHORT
{ $$ = new TAO_PSDL_Predefined_Type (TAO_PSDL_UNSIGNED, TAO_PSDL_SHORT); }
;
unsigned_long_int : TAO_PSDL_UNSIGNED TAO_PSDL_LONG
{ $$ = new TAO_PSDL_Predefined_Type (TAO_PSDL_UNSIGNED, TAO_PSDL_LONG); }
;
unsigned_longlong_int : TAO_PSDL_UNSIGNED TAO_PSDL_LONG TAO_PSDL_LONG
{ $$ = new TAO_PSDL_Predefined_Type (TAO_PSDL_UNSIGNED, TAO_PSDL_LONG, TAO_PSDL_LONG); }
;
char_type : TAO_PSDL_CHAR
{ $$ = new TAO_PSDL_Predefined_Type (TAO_PSDL_CHAR); }
;
wide_char_type : TAO_PSDL_WCHAR
{ $$ = new TAO_PSDL_Predefined_Type (TAO_PSDL_WCHAR); }
;
boolean_type : TAO_PSDL_BOOLEAN
{ $$ = new TAO_PSDL_Predefined_Type (TAO_PSDL_BOOLEAN); }
;
octet_type : TAO_PSDL_OCTET
{ $$ = new TAO_PSDL_Predefined_Type (TAO_PSDL_OCTET); }
;
any_type : TAO_PSDL_ANY
{ $$ = new TAO_PSDL_Predefined_Type (TAO_PSDL_ANY); }
;
object_type : TAO_PSDL_OBJECT
{ $$ = new TAO_PSDL_Predefined_Type (TAO_PSDL_OBJECT); }
;
struct_type : TAO_PSDL_STRUCT identifier
{
int good_struct_name = TAO_PSDL_Scope::instance ()->pop_top_scope ()->add_struct (TAO_PSDL_Scope::instance ()->get_identifier ());
if (good_struct_name == -1)
YYABORT;
}
TAO_PSDL_OPEN_CURLY_BRACE member_list TAO_PSDL_CLOSE_CURLY_BRACE
{
TAO_PSDL_Scope::instance ()->set_scope ();
$$ = new TAO_PSDL_Predefined_Type (TAO_PSDL_STRUCT, $2, $5); }
;
member_list : member
{ $$ = new TAO_PSDL_Member_List ($1); }
|
member member_list
{ $$ = new TAO_PSDL_Member_List ($1, $2); }
;
member : type_spec declarators TAO_PSDL_SEMI
{ $$ = new TAO_PSDL_Member ($1, $2); }
;
union_type : TAO_PSDL_UNION identifier TAO_PSDL_SWITCH TAO_PSDL_OPEN_BRACE switch_type_spec TAO_PSDL_CLOSE_BRACE TAO_PSDL_OPEN_CURLY_BRACE switch_body TAO_PSDL_CLOSE_CURLY_BRACE
{ $$ = new TAO_PSDL_Predefined_Type ($2, $5, $8); }
;
switch_type_spec : integer_type
{ $$ = new TAO_PSDL_Switch_Type_Spec ($1); }
|
char_type
{ $$ = new TAO_PSDL_Switch_Type_Spec ($1); }
|
boolean_type
{ $$ = new TAO_PSDL_Switch_Type_Spec ($1); }
|
enum_type
{ $$ = new TAO_PSDL_Switch_Type_Spec ($1); }
|
scoped_name
{ $$ = new TAO_PSDL_Switch_Type_Spec ($1); }
;
switch_body : case
{ $$ = new TAO_PSDL_Switch_Body ($1); }
|
case switch_body
{ $$ = new TAO_PSDL_Switch_Body ($1, $2); }
;
case : case_label element_spec TAO_PSDL_SEMI
{ $$ = new TAO_PSDL_Case ($1, $2); }
;
case_label : TAO_PSDL_CASE const_exp TAO_PSDL_COLON
{ $$ = new TAO_PSDL_Case_Label ($1, $2); }
|
TAO_PSDL_DEFAULT TAO_PSDL_COLON
{ $$ = new TAO_PSDL_Case_Label ($1); }
|
TAO_PSDL_CASE const_exp TAO_PSDL_COLON case_label
{ $$ = new TAO_PSDL_Case_Label ($1, $2, $4); }
|
TAO_PSDL_DEFAULT TAO_PSDL_COLON case_label
{ $$ = new TAO_PSDL_Case_Label ($1, $3); }
;
element_spec : type_spec declarator
{ $$ = new TAO_PSDL_Element_Spec ($1, $2); }
;
const_dcl : TAO_PSDL_CONST const_type identifier TAO_PSDL_EQUAL const_exp
{ $$ = new TAO_PSDL_Const_Dcl ($2, $3, $5); }
;
const_type : integer_type
{ $$ = new TAO_PSDL_Predefined_Type($1); }
|
char_type
{ $$ = new TAO_PSDL_Predefined_Type($1); }
|
wide_char_type
{ $$ = new TAO_PSDL_Predefined_Type($1); }
|
boolean_type
{ $$ = new TAO_PSDL_Predefined_Type($1); }
|
floating_pt_type
{ $$ = new TAO_PSDL_Predefined_Type($1); }
|
string_type
{ $$ = new TAO_PSDL_Predefined_Type($1); }
|
wide_string_type
{ $$ = new TAO_PSDL_Predefined_Type($1); }
|
fixed_pt_const_type
{ $$ = new TAO_PSDL_Predefined_Type($1); }
|
scoped_name
{ $$ = new TAO_PSDL_Predefined_Type($1); }
|
octet_type
{ $$ = new TAO_PSDL_Predefined_Type($1); }
;
const_exp : or_expr
{ $$ = new TAO_PSDL_Const_Exp ($1); }
;
or_expr : xor_expr
{ $$ = new TAO_PSDL_Or_Expr ($1); }
|
or_expr TAO_PSDL_OR xor_expr
{ $$ = new TAO_PSDL_Or_Expr ($1, $3); }
;
xor_expr : and_expr
{ $$ = new TAO_PSDL_Xor_Expr ($1); }
|
xor_expr TAO_PSDL_XOR and_expr
{ $$ = new TAO_PSDL_Xor_Expr ($1, $3); }
;
and_expr : shift_expr
{ $$ = new TAO_PSDL_And_Expr ($1); }
|
and_expr TAO_PSDL_AND shift_expr
{ $$ = new TAO_PSDL_And_Expr ($1, $3); }
;
shift_expr : add_expr
{ $$ = new TAO_PSDL_Shift_Expr ($1); }
|
shift_expr TAO_PSDL_RIGHT_SHIFT add_expr
{ $$ = new TAO_PSDL_Shift_Expr ($1, $2, $3); }
|
shift_expr TAO_PSDL_LEFT_SHIFT add_expr
{ $$ = new TAO_PSDL_Shift_Expr ($1, $2, $3); }
;
add_expr : mult_expr
{ $$ = new TAO_PSDL_Add_Expr ($1); }
|
add_expr TAO_PSDL_PLUS mult_expr
{ $$ = new TAO_PSDL_Add_Expr ($1, $2, $3); }
|
add_expr TAO_PSDL_MINUS mult_expr
{ $$ = new TAO_PSDL_Add_Expr ($1, $2, $3); }
;
mult_expr : unary_expr
{ $$ = new TAO_PSDL_Mult_Expr ($1); }
|
mult_expr TAO_PSDL_MULT unary_expr
{ $$ = new TAO_PSDL_Mult_Expr ($1, $3); }
|
mult_expr TAO_PSDL_DIV unary_expr
{ $$ = new TAO_PSDL_Mult_Expr ($1, $3); }
|
mult_expr TAO_PSDL_PERCENT unary_expr
{ $$ = new TAO_PSDL_Mult_Expr ($1, $3); }
;
unary_expr : unary_operator primary_expr
{ $$ = new TAO_PSDL_Unary_Expr ($1, $2); }
|
primary_expr
{ $$ = new TAO_PSDL_Unary_Expr ($1); }
;
unary_operator : TAO_PSDL_MINUS
{ $$ = $1; }
|
TAO_PSDL_PLUS
{ $$ = $1; }
|
TAO_PSDL_TILDA
{ $$ = $1; }
;
primary_expr : scoped_name
{ $$ = new TAO_PSDL_Primary_Expr ($1); }
|
literal
{ $$ = new TAO_PSDL_Primary_Expr ($1); }
|
TAO_PSDL_OPEN_BRACE const_exp TAO_PSDL_CLOSE_BRACE
{ $$ = new TAO_PSDL_Primary_Expr ($2); }
;
except_header : TAO_PSDL_EXCEPTION identifier
{
int good_except_name = TAO_PSDL_Scope::instance ()->pop_top_scope ()->add_exception (TAO_PSDL_Scope::instance ()->get_identifier ());
if (good_except_name == -1)
YYABORT;
$$ = $2;
}
;
except_dcl : except_header TAO_PSDL_OPEN_CURLY_BRACE member_list TAO_PSDL_CLOSE_CURLY_BRACE
{
TAO_PSDL_Scope::instance ()->set_scope ();
$$ = new TAO_PSDL_Except_Dcl ($1, $3);
}
|
except_header TAO_PSDL_OPEN_CURLY_BRACE TAO_PSDL_CLOSE_CURLY_BRACE
{
TAO_PSDL_Scope::instance ()->set_scope ();
$$ = new TAO_PSDL_Except_Dcl ($1);
}
;
op_name : identifier
{
int good_op_dcl_name = TAO_PSDL_Scope::instance ()->pop_top_scope ()->add_op_dcl (TAO_PSDL_Scope::instance ()->get_identifier ());
if (good_op_dcl_name == -1)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -