grammar XdrDeclarationGrammar rule declaration void_decl / opaque_decl / string_decl / array_decl / optional_decl / simple_decl end rule void_decl "void" end rule opaque_decl type_s:("opaque" ) space identifier size_spec:(fixed_size_spec / var_size_spec) end rule string_decl type_s:("string" ) space identifier size_spec:var_size_spec end rule array_decl type_s:type_specifier space identifier size_spec:(fixed_size_spec / var_size_spec) end rule optional_decl type_s:type_specifier ("*" space? / space? "*") identifier end rule simple_decl type_s:type_specifier space identifier end rule type_specifier (integral_type_spec / float_type_spec / boolean_type_spec / enum_type_spec / struct_type_spec / union_type_spec / (identifier )) end rule integral_type_spec (("int" ) / ("hyper" ) / ("unsigned int" )/ ("unsigned hyper" )) type_suffix end rule float_type_spec (("float" ) / ("double" ) / ("quadruple" ) ) type_suffix end rule boolean_type_spec "bool" type_suffix end rule type_suffix &(space / "*") end rule fixed_size_spec "[" size_t:size "]" end rule var_size_spec "<" size_t:size? ">" end end