PHP で AST 解析をして Java のオペコードを生成する

218473ff7abad0fcd72865da2b23bb5b?s=47 memory
November 22, 2019

PHP で AST 解析をして Java のオペコードを生成する

- Kichijoji.pm in Japan

English Title:
Generates Operation Codes of Java on performed an Abstract Syntax Tree from PHP code.

218473ff7abad0fcd72865da2b23bb5b?s=128

memory

November 22, 2019
Tweet

Transcript

  1. 2.

    © - BASE, Inc. Who am I? (@m m r

    ) BASE GameWith PHP, TypeScript
  2. 19.

    © - BASE, Inc. 1 + 2 + 3 Value

    Label Means Number Whitespace + Plus Whitespace Number Whitespace + Plus Whitespace Number
  3. 20.

    © - BASE, Inc. PHP Value Label Means T_LNUMBER T_WHITESPACE

    + - ( ) Whitespace T_LNUMBER T_WHITESPACE + - ( ) T_WHITESPACE T_LNUMBER
  4. 32.

    © - BASE, Inc. PHP AST Echo_ (Stmt) Plus (BinaryOp)

    Plus (BinaryOp) (LNumber) (LNumber) (LNumber) left right left right expressions ( ) (*1) (* ) PHP echo , print ,
  5. 33.

    © - BASE, Inc. PHP AST Echo_ (Stmt) Plus (BinaryOp)

    Plus (BinaryOp) (LNumber) (LNumber) (LNumber) left right left right expressions ( ) (*1) (* ) PHP echo , print ,
  6. 42.

    © - BASE, Inc. Java 1 + 2 + 3

    1 2 2 (3 ) 2 (6 ) 3 iconst_ iconst_ iadd iconst_ iadd
  7. 44.
  8. 45.

    © - BASE, Inc. PHP Java Plus (BinaryOp) Plus (BinaryOp)

    (LNumber) (LNumber) (LNumber) left right left right PHP AST
  9. 46.

    © - BASE, Inc. PHP Java Plus (BinaryOp) Plus (BinaryOp)

    (LNumber) left right left right iconst_ iconst_
  10. 47.

    © - BASE, Inc. PHP Java Plus (BinaryOp) (LNumber) left

    right iconst_ iconst_ iadd left right
  11. 48.

    © - BASE, Inc. PHP Java Plus (BinaryOp) left right

    iconst_ iconst_ iadd left right iconst_
  12. 49.