tok_typedef FieldType tok_identifier TypeAnnotations
{
pdebug("TypeDef -> tok_typedef FieldType tok_identifier");
+ validate_simple_identifier( $3);
t_typedef *td = new t_typedef(g_program, $2, $3);
$$ = td;
if ($4 != NULL) {
{
pdebug("Enum -> tok_enum tok_identifier { EnumDefList }");
$$ = $4;
+ validate_simple_identifier( $2);
$$->set_name($2);
if ($6 != NULL) {
$$->annotations_ = $6->annotations_;
if ($4 > INT_MAX) {
pwarning(1, "64-bit value supplied for enum %s.\n", $2);
}
+ validate_simple_identifier( $2);
$$ = new t_enum_value($2, $4);
if ($1 != NULL) {
$$->set_doc($1);
CaptureDocText tok_identifier TypeAnnotations CommaOrSemicolonOptional
{
pdebug("EnumDef -> tok_identifier");
+ validate_simple_identifier( $2);
$$ = new t_enum_value($2);
if ($1 != NULL) {
$$->set_doc($1);
tok_senum tok_identifier '{' SenumDefList '}' TypeAnnotations
{
pdebug("Senum -> tok_senum tok_identifier { SenumDefList }");
+ validate_simple_identifier( $2);
$$ = new t_typedef(g_program, $4, $2);
if ($6 != NULL) {
$$->annotations_ = $6->annotations_;
{
pdebug("Const -> tok_const FieldType tok_identifier = ConstValue");
if (g_parse_mode == PROGRAM) {
+ validate_simple_identifier( $3);
g_scope->resolve_const_value($5, $2);
$$ = new t_const($2, $3, $5);
validate_const_type($$);
StructHead tok_identifier XsdAll '{' FieldList '}' TypeAnnotations
{
pdebug("Struct -> tok_struct tok_identifier { FieldList }");
+ validate_simple_identifier( $2);
$5->set_xsd_all($3);
$5->set_union($1 == struct_is_union);
$$ = $5;
tok_xception tok_identifier '{' FieldList '}' TypeAnnotations
{
pdebug("Xception -> tok_xception tok_identifier { FieldList }");
+ validate_simple_identifier( $2);
$4->set_name($2);
$4->set_xception(true);
$$ = $4;
tok_service tok_identifier Extends '{' FlagArgs FunctionList UnflagArgs '}' TypeAnnotations
{
pdebug("Service -> tok_service tok_identifier { FunctionList }");
+ validate_simple_identifier( $2);
$$ = $6;
$$->set_name($2);
$$->set_extends($3);
Function:
CaptureDocText Oneway FunctionType tok_identifier '(' FieldList ')' Throws TypeAnnotations CommaOrSemicolonOptional
{
+ validate_simple_identifier( $4);
$6->set_name(std::string($4) + "_args");
$$ = new t_function($3, $4, $6, $8, $2);
if ($1 != NULL) {
exit(1);
}
}
+ validate_simple_identifier($5);
$$ = new t_field($4, $5, $2.value);
$$->set_req($3);
if ($6 != NULL) {