Skip to content

Commit

Permalink
New Standalone compiler.
Browse files Browse the repository at this point in the history
  • Loading branch information
dim-s committed Mar 7, 2020
1 parent d698624 commit 30b6caf
Show file tree
Hide file tree
Showing 29 changed files with 1,279 additions and 71 deletions.
2 changes: 1 addition & 1 deletion jphp-core/api-docs/README.md
Expand Up @@ -9,7 +9,7 @@ Compiler and Launcher for JPHP.

### Install
```
jppm add jphp-core@1.2.4
jppm add jphp-core@1.2.5
```

### API
Expand Down
2 changes: 1 addition & 1 deletion jphp-core/api-docs/README.ru.md
Expand Up @@ -9,7 +9,7 @@ Compiler and Launcher for JPHP.

### Установка
```
jppm add jphp-core@1.2.4
jppm add jphp-core@1.2.5
```

### АПИ
Expand Down
4 changes: 2 additions & 2 deletions jphp-core/package.php.yml
@@ -1,10 +1,10 @@

name: jphp-core
version: 1.2.4
version: 1.2.5
description: Compiler and Launcher for JPHP.

deps:
jphp-runtime: '~1.2.4'
jphp-runtime: '~1.2.5'


plugins: [Doc, Hub]
Expand Down
@@ -0,0 +1 @@
org.develnext.jphp.ext.compress.CompressExtension
16 changes: 16 additions & 0 deletions jphp-core/src/org/develnext/jphp/core/ext/CompilerExtension.java
@@ -0,0 +1,16 @@
package org.develnext.jphp.core.ext;

import php.runtime.env.CompileScope;
import php.runtime.ext.support.Extension;

public class CompilerExtension extends Extension {
@Override
public Status getStatus() {
return Status.EXPERIMENTAL;
}

@Override
public void onRegister(CompileScope scope) {

}
}
Expand Up @@ -365,7 +365,7 @@ public FunctionStmtToken getToken(Token current, ListIterator<Token> iterator, b
analyzer.pushClosure(result);

analyzer.addScope(true);
processArguments(result, iterator, false);
processArguments(result, iterator, true);
processUses(result, iterator);
processBody(result, iterator);
//boolean thisExists = result.isThisExists();
Expand Down
8 changes: 8 additions & 0 deletions jphp-native/build.gradle
@@ -0,0 +1,8 @@
plugins {
id "com.palantir.graal" version "0.6.0-110-gd6e368f"
}

dependencies {
compile project(":jphp-runtime")
compile project(":jphp-core")
}
3 changes: 2 additions & 1 deletion jphp-runtime/api-docs/README.md
Expand Up @@ -9,7 +9,7 @@ Runtime for JPHP + Standard library.

### Install
```
jppm add jphp-runtime@1.2.3
jppm add jphp-runtime@1.2.5
```

### API
Expand All @@ -29,6 +29,7 @@ jppm add jphp-runtime@1.2.3

#### `php\io`

- [`DataStream`](https://github.com/jphp-compiler/jphp/blob/master/jphp-runtime/api-docs/classes/php/io/DataStream.md)- _Class DataStream_
- [`File`](https://github.com/jphp-compiler/jphp/blob/master/jphp-runtime/api-docs/classes/php/io/File.md)- _Class File_
- [`FileStream`](https://github.com/jphp-compiler/jphp/blob/master/jphp-runtime/api-docs/classes/php/io/FileStream.md)- _Class FileStream_
- [`IOException`](https://github.com/jphp-compiler/jphp/blob/master/jphp-runtime/api-docs/classes/php/io/IOException.md)- _Class IOException_
Expand Down
3 changes: 2 additions & 1 deletion jphp-runtime/api-docs/README.ru.md
Expand Up @@ -9,7 +9,7 @@ Runtime for JPHP + Standard library.

### Установка
```
jppm add jphp-runtime@1.2.3
jppm add jphp-runtime@1.2.5
```

### АПИ
Expand All @@ -29,6 +29,7 @@ jppm add jphp-runtime@1.2.3

#### `php\io`

- [`DataStream`](https://github.com/jphp-compiler/jphp/blob/master/jphp-runtime/api-docs/classes/php/io/DataStream.ru.md)- _Class DataStream_
- [`File`](https://github.com/jphp-compiler/jphp/blob/master/jphp-runtime/api-docs/classes/php/io/File.ru.md)- _Class File_
- [`FileStream`](https://github.com/jphp-compiler/jphp/blob/master/jphp-runtime/api-docs/classes/php/io/FileStream.ru.md)- _Class FileStream_
- [`IOException`](https://github.com/jphp-compiler/jphp/blob/master/jphp-runtime/api-docs/classes/php/io/IOException.ru.md)- _Class IOException_
Expand Down
265 changes: 265 additions & 0 deletions jphp-runtime/api-docs/classes/php/io/DataStream.md
@@ -0,0 +1,265 @@
# DataStream

- **class** `DataStream` (`php\io\DataStream`)
- **source** `php/io/DataStream.php`

**Description**

Class DataStream

---

#### Methods

- `->`[`__construct()`](#method-__construct) - _DataStream constructor._
- `->`[`read()`](#method-read)
- `->`[`write()`](#method-write)
- `->`[`readBool()`](#method-readbool)
- `->`[`readByte()`](#method-readbyte)
- `->`[`readUnsignedByte()`](#method-readunsignedbyte)
- `->`[`readShort()`](#method-readshort)
- `->`[`readUnsignedShort()`](#method-readunsignedshort)
- `->`[`readInt()`](#method-readint)
- `->`[`readLong()`](#method-readlong)
- `->`[`readFloat()`](#method-readfloat)
- `->`[`readDouble()`](#method-readdouble)
- `->`[`readUTF()`](#method-readutf)
- `->`[`readChar()`](#method-readchar)
- `->`[`writeByte()`](#method-writebyte)
- `->`[`writeShort()`](#method-writeshort)
- `->`[`writeInt()`](#method-writeint)
- `->`[`writeLong()`](#method-writelong)
- `->`[`writeFloat()`](#method-writefloat)
- `->`[`writeDouble()`](#method-writedouble)
- `->`[`writeChar()`](#method-writechar)
- `->`[`writeChars()`](#method-writechars)
- `->`[`writeUTF()`](#method-writeutf)
- `->`[`writeBinary()`](#method-writebinary)
- `->`[`writeBool()`](#method-writebool)

---
# Methods

<a name="method-__construct"></a>

### __construct()
```php
__construct(php\io\Stream $stream): void
```
DataStream constructor.

---

<a name="method-read"></a>

### read()
```php
read(): int
```

---

<a name="method-write"></a>

### write()
```php
write(int $value): void
```

---

<a name="method-readbool"></a>

### readBool()
```php
readBool(): boolean
```

---

<a name="method-readbyte"></a>

### readByte()
```php
readByte(): int
```

---

<a name="method-readunsignedbyte"></a>

### readUnsignedByte()
```php
readUnsignedByte(): int
```

---

<a name="method-readshort"></a>

### readShort()
```php
readShort(): int
```

---

<a name="method-readunsignedshort"></a>

### readUnsignedShort()
```php
readUnsignedShort(): int
```

---

<a name="method-readint"></a>

### readInt()
```php
readInt(): int
```

---

<a name="method-readlong"></a>

### readLong()
```php
readLong(): int
```

---

<a name="method-readfloat"></a>

### readFloat()
```php
readFloat(): double
```

---

<a name="method-readdouble"></a>

### readDouble()
```php
readDouble(): double
```

---

<a name="method-readutf"></a>

### readUTF()
```php
readUTF(): string
```

---

<a name="method-readchar"></a>

### readChar()
```php
readChar(): string
```

---

<a name="method-writebyte"></a>

### writeByte()
```php
writeByte(int $value): void
```

---

<a name="method-writeshort"></a>

### writeShort()
```php
writeShort(int $value): void
```

---

<a name="method-writeint"></a>

### writeInt()
```php
writeInt(int $value): void
```

---

<a name="method-writelong"></a>

### writeLong()
```php
writeLong(int $value): void
```

---

<a name="method-writefloat"></a>

### writeFloat()
```php
writeFloat(double $value): void
```

---

<a name="method-writedouble"></a>

### writeDouble()
```php
writeDouble(double $value): void
```

---

<a name="method-writechar"></a>

### writeChar()
```php
writeChar(string $value): void
```

---

<a name="method-writechars"></a>

### writeChars()
```php
writeChars(string $value): void
```

---

<a name="method-writeutf"></a>

### writeUTF()
```php
writeUTF(string $value): void
```

---

<a name="method-writebinary"></a>

### writeBinary()
```php
writeBinary(string $value): void
```

---

<a name="method-writebool"></a>

### writeBool()
```php
writeBool(boolean $value): void
```

0 comments on commit 30b6caf

Please sign in to comment.