comparison vendor/nikic/php-parser/doc/0_Introduction.markdown @ 17:129ea1e6d783

Update, including to Drupal core 8.6.10
author Chris Cannam
date Thu, 28 Feb 2019 13:21:36 +0000
parents 5fb285c0d0e3
children
comparison
equal deleted inserted replaced
16:c2387f117808 17:129ea1e6d783
1 Introduction 1 Introduction
2 ============ 2 ============
3 3
4 This project is a PHP 5.2 to PHP 7.2 parser **written in PHP itself**. 4 This project is a PHP 5.2 to PHP 7.3 parser **written in PHP itself**.
5 5
6 What is this for? 6 What is this for?
7 ----------------- 7 -----------------
8 8
9 A parser is useful for [static analysis][0], manipulation of code and basically any other 9 A parser is useful for [static analysis][0], manipulation of code and basically any other
24 programmatic PHP code analysis are incidentally PHP developers, not C developers. 24 programmatic PHP code analysis are incidentally PHP developers, not C developers.
25 25
26 What can it parse? 26 What can it parse?
27 ------------------ 27 ------------------
28 28
29 The parser supports parsing PHP 5.2-7.2. 29 The parser supports parsing PHP 5.2-7.3.
30 30
31 As the parser is based on the tokens returned by `token_get_all` (which is only able to lex the PHP 31 As the parser is based on the tokens returned by `token_get_all` (which is only able to lex the PHP
32 version it runs on), additionally a wrapper for emulating tokens from newer versions is provided. 32 version it runs on), additionally a wrapper for emulating tokens from newer versions is provided.
33 This allows to parse PHP 7.2 source code running on PHP 5.5, for example. This emulation is somewhat 33 This allows to parse PHP 7.3 source code running on PHP 7.0, for example. This emulation is somewhat
34 hacky and not perfect, but it should work well on any sane code. 34 hacky and not perfect, but it should work well on any sane code.
35 35
36 What output does it produce? 36 What output does it produce?
37 ---------------------------- 37 ----------------------------
38 38