Download the PHP package ffi/preprocessor without Composer

On this page you can find all versions of the php package ffi/preprocessor. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package preprocessor

C23 Preprocessor for PHP

PHP 8.1+ Latest Stable Version Latest Unstable Version Total Downloads License MIT

Tests

This implementation of a C-preprocessor based on ISO/IEC 9899:2024 - N3220.

You can also use a PHP C parser to subsequently parse the source code into an AST after preprocessing.

Requirements

Installation

Library is available as a Composer repository and can be installed using the following command in the root of your project.

Usage

Preprocessor::process() expands the macros and executes the directives of a C source, the result is a stringable Result.

Method process() accepts:

Result

Besides the output, the result tells what the run has learned. Each getter reads the output to the end first, and the result can be read more than once.

Macros

The $pre->macros holds the macros every run starts with.

The __DATE__ and __TIME__ are taken from a PSR-20 clock, the system one by default.

File System

Any #include and #embed search for files in the file system of the preprocessor, $pre->files.

Diagnostics

Ane #error and #warning are reported to a listener. By default, an error stops the run with DiagnosticException and a warning is skipped.

The ready listeners are:

Directives

Every directive has a handler, $pre->directives holds them. Add a directive of your own or replace a standard one.

The context gives the handler the macros, the file system, the diagnostic listener and the executor that preprocesses an included file.

Pragmas

#pragma once is executed, any other pragma is passed to the output. A pragma is executed by a processor, add one to react to a pragma of your own.

Limitations

List of preprocessor limitations. May be added to in the future.

Directives

Other Features


All versions of preprocessor with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
phplrt/exception Version ^4.2
phplrt/position Version ^4.2
phplrt/runtime Version ^4.2
psr/clock Version ^1.0
psr/log Version ^3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package ffi/preprocessor contains the following files

Loading the files please wait ...