| 646 | } |
| 647 | |
| 648 | void asCBuilder::ParseScripts() |
| 649 | { |
| 650 | TimeIt("asCBuilder::ParseScripts"); |
| 651 | |
| 652 | asCArray<asCParser*> parsers((int)scripts.GetLength()); |
| 653 | |
| 654 | // Parse all the files as if they were one |
| 655 | asUINT n = 0; |
| 656 | for( n = 0; n < scripts.GetLength(); n++ ) |
| 657 | { |
| 658 | asCParser *parser = asNEW(asCParser)(this); |
| 659 | if( parser != 0 ) |
| 660 | { |
| 661 | parsers.PushLast(parser); |
| 662 | |
| 663 | // Parse the script file |
| 664 | parser->ParseScript(scripts[n]); |
| 665 | } |
| 666 | } |
| 667 | |
| 668 | if (numErrors == 0) |
| 669 | { |
| 670 | // Register namespace visibility |
| 671 | for (n = 0; n < scripts.GetLength(); n++) |
| 672 | { |
| 673 | asCScriptNode* node = parsers[n]->GetScriptNode(); |
| 674 | RegisterNamespaceVisibility(node, scripts[n], engine->nameSpaces[0]); |
| 675 | } |
| 676 | |
| 677 | // Find all type declarations |
| 678 | for (n = 0; n < scripts.GetLength(); n++) |
| 679 | { |
| 680 | asCScriptNode *node = parsers[n]->GetScriptNode(); |
| 681 | RegisterTypesFromScript(node, scripts[n], engine->nameSpaces[0]); |
| 682 | } |
| 683 | |
| 684 | // Before moving forward the builder must establish the relationship between types |
| 685 | // so that a derived type can see the child types of the parent type. |
| 686 | DetermineTypeRelations(); |
| 687 | |
| 688 | // Complete function definitions (defining returntype and parameters) |
| 689 | for( n = 0; n < funcDefs.GetLength(); n++ ) |
| 690 | CompleteFuncDef(funcDefs[n]); |
| 691 | |
| 692 | // Find other global nodes |
| 693 | for (n = 0; n < scripts.GetLength(); n++) |
| 694 | { |
| 695 | // Find other global nodes |
| 696 | asCScriptNode *node = parsers[n]->GetScriptNode(); |
| 697 | RegisterNonTypesFromScript(node, scripts[n], engine->nameSpaces[0]); |
| 698 | } |
| 699 | |
| 700 | // Register script methods found in the interfaces |
| 701 | for( n = 0; n < interfaceDeclarations.GetLength(); n++ ) |
| 702 | { |
| 703 | sClassDeclaration *decl = interfaceDeclarations[n]; |
| 704 | asCScriptNode *node = decl->node->firstChild->next; |
| 705 |
nothing calls this directly
no test coverage detected