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. Full documentation is at nerima-lisp.github.io/cl-cc-php.
(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.
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 is not standalone. It needs cl-cc-ast, cl-cc-bootstrap,
cl-cc-parse, and cl-cc-vm, which live inside a checkout of the cl-cc
monorepo rather than in split-out repositories. See
Installation.
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 treefmtWithout Nix, run-tests.lisp falls back to sibling checkouts of cl-cc,
cl-weave, cl-prolog, and cl-parser-kit next to this repository:
sbcl --script run-tests.lispSee Development.
See the organisation-wide contributing guide and code of conduct.
Open an issue at nerima-lisp/cl-cc-php/issues. For security reports, follow the security policy.
MIT — see LICENSE.