Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Impl PHP target #12

Merged
merged 18 commits into from Nov 23, 2016

Conversation

@zonuexe
Copy link
Contributor

commented Nov 15, 2016

It based on JavaScript target.

But, I can not see it works in my environment. (refs #10)

@shinh

This comment has been minimized.

Copy link
Owner

commented Nov 21, 2016

Are you planning to finish implementing this? I tried to make this work but I gave up for now as I'm not familiar with PHP. Current patch is

http://shinh.skr.jp/t/php.patch

@zonuexe zonuexe force-pushed the zonuexe:feature/target-php branch from 557348e to 115c1be Nov 22, 2016

@@ -74,7 +73,7 @@ static void php_emit_inst(Inst* inst) {
break;

case PUTC:
emit_line("echo %s;", src_str(inst));
emit_line("printf(\"%%c\", %s);", src_str(inst));

This comment has been minimized.

Copy link
@shinh

shinh Nov 23, 2016

Owner

日本の方のようなので日本語で。 sigil のある言語で src_str をそのまま使うと $ がついてるのかついてないかとかもろもろで無理が出るかと思います。 Ruby バックエンドがやってるように、 sigil がついた変数名を使ったレジスタ名一覧をグローバル変数 reg_names に代入してやると、つじつまがあって $true = true や inst_is_variable などそのへん全部いらなくなるかと思います

https://github.com/shinh/elvm/blob/master/target/rb.c#L9

This comment has been minimized.

Copy link
@zonuexe

zonuexe Nov 23, 2016

Author Contributor

なるほど!

@shinh shinh merged commit f6c62fd into shinh:master Nov 23, 2016

@shinh

This comment has been minimized.

Copy link
Owner

commented Nov 23, 2016

PHPよくわかってないのですが、動いてそうだったので取りこませていただきました。ありがとうございます!

@zonuexe zonuexe deleted the zonuexe:feature/target-php branch Nov 26, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.