Skip to content

nerima-lisp/cl-cc-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

45 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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. Full documentation is at nerima-lisp.github.io/cl-cc-php.

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 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.

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 falls back to sibling checkouts of cl-cc, cl-weave, cl-prolog, and cl-parser-kit next to this repository:

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 backend for the cl-cc Common Lisp compiler

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages