コード例 #1
0
 public function createCodeChunk(TES4Branch $chunk, TES5CodeScope $codeScope, \Ormin\OBSLexicalParser\TES5\AST\Scope\TES5GlobalScope $globalScope, TES5MultipleScriptsScope $multipleScriptsScope)
 {
     $mainBranch = $this->convertSubBranch($chunk->getMainBranch(), $codeScope, $globalScope, $multipleScriptsScope);
     $branchList = $chunk->getElseifBranches();
     $convertedElseIfBranches = null;
     if ($branchList !== null) {
         $convertedElseIfBranches = new TES5SubBranchList();
         foreach ($branchList->getSubBranches() as $subBranch) {
             $convertedElseIfBranches->add($this->convertSubBranch($subBranch, $codeScope, $globalScope, $multipleScriptsScope));
         }
     }
     $elseBranch = $chunk->getElseBranch();
     $convertedElseBranch = null;
     if ($elseBranch !== null) {
         $convertedElseBranch = $this->convertElseBranch($elseBranch, $codeScope, $globalScope, $multipleScriptsScope);
     }
     $collection = new TES5CodeChunkCollection();
     $collection->add(new TES5Branch($mainBranch, $convertedElseIfBranches, $convertedElseBranch));
     return $collection;
 }
コード例 #2
0
 public function createCodeChunk()
 {
     $collection = new TES5CodeChunkCollection();
     $collection->add(new TES5Return());
     return $collection;
 }
コード例 #3
0
 public function createCodeChunk(TES4Callable $chunk, TES5CodeScope $codeScope, TES5GlobalScope $globalScope, TES5MultipleScriptsScope $multipleScriptsScope)
 {
     $localScope = $codeScope->getLocalScope();
     $function = $chunk->getFunction();
     $calledOnReference = $this->createCalledOnReferenceOfCalledFunction($chunk, $codeScope, $globalScope, $multipleScriptsScope);
     $codeChunk = $this->convertFunction($calledOnReference, $function, $codeScope, $globalScope, $multipleScriptsScope, $localScope);
     $codeChunks = new TES5CodeChunkCollection();
     $codeChunks->add($codeChunk);
     return $codeChunks;
 }