| 275 | } |
| 276 | |
| 277 | bool ast_structureAlias ( yyscan_t scanner, string * name, TypeDecl * typeDecl, const LineInfo & atName ) { |
| 278 | if (!typeDecl->alias.empty()) { |
| 279 | das_yyerror(scanner,"alias is already defined "+typeDecl->alias, atName, |
| 280 | CompilationError::already_declared_type_alias); |
| 281 | delete name; |
| 282 | delete typeDecl; |
| 283 | return false; |
| 284 | } |
| 285 | typeDecl->alias = *name; |
| 286 | delete name; |
| 287 | if ( !yyextra->g_thisStructure ) { |
| 288 | das_yyerror(scanner,"typedef outside of structure", atName, |
| 289 | CompilationError::invalid_type_alias); |
| 290 | delete typeDecl; |
| 291 | return false; |
| 292 | } |
| 293 | if ( yyextra->g_thisStructure->aliases.find(typeDecl->alias) ) { |
| 294 | das_yyerror(scanner,"alias is already defined "+typeDecl->alias, atName, |
| 295 | CompilationError::already_declared_type_alias); |
| 296 | delete typeDecl; |
| 297 | return false; |
| 298 | } |
| 299 | yyextra->g_thisStructure->aliases.insert(typeDecl->alias, typeDecl); |
| 300 | return true; |
| 301 | } |
| 302 | |
| 303 | void ast_structureDeclaration ( yyscan_t scanner, AnnotationList * annL, const LineInfo & loc, Structure * ps, |
| 304 | const LineInfo & atPs, vector<VariableDeclaration*> * list ) { |