/** * SymbolTable * * @param CompilationContext $compilationContext */ public function __construct(CompilationContext $compilationContext) { /* this_ptr */ $thisVar = new Variable('variable', 'this', $compilationContext->currentBranch); $thisVar->setIsInitialized(true, $compilationContext, array()); $thisVar->increaseUses(); $thisVar->setReadOnly(true); $thisVar->setLowName('this_ptr'); $thisVar->setDynamicTypes('object'); $this->variables['this'] = $thisVar; $returnValue = new Variable('variable', 'return_value', $compilationContext->currentBranch); $returnValue->setIsInitialized(true, $compilationContext, array()); $returnValue->increaseUses(); $this->variables['return_value'] = $returnValue; $returnValue = new Variable('variable', 'return_value_ptr', $compilationContext->currentBranch); $returnValue->setIsInitialized(true, $compilationContext, array()); $returnValue->increaseUses(); $this->variables['return_value_ptr'] = $returnValue; }
/** * SymbolTable * * @param CompilationContext $compilationContext */ public function __construct(CompilationContext $compilationContext) { /* The variables are registered in branch 1, which is the external branch */ $this->compilationContext = $compilationContext; $this->branchVariables[1] = array(); /* this_ptr */ $thisVar = new Variable('variable', 'this', $compilationContext->currentBranch); $thisVar->setIsInitialized(true, $compilationContext, array()); $thisVar->increaseUses(); $thisVar->setReadOnly(true); $thisVar->setLowName('this_ptr'); $thisVar->setDynamicTypes('object'); $this->branchVariables[1]['this'] = $thisVar; $returnValue = new Variable('variable', 'return_value', $compilationContext->currentBranch); $returnValue->setIsInitialized(true, $compilationContext, array()); $returnValue->increaseUses(); $this->branchVariables[1]['return_value'] = $returnValue; $returnValue = new Variable('variable', 'return_value_ptr', $compilationContext->currentBranch); $returnValue->setIsInitialized(true, $compilationContext, array()); $returnValue->increaseUses(); $this->branchVariables[1]['return_value_ptr'] = $returnValue; }