Example #1
0
 public function printInfo($offset)
 {
     Console::write("{$offset}SymSubrangeType:\n");
     $offset .= '    ';
     Console::write("{$offset}{$this->identifier}\n");
     Console::write("{$offset}{$this->from}..{$this->to}\n");
 }
Example #2
0
 public function printInfo($offset)
 {
     Console::write("{$offset}SymProc:\n");
     $offset .= '    ';
     Console::write("{$offset}{$this->identifier}\n");
     $this->symTable->printInfo($offset);
 }
Example #3
0
 public function printInfo($offset)
 {
     Console::write("{$offset}SymConst:\n");
     $offset .= '    ';
     Console::write("{$offset}{$this->identifier} = {$this->value}\n");
     $this->type->printInfo($offset);
 }
 public function printInfo($offset)
 {
     Console::write("{$offset}SymPointerAnonimType:\n");
     $offset .= '    ';
     Console::write("{$offset}{$this->identifier}\n");
     $this->type->printInfo($offset);
 }
Example #5
0
 public function printInfo($offset)
 {
     Console::write("{$offset}SymSimpleType:\n");
     $offset .= '    ';
     Console::write("{$offset}{$this->identifier}\n");
     Console::write("{$offset}{$this->type}\n");
 }
Example #6
0
 public function printInfo($offset)
 {
     Console::write("{$offset}SymAliasType:\n");
     $offset .= '    ';
     Console::write("{$offset}{$this->identifier}\n");
     $this->aliased->printInfo($offset);
 }
Example #7
0
 public function printInfo($offset)
 {
     Console::write("{$offset}SymTable:\n");
     $offset .= '    ';
     foreach ($this->symbols as $identifier => $symbol) {
         $symbol->printInfo($offset);
     }
 }
Example #8
0
 public function printInfo($offset)
 {
     Console::write("{$offset}SymArg:\n");
     $offset .= '    ';
     Console::write("{$offset}{$this->identifier}\n");
     Console::write("{$offset}index = {$this->index}\n");
     $this->type->printInfo($offset);
 }
Example #9
0
 public function printInfo($offset)
 {
     Console::write("{$offset}SymFunc:\n");
     $offset .= '    ';
     Console::write("{$offset}{$this->identifier}\n");
     $this->symTable->printInfo($offset);
     Console::write("{$offset}return value:\n");
     $this->returnType->printInfo($offset);
 }
Example #10
0
 public function printInfo($offset)
 {
     Console::write("{$offset}SymArrayAnonimType:\n");
     $offset .= '    ';
     Console::write("{$offset}{$this->identifier}\n");
     for ($i = 0; $i < count($this->dimensions); $i++) {
         $this->dimensions[$i]->printInfo($offset);
     }
     $this->type->printInfo($offset);
 }
Example #11
0
    if ($params['syntax-only']) {
        try {
            $program = new Program($scanner);
        } catch (CompilerException $e) {
            Console::write($e);
            Console::closeStream();
            exit(1);
        }
        if ($params['html']) {
            $syntaxTree = json_encode($program->toIdArray());
            // echo $syntaxTree;
            TreeViewer::genSyntaxHtml($params['html'], "result", $syntaxTree);
        } else {
            $syntaxTree = $program->toIdArray();
            Console::write(json_encode($syntaxTree, JSON_PRETTY_PRINT));
        }
    } else {
        if ($params['table-only']) {
            try {
                $program = new Program($scanner);
            } catch (CompilerException $e) {
                Console::write($e);
                Console::closeStream();
                exit(1);
            }
            $program->symTable->printInfo('');
        }
    }
}
Console::closeStream();