承接 tacoberu/hayo-ast 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

tacoberu/hayo-ast

Composer 安装命令:

composer require tacoberu/hayo-ast

包简介

Abstract Syntax Tree (AST) implementation for the Hayo scripting language.

README 文档

README

Abstract Syntax Tree (AST) implementation for the Hayo scripting language in PHP.

Note: This project is not useful on its own as it is a component of the php-hayo project.

Installation

Install via Composer:

composer require tacoberu/hayo-ast

Basic Usage

The library provides classes for representing various language constructs like expressions, scalars, lambdas, and scopes.

Scalars

Represent basic values:

use Taco\Hayo\Scalar;

$int = Scalar::Int_(42);
$str = Scalar::Str_("Hello World");
$bool = Scalar::Bool_(true);

echo (string) $int; // 42 : Int

Expressions

Expressions can be functional calls or binary operations:

use Taco\Hayo\Expr;
use Taco\Hayo\Scalar;

// Function call: str.len "Lorem"
$expr = Expr::Func_("str.len", [Scalar::Str_("Lorem")]);

// Binary operation: 1 + 2
$binExpr = Expr::Bin_(Scalar::Int_(1), "+", Scalar::Int_(2));

References

You can track required symbols (references) in an expression:

$expr = Expr::Bin_('a', "+", Scalar::Int_(1));
print_r($expr->refs()); // ['a', '+']

License

This project is licensed under the MIT License.

统计信息

  • 总下载量: 146
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-06-02

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固