Skip to content
nerima-lispPublic

About

PHP frontend for the cl-cc Common Lisp compiler

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

71 Commits

Folders and files

Repository files navigation

cl-cc-php

CI License: MIT Documentation

The PHP frontend for the cl-cc Common Lisp compiler: a lexer, parser, and grammar that turn PHP source into cl-cc's AST, plus the PHP runtime builtins that compiled code calls into.

Quick Start

(asdf:load-system "cl-cc-php")

(cl-cc/php:parse-php-source "<?php $x = 1 + 2;")

parse-php-source returns a list of top-level cl-cc AST nodes. tokenize-php-source gives you the token stream instead, and parse-php-source-to-cst gives you a concrete syntax tree when you need the surface detail the AST drops.

Install

Add the flake input:

cl-cc-php = {
  url = "github:nerima-lisp/cl-cc-php";
  flake = false;
};

Then depend on it from your .asd:

:depends-on ("cl-cc-php")

cl-cc-php needs the compiler systems cl-cc-ast, cl-cc-bootstrap, cl-cc-parse, and cl-cc-vm from their separately pinned sibling source repositories. It also uses cl-host-kit and cl-json-kit at runtime. The umbrella cl-cc checkout is not a PHP package dependency. See Getting Started.

Documentation

Development

nix develop                          # SBCL with the dependency roots exported
nix flake check --print-build-logs   # tests, formatting, and docs
nix run .#test                       # the test suite alone
nix fmt                              # nixfmt via treefmt

Without Nix, run-tests.lisp uses sibling checkouts for the compiler systems and library dependencies. See Getting Started for the expected source roots:

sbcl --script run-tests.lisp

See Development.

Contributing

See the organisation-wide contributing guide and code of conduct.

Support

Open an issue at nerima-lisp/cl-cc-php/issues. For security reports, follow the security policy.

License

MIT — see LICENSE.

About

PHP frontend for the cl-cc Common Lisp compiler

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages