diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..f8164b6 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,51 @@ +--- +name: Bug report +about: Create a report to help us improve +title: "[BUG]: " +labels: 'bug, status: unverified' +assignees: '' +--- + +Questions? Discussions: https://phalcon.io/discussions or Discord: https://phalcon.io/discord + +## Describe the bug + +A clear and concise description of what the bug is. + +## To Reproduce + +Steps to reproduce the behavior: + +```php +// paste output here +``` + +> Provide minimal script to reproduce the issue + +```php +// paste output here +``` + +## Expected behavior + +A clear and concise description of what you expected to happen. + +```php +// paste code +``` + +## Screenshots + +If applicable, add screenshots to help explain your problem. + +## Details + +- Phalcon version +- PHP Version: (`php -v`) +- Operating System: +- Server: Nginx | Apache | Other +- Other related info (Database, table schema): + +## Additional context + +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000..32d1d5d --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,23 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: "[NFR]: " +labels: new feature request +assignees: '' +--- + +## Is your feature request related to a problem? Please describe. + +A clear and concise description of what the problem is. Example: _I am always frustrated when..._ + +## Describe the solution you would like + +A clear and concise description of what you want to happen. + +## Describe alternatives you've considered + +A clear and concise description of any alternative solutions or features you've considered. + +## Additional context + +Add any other context or screenshots about the feature request here. diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..7df3892 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,11 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + - package-ecosystem: "composer" # See documentation for possible values + directory: "/" # Location of package manifests + schedule: + interval: "weekly" diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..d0d960e --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,16 @@ +Hello! + +* Type: bug fix | new feature | code quality | documentation +* Link to issue: + +**In raising this pull request, I confirm the following:** + +- [ ] I have read and understood the [Contributing Guidelines](https://github.com/phalcon/phalcon/blob/master/CONTRIBUTING.md) +- [ ] I have checked that another pull request for this purpose does not exist +- [ ] I wrote some tests for this PR +- [ ] I have updated the relevant CHANGELOG +- [ ] I have created a PR for the [documentation](https://github.com/phalcon/docs) about this change + +Small description of change: + +Thanks diff --git a/.github/stale.yml b/.github/stale.yml new file mode 100644 index 0000000..c423a7c --- /dev/null +++ b/.github/stale.yml @@ -0,0 +1,57 @@ +# Configuration for probot-stale - https://github.com/probot/stale + +# Number of days of inactivity before an Issue or Pull Request becomes stale +daysUntilStale: 90 + +# Number of days of inactivity before a stale Issue or Pull Request is closed. +# Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale. +daysUntilClose: 1 + +# Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable +exemptLabels: + - "status: high" + - "status: medium" + - "status: low" + - "bug" + - "wip" + - Locked + - "new feature request" + - "enhancement" + +# Set to true to ignore issues in a project (defaults to false) +exemptProjects: false + +# Set to true to ignore issues in a milestone (defaults to false) +exemptMilestones: true + +# Label to use when marking as stale +staleLabel: stale + +# Comment to post when marking as stale. Set to `false` to disable +markComment: > + Thank you for contributing to this issue. As it has been 90 days since the last activity, we are automatically closing the issue. This is often because the request was already solved in some way and it just wasn't updated or it's no longer applicable. If that's not the case, please feel free to either reopen this issue or open a new one. We will be more than happy to look at it again! You can read more here: https://blog.phalcon.io/post/github-closing-old-issues +# Comment to post when removing the stale label. +# unmarkComment: > +# Your comment here. + +# Comment to post when closing a stale Issue or Pull Request. +#closeComment: > +# Thank you for contributing to this issue. As it has been 90 days since the last activity, we are automatically closing the issue. This is often because the request was already solved in some way and it just wasn't updated or it's no longer applicable. If that's not the case, please feel free to either reopen this issue or open a new one. We will be more than happy to look at it again! You can read more here: https://blog.phalcon.io/post/github-closing-old-issues + +# Limit the number of actions per hour, from 1-30. Default is 30 +limitPerRun: 30 + +# Limit to only `issues` or `pulls` +only: issues + +# Optionally, specify configuration settings that are specific to just 'issues' or 'pulls': +# pulls: +# daysUntilStale: 30 +# markComment: > +# This pull request has been automatically marked as stale because it has not had +# recent activity. It will be closed if no further activity occurs. Thank you +# for your contributions! + +# issues: +# exemptLabels: +# - confirmed diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml new file mode 100644 index 0000000..df5f52d --- /dev/null +++ b/.github/workflows/continuous-integration.yml @@ -0,0 +1,223 @@ +# This file is part of Phalcon. +# +# (c) Phalcon Team +# +# For the full copyright and license information, please view +# the LICENSE file that was distributed with this source code. + +name: "Phalcon Volt CI" + +on: + schedule: + - cron: '0 2 * * *' # Daily at 02:00 runs only on default branch + push: + paths-ignore: + - '**.md' + - '**.txt' + pull_request: + workflow_dispatch: + +env: + fail-fast: true + + # All versions should be declared here + PHALCON_VERSION: 6.0.0 + CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }} + + # For tests + LANG: en_US.UTF-8 + LANGUAGE: en_US.UTF-8 + LC_ALL: en_US.UTF-8 + + # Windows specific + TOOLS_DIR: 'C:\tools' + + # PHP extensions required by Composer + EXTENSIONS: mbstring + +permissions: { } +jobs: + + # PHP CodeSniffer inspection + phpcs: + name: "Validate Tests code style" + if: "!contains(github.event.head_commit.message, 'ci skip')" + + permissions: + contents: read + + runs-on: ubuntu-20.04 + + strategy: + fail-fast: true + matrix: + php: + - '8.1' + steps: + - uses: actions/checkout@v4 + + - name: "Setup PHP" + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + extensions: ${{ env.EXTENSIONS }} + ini-values: apc.enable_cli=on, session.save_path=/tmp + tools: pecl + env: + COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} + PHALCON_PATH: ext + + - name: "Install development dependencies with Composer" + uses: "ramsey/composer-install@v2" + with: + composer-options: "--prefer-dist" + + - name: "PHPCS" + run: | + composer cs + +# - name: "PHPStan" +# run: | +# composer analyze + + unit-tests: + needs: phpcs + + permissions: + contents: read # to fetch code (actions/checkout) + + name: Unit tests / PHP-${{ matrix.php }}-${{ matrix.ts }}-${{ matrix.name }} + runs-on: ${{ matrix.os }} + + strategy: + matrix: + php: + - '8.1' + ts: + - 'ts' + name: + - ubuntu-gcc + include: + # Linux + - { name: ubuntu-gcc, os: ubuntu-20.04, compiler: gcc } + + steps: + - uses: actions/checkout@v4 + - name: "Setup platform specific environment" + shell: pwsh + run: | + git config --global core.autocrlf false + $SessionSavePath = if ("${{ runner.os }}" -eq "Windows") { 'C:\temp' } else { '/tmp' } + Write-Output "SESSION_SAVE_PATH=$SessionSavePath" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + + - name: "Setup PHP" + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php }} + extensions: ${{ env.EXTENSIONS }} + tools: pecl, composer:v2 + coverage: xdebug + env: + PHPTS: ${{ matrix.ts }} + COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: "Validate composer" + run: composer validate --no-check-all --no-check-publish + + - name: "Install development dependencies with Composer" + uses: "ramsey/composer-install@v2" + with: + composer-options: "--prefer-dist" + + - name: "Run Unit Tests" + if: always() + run: | + composer test-coverage + + - name: "Upload coverage file artifact" + uses: "actions/upload-artifact@v4" + with: + name: "unit-${{ matrix.php }}.coverage" + path: "tests/support/coverage.xml" + + qodana-analysis: + permissions: + contents: read + + name: "Qodana Analysis" + runs-on: "ubuntu-22.04" + needs: + - "unit-tests" + + steps: + - name: "Checkout" + uses: "actions/checkout@v3" + with: + ref: ${{ github.event.pull_request.head.sha }} # to check out the actual pull request commit, not the merge commit + fetch-depth: 0 # a full history is required for pull request analysis + + - name: 'Qodana Scan' + uses: JetBrains/qodana-action@v2023.2 + env: + QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }} + with: + args: --baseline,qodana.sarif.json + + upload-coverage: + permissions: + contents: read + + name: "Upload coverage" + runs-on: "ubuntu-22.04" + needs: + - "unit-tests" + + steps: + - name: "Checkout" + uses: "actions/checkout@v4" + with: + fetch-depth: 2 + + - name: "Display structure of downloaded files" + run: | + mkdir -p reports + + - name: "Download coverage files" + uses: "actions/download-artifact@v4" + with: + path: "reports" + + - name: "Display structure of downloaded files" + run: ls -R + working-directory: reports + +# - name: "Upload to Codacy" +# run: | +# bash <(curl -Ls https://coverage.codacy.com/get.sh) report \ +# -l php $(find ./reports/ -name '*.xml' | sed 's,^, -r ,' | xargs echo) + +# - name: "Upload to Codacy" +# uses: codacy/codacy-coverage-reporter-action@v1.3.0 +# with: +# project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} +# # or +# # api-token: ${{ secrets.CODACY_API_TOKEN }} +# coverage-reports: reports +# # or a comma-separated list for multiple reports +# # coverage-reports: , + +# - name: "Upload to Codecov" +# uses: "codecov/codecov-action@v3" +# with: +# token: ${{ secrets.CODECOV_TOKEN }} +# directory: reports +# fail_ci_if_error: true +# verbose: true +# + - name: "Upload to Qodana" + run: | + docker run \ + -v $(pwd):/data/project/ \ + -v ./reports/:/data/coverage \ + -e QODANA_TOKEN="${{ secrets.QODANA_TOKEN }}" \ + jetbrains/qodana-php diff --git a/.gitignore b/.gitignore index d64633e..55b44f4 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ composer.phar /vendor/ /lemon-php/ log.txt +tests/support/output/ diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..e69de29 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..e69de29 diff --git a/README.md b/README.md index 0e64f84..0101d2b 100644 --- a/README.md +++ b/README.md @@ -1 +1,3 @@ # Volt: Template Engine + +This repository consists of the Volt parser, for the Volt Template Engine used by the Phalcon Framework. diff --git a/composer.json b/composer.json index baa5288..f8d52cc 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,7 @@ { "name": "phalcon/volt", "description": "Phalcon Volt is a HTML template engine for sender-side rendering.", + "version": "1.0.0", "keywords": [ "phalcon", "volt", @@ -8,7 +9,7 @@ "engine", "HTML" ], - "license": "BSD-3-Clause", + "license": "MIT", "authors": [ { "name": "Phalcon Team", @@ -22,11 +23,14 @@ ], "require": { "php": ">=8.0", - "ext-mbstring": "*" + "ext-mbstring": "*", + "pds/skeleton": "^1.0" }, "require-dev": { "phalcon/ide-stubs": "^5.0", - "phpunit/phpunit": "^9.0" + "phpstan/phpstan": "^1.11", + "phpunit/phpunit": "^9.0", + "squizlabs/php_codesniffer": "^3.10" }, "config": { "optimize-autoloader": true, @@ -46,7 +50,7 @@ }, "autoload-dev": { "psr-4": { - "Tests\\": "tests/" + "Phalcon\\Tests\\Unit\\": "tests/unit/" } }, "support": { @@ -56,5 +60,12 @@ "source": "https://github.com/phalcon/cphalcon", "docs": "https://phalcon.io/docs/", "rss": "https://blog.phalcon.io/rss" + }, + "scripts": { + "analyze": "vendor/bin/phpstan analyse -c phpstan.neon", + "cs": "vendor/bin/phpcs --standard=phpcs.xml", + "cs-fix": "vendor/bin/phpcbf --standard=phpcs.xml", + "test": "vendor/bin/phpunit", + "test-coverage": "vendor/bin/phpunit --coverage-clover ./tests/support/coverage.xml" } } diff --git a/composer.lock b/composer.lock index f7ac368..222279f 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,44 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "75ed54ebd98ccf2e3d4982c5c0af57fb", - "packages": [], + "content-hash": "f94fa355bb7d74b82c017f9136948411", + "packages": [ + { + "name": "pds/skeleton", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-pds/skeleton.git", + "reference": "95e476e5d629eadacbd721c5a9553e537514a231" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-pds/skeleton/zipball/95e476e5d629eadacbd721c5a9553e537514a231", + "reference": "95e476e5d629eadacbd721c5a9553e537514a231", + "shasum": "" + }, + "bin": [ + "bin/pds-skeleton" + ], + "type": "standard", + "autoload": { + "psr-4": { + "Pds\\Skeleton\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "CC-BY-SA-4.0" + ], + "description": "Standard for PHP package skeletons.", + "homepage": "https://github.com/php-pds/skeleton", + "support": { + "issues": "https://github.com/php-pds/skeleton/issues", + "source": "https://github.com/php-pds/skeleton/tree/1.x" + }, + "time": "2017-01-25T23:30:41+00:00" + } + ], "packages-dev": [ { "name": "doctrine/instantiator", @@ -380,6 +416,64 @@ }, "time": "2022-02-21T01:04:05+00:00" }, + { + "name": "phpstan/phpstan", + "version": "1.11.8", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpstan.git", + "reference": "6adbd118e6c0515dd2f36b06cde1d6da40f1b8ec" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/6adbd118e6c0515dd2f36b06cde1d6da40f1b8ec", + "reference": "6adbd118e6c0515dd2f36b06cde1d6da40f1b8ec", + "shasum": "" + }, + "require": { + "php": "^7.2|^8.0" + }, + "conflict": { + "phpstan/phpstan-shim": "*" + }, + "bin": [ + "phpstan", + "phpstan.phar" + ], + "type": "library", + "autoload": { + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHPStan - PHP Static Analysis Tool", + "keywords": [ + "dev", + "static analysis" + ], + "support": { + "docs": "https://phpstan.org/user-guide/getting-started", + "forum": "https://github.com/phpstan/phpstan/discussions", + "issues": "https://github.com/phpstan/phpstan/issues", + "security": "https://github.com/phpstan/phpstan/security/policy", + "source": "https://github.com/phpstan/phpstan-src" + }, + "funding": [ + { + "url": "https://github.com/ondrejmirtes", + "type": "github" + }, + { + "url": "https://github.com/phpstan", + "type": "github" + } + ], + "time": "2024-07-24T07:01:22+00:00" + }, { "name": "phpunit/php-code-coverage", "version": "9.2.31", @@ -1765,6 +1859,86 @@ ], "time": "2020-09-28T06:39:44+00:00" }, + { + "name": "squizlabs/php_codesniffer", + "version": "3.10.2", + "source": { + "type": "git", + "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", + "reference": "86e5f5dd9a840c46810ebe5ff1885581c42a3017" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/86e5f5dd9a840c46810ebe5ff1885581c42a3017", + "reference": "86e5f5dd9a840c46810ebe5ff1885581c42a3017", + "shasum": "" + }, + "require": { + "ext-simplexml": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": ">=5.4.0" + }, + "require-dev": { + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.3.4" + }, + "bin": [ + "bin/phpcbf", + "bin/phpcs" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Greg Sherwood", + "role": "Former lead" + }, + { + "name": "Juliette Reinders Folmer", + "role": "Current lead" + }, + { + "name": "Contributors", + "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer/graphs/contributors" + } + ], + "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", + "homepage": "https://github.com/PHPCSStandards/PHP_CodeSniffer", + "keywords": [ + "phpcs", + "standards", + "static analysis" + ], + "support": { + "issues": "https://github.com/PHPCSStandards/PHP_CodeSniffer/issues", + "security": "https://github.com/PHPCSStandards/PHP_CodeSniffer/security/policy", + "source": "https://github.com/PHPCSStandards/PHP_CodeSniffer", + "wiki": "https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki" + }, + "funding": [ + { + "url": "https://github.com/PHPCSStandards", + "type": "github" + }, + { + "url": "https://github.com/jrfnl", + "type": "github" + }, + { + "url": "https://opencollective.com/php_codesniffer", + "type": "open_collective" + } + ], + "time": "2024-07-21T23:26:44+00:00" + }, { "name": "theseer/tokenizer", "version": "1.2.3", diff --git a/docker-compose.yml b/docker-compose.yml index 2efa028..4553737 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,10 +1,10 @@ # For local development only. services: - phalcon-volt-8.0: - container_name: phalcon-volt-8.0 - hostname: phalcon-volt-8.0 - build: .docker/8.0 + phalcon-volt-8.1: + container_name: phalcon-volt-8.1 + hostname: phalcon-volt-8.1 + build: resources/docker/8.1 tty: true working_dir: /srv volumes: diff --git a/phpcs.xml b/phpcs.xml new file mode 100644 index 0000000..a97d4b7 --- /dev/null +++ b/phpcs.xml @@ -0,0 +1,13 @@ + + + Phalcon Coding Standards + + + + + + + + src + tests + diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 0000000..e260db2 --- /dev/null +++ b/phpstan.neon @@ -0,0 +1,6 @@ +parameters: + bootstrapFiles: + - phpunit.php + paths: + - src + level: 1 diff --git a/phpunit.php b/phpunit.php new file mode 100644 index 0000000..09d957b --- /dev/null +++ b/phpunit.php @@ -0,0 +1,13 @@ + + + + + ./src + + + + + ./tests/unit + + + diff --git a/.docker/8.0/Dockerfile b/resources/docker/8.1/Dockerfile similarity index 89% rename from .docker/8.0/Dockerfile rename to resources/docker/8.1/Dockerfile index cdcc820..f89d160 100644 --- a/.docker/8.0/Dockerfile +++ b/resources/docker/8.1/Dockerfile @@ -1,4 +1,4 @@ -FROM composer:latest as composer +FROM composer:latest AS composer FROM php:8.0-cli # Update diff --git a/src/Compiler.php b/src/Compiler.php index e582334..05d8e18 100644 --- a/src/Compiler.php +++ b/src/Compiler.php @@ -14,8 +14,40 @@ namespace Phalcon\Volt; use Closure; +use Phalcon\Di\DiInterface; +use Phalcon\Mvc\ViewBaseInterface; use Phalcon\Volt\Parser\Parser; +use function addslashes; +use function array_key_exists; +use function array_unshift; +use function call_user_func; +use function call_user_func_array; +use function file_exists; +use function file_get_contents; +use function file_put_contents; +use function filemtime; +use function implode; +use function is_array; +use function is_object; +use function is_string; +use function lcfirst; +use function method_exists; +use function ord; +use function preg_replace; +use function realpath; +use function serialize; +use function sprintf; +use function str_replace; +use function strlen; +use function strtolower; +use function trigger_error; +use function ucwords; +use function unserialize; +use function var_export; + +use const E_USER_DEPRECATED; + /** * This class reads and compiles Volt templates into PHP plain code * @@ -29,208 +61,265 @@ */ class Compiler { - public const PHVOLT_PARSING_OK = 1; - public const PHVOLT_PARSING_FAILED = 0; + public const PHVOLT_MODE_CODE = 1; + public const PHVOLT_MODE_COMMENT = 2; // TODO: add trait InjectionAwareTrait - - public const PHVOLT_RAW_BUFFER_SIZE = 256; - - public const PHVOLT_SCANNER_RETCODE_EOF = -1; - public const PHVOLT_SCANNER_RETCODE_ERR = -2; - public const PHVOLT_SCANNER_RETCODE_IMPOSSIBLE = -3; - /** * Modes */ - public const PHVOLT_MODE_RAW = 0; - public const PHVOLT_MODE_CODE = 1; - public const PHVOLT_MODE_COMMENT = 2; - - public const PHVOLT_T_IGNORE = 257; - + public const PHVOLT_MODE_RAW = 0; + public const PHVOLT_PARSING_FAILED = 0; + public const PHVOLT_PARSING_OK = 1; + public const PHVOLT_RAW_BUFFER_SIZE = 256; + public const PHVOLT_SCANNER_RETCODE_EOF = -1; + public const PHVOLT_SCANNER_RETCODE_ERR = -2; + public const PHVOLT_SCANNER_RETCODE_IMPOSSIBLE = -3; /** - * Literals & Identifiers + * Operators */ - public const PHVOLT_T_INTEGER = 258; - public const PHVOLT_T_DOUBLE = 259; - public const PHVOLT_T_STRING = 260; - public const PHVOLT_T_NULL = 261; - public const PHVOLT_T_FALSE = 262; - public const PHVOLT_T_TRUE = 263; - public const PHVOLT_T_IDENTIFIER = 265; - + public const PHVOLT_T_ADD = '+'; + public const PHVOLT_T_ADD_ASSIGN = 281; + public const PHVOLT_T_AND = 266; + public const PHVOLT_T_ARRAY = 360; + public const PHVOLT_T_ARRAYACCESS = 361; + public const PHVOLT_T_ASSIGN = '='; + public const PHVOLT_T_AUTOESCAPE = 317; + public const PHVOLT_T_BLOCK = 307; + public const PHVOLT_T_BREAK = 320; + public const PHVOLT_T_CACHE = 314; + public const PHVOLT_T_CALL = 325; + public const PHVOLT_T_CASE = 412; + public const PHVOLT_T_CBRACKET_CLOSE = '}'; + public const PHVOLT_T_CBRACKET_OPEN = '{'; + public const PHVOLT_T_CLOSE_DELIMITER = 331; + public const PHVOLT_T_CLOSE_EDELIMITER = 333; + public const PHVOLT_T_COLON = 277; + public const PHVOLT_T_COMMA = 269; + public const PHVOLT_T_CONCAT = '~'; + public const PHVOLT_T_CONTINUE = 319; + public const PHVOLT_T_DECR = 280; + public const PHVOLT_T_DEFAULT = 413; + public const PHVOLT_T_DEFINED = 312; + public const PHVOLT_T_DIV = '/'; + public const PHVOLT_T_DIV_ASSIGN = 284; + public const PHVOLT_T_DO = 316; + public const PHVOLT_T_DOT = '.'; + public const PHVOLT_T_DOUBLE = 259; + public const PHVOLT_T_ECHO = 359; + public const PHVOLT_T_ELSE = 301; + public const PHVOLT_T_ELSEFOR = 321; + public const PHVOLT_T_ELSEIF = 302; + public const PHVOLT_T_EMPTY = 380; + public const PHVOLT_T_EMPTY_STATEMENT = 358; + public const PHVOLT_T_ENCLOSED = 356; + public const PHVOLT_T_ENDAUTOESCAPE = 318; + public const PHVOLT_T_ENDBLOCK = 308; + public const PHVOLT_T_ENDCACHE = 315; + public const PHVOLT_T_ENDCALL = 326; + public const PHVOLT_T_ENDFOR = 305; + public const PHVOLT_T_ENDIF = 303; + public const PHVOLT_T_ENDMACRO = 323; + public const PHVOLT_T_ENDRAW = 401; + public const PHVOLT_T_ENDSWITCH = 414; + public const PHVOLT_T_EQUALS = 272; + public const PHVOLT_T_EVEN = 381; + public const PHVOLT_T_EXPR = 354; + public const PHVOLT_T_EXTENDS = 310; + public const PHVOLT_T_FALSE = 262; /** - * Operators + * Special Tokens */ - public const PHVOLT_T_ADD = '+'; - public const PHVOLT_T_SUB = '-'; - public const PHVOLT_T_MUL = '*'; - public const PHVOLT_T_DIV = '/'; - public const PHVOLT_T_MOD = '%'; - public const PHVOLT_T_AND = 266; - public const PHVOLT_T_OR = 267; - public const PHVOLT_T_CONCAT = '~'; - public const PHVOLT_T_PIPE = '|'; - - public const PHVOLT_T_DOT = '.'; - public const PHVOLT_T_COMMA = 269; - - public const PHVOLT_T_NOT = '|'; - public const PHVOLT_T_LESS = '<'; - public const PHVOLT_T_LESSEQUAL = 270; - public const PHVOLT_T_GREATER = '>'; + public const PHVOLT_T_FCALL = 350; + public const PHVOLT_T_FOR = 304; + public const PHVOLT_T_GREATER = '>'; public const PHVOLT_T_GREATEREQUAL = 271; - public const PHVOLT_T_EQUALS = 272; - public const PHVOLT_T_NOTEQUALS = 273; - public const PHVOLT_T_IDENTICAL = 274; - public const PHVOLT_T_NOTIDENTICAL = 275; - public const PHVOLT_T_RANGE = 276; - public const PHVOLT_T_ASSIGN = '='; - public const PHVOLT_T_COLON = 277; - public const PHVOLT_T_QUESTION = '?'; - public const PHVOLT_T_POW = 278; - public const PHVOLT_T_INCR = 279; - public const PHVOLT_T_DECR = 280; - public const PHVOLT_T_ADD_ASSIGN = 281; - public const PHVOLT_T_SUB_ASSIGN = 282; - public const PHVOLT_T_MUL_ASSIGN = 283; - public const PHVOLT_T_DIV_ASSIGN = 284; - - public const PHVOLT_T_PARENTHESES_OPEN = '('; - public const PHVOLT_T_PARENTHESES_CLOSE = ')'; - public const PHVOLT_T_SBRACKET_OPEN = '['; - public const PHVOLT_T_SBRACKET_CLOSE = ']'; - public const PHVOLT_T_CBRACKET_OPEN = '{'; - public const PHVOLT_T_CBRACKET_CLOSE = '}'; - + public const PHVOLT_T_IDENTICAL = 274; + public const PHVOLT_T_IDENTIFIER = 265; /** * Reserved words */ - public const PHVOLT_T_IF = 300; - public const PHVOLT_T_ELSE = 301; - public const PHVOLT_T_ELSEIF = 302; - public const PHVOLT_T_ENDIF = 303; - public const PHVOLT_T_FOR = 304; - public const PHVOLT_T_ENDFOR = 305; - public const PHVOLT_T_SET = 306; - public const PHVOLT_T_BLOCK = 307; - public const PHVOLT_T_ENDBLOCK = 308; - public const PHVOLT_T_IN = 309; - public const PHVOLT_T_EXTENDS = 310; - public const PHVOLT_T_IS = 311; - public const PHVOLT_T_DEFINED = 312; + public const PHVOLT_T_IF = 300; + public const PHVOLT_T_IGNORE = 257; + public const PHVOLT_T_IN = 309; public const PHVOLT_T_INCLUDE = 313; - public const PHVOLT_T_CACHE = 314; - public const PHVOLT_T_ENDCACHE = 315; - public const PHVOLT_T_DO = 316; - public const PHVOLT_T_AUTOESCAPE = 317; - public const PHVOLT_T_ENDAUTOESCAPE = 318; - public const PHVOLT_T_CONTINUE = 319; - public const PHVOLT_T_BREAK = 320; - public const PHVOLT_T_ELSEFOR = 321; - public const PHVOLT_T_MACRO = 322; - public const PHVOLT_T_ENDMACRO = 323; - public const PHVOLT_T_WITH = 324; - public const PHVOLT_T_CALL = 325; - public const PHVOLT_T_ENDCALL = 326; - public const PHVOLT_T_RETURN = 327; - + public const PHVOLT_T_INCR = 279; + /** + * Literals & Identifiers + */ + public const PHVOLT_T_INTEGER = 258; + public const PHVOLT_T_IS = 311; + public const PHVOLT_T_ISEMPTY = 386; + public const PHVOLT_T_ISEVEN = 387; + public const PHVOLT_T_ISITERABLE = 391; + public const PHVOLT_T_ISNUMERIC = 389; + public const PHVOLT_T_ISODD = 388; + public const PHVOLT_T_ISSCALAR = 390; + public const PHVOLT_T_ISSET = 363; + public const PHVOLT_T_ITERABLE = 385; + public const PHVOLT_T_LESS = '<'; + public const PHVOLT_T_LESSEQUAL = 270; + public const PHVOLT_T_MACRO = 322; + public const PHVOLT_T_MINUS = 368; + public const PHVOLT_T_MOD = '%'; + public const PHVOLT_T_MUL = '*'; + public const PHVOLT_T_MUL_ASSIGN = 283; + public const PHVOLT_T_NOT = '|'; + public const PHVOLT_T_NOTEQUALS = 273; + public const PHVOLT_T_NOTIDENTICAL = 275; + public const PHVOLT_T_NOT_IN = 367; + public const PHVOLT_T_NOT_ISEMPTY = 392; + public const PHVOLT_T_NOT_ISEVEN = 393; + public const PHVOLT_T_NOT_ISITERABLE = 397; + public const PHVOLT_T_NOT_ISNUMERIC = 395; + public const PHVOLT_T_NOT_ISODD = 394; + public const PHVOLT_T_NOT_ISSCALAR = 396; + public const PHVOLT_T_NOT_ISSET = 362; + public const PHVOLT_T_NULL = 261; + public const PHVOLT_T_NUMERIC = 383; + public const PHVOLT_T_ODD = 382; /** * Delimiters */ - public const PHVOLT_T_OPEN_DELIMITER = 330; - public const PHVOLT_T_CLOSE_DELIMITER = 331; - public const PHVOLT_T_OPEN_EDELIMITER = 332; - public const PHVOLT_T_CLOSE_EDELIMITER = 333; - - /** - * Special Tokens - */ - public const PHVOLT_T_FCALL = 350; - public const PHVOLT_T_EXPR = 354; - public const PHVOLT_T_QUALIFIED = 355; - public const PHVOLT_T_ENCLOSED = 356; - public const PHVOLT_T_RAW_FRAGMENT = 357; - public const PHVOLT_T_EMPTY_STATEMENT = 358; - public const PHVOLT_T_ECHO = 359; - public const PHVOLT_T_ARRAY = 360; - public const PHVOLT_T_ARRAYACCESS = 361; - public const PHVOLT_T_NOT_ISSET = 362; - public const PHVOLT_T_ISSET = 363; - public const PHVOLT_T_RESOLVED_EXPR = 364; - public const PHVOLT_T_SLICE = 365; + public const PHVOLT_T_OPEN_DELIMITER = 330; + public const PHVOLT_T_OPEN_EDELIMITER = 332; + public const PHVOLT_T_OR = 267; + public const PHVOLT_T_PARENTHESES_CLOSE = ')'; + public const PHVOLT_T_PARENTHESES_OPEN = '('; + public const PHVOLT_T_PIPE = '|'; + public const PHVOLT_T_PLUS = 369; + public const PHVOLT_T_POW = 278; + public const PHVOLT_T_QUALIFIED = 355; + public const PHVOLT_T_QUESTION = '?'; + public const PHVOLT_T_RANGE = 276; + public const PHVOLT_T_RAW = 400; + public const PHVOLT_T_RAW_FRAGMENT = 357; + public const PHVOLT_T_RESOLVED_EXPR = 364; + public const PHVOLT_T_RETURN = 327; + public const PHVOLT_T_SBRACKET_CLOSE = ']'; + public const PHVOLT_T_SBRACKET_OPEN = '['; + public const PHVOLT_T_SCALAR = 384; + public const PHVOLT_T_SET = 306; + public const PHVOLT_T_SLICE = 365; + public const PHVOLT_T_STRING = 260; + public const PHVOLT_T_SUB = '-'; + public const PHVOLT_T_SUB_ASSIGN = 282; + /** + * switch-case statement + */ + public const PHVOLT_T_SWITCH = 411; public const PHVOLT_T_TERNARY = 366; - public const PHVOLT_T_NOT_IN = 367; - - public const PHVOLT_T_MINUS = 368; - public const PHVOLT_T_PLUS = 369; - - public const PHVOLT_T_EMPTY = 380; - public const PHVOLT_T_EVEN = 381; - public const PHVOLT_T_ODD = 382; - public const PHVOLT_T_NUMERIC = 383; - public const PHVOLT_T_SCALAR = 384; - public const PHVOLT_T_ITERABLE = 385; - - public const PHVOLT_T_ISEMPTY = 386; - public const PHVOLT_T_ISEVEN = 387; - public const PHVOLT_T_ISODD = 388; - public const PHVOLT_T_ISNUMERIC = 389; - public const PHVOLT_T_ISSCALAR = 390; - public const PHVOLT_T_ISITERABLE = 391; - - public const PHVOLT_T_NOT_ISEMPTY = 392; - public const PHVOLT_T_NOT_ISEVEN = 393; - public const PHVOLT_T_NOT_ISODD = 394; - public const PHVOLT_T_NOT_ISNUMERIC = 395; - public const PHVOLT_T_NOT_ISSCALAR = 396; - public const PHVOLT_T_NOT_ISITERABLE = 397; + public const PHVOLT_T_TRUE = 263; + public const PHVOLT_T_WITH = 324; + + /** + * @var bool + */ + protected bool $autoescape = false; - public const PHVOLT_T_RAW = 400; - public const PHVOLT_T_ENDRAW = 401; + /** + * @var int + */ + protected int $blockLevel = 0; /** - * switch-case statement + * @var array|null + * + * TODO: Make array only? + */ + protected ?array $blocks = null; + + /** + * @var string|null + */ + protected ?string $compiledTemplatePath; + + /** + * @var DiInterface|null + */ + protected ?DiInterface $container = null; + + /** + * @var string|null + */ + protected ?string $currentBlock = null; + + /** + * @var string|null + */ + protected ?string $currentPath = null; + + /** + * @var int */ - public const PHVOLT_T_SWITCH = 411; - public const PHVOLT_T_CASE = 412; - public const PHVOLT_T_DEFAULT = 413; - public const PHVOLT_T_ENDSWITCH = 414; - - - - protected bool $autoescape = false; - protected int $blockLevel = 0; - protected $blocks; - protected $container; - protected $compiledTemplatePath; - protected $currentBlock; - protected $currentPath; protected int $exprLevel = 0; + + /** + * @var bool + */ protected bool $extended = false; - protected $extensions; - protected $extendedBlocks; - protected $filters; + /** + * @var array|bool + * + * TODO: Make it always array + */ + protected array | bool $extendedBlocks; + /** + * @var array + */ + protected array $extensions = []; + /** + * @var array + */ + protected array $filters = []; + /** + * @var array + */ + protected array $forElsePointers = []; + /** + * @var int + */ protected int $foreachLevel = 0; - protected $forElsePointers; - protected $functions; + /** + * @var array + */ + protected array $functions = []; + + /** + * @var int + */ protected int $level = 0; - protected $loopPointers; - protected $macros; + + /** + * @var array + */ + protected array $loopPointers = []; + + /** + * @var array + */ + protected array $macros = []; + + /** + * @var array + */ protected array $options = []; - protected $prefix; - protected $view; // string? - public function __construct($view = null) - { - $this->view = $view; + /** + * @var string + */ + protected string $prefix = ""; + + public function __construct( + protected ?ViewBaseInterface $view = null + ) { } /** * Registers a Volt's extension * * @param object $extension + * * @return Compiler */ public function addExtension(object $extension): Compiler @@ -251,7 +340,8 @@ public function addExtension(object $extension): Compiler * Register a new filter in the compiler * * @param string $name - * @param $definition + * @param $definition + * * @return Compiler */ public function addFilter(string $name, $definition): Compiler @@ -265,7 +355,8 @@ public function addFilter(string $name, $definition): Compiler * Register a new function in the compiler * * @param string $name - * @param $definition + * @param $definition + * * @return Compiler */ public function addFunction(string $name, $definition): Compiler @@ -279,12 +370,13 @@ public function addFunction(string $name, $definition): Compiler * Resolves attribute reading * * @param array $expr + * * @return string */ public function attributeReader(array $expr): string { $exprCode = ''; - $left = $expr['left']; + $left = $expr['left']; if ($left['type'] == static::PHVOLT_T_IDENTIFIER) { $variable = $left['value']; @@ -293,8 +385,8 @@ public function attributeReader(array $expr): string * Check if the variable is the loop context */ if ($variable === 'loop') { - $level = $this->foreachLevel; - $exprCode .= '$' . $this->getUniquePrefix() . $level . 'loop'; + $level = $this->foreachLevel; + $exprCode .= '$' . $this->getUniquePrefix() . $level . 'loop'; $this->loopPointers[$level] = $level; } else { /** @@ -319,7 +411,7 @@ public function attributeReader(array $expr): string } $exprCode .= '->'; - $right = $expr['right']; + $right = $expr['right']; if ($right['type'] == static::PHVOLT_T_IDENTIFIER) { $exprCode .= $right['value']; @@ -341,7 +433,8 @@ public function attributeReader(array $expr): string *``` * * @param string $templatePath - * @param bool $extendsMode + * @param bool $extendsMode + * * @return array|mixed|string|null * @throws \Exception */ @@ -351,16 +444,16 @@ public function compile(string $templatePath, bool $extendsMode = false) * Re-initialize some properties already initialized when the object is * cloned */ - $this->extended = false; + $this->extended = false; $this->extendedBlocks = false; - $this->blocks = null; - $this->level = 0; - $this->foreachLevel = 0; - $this->blockLevel = 0; - $this->exprLevel = 0; + $this->blocks = null; + $this->level = 0; + $this->foreachLevel = 0; + $this->blockLevel = 0; + $this->exprLevel = 0; $compilation = null; - $options = $this->options; + $options = $this->options; /** * This makes that templates will be compiled always @@ -556,7 +649,8 @@ public function compile(string $templatePath, bool $extendsMode = false) * Compiles a "autoescape" statement returning PHP code * * @param array $statement - * @param bool $extendsMode + * @param bool $extendsMode + * * @return string */ public function compileAutoEscape(array $statement, bool $extendsMode): string @@ -571,10 +665,10 @@ public function compileAutoEscape(array $statement, bool $extendsMode): string /** * "autoescape" mode */ - $oldAutoescape = $this->autoescape; + $oldAutoescape = $this->autoescape; $this->autoescape = $statement['enable']; - $compilation = $this->statementList($statement['block_statements'], $extendsMode); + $compilation = $this->statementList($statement['block_statements'], $extendsMode); $this->autoescape = $oldAutoescape; return $compilation; @@ -595,9 +689,9 @@ public function compileCache(array $statement, bool $extendsMode = false): strin /** * Cache statement */ - $expr = $statement['expr']; - $lifetime = $statement['lifetime'] ?? null; - $exprCode = $this->expression($expr); + $expr = $statement['expr']; + $lifetime = $statement['lifetime'] ?? null; + $exprCode = $this->expression($expr); $compilation = 'expression($expr) . '] = $this->di->get(\'viewCache\'); '; if ($lifetime !== null) { @@ -624,14 +718,17 @@ public function compileCache(array $statement, bool $extendsMode = false): strin */ if ($lifetime !== null) { if ($lifetime['type'] == static::PHVOLT_T_IDENTIFIER) { - $compilation .= 'save(' . $exprCode . ', null, $' . $lifetime['value'] . '); '; + $compilation .= 'save(' . $exprCode . ', null, $' . $lifetime['value'] . '); '; } else { - $compilation .= 'save(' . $exprCode . ', null, ' . $lifetime['value'] . '); '; + $compilation .= 'save(' . $exprCode . ', null, ' . $lifetime['value'] . '); '; } $compilation .= '} else { echo $_cacheKey[' . $exprCode . ']; } ?>'; } else { - $compilation .= 'save(' . $exprCode . '); } else { echo $_cacheKey[' . $exprCode . ']; } ?>'; + $compilation .= 'save(' . $exprCode . '); } else { echo $_cacheKey[' . $exprCode . ']; } ?>'; } return $compilation; @@ -641,7 +738,7 @@ public function compileCache(array $statement, bool $extendsMode = false): strin * Compiles calls to macros * * @param array $statement - * @param bool $extendsMode + * @param bool $extendsMode */ public function compileCall(array $statement, bool $extendsMode) { @@ -651,7 +748,8 @@ public function compileCall(array $statement, bool $extendsMode) * Compiles a "case"/"default" clause returning PHP code * * @param array $statement - * @param bool $caseClause + * @param bool $caseClause + * * @return string */ public function compileCase(array $statement, bool $caseClause = true): string @@ -680,6 +778,7 @@ public function compileCase(array $statement, bool $caseClause = true): string * Compiles a "do" statement returning PHP code * * @param array $statement + * * @return string * @throws \Exception */ @@ -702,6 +801,7 @@ public function compileDo(array $statement): string * Compiles a {% raw %}`{{` `}}`{% endraw %} statement returning PHP code * * @param array $statement + * * @return string */ public function compileEcho(array $statement): string @@ -716,7 +816,7 @@ public function compileEcho(array $statement): string /** * Evaluate common expressions */ - $expr = $statement['expr']; + $expr = $statement['expr']; $exprCode = $this->expression($expr); if ($expr == static::PHVOLT_T_FCALL) { @@ -743,13 +843,14 @@ public function compileEcho(array $statement): string return '>escaper->escapeHtml(' . $exprCode . ')'; } - return ''; + return ''; } /** * Compiles a "elseif" statement returning PHP code * * @param array $statement + * * @return string * @throws \Exception */ @@ -780,7 +881,8 @@ public function compileElseIf(array $statement): string * * @param string $path * @param string $compiledPath - * @param bool $extendsMode + * @param bool $extendsMode + * * @return string|array */ public function compileFile(string $path, string $compiledPath, bool $extendsMode = false) @@ -810,7 +912,7 @@ public function compileFile(string $path, string $compiledPath, bool $extendsMod } $this->currentPath = $path; - $compilation = $this->compileSource($viewCode, $extendsMode); + $compilation = $this->compileSource($viewCode, $extendsMode); /** * We store the file serialized if it's an array of blocks @@ -832,11 +934,33 @@ public function compileFile(string $path, string $compiledPath, bool $extendsMod return $compilation; } + /** + * Generates a 'forelse' PHP code + * + * @return string + */ + public function compileForElse(): string + { + $level = $this->foreachLevel; + + if (!isset($this->forElsePointers[$level])) { + return ''; + } + + $prefix = $this->forElsePointers[$level]; + if (isset($this->loopPointers[$level])) { + return ''; + } + + return ''; + } + /** * Compiles a "foreach" intermediate code representation into plain PHP code * * @param array $statement - * @param bool $extendsMode + * @param bool $extendsMode + * * @return string */ public function compileForeach(array $statement, bool $extendsMode = false): string @@ -848,11 +972,11 @@ public function compileForeach(array $statement, bool $extendsMode = false): str throw new \Exception('Corrupted statement'); } - $forElse = null; + $forElse = null; $compilation = ''; $this->foreachLevel++; $prefix = $this->getUniquePrefix(); - $level = $this->foreachLevel; + $level = $this->foreachLevel; /** * prefixLevel is used to prefix every temporal variable @@ -862,14 +986,14 @@ public function compileForeach(array $statement, bool $extendsMode = false): str /** * Evaluate common expressions */ - $expr = $statement['expr']; + $expr = $statement['expr']; $exprCode = $this->expression($expr); /** * Process the block statements */ $blockStatements = $statement['block_statements']; - $forElse = false; + $forElse = false; if (gettype($blockStatements) === 'array') { foreach ($blockStatements as $blockStatement) { @@ -881,8 +1005,8 @@ public function compileForeach(array $statement, bool $extendsMode = false): str } if ($blockStatement['type'] == static::PHVOLT_T_ELSEFOR) { - $compilation .= ''; - $forElse = $prefixLevel; + $compilation .= ''; + $forElse = $prefixLevel; $this->forElsePointers[$level] = $forElse; break; @@ -893,7 +1017,7 @@ public function compileForeach(array $statement, bool $extendsMode = false): str /** * Process statements block */ - $code = $this->statementList($blockStatements, $extendsMode); + $code = $this->statementList($blockStatements, $extendsMode); $loopContext = $this->loopPointers; /** @@ -943,11 +1067,16 @@ public function compileForeach(array $statement, bool $extendsMode = false): str */ if (isset($loopContext[$level])) { $compilation .= 'first = ($' . $prefixLevel . 'incr == 0); '; - $compilation .= '$' . $prefixLevel . 'loop->index = $' . $prefixLevel . 'incr + 1; '; - $compilation .= '$' . $prefixLevel . 'loop->index0 = $' . $prefixLevel . 'incr; '; - $compilation .= '$' . $prefixLevel . 'loop->revindex = $' . $prefixLevel . 'loop->length - $' . $prefixLevel . 'incr; '; - $compilation .= '$' . $prefixLevel . 'loop->revindex0 = $' . $prefixLevel . 'loop->length - ($' . $prefixLevel . 'incr + 1); '; - $compilation .= '$' . $prefixLevel . 'loop->last = ($' . $prefixLevel . 'incr == ($' . $prefixLevel . 'loop->length - 1)); ?>'; + $compilation .= '$' . $prefixLevel . 'loop->index = $' + . $prefixLevel . 'incr + 1; '; + $compilation .= '$' . $prefixLevel . 'loop->index0 = $' + . $prefixLevel . 'incr; '; + $compilation .= '$' . $prefixLevel . 'loop->revindex = $' + . $prefixLevel . 'loop->length - $' . $prefixLevel . 'incr; '; + $compilation .= '$' . $prefixLevel . 'loop->revindex0 = $' + . $prefixLevel . 'loop->length - ($' . $prefixLevel . 'incr + 1); '; + $compilation .= '$' . $prefixLevel . 'loop->last = ($' + . $prefixLevel . 'incr == ($' . $prefixLevel . 'loop->length - 1)); ?>'; } /** @@ -982,32 +1111,12 @@ public function compileForeach(array $statement, bool $extendsMode = false): str return $compilation; } - /** - * Generates a 'forelse' PHP code - * - * @return string - */ - public function compileForElse(): string - { - $level = $this->foreachLevel; - - if (!isset($this->forElsePointers[$level])) { - return ''; - } - - $prefix = $this->forElsePointers[$level]; - if (isset($this->loopPointers[$level])) { - return ''; - } - - return ''; - } - /** * Compiles a 'if' statement returning PHP code * * @param array $statement - * @param bool $extendsMode + * @param bool $extendsMode + * * @return string * @throws \Exception */ @@ -1023,7 +1132,11 @@ public function compileIf(array $statement, bool $extendsMode = false): string /** * Process statements in the "true" block */ - $compilation = 'expression($statement['expr']) . ') { ?>' . $this->statementList($statement['true_statements'], $extendsMode); + $compilation = 'expression($statement['expr']) . ') { ?>' + . $this->statementList( + $statement['true_statements'], + $extendsMode + ); /** * Check for a "else"/"elseif" block @@ -1032,7 +1145,8 @@ public function compileIf(array $statement, bool $extendsMode = false): string /** * Process statements in the "false" block */ - $compilation .= '' . $this->statementList($statement['false_statements'], $extendsMode); + $compilation .= '' + . $this->statementList($statement['false_statements'], $extendsMode); } $compilation .= ''; @@ -1067,7 +1181,7 @@ public function compileInclude(array $statement): string /** * Get the static path */ - $path = $pathExpr['value']; + $path = $pathExpr['value']; $finalPath = $this->getFinalPath($path); /** @@ -1111,7 +1225,8 @@ public function compileInclude(array $statement): string * Compiles macros * * @param array $statement - * @param bool $extendsMode + * @param bool $extendsMode + * * @return string * @throws \Exception */ @@ -1136,8 +1251,8 @@ public function compileMacro(array $statement, bool $extendsMode): string * Register the macro */ $this->macros[$name] = $name; - $macroName = '$this->>macros[\'' . $name . '\]'; - $code = '>macros[\'' . $name . '\]'; + $code = ''; @@ -1160,7 +1275,8 @@ public function compileMacro(array $statement, bool $extendsMode): string if (isset($parameter['default'])) { $code .= '$' . $variableName . ' = ' . $this->expression($parameter['default']) . ';'; } else { - $code .= ' throw new \\Phalcon\\Mvc\\View\\Exception(\'Macro "' . $name . '" was called without parameter ' . $variableName . '\'); '; + $code .= ' throw new \\Phalcon\\Mvc\\View\\Exception(\'Macro "' + . $name . '" was called without parameter ' . $variableName . '\'); '; } $code .= ' } ) '; @@ -1193,6 +1309,7 @@ public function compileMacro(array $statement, bool $extendsMode): string * Compiles a "return" statement returning PHP code * * @param array $statement + * * @return string * @throws \Exception */ @@ -1254,11 +1371,11 @@ public function compileSet(array $statement): string break; case static::PHVOLT_T_DIV_ASSIGN: - $compilation .= ' ' . $target . ' /= '. $exprCode . ';'; + $compilation .= ' ' . $target . ' /= ' . $exprCode . ';'; break; default: - $compilation .= ' ' . $target . ' = '. $exprCode . ';'; + $compilation .= ' ' . $target . ' = ' . $exprCode . ';'; break; } } @@ -1268,6 +1385,94 @@ public function compileSet(array $statement): string return $compilation; } + /** + * Compiles a Volt source code returning a PHP plain version + * + * @param string $viewCode + * @param bool $extendsMode + * + * @return string + */ + public function compileSource(string $viewCode, bool $extendsMode = false): string + { + /** + * Enable autoescape globally + */ + if (array_key_exists('autoescape', $this->options)) { + if (gettype($this->options['autoescape']) !== 'boolean') { + throw new Exception("'autoescape' must be bool"); + } + + $this->autoescape = $this->options['autoescape']; + } + + $parser = new Parser($viewCode); + $intermediate = $parser->parseView($this->currentPath); + $compilation = $this->statementList($intermediate, $extendsMode); + + /** + * Check if the template is extending another + */ + if (true === $this->extended) { + /** + * Multiple-Inheritance is allowed + */ + $finalCompilation = true === $extendsMode ? [] : null; + foreach ($this->extendedBlocks as $name => $block) { + /** + * If name is a string then is a block name + */ + if (true === is_string($name)) { + if (isset($this->blocks[$name])) { + /** + * The block is set in the local template + */ + $localBlock = $this->blocks[$name]; + $this->currentBlock = $name; + $blockCompilation = $this->statementList($localBlock); + } else { + if (true === is_array($block)) { + /** + * The block is not set local only in the extended + * template + */ + $blockCompilation = $this->statementList($block); + } else { + $blockCompilation = $block; + } + } + + if (true === $extendsMode) { + $finalCompilation[$name] = $blockCompilation; + } else { + $finalCompilation .= $blockCompilation; + } + } else { + /** + * Here the block is an already compiled text + */ + if (true === $extendsMode) { + $finalCompilation[] = $block; + } else { + $finalCompilation .= $block; + } + } + } + + return $finalCompilation; + } + + if (true === $extendsMode) { + /** + * In extends mode we return the template blocks instead of the + * compilation + */ + return $this->blocks; + } + + return $compilation; + } + /** * Compiles a template into a string * @@ -1276,7 +1481,8 @@ public function compileSet(array $statement): string *``` * * @param string $viewCode - * @param bool $extendsMode + * @param bool $extendsMode + * * @return string */ public function compileString(string $viewCode, bool $extendsMode = false): string @@ -1310,7 +1516,7 @@ public function compileSwitch(array $statement, bool $extendsMode = false): stri */ if (isset($statement['case_clauses'])) { $caseClauses = $statement['case_clauses']; - $lines = $this->statementList($caseClauses, $extendsMode); + $lines = $this->statementList($caseClauses, $extendsMode); /** * Any output (including whitespace) between a switch statement and @@ -1432,14 +1638,14 @@ final public function expression(array $expr, bool $doubleQuotes = false): strin /** * From here, right part of expression is always resolved */ - $exprCode = null; + $exprCode = null; $rightCode = isset($expr['right']) ? $this->expression($expr['right'], $doubleQuotes) : ''; switch ($type) { case static::PHVOLT_T_NOT: $exprCode = '|' . $rightCode; break; - + case static::PHVOLT_T_MUL: $exprCode = $leftCode . ' * ' . $rightCode; break; @@ -1634,7 +1840,8 @@ final public function expression(array $expr, bool $doubleQuotes = false): strin break; case static::PHVOLT_T_TERNARY: - $exprCode = '(' . $this->expression($expr['ternary'], $doubleQuotes) . ' ? ' . $leftCode . ' : ' . $rightCode . ')'; + $exprCode = '(' . $this->expression($expr['ternary'], $doubleQuotes) + . ' ? ' . $leftCode . ' : ' . $rightCode . ')'; break; case static::PHVOLT_T_MINUS: @@ -1664,6 +1871,7 @@ final public function expression(array $expr, bool $doubleQuotes = false): strin * * @param string $name * @param array|null arguments + * * @return string|void */ final public function fireExtensionEvent(string $name, ?array $arguments = null) @@ -1703,11 +1911,12 @@ final public function fireExtensionEvent(string $name, ?array $arguments = null) * Resolves function intermediate code into PHP function calls * * @param array $expr + * * @return string */ public function functionCall(array $expr, bool $doubleQuotes = false): string { - $code = null; + $code = null; $funcArguments = null; $arguments = isset($expr['arguments']) ? $this->expression($expr['arguments'], $doubleQuotes) : ''; @@ -1746,7 +1955,7 @@ public function functionCall(array $expr, bool $doubleQuotes = false): string $functions = $this->functions; if (gettype($functions) === 'array') { if (isset($functions[$name])) { - $definition = $functions[$name]; + $definition = $functions[$name]; $definitionType = gettype($definition); /** @@ -1770,7 +1979,8 @@ public function functionCall(array $expr, bool $doubleQuotes = false): string } throw new \Exception( - 'Invalid definition for user function "' . $name . '" in ' . $expr['file'] . ' on line ' . $expr['line'] + 'Invalid definition for user function "' + . $name . '" in ' . $expr['file'] . ' on line ' . $expr['line'] ); } } @@ -1799,11 +2009,11 @@ public function functionCall(array $expr, bool $doubleQuotes = false): string $currentBlock = $this->currentBlock; if (isset($extendedBlocks[$currentBlock])) { - $block = $extendedBlocks[$currentBlock]; + $block = $extendedBlocks[$currentBlock]; $exprLevel = $this->exprLevel; if (gettype($block) === 'array') { - $code = $this->statementListOrExtends($block); + $code = $this->statementListOrExtends($block); $escapedCode = $exprLevel == 1 ? $code : addslashes($code); } else { $escapedCode = $exprLevel == 1 ? $block : addslashes($block); @@ -1824,27 +2034,27 @@ public function functionCall(array $expr, bool $doubleQuotes = false): string } $method = lcfirst( - //\Phalcon\Text::camelize($name) + //\Phalcon\Text::camelize($name) ucwords($name) ); $arrayHelpers = [ - 'link_to' => true, - 'image' => true, - 'form' => true, - 'submit_button' => true, - 'radio_field' => true, - 'check_field' => true, - 'file_field' => true, - "hidden_field" => true, + 'link_to' => true, + 'image' => true, + 'form' => true, + 'submit_button' => true, + 'radio_field' => true, + 'check_field' => true, + 'file_field' => true, + "hidden_field" => true, "password_field" => true, - "text_area" => true, - "text_field" => true, - "email_field" => true, - "date_field" => true, - "tel_field" => true, - "numeric_field" => true, - "image_input" => true, + "text_area" => true, + "text_field" => true, + "email_field" => true, + "date_field" => true, + "tel_field" => true, + "numeric_field" => true, + "image_input" => true, ]; /** @@ -1902,7 +2112,7 @@ public function functionCall(array $expr, bool $doubleQuotes = false): string /** * By default it tries to call a macro */ - return '$this->>callMacro(' . $name . '\', [' . $arguments . '])'; + return '$this->callMacro(\'' . $name . '\', [' . $arguments . '])'; } return $this->expression($nameExpr, $doubleQuotes) . '(' . $arguments . ')'; @@ -1952,6 +2162,7 @@ public function getFunctions(): array * Returns a compiler's option * * @param string $option + * * @return string */ public function getOption(string $option): ?string @@ -2000,7 +2211,7 @@ public function getUniquePrefix(): string $this->prefix = call_user_func_array( $this->prefix, [ - $this + $this, ] ); } @@ -2022,6 +2233,7 @@ public function getUniquePrefix(): string *``` * * @param string $viewCode + * * @return array */ public function parse(string $viewCode): array @@ -2120,7 +2332,7 @@ public function resolveTest(array $test, string $left): string * Sets a single compiler option * * @param string $option - * @param $value + * @param $value */ public function setOption(string $option, $value): void { @@ -2129,6 +2341,7 @@ public function setOption(string $option, $value): void /** * Sets the compiler options + * * @param array $options */ public function setOptions(array $options): void @@ -2138,7 +2351,9 @@ public function setOptions(array $options): void /** * Set a unique prefix to be used as prefix for compiled variables + * * @param string $prefix + * * @return Compiler */ public function setUniquePrefix(string $prefix): Compiler @@ -2148,96 +2363,11 @@ public function setUniquePrefix(string $prefix): Compiler return $this; } - /** - * Compiles a Volt source code returning a PHP plain version - * @param string $viewCode - * @param bool $extendsMode - * @return string - */ - public function compileSource(string $viewCode, bool $extendsMode = false): string - { - /** - * Enable autoescape globally - */ - if (array_key_exists('autoescape', $this->options)) { - if (gettype($this->options['autoescape']) !== 'boolean') { - throw new Exception("'autoescape' must be bool"); - } - - $this->autoescape = $this->options['autoescape']; - } - - $parser = new Parser($viewCode); - $intermediate = $parser->parseView($this->currentPath); - $compilation = $this->statementList($intermediate, $extendsMode); - - /** - * Check if the template is extending another - */ - if (true === $this->extended) { - /** - * Multiple-Inheritance is allowed - */ - $finalCompilation = true === $extendsMode ? [] : null; - foreach ($this->extendedBlocks as $name => $block) { - /** - * If name is a string then is a block name - */ - if (true === is_string($name)) { - if (isset($this->blocks[$name])) { - /** - * The block is set in the local template - */ - $localBlock = $this->blocks[$name]; - $this->currentBlock = $name; - $blockCompilation = $this->statementList($localBlock); - } else { - if (true === is_array($block)) { - /** - * The block is not set local only in the extended - * template - */ - $blockCompilation = $this->statementList($block); - } else { - $blockCompilation = $block; - } - } - - if (true === $extendsMode) { - $finalCompilation[$name] = $blockCompilation; - } else { - $finalCompilation .= $blockCompilation; - } - } else { - /** - * Here the block is an already compiled text - */ - if (true === $extendsMode) { - $finalCompilation[] = $block; - } else { - $finalCompilation .= $block; - } - } - } - - return $finalCompilation; - } - - if (true === $extendsMode) { - /** - * In extends mode we return the template blocks instead of the - * compilation - */ - return $this->blocks; - } - - return $compilation; - } - /** * Gets the final path with VIEW * * @param string $path + * * @return string */ protected function getFinalPath(string $path): string @@ -2267,8 +2397,9 @@ protected function getFinalPath(string $path): string /** * Resolves filter intermediate code into PHP function calls * - * @param array $filter + * @param array $filter * @param string $left + * * @return string */ final protected function resolveFilter(array $filter, string $left): string @@ -2292,11 +2423,11 @@ final protected function resolveFilter(array $filter, string $left): string } $functionName = $filter['name']; - $name = $functionName['value']; + $name = $functionName['value']; } $funcArguments = null; - $arguments = null; + $arguments = null; /** * Resolve arguments @@ -2316,10 +2447,10 @@ final protected function resolveFilter(array $filter, string $left): string $funcArguments, [ "expr" => [ - "type" => 364, + "type" => 364, "value" => $left, - "file" => $file, - "line" => $line + "file" => $file, + "line" => $line, ], "file" => $file, "line" => $line, @@ -2380,7 +2511,8 @@ final protected function resolveFilter(array $filter, string $left): string * Invalid filter definition throw an exception */ throw new Exception( - "Invalid definition for user filter '" . $name . "' in " . $filter["file"] . " on line " . $filter["line"] + "Invalid definition for user filter '" + . $name . "' in " . $filter["file"] . " on line " . $filter["line"] ); } @@ -2582,7 +2714,8 @@ final protected function resolveFilter(array $filter, string $left): string * Traverses a statement list compiling each of its nodes * * @param array $statements - * @param bool $extendsMode + * @param bool $extendsMode + * * @return string */ final protected function statementList(array $statements, bool $extendsMode = false): string @@ -2597,7 +2730,7 @@ final protected function statementList(array $statements, bool $extendsMode = fa /** * Increase the statement recursion level in extends mode */ - $extended = $this->extended; + $extended = $this->extended; $blockMode = $extended || $extendsMode; if (true === $blockMode) { @@ -2606,7 +2739,7 @@ final protected function statementList(array $statements, bool $extendsMode = fa $this->level++; $compilation = null; - $extensions = $this->extensions; + $extensions = $this->extensions; foreach ($statements as $statement) { /** @@ -2702,9 +2835,9 @@ final protected function statementList(array $statements, bool $extendsMode = fa /** * Block statement */ - $blockName = $statement['name']; + $blockName = $statement['name']; $blockStatements = $statement["block_statements"]; - $blocks = $this->blocks; + $blocks = $this->blocks; if (true === $blockMode) { if (false === is_array($blocks)) { @@ -2715,7 +2848,7 @@ final protected function statementList(array $statements, bool $extendsMode = fa * Create a unamed block */ if ($compilation !== null) { - $blocks[] = $compilation; + $blocks[] = $compilation; $compilation = null; } @@ -2724,7 +2857,7 @@ final protected function statementList(array $statements, bool $extendsMode = fa * blocks variable */ $blocks[$blockName] = $blockStatements; - $this->blocks = $blocks; + $this->blocks = $blocks; } elseif (true === is_array($blockStatements)) { $compilation .= $this->statementList($blockStatements, $extendsMode); } @@ -2735,14 +2868,14 @@ final protected function statementList(array $statements, bool $extendsMode = fa /** * Extends statement */ - $path = $statement["path"]; + $path = $statement["path"]; $finalPath = $this->getFinalPath($path['value']); - $extended = true; + $extended = true; /** * Perform a sub-compilation of the extended file */ - $subCompiler = clone $this; + $subCompiler = clone $this; $tempCompilation = $subCompiler->compile($finalPath, $extended); /** @@ -2753,9 +2886,9 @@ final protected function statementList(array $statements, bool $extendsMode = fa $tempCompilation = file_get_contents($subCompiler->getCompiledTemplatePath()); } - $this->extended = true; + $this->extended = true; $this->extendedBlocks = $tempCompilation; - $blockMode = $extended; + $blockMode = $extended; break; @@ -2773,7 +2906,7 @@ final protected function statementList(array $statements, bool $extendsMode = fa break; case self::PHVOLT_T_AUTOESCAPE: - $compilation .= $this->compileAutoEscape( + $compilation .= $this->compileAutoEscape( $statement, $extendsMode ); @@ -2858,6 +2991,7 @@ final protected function statementList(array $statements, bool $extendsMode = fa * Compiles a block of statements * * @param array statements + * * @return string|array */ final protected function statementListOrExtends($statements) @@ -2898,6 +3032,20 @@ final protected function statementListOrExtends($statements) return $statements; } + /** + * Compare modification timestamps to check if the $filename1 + * needs to be recompiled + * + * @param string $filename1 + * @param string $filename2 + * + * @return bool + */ + private function compareMtime(string $filename1, string $filename2): bool + { + return filemtime($filename1) >= filemtime($filename2); + } + private function isTagFactory(array $expression): bool { if (isset($expression['name']['left'])) { @@ -2925,6 +3073,7 @@ private function isTagFactory(array $expression): bool * * @param string|null $path * @param string|null $virtualSeparator + * * @return string */ private function prepareVirtualPath(?string $path = null, ?string $virtualSeparator = null): string @@ -2939,7 +3088,7 @@ private function prepareVirtualPath(?string $path = null, ?string $virtualSepara return $virtualPath; } - $path = strtolower($path); + $path = strtolower($path); $length = strlen($path); for ($i = 0; $i < $length; $i++) { $char = $path[$i]; @@ -2963,23 +3112,11 @@ private function prepareVirtualPath(?string $path = null, ?string $virtualSepara return $virtualPath; } - /** - * Compare modification timestamps to check if the $filename1 - * needs to be recompiled - * - * @param string $filename1 - * @param string $filename2 - * @return bool - */ - private function compareMtime(string $filename1, string $filename2): bool - { - return filemtime($filename1) >= filemtime($filename2); - } - /** * Implementation of zephir_unique_path_key() * * @param string|null $path + * * @return string|null */ private function uniquePathKey(?string $path = null): ?string @@ -2996,12 +3133,13 @@ private function uniquePathKey(?string $path = null): ?string * * @param $arKey * @param $nKeyLength + * * @return int */ private function zendInlineHashFunc($arKey, $nKeyLength): int { $hash = 5381; - $i = 0; + $i = 0; /* variant with the hash unrolled eight times */ for (; $nKeyLength >= 8; $nKeyLength -= 8) { @@ -3016,14 +3154,23 @@ private function zendInlineHashFunc($arKey, $nKeyLength): int } switch ($nKeyLength) { - case 7: $hash = (($hash << 5) + $hash) + ord($arKey[$i++]); /* fallthrough... */ - case 6: $hash = (($hash << 5) + $hash) + ord($arKey[$i++]); /* fallthrough... */ - case 5: $hash = (($hash << 5) + $hash) + ord($arKey[$i++]); /* fallthrough... */ - case 4: $hash = (($hash << 5) + $hash) + ord($arKey[$i++]); /* fallthrough... */ - case 3: $hash = (($hash << 5) + $hash) + ord($arKey[$i++]); /* fallthrough... */ - case 2: $hash = (($hash << 5) + $hash) + ord($arKey[$i++]); /* fallthrough... */ - case 1: $hash = (($hash << 5) + $hash) + ord($arKey[$i++]); break; - case 0: break; + case 7: + $hash = (($hash << 5) + $hash) + ord($arKey[$i++]); /* fallthrough... */ + case 6: + $hash = (($hash << 5) + $hash) + ord($arKey[$i++]); /* fallthrough... */ + case 5: + $hash = (($hash << 5) + $hash) + ord($arKey[$i++]); /* fallthrough... */ + case 4: + $hash = (($hash << 5) + $hash) + ord($arKey[$i++]); /* fallthrough... */ + case 3: + $hash = (($hash << 5) + $hash) + ord($arKey[$i++]); /* fallthrough... */ + case 2: + $hash = (($hash << 5) + $hash) + ord($arKey[$i++]); /* fallthrough... */ + case 1: + $hash = (($hash << 5) + $hash) + ord($arKey[$i++]); + break; + case 0: + break; } return $hash; diff --git a/src/Parser/Parser.php b/src/Parser/Parser.php index 4c6c67a..a417707 100644 --- a/src/Parser/Parser.php +++ b/src/Parser/Parser.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE.txt + * file that was distributed with this source code. + */ + declare(strict_types=1); namespace Phalcon\Volt\Parser; @@ -10,6 +19,11 @@ use Phalcon\Volt\Scanner\State; use Phalcon\Volt\Scanner\Token; +use function fopen; +use function sprintf; +use function strlen; +use function substr; + class Parser { private ?Token $token = null; @@ -18,6 +32,11 @@ public function __construct(private string $code) { } + /** + * @param string $templatePath + * + * @return array + */ public function parseView(string $templatePath): array { if (strlen($this->code) === 0) { @@ -174,7 +193,10 @@ public function parseView(string $templatePath): array case Compiler::PHVOLT_T_OPEN_EDELIMITER: if ($state->extendsMode === 1 && $state->blockLevel == 0) { - $this->createErrorMessage($parserStatus, 'Child templates only may contain blocks'); + $this->createErrorMessage( + $parserStatus, + 'Child templates only may contain blocks' + ); $parserStatus->setStatus(Status::PHVOLT_PARSING_FAILED); break; } @@ -199,24 +221,43 @@ public function parseView(string $templatePath): array break; case Compiler::PHVOLT_T_INTEGER: - $this->phvolt_parse_with_token($parser, Compiler::PHVOLT_T_INTEGER, Opcode::PHVOLT_INTEGER); + $this->phvoltParseWithToken( + $parser, + Compiler::PHVOLT_T_INTEGER, + Opcode::PHVOLT_INTEGER + ); break; case Compiler::PHVOLT_T_DOUBLE: - $this->phvolt_parse_with_token($parser, Compiler::PHVOLT_T_DOUBLE, Opcode::PHVOLT_DOUBLE); + $this->phvoltParseWithToken( + $parser, + Compiler::PHVOLT_T_DOUBLE, + Opcode::PHVOLT_DOUBLE + ); break; case Compiler::PHVOLT_T_STRING: - $this->phvolt_parse_with_token($parser, Compiler::PHVOLT_T_STRING, Opcode::PHVOLT_STRING); + $this->phvoltParseWithToken( + $parser, + Compiler::PHVOLT_T_STRING, + Opcode::PHVOLT_STRING + ); break; case Compiler::PHVOLT_T_IDENTIFIER: - $this->phvolt_parse_with_token($parser, Compiler::PHVOLT_T_IDENTIFIER, Opcode::PHVOLT_IDENTIFIER); + $this->phvoltParseWithToken( + $parser, + Compiler::PHVOLT_T_IDENTIFIER, + Opcode::PHVOLT_IDENTIFIER + ); break; case Compiler::PHVOLT_T_IF: if ($state->extendsMode === 1 && $state->blockLevel == 0) { - $this->createErrorMessage($parserStatus, 'Child templates only may contain blocks'); + $this->createErrorMessage( + $parserStatus, + 'Child templates only may contain blocks' + ); $parserStatus->setStatus(Status::PHVOLT_PARSING_FAILED); break; } @@ -257,7 +298,10 @@ public function parseView(string $templatePath): array case Compiler::PHVOLT_T_FOR: if ($state->extendsMode === 1 && $state->blockLevel == 0) { - $this->createErrorMessage($parserStatus, 'Child templates only may contain blocks'); + $this->createErrorMessage( + $parserStatus, + 'Child templates only may contain blocks' + ); $parserStatus->setStatus(Status::PHVOLT_PARSING_FAILED); break; } @@ -282,11 +326,17 @@ public function parseView(string $templatePath): array case Compiler::PHVOLT_T_SWITCH: if ($state->extendsMode === 1 && $state->blockLevel == 0) { - $this->createErrorMessage($parserStatus, 'Child templates only may contain blocks'); + $this->createErrorMessage( + $parserStatus, + 'Child templates only may contain blocks' + ); $parserStatus->setStatus(Status::PHVOLT_PARSING_FAILED); break; } elseif ($state->switchLevel > 0) { - $this->createErrorMessage($parserStatus, 'A nested switch detected. There is no nested switch-case statements support'); + $this->createErrorMessage( + $parserStatus, + 'A nested switch detected. There is no nested switch-case statements support' + ); $parserStatus->setStatus(Status::PHVOLT_PARSING_FAILED); break; } @@ -314,7 +364,11 @@ public function parseView(string $templatePath): array break; } - $this->phvolt_parse_with_token($parser, Compiler::PHVOLT_T_IDENTIFIER, Opcode::PHVOLT_DEFAULT); + $this->phvoltParseWithToken( + $parser, + Compiler::PHVOLT_T_IDENTIFIER, + Opcode::PHVOLT_DEFAULT + ); break; case Compiler::PHVOLT_T_ENDSWITCH: @@ -332,22 +386,32 @@ public function parseView(string $templatePath): array case Compiler::PHVOLT_T_RAW_FRAGMENT: if ($this->token !== null) { if ($state->extendsMode === 1 && $state->blockLevel === 0) { - $this->createErrorMessage($parserStatus, 'Child templates only may contain blocks'); + $this->createErrorMessage( + $parserStatus, + 'Child templates only may contain blocks' + ); $parserStatus->setStatus(Status::PHVOLT_PARSING_FAILED); break; } - if (!$this->phvolt_is_blank_string($this->token)) { + if (!$this->phvoltIsBlankString($this->token)) { $state->statementPosition++; } - $this->phvolt_parse_with_token($parser, Compiler::PHVOLT_T_RAW_FRAGMENT, Opcode::PHVOLT_RAW_FRAGMENT); + $this->phvoltParseWithToken( + $parser, + Compiler::PHVOLT_T_RAW_FRAGMENT, + Opcode::PHVOLT_RAW_FRAGMENT + ); } break; case Compiler::PHVOLT_T_SET: if ($state->extendsMode === 1 && $state->blockLevel === 0) { - $this->createErrorMessage($parserStatus, 'Child templates only may contain blocks'); + $this->createErrorMessage( + $parserStatus, + 'Child templates only may contain blocks' + ); $parserStatus->setStatus(Status::PHVOLT_PARSING_FAILED); break; } @@ -385,7 +449,10 @@ public function parseView(string $templatePath): array case Compiler::PHVOLT_T_BLOCK: if ($state->blockLevel > 0) { - $this->createErrorMessage($parserStatus, 'Embedding blocks into other blocks is not supported'); + $this->createErrorMessage( + $parserStatus, + 'Embedding blocks into other blocks is not supported' + ); $parserStatus->setStatus(Status::PHVOLT_PARSING_FAILED); break; } @@ -401,7 +468,10 @@ public function parseView(string $templatePath): array case Compiler::PHVOLT_T_MACRO: if ($state->macroLevel > 0) { - $this->createErrorMessage($parserStatus, 'Embedding macros into other macros is not allowed'); + $this->createErrorMessage( + $parserStatus, + 'Embedding macros into other macros is not allowed' + ); $parserStatus->setStatus(Status::PHVOLT_PARSING_FAILED); break; } @@ -503,7 +573,10 @@ public function parseView(string $templatePath): array case Compiler::PHVOLT_T_EXTENDS: if ($state->statementPosition !== 1) { - $this->createErrorMessage($parserStatus, 'Extends statement must be placed at the first line in the template'); + $this->createErrorMessage( + $parserStatus, + 'Extends statement must be placed at the first line in the template' + ); $parserStatus->setStatus(Status::PHVOLT_PARSING_FAILED); break; } @@ -512,10 +585,13 @@ public function parseView(string $templatePath): array $parser->phvolt_(Opcode::PHVOLT_EXTENDS); break; - default: - $this->createErrorMessage($parserStatus, sprintf('Scanner: unknown opcode %d', $opcode)); - $parserStatus->setStatus(Status::PHVOLT_PARSING_FAILED); - break; + default: + $this->createErrorMessage( + $parserStatus, + sprintf('Scanner: unknown opcode %d', $opcode) + ); + $parserStatus->setStatus(Status::PHVOLT_PARSING_FAILED); + break; } if ($parserStatus->getStatus() !== Status::PHVOLT_PARSING_OK) { @@ -532,6 +608,12 @@ public function parseView(string $templatePath): array return $parser->getOutput(); } + /** + * @param Status $parserStatus + * @param string $message + * + * @return void + */ private function createErrorMessage(Status $parserStatus, string $message): void { $length = 128 + strlen($parserStatus->getState()->getActiveFile()); @@ -545,7 +627,14 @@ private function createErrorMessage(Status $parserStatus, string $message): void $parserStatus->setSyntaxError(substr($str, 0, $length)); } - private function phvolt_parse_with_token(\phvolt_Parser $parser, int $opcode, int $parserCode): void + /** + * @param \phvolt_Parser $parser + * @param int $opcode + * @param int $parserCode + * + * @return void + */ + private function phvoltParseWithToken(\phvolt_Parser $parser, int $opcode, int $parserCode): void { $newToken = new Token(); $newToken->setOpcode($opcode); @@ -557,7 +646,12 @@ private function phvolt_parse_with_token(\phvolt_Parser $parser, int $opcode, in $parser->phvolt_($parserCode, $newToken); } - private function phvolt_is_blank_string(Token $token): bool + /** + * @param Token $token + * + * @return bool + */ + private function phvoltIsBlankString(Token $token): bool { $marker = $token->getValue(); $len = strlen($marker); diff --git a/src/Parser/Status.php b/src/Parser/Status.php index fe4cc41..f8098ac 100644 --- a/src/Parser/Status.php +++ b/src/Parser/Status.php @@ -18,56 +18,76 @@ class Status { - public const PHVOLT_PARSING_OK = 1; public const PHVOLT_PARSING_FAILED = 0; - + public const PHVOLT_PARSING_OK = 1; + /** + * @var null + */ protected $ret = null; - - protected State $scannerState; - - protected ?Token $token = null; - - protected int $status; - + /** + * @var string|null + */ protected ?string $syntaxError = null; + /** + * @var Token|null + */ + protected ?Token $token = null; public function __construct( - State $scannerState, - int $status = self::PHVOLT_PARSING_OK, + protected State $scannerState, + protected int $status = self::PHVOLT_PARSING_OK, ) { - $this->scannerState = $scannerState; - $this->status = $status; } - public function setStatus(int $status): self + /** + * @return State + */ + public function getState(): State { - $this->status = $status; - - return $this; + return $this->scannerState; } + /** + * @return int + */ public function getStatus(): int { return $this->status; } - public function getState(): State + /** + * @return string|null + */ + public function getSyntaxError(): ?string { - return $this->scannerState; + return $this->syntaxError; } - public function setToken(Token $token): self + /** + * @return Token|null + */ + public function getToken(): ?Token { - $this->token = $token; - - return $this; + return $this->token; } - public function getToken(): ?Token + /** + * @param int $status + * + * @return $this + */ + public function setStatus(int $status): self { - return $this->token; + $this->status = $status; + + return $this; } + /** + * @param string $syntaxError + * + * @return $this + */ public function setSyntaxError(string $syntaxError): self { $this->syntaxError = $syntaxError; @@ -75,8 +95,15 @@ public function setSyntaxError(string $syntaxError): self return $this; } - public function getSyntaxError(): ?string + /** + * @param Token $token + * + * @return $this + */ + public function setToken(Token $token): self { - return $this->syntaxError; + $this->token = $token; + + return $this; } } diff --git a/src/Scanner/Opcode.php b/src/Scanner/Opcode.php index de6b0d8..770de10 100644 --- a/src/Scanner/Opcode.php +++ b/src/Scanner/Opcode.php @@ -15,92 +15,92 @@ */ class Opcode { - public const PHVOLT_OPEN_DELIMITER = 1; - public const PHVOLT_COMMA = 2; - public const PHVOLT_QUESTION = 3; - public const PHVOLT_COLON = 4; - public const PHVOLT_RANGE = 5; - public const PHVOLT_AND = 6; - public const PHVOLT_OR = 7; - public const PHVOLT_IN = 8; - public const PHVOLT_IS = 9; - public const PHVOLT_EQUALS = 10; - public const PHVOLT_NOTEQUALS = 11; - public const PHVOLT_LESS = 12; - public const PHVOLT_GREATER = 13; - public const PHVOLT_GREATEREQUAL = 14; - public const PHVOLT_LESSEQUAL = 15; - public const PHVOLT_IDENTICAL = 16; - public const PHVOLT_NOTIDENTICAL = 17; - public const PHVOLT_DIVIDE = 18; - public const PHVOLT_TIMES = 19; - public const PHVOLT_MOD = 20; - public const PHVOLT_PLUS = 21; - public const PHVOLT_MINUS = 22; - public const PHVOLT_CONCAT = 23; - public const PHVOLT_SBRACKET_OPEN = 24; - public const PHVOLT_PIPE = 25; - public const PHVOLT_NOT = 26; - public const PHVOLT_INCR = 27; - public const PHVOLT_DECR = 28; - public const PHVOLT_PARENTHESES_OPEN = 29; - public const PHVOLT_DOT = 30; - public const PHVOLT_IF = 31; - public const PHVOLT_CLOSE_DELIMITER = 32; - public const PHVOLT_ENDIF = 33; - public const PHVOLT_ELSE = 34; - public const PHVOLT_ELSEIF = 35; - public const PHVOLT_ELSEFOR = 36; - public const PHVOLT_FOR = 37; - public const PHVOLT_IDENTIFIER = 38; - public const PHVOLT_ENDFOR = 39; - public const PHVOLT_SWITCH = 40; - public const PHVOLT_ENDSWITCH = 41; - public const PHVOLT_CASE = 42; - public const PHVOLT_DEFAULT = 43; - public const PHVOLT_SET = 44; - public const PHVOLT_ASSIGN = 45; - public const PHVOLT_ADD_ASSIGN = 46; - public const PHVOLT_SUB_ASSIGN = 47; - public const PHVOLT_MUL_ASSIGN = 48; - public const PHVOLT_DIV_ASSIGN = 49; - public const PHVOLT_SBRACKET_CLOSE = 50; - public const PHVOLT_MACRO = 51; + public const PHVOLT_ADD_ASSIGN = 46; + public const PHVOLT_AND = 6; + public const PHVOLT_ASSIGN = 45; + public const PHVOLT_AUTOESCAPE = 75; + public const PHVOLT_BLOCK = 64; + public const PHVOLT_BREAK = 77; + public const PHVOLT_CACHE = 66; + public const PHVOLT_CALL = 60; + public const PHVOLT_CASE = 42; + public const PHVOLT_CBRACKET_CLOSE = 88; + public const PHVOLT_CBRACKET_OPEN = 87; + public const PHVOLT_CLOSE_DELIMITER = 32; + public const PHVOLT_CLOSE_EDELIMITER = 63; + public const PHVOLT_COLON = 4; + public const PHVOLT_COMMA = 2; + public const PHVOLT_CONCAT = 23; + public const PHVOLT_CONTINUE = 78; + public const PHVOLT_DECR = 28; + public const PHVOLT_DEFAULT = 43; + public const PHVOLT_DEFINED = 80; + public const PHVOLT_DIVIDE = 18; + public const PHVOLT_DIV_ASSIGN = 49; + public const PHVOLT_DO = 73; + public const PHVOLT_DOT = 30; + public const PHVOLT_DOUBLE = 56; + public const PHVOLT_ELSE = 34; + public const PHVOLT_ELSEFOR = 36; + public const PHVOLT_ELSEIF = 35; + public const PHVOLT_EMPTY = 81; + public const PHVOLT_ENDAUTOESCAPE = 76; + public const PHVOLT_ENDBLOCK = 65; + public const PHVOLT_ENDCACHE = 67; + public const PHVOLT_ENDCALL = 61; + public const PHVOLT_ENDFOR = 39; + public const PHVOLT_ENDIF = 33; + public const PHVOLT_ENDMACRO = 53; + public const PHVOLT_ENDRAW = 69; + public const PHVOLT_ENDSWITCH = 41; + public const PHVOLT_EQUALS = 10; + public const PHVOLT_EVEN = 82; + public const PHVOLT_EXTENDS = 70; + public const PHVOLT_FALSE = 58; + public const PHVOLT_FOR = 37; + public const PHVOLT_GREATER = 13; + public const PHVOLT_GREATEREQUAL = 14; + public const PHVOLT_IDENTICAL = 16; + public const PHVOLT_IDENTIFIER = 38; + public const PHVOLT_IF = 31; + public const PHVOLT_IN = 8; + public const PHVOLT_INCLUDE = 71; + public const PHVOLT_INCR = 27; + public const PHVOLT_INTEGER = 54; + public const PHVOLT_IS = 9; + public const PHVOLT_ITERABLE = 86; + public const PHVOLT_LESS = 12; + public const PHVOLT_LESSEQUAL = 15; + public const PHVOLT_MACRO = 51; + public const PHVOLT_MINUS = 22; + public const PHVOLT_MOD = 20; + public const PHVOLT_MUL_ASSIGN = 48; + public const PHVOLT_NOT = 26; + public const PHVOLT_NOTEQUALS = 11; + public const PHVOLT_NOTIDENTICAL = 17; + public const PHVOLT_NULL = 57; + public const PHVOLT_NUMERIC = 84; + public const PHVOLT_ODD = 83; + public const PHVOLT_OPEN_DELIMITER = 1; + public const PHVOLT_OPEN_EDELIMITER = 62; + public const PHVOLT_OR = 7; public const PHVOLT_PARENTHESES_CLOSE = 52; - public const PHVOLT_ENDMACRO = 53; - public const PHVOLT_INTEGER = 54; - public const PHVOLT_STRING = 55; - public const PHVOLT_DOUBLE = 56; - public const PHVOLT_NULL = 57; - public const PHVOLT_FALSE = 58; - public const PHVOLT_TRUE = 59; - public const PHVOLT_CALL = 60; - public const PHVOLT_ENDCALL = 61; - public const PHVOLT_OPEN_EDELIMITER = 62; - public const PHVOLT_CLOSE_EDELIMITER = 63; - public const PHVOLT_BLOCK = 64; - public const PHVOLT_ENDBLOCK = 65; - public const PHVOLT_CACHE = 66; - public const PHVOLT_ENDCACHE = 67; - public const PHVOLT_RAW = 68; - public const PHVOLT_ENDRAW = 69; - public const PHVOLT_EXTENDS = 70; - public const PHVOLT_INCLUDE = 71; - public const PHVOLT_WITH = 72; - public const PHVOLT_DO = 73; - public const PHVOLT_RETURN = 74; - public const PHVOLT_AUTOESCAPE = 75; - public const PHVOLT_ENDAUTOESCAPE = 76; - public const PHVOLT_BREAK = 77; - public const PHVOLT_CONTINUE = 78; - public const PHVOLT_RAW_FRAGMENT = 79; - public const PHVOLT_DEFINED = 80; - public const PHVOLT_EMPTY = 81; - public const PHVOLT_EVEN = 82; - public const PHVOLT_ODD = 83; - public const PHVOLT_NUMERIC = 84; - public const PHVOLT_SCALAR = 85; - public const PHVOLT_ITERABLE = 86; - public const PHVOLT_CBRACKET_OPEN = 87; - public const PHVOLT_CBRACKET_CLOSE = 88; + public const PHVOLT_PARENTHESES_OPEN = 29; + public const PHVOLT_PIPE = 25; + public const PHVOLT_PLUS = 21; + public const PHVOLT_QUESTION = 3; + public const PHVOLT_RANGE = 5; + public const PHVOLT_RAW = 68; + public const PHVOLT_RAW_FRAGMENT = 79; + public const PHVOLT_RETURN = 74; + public const PHVOLT_SBRACKET_CLOSE = 50; + public const PHVOLT_SBRACKET_OPEN = 24; + public const PHVOLT_SCALAR = 85; + public const PHVOLT_SET = 44; + public const PHVOLT_STRING = 55; + public const PHVOLT_SUB_ASSIGN = 47; + public const PHVOLT_SWITCH = 40; + public const PHVOLT_TIMES = 19; + public const PHVOLT_TRUE = 59; + public const PHVOLT_WITH = 72; } diff --git a/src/Scanner/Scanner.php b/src/Scanner/Scanner.php index 49fe6c7..0727f3c 100644 --- a/src/Scanner/Scanner.php +++ b/src/Scanner/Scanner.php @@ -8,8 +8,8 @@ class Scanner { - public const PHVOLT_SCANNER_RETCODE_EOF = -1; - public const PHVOLT_SCANNER_RETCODE_ERR = -2; + public const PHVOLT_SCANNER_RETCODE_EOF = -1; + public const PHVOLT_SCANNER_RETCODE_ERR = -2; public const PHVOLT_SCANNER_RETCODE_IMPOSSIBLE = -3; private Token $token; @@ -35,7 +35,7 @@ public function scanForToken(): int $mode = $this->state->getMode(); if ($mode === Compiler::PHVOLT_MODE_RAW || $mode === Compiler::PHVOLT_MODE_COMMENT) { - $next = $this->state->getNext(); + $next = $this->state->getNext(); $doubleNext = $this->state->getNext(2); if ($cursor === "\n") { @@ -50,7 +50,8 @@ public function scanForToken(): int $this ->token ->setOpcode(Compiler::PHVOLT_T_RAW_FRAGMENT) - ->setValue(0); + ->setValue(0) + ; if ($this->state->getWhitespaceControl()) { //ltrim(); // TODO @@ -228,10 +229,10 @@ public function scanForToken(): int default: $this->state->incrementStart(); } -vv5: + vv5: $status = self::PHVOLT_SCANNER_RETCODE_ERR; break; -vv6: + vv6: $vvch = $this->state->incrementStart()->getStart(); switch ($vvch) { case '\t': @@ -241,15 +242,15 @@ public function scanForToken(): int default: goto vv8; } -vv8: + vv8: $this->token->setOpcode(Compiler::PHVOLT_T_IGNORE); return 0; -vv9: + vv9: $this->state->incrementStart(); $this->state->incrementActiveLine(); $this->token->setOpcode(Compiler::PHVOLT_T_IGNORE); return 0; -vv11: + vv11: $vvch = $this->state->incrementStart()->getStart(); switch ($vvch) { case '=': @@ -257,18 +258,18 @@ public function scanForToken(): int default: goto vv12; } -vv12: + vv12: $this->token->setOpcode(Compiler::PHVOLT_T_NOT); return 0; -vv13: + vv13: $vvaccept = 0; - $vvch = $this->state->incrementStart()->getStart(); + $vvch = $this->state->incrementStart()->getStart(); $this->state->setMarker($vvch); if ($vvch === null) { goto vv5; } goto vv80; -vv14: + vv14: $vvch = $this->state->incrementStart()->getStart(); switch ($vvch) { case '}': @@ -276,5702 +277,5716 @@ public function scanForToken(): int default: goto vv15; } -vv15: + vv15: $this->token->setOpcode(Compiler::PHVOLT_T_MOD); return 0; -vv16: - $vvaccept = 0; - $vvch = $this->state->incrementStart()->getStart(); + vv16: + $vvaccept = 0; + $vvch = $this->state->incrementStart()->getStart(); $this->state->setMarker($vvch); if ($vvch === null) { goto vv5; } goto vv88; -vv17: - $this->state->incrementStart(); + vv17: + $this->state->incrementStart(); $this->token->setOpcode(Compiler::PHVOLT_T_PARENTHESES_OPEN); return 0; -vv19: - $this->state->incrementStart(); - { - $this->token->setOpcode(Compiler::PHVOLT_T_PARENTHESES_CLOSE); - return 0; - } -vv21: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case '=': - goto vv90; - default: - goto vv22; - } -vv22: - { - $this->token->setOpcode(Compiler::PHVOLT_T_MUL); - return 0; - } -vv23: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case '+': - goto vv92; - case '=': - goto vv94; - default: - goto vv24; - } -vv24: - { - $this->token->setOpcode(Compiler::PHVOLT_T_ADD); - return 0; - } -vv25: - $this->state->incrementStart(); - { - $this->token->setOpcode(Compiler::PHVOLT_T_COMMA); - return 0; - } -vv27: - $vvaccept = 1; - $vvch = $this->state->incrementStart()->getStart(); - $this->state->setMarker($vvch); - switch ($vvch) { - case '%': - goto vv96; - case '-': - goto vv97; - case '=': - goto vv99; - case '}': - goto vv101; - default: - goto vv28; - } -vv28: - $this->token->setOpcode(Compiler::PHVOLT_T_SUB); - return 0; -vv29: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case '.': - goto vv102; - default: - goto vv30; - } -vv30: - { - $this->token->setOpcode(Compiler::PHVOLT_T_DOT); - return 0; - } -vv31: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case '=': - goto vv104; - default: - goto vv32; - } -vv32: - { - $this->token->setOpcode(Compiler::PHVOLT_T_DIV); - return 0; - } -vv33: - $vvaccept = 2; - $vvch = $this->state->incrementStart()->getStart(); - $this->state->setMarker($vvch); - switch ($vvch) { - case '.': - goto vv106; - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - goto vv33; - default: - goto vv35; - } -vv35: - $this->token->setOpcode(Compiler::PHVOLT_T_INTEGER); - $this->token->setValue(substr($this->state->getRawBuffer(), $start, $this->state->getCursor() - $start)); - return 0; -vv36: - $this->state->incrementStart(); - $this->token->setOpcode(Compiler::PHVOLT_T_COLON); - return 0; -vv38: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case '=': - goto vv107; - case '>': - goto vv109; - default: - goto vv39; - } -vv39: - $this->token->setOpcode(Compiler::PHVOLT_T_LESS); - return 0; -vv40: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case '=': - goto vv111; - default: - goto vv41; - } -vv41: - { - $this->token->setOpcode(Compiler::PHVOLT_T_ASSIGN); - return 0; - } -vv42: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case '=': - goto vv113; - default: - goto vv43; - } -vv43: - { - $this->token->setOpcode(Compiler::PHVOLT_T_GREATER); - return 0; - } -vv44: - $this->state->incrementStart(); - { - $this->token->setOpcode(Compiler::PHVOLT_T_QUESTION); - return 0; - } -vv46: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'N': - case 'n': - goto vv115; - case 'U': - case 'u': - goto vv116; - default: - goto vv54; - } -vv47: - $this->token->setOpcode(Compiler::PHVOLT_T_IDENTIFIER); - $this->token->setValue(substr($this->state->getRawBuffer(), $start, $this->state->getCursor() - $start)); - return 0; -vv48: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'L': - case 'l': - goto vv117; - case 'R': - case 'r': - goto vv118; - default: - goto vv54; - } -vv49: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'A': - case 'a': - goto vv119; - case 'O': - case 'o': - goto vv120; - default: - goto vv54; - } -vv50: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'E': - case 'e': - goto vv121; - case 'O': - case 'o': - goto vv122; - default: - goto vv54; - } -vv51: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'L': - case 'l': - goto vv124; - case 'M': - case 'm': - goto vv125; - case 'N': - case 'n': - goto vv126; - case 'V': - case 'v': - goto vv127; - case 'X': - case 'x': - goto vv128; - default: - goto vv54; - } -vv52: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'A': - case 'a': - goto vv129; - case 'O': - case 'o': - goto vv130; - default: - goto vv54; - } -vv53: - $vvch = $this->state->incrementStart()->getStart(); -vv54: - switch ($vvch) { - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - case 'A': - case 'B': - case 'C': - case 'D': - case 'E': - case 'F': - case 'G': - case 'H': - case 'I': - case 'J': - case 'K': - case 'L': - case 'M': - case 'N': - case 'O': - case 'P': - case 'Q': - case 'R': - case 'S': - case 'T': - case 'U': - case 'V': - case 'W': - case 'X': - case 'Y': - case 'Z': - case '\\': - case '_': - case 'a': - case 'b': - case 'c': - case 'd': - case 'e': - case 'f': - case 'g': - case 'h': - case 'i': - case 'j': - case 'k': - case 'l': - case 'm': - case 'n': - case 'o': - case 'p': - case 'q': - case 'r': - case 's': - case 't': - case 'u': - case 'v': - case 'w': - case 'x': - case 'y': - case 'z': - goto vv53; - default: - goto vv47; - } -vv55: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'F': - case 'f': - goto vv131; - case 'N': - case 'n': - goto vv133; - case 'S': - case 's': - goto vv135; - case 'T': - case 't': - goto vv137; - default: - goto vv54; - } -vv56: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'A': - case 'a': - goto vv138; - default: - goto vv54; - } -vv57: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'O': - case 'o': - goto vv139; - case 'U': - case 'u': - goto vv140; - default: - goto vv54; - } -vv58: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'D': - case 'd': - goto vv141; - case 'R': - case 'r': - goto vv142; - default: - goto vv54; - } -vv59: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'A': - case 'a': - goto vv144; - case 'E': - case 'e': - goto vv145; - default: - goto vv54; - } -vv60: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'C': - case 'c': - goto vv146; - case 'E': - case 'e': - goto vv147; - case 'W': - case 'w': - goto vv148; - default: - goto vv54; - } -vv61: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'R': - case 'r': - goto vv149; - default: - goto vv54; - } -vv62: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'I': - case 'i': - goto vv150; - default: - goto vv54; - } -vv63: - $this->state->incrementStart(); - { - $this->token->setOpcode(Compiler::PHVOLT_T_SBRACKET_OPEN); - return 0; - } -vv65: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'A': - case 'B': - case 'C': - case 'D': - case 'E': - case 'F': - case 'G': - case 'H': - case 'I': - case 'J': - case 'K': - case 'L': - case 'M': - case 'N': - case 'O': - case 'P': - case 'Q': - case 'R': - case 'S': - case 'T': - case 'U': - case 'V': - case 'W': - case 'X': - case 'Y': - case 'Z': - case '_': - case 'a': - case 'b': - case 'c': - case 'd': - case 'e': - case 'f': - case 'g': - case 'h': - case 'i': - case 'j': - case 'k': - case 'l': - case 'm': - case 'n': - case 'o': - case 'p': - case 'q': - case 'r': - case 's': - case 't': - case 'u': - case 'v': - case 'w': - case 'x': - case 'y': - case 'z': - goto vv53; - default: - goto vv5; - } -vv66: - $this->state->incrementStart(); - { - $this->token->setOpcode(Compiler::PHVOLT_T_SBRACKET_CLOSE); - return 0; - } -vv68: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'F': - case 'f': - goto vv131; - case 'N': - case 'n': - goto vv133; - case 'S': - goto vv135; - case 'T': - case 't': - goto vv137; - case 's': - goto vv151; - default: - goto vv54; - } -vv69: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case '%': - goto vv152; - case '{': - goto vv154; - default: - goto vv70; - } -vv70: - { - $this->token->setOpcode(Compiler::PHVOLT_T_CBRACKET_OPEN); - return 0; - } -vv71: - $this->state->incrementStart(); - { - $this->token->setOpcode(Compiler::PHVOLT_T_PIPE); - return 0; - } -vv73: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case '}': - goto vv156; - default: - goto vv74; - } -vv74: - { - $this->token->setOpcode(Compiler::PHVOLT_T_CBRACKET_CLOSE); - return 0; - } -vv75: - $this->state->incrementStart(); - { - $this->token->setOpcode(Compiler::PHVOLT_T_CONCAT); - return 0; - } -vv77: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case '=': - goto vv158; - default: - goto vv78; - } -vv78: - { - $this->token->setOpcode(Compiler::PHVOLT_T_NOTEQUALS); - return 0; - } -vv79: - $vvch = $this->state->incrementStart()->getStart(); -vv80: - switch ($vvch) { - case 0x00: - goto vv81; - case '"': - goto vv82; - case '\\': - goto vv84; - default: - goto vv79; - } -vv81: - $this->state->setStart($this->state->getMarker()); - switch ($vvaccept) { - case 0: - goto vv5; - case 1: - goto vv28; - case 2: - goto vv35; - default: - goto vv136; - } -vv82: - $this->state->incrementStart(); - $start++; - $this->token->setOpcode(Compiler::PHVOLT_T_STRING); - $this->token->setValue(substr($this->state->getRawBuffer(), $start, $this->state->getCursor() - $start - 1)); - return 0; -vv84: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case '\n': - goto vv81; - default: - goto vv79; - } -vv85: - $this->state->incrementStart(); - $this->state->setMode(Compiler::PHVOLT_MODE_RAW); - $this->token->setOpcode(Compiler::PHVOLT_T_CLOSE_DELIMITER); - return 0; -vv87: - $vvch = $this->state->incrementStart()->getStart(); -vv88: - switch ($vvch) { - case 0x00: - goto vv81; - case '\'': - goto vv82; - case '\\': - goto vv89; - default: - goto vv87; - } -vv89: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case '\n': - goto vv81; - default: - goto vv87; - } -vv90: - $this->state->incrementStart(); - { - $this->token->setOpcode(Compiler::PHVOLT_T_MUL_ASSIGN); - return 0; - } -vv92: - $this->state->incrementStart(); - { - $this->token->setOpcode(Compiler::PHVOLT_T_INCR); - return 0; - } -vv94: - $this->state->incrementStart(); - { - $this->token->setOpcode(Compiler::PHVOLT_T_ADD_ASSIGN); - return 0; - } -vv96: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case '}': - goto vv160; - default: - goto vv81; - } -vv97: - $this->state->incrementStart(); - { - $this->token->setOpcode(Compiler::PHVOLT_T_DECR); - return 0; - } -vv99: - $this->state->incrementStart(); - { - $this->token->setOpcode(Compiler::PHVOLT_T_SUB_ASSIGN); - return 0; - } -vv101: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case '}': - goto vv162; - default: - goto vv81; - } -vv102: - $this->state->incrementStart(); - { - $this->token->setOpcode(Compiler::PHVOLT_T_RANGE); - return 0; - } -vv104: - $this->state->incrementStart(); - { - $this->token->setOpcode(Compiler::PHVOLT_T_DIV_ASSIGN); - return 0; - } -vv106: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - goto vv164; - default: - goto vv81; - } -vv107: - $this->state->incrementStart(); - { - $this->token->setOpcode(Compiler::PHVOLT_T_LESSEQUAL); - return 0; - } -vv109: - $this->state->incrementStart(); - { - $this->token->setOpcode(Compiler::PHVOLT_T_NOTEQUALS); - return 0; - } -vv111: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case '=': - goto vv167; - default: - goto vv112; - } -vv112: - { - $this->token->setOpcode(Compiler::PHVOLT_T_EQUALS); - return 0; - } -vv113: - $this->state->incrementStart(); - { - $this->token->setOpcode(Compiler::PHVOLT_T_GREATEREQUAL); - return 0; - } -vv115: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'D': - case 'd': - goto vv169; - default: - goto vv54; - } -vv116: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'T': - case 't': - goto vv171; - default: - goto vv54; - } -vv117: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'O': - case 'o': - goto vv172; - default: - goto vv54; - } -vv118: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'E': - case 'e': - goto vv173; - default: - goto vv54; - } -vv119: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'C': - case 'c': - goto vv174; - case 'L': - case 'l': - goto vv175; - case 'S': - case 's': - goto vv176; - default: - goto vv54; - } -vv120: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'N': - case 'n': - goto vv177; - default: - goto vv54; - } -vv121: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'F': - case 'f': - goto vv178; - default: - goto vv54; - } -vv122: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - case 'A': - case 'B': - case 'C': - case 'D': - case 'E': - case 'F': - case 'G': - case 'H': - case 'I': - case 'J': - case 'K': - case 'L': - case 'M': - case 'N': - case 'O': - case 'P': - case 'Q': - case 'R': - case 'S': - case 'T': - case 'U': - case 'V': - case 'W': - case 'X': - case 'Y': - case 'Z': - case '\\': - case '_': - case 'a': - case 'b': - case 'c': - case 'd': - case 'e': - case 'f': - case 'g': - case 'h': - case 'i': - case 'j': - case 'k': - case 'l': - case 'm': - case 'n': - case 'o': - case 'p': - case 'q': - case 'r': - case 's': - case 't': - case 'u': - case 'v': - case 'w': - case 'x': - case 'y': - case 'z': - goto vv53; - default: - goto vv123; - } -vv123: - { - $this->state->statementPosition++; - $this->token->setOpcode(Compiler::PHVOLT_T_DO); - return 0; - } -vv124: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'S': - case 's': - goto vv179; - default: - goto vv54; - } -vv125: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'P': - case 'p': - goto vv180; - default: - goto vv54; - } -vv126: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'D': - case 'd': - goto vv181; - default: - goto vv54; - } -vv127: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'E': - case 'e': - goto vv182; - default: - goto vv54; - } -vv128: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'T': - case 't': - goto vv183; - default: - goto vv54; - } -vv129: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'L': - case 'l': - goto vv184; - default: - goto vv54; - } -vv130: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'R': - case 'r': - goto vv185; - default: - goto vv54; - } -vv131: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - case 'A': - case 'B': - case 'C': - case 'D': - case 'E': - case 'F': - case 'G': - case 'H': - case 'I': - case 'J': - case 'K': - case 'L': - case 'M': - case 'N': - case 'O': - case 'P': - case 'Q': - case 'R': - case 'S': - case 'T': - case 'U': - case 'V': - case 'W': - case 'X': - case 'Y': - case 'Z': - case '\\': - case '_': - case 'a': - case 'b': - case 'c': - case 'd': - case 'e': - case 'f': - case 'g': - case 'h': - case 'i': - case 'j': - case 'k': - case 'l': - case 'm': - case 'n': - case 'o': - case 'p': - case 'q': - case 'r': - case 's': - case 't': - case 'u': - case 'v': - case 'w': - case 'x': - case 'y': - case 'z': - goto vv53; - default: - goto vv132; - } -vv132: - { - $this->state->statementPosition++; - $this->token->setOpcode(Compiler::PHVOLT_T_IF); - return 0; - } -vv133: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - case 'A': - case 'B': - case 'D': - case 'E': - case 'F': - case 'G': - case 'H': - case 'I': - case 'J': - case 'K': - case 'L': - case 'M': - case 'N': - case 'O': - case 'P': - case 'Q': - case 'R': - case 'S': - case 'T': - case 'U': - case 'V': - case 'W': - case 'X': - case 'Y': - case 'Z': - case '\\': - case '_': - case 'a': - case 'b': - case 'd': - case 'e': - case 'f': - case 'g': - case 'h': - case 'i': - case 'j': - case 'k': - case 'l': - case 'm': - case 'n': - case 'o': - case 'p': - case 'q': - case 'r': - case 's': - case 't': - case 'u': - case 'v': - case 'w': - case 'x': - case 'y': - case 'z': - goto vv53; - case 'C': - case 'c': - goto vv187; - default: - goto vv134; - } -vv134: - { - $this->token->setOpcode(Compiler::PHVOLT_T_IN); - return 0; - } -vv135: - $vvaccept = 3; - $vvch = $this->state->incrementStart()->getStart(); - $this->state->setMarker($vvch); - switch ($vvch) { - case ' ': - goto vv188; - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - case 'A': - case 'B': - case 'C': - case 'D': - case 'E': - case 'F': - case 'G': - case 'H': - case 'I': - case 'J': - case 'K': - case 'L': - case 'M': - case 'N': - case 'O': - case 'P': - case 'Q': - case 'R': - case 'S': - case 'T': - case 'U': - case 'V': - case 'W': - case 'X': - case 'Y': - case 'Z': - case '\\': - case '_': - case 'a': - case 'b': - case 'c': - case 'd': - case 'e': - case 'f': - case 'g': - case 'h': - case 'i': - case 'j': - case 'k': - case 'l': - case 'm': - case 'n': - case 'o': - case 'p': - case 'q': - case 'r': - case 's': - case 't': - case 'u': - case 'v': - case 'w': - case 'x': - case 'y': - case 'z': - goto vv53; - default: - goto vv136; - } -vv136: - { - if ($this->state->activeToken === Compiler::PHVOLT_T_DOT) { - $this->token->setOpcode(Compiler::PHVOLT_T_IDENTIFIER); - $this->token->setValue(substr($this->state->getRawBuffer(), $start, $this->state->getCursor() - $start)); - } else { - $this->state->statementPosition++; - $this->token->setOpcode(Compiler::PHVOLT_T_IS); + vv19: + $this->state->incrementStart(); + { + $this->token->setOpcode(Compiler::PHVOLT_T_PARENTHESES_CLOSE); + return 0; } - - return 0; - } -vv137: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'E': - case 'e': - goto vv189; - default: - goto vv54; - } -vv138: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'C': - case 'c': - goto vv190; - default: - goto vv54; - } -vv139: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'T': - case 't': - goto vv191; - default: - goto vv54; - } -vv140: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'L': - case 'l': - goto vv193; - case 'M': - case 'm': - goto vv194; - default: - goto vv54; - } -vv141: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'D': - case 'd': - goto vv195; - default: - goto vv54; - } -vv142: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - case 'A': - case 'B': - case 'C': - case 'D': - case 'E': - case 'F': - case 'G': - case 'H': - case 'I': - case 'J': - case 'K': - case 'L': - case 'M': - case 'N': - case 'O': - case 'P': - case 'Q': - case 'R': - case 'S': - case 'T': - case 'U': - case 'V': - case 'W': - case 'X': - case 'Y': - case 'Z': - case '\\': - case '_': - case 'a': - case 'b': - case 'c': - case 'd': - case 'e': - case 'f': - case 'g': - case 'h': - case 'i': - case 'j': - case 'k': - case 'l': - case 'm': - case 'n': - case 'o': - case 'p': - case 'q': - case 'r': - case 's': - case 't': - case 'u': - case 'v': - case 'w': - case 'x': - case 'y': - case 'z': - goto vv53; - default: - goto vv143; - } -vv143: - { - $this->token->setOpcode(Compiler::PHVOLT_T_OR); - return 0; - } -vv144: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'W': - case 'w': - goto vv197; - default: - goto vv54; - } -vv145: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'T': - case 't': - goto vv199; - default: - goto vv54; - } -vv146: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'A': - case 'a': - goto vv200; - default: - goto vv54; - } -vv147: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'T': - case 't': - goto vv201; - default: - goto vv54; - } -vv148: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'I': - case 'i': - goto vv203; - default: - goto vv54; - } -vv149: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'U': - case 'u': - goto vv204; - default: - goto vv54; - } -vv150: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'T': - case 't': - goto vv205; - default: - goto vv54; - } -vv151: - $vvaccept = 3; - $vvch = $this->state->incrementStart()->getStart(); - $this->state->setMarker($vvch); - switch ($vvch) { - case ' ': - goto vv206; - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - case 'A': - case 'B': - case 'C': - case 'D': - case 'E': - case 'F': - case 'G': - case 'H': - case 'I': - case 'J': - case 'K': - case 'L': - case 'M': - case 'N': - case 'O': - case 'P': - case 'Q': - case 'R': - case 'S': - case 'T': - case 'U': - case 'V': - case 'W': - case 'X': - case 'Y': - case 'Z': - case '\\': - case '_': - case 'a': - case 'b': - case 'c': - case 'd': - case 'e': - case 'f': - case 'g': - case 'h': - case 'i': - case 'j': - case 'k': - case 'l': - case 'm': - case 'n': - case 'o': - case 'p': - case 'q': - case 'r': - case 's': - case 't': - case 'u': - case 'v': - case 'w': - case 'x': - case 'y': - case 'z': - goto vv53; - default: - goto vv136; - } -vv152: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case '-': - goto vv207; - default: - goto vv153; - } -vv153: - { - $this->state->whitespaceControl = false; - $this->token->setOpcode(Compiler::PHVOLT_T_OPEN_DELIMITER); + vv21: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case '=': + goto vv90; + default: + goto vv22; + } + vv22: + { + $this->token->setOpcode(Compiler::PHVOLT_T_MUL); + return 0; + } + vv23: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case '+': + goto vv92; + case '=': + goto vv94; + default: + goto vv24; + } + vv24: + { + $this->token->setOpcode(Compiler::PHVOLT_T_ADD); + return 0; + } + vv25: + $this->state->incrementStart(); + { + $this->token->setOpcode(Compiler::PHVOLT_T_COMMA); + return 0; + } + vv27: + $vvaccept = 1; + $vvch = $this->state->incrementStart()->getStart(); + $this->state->setMarker($vvch); + switch ($vvch) { + case '%': + goto vv96; + case '-': + goto vv97; + case '=': + goto vv99; + case '}': + goto vv101; + default: + goto vv28; + } + vv28: + $this->token->setOpcode(Compiler::PHVOLT_T_SUB); return 0; - } -vv154: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case '-': - goto vv209; - default: - goto vv155; - } -vv155: - { - $this->state->whitespaceControl = false; - $this->state->statementPosition++; - $this->token->setOpcode(Compiler::PHVOLT_T_OPEN_EDELIMITER); + vv29: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case '.': + goto vv102; + default: + goto vv30; + } + vv30: + { + $this->token->setOpcode(Compiler::PHVOLT_T_DOT); + return 0; + } + vv31: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case '=': + goto vv104; + default: + goto vv32; + } + vv32: + { + $this->token->setOpcode(Compiler::PHVOLT_T_DIV); + return 0; + } + vv33: + $vvaccept = 2; + $vvch = $this->state->incrementStart()->getStart(); + $this->state->setMarker($vvch); + switch ($vvch) { + case '.': + goto vv106; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + goto vv33; + default: + goto vv35; + } + vv35: + $this->token->setOpcode(Compiler::PHVOLT_T_INTEGER); + $this->token->setValue( + substr($this->state->getRawBuffer(), $start, $this->state->getCursor() - $start) + ); return 0; - } -vv156: - $this->state->incrementStart(); - $this->state->setMode(Compiler::PHVOLT_MODE_RAW); - $this->token->setOpcode(Compiler::PHVOLT_T_CLOSE_EDELIMITER); - return 0; -vv158: - $this->state->incrementStart(); - $this->token->setOpcode(Compiler::PHVOLT_T_NOTIDENTICAL); - return 0; -vv160: - $this->state->incrementStart(); - $this->state->setMode(Compiler::PHVOLT_MODE_RAW); - $this->state->whitespaceControl = true; - $this->token->setOpcode(Compiler::PHVOLT_T_CLOSE_DELIMITER); - return 0; -vv162: - $this->state->incrementStart(); - $this->state->setMode(Compiler::PHVOLT_MODE_RAW); - $this->state->whitespaceControl = true; - $this->token->setOpcode(Compiler::PHVOLT_T_CLOSE_EDELIMITER); - return 0; -vv164: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - goto vv164; - default: - goto vv166; - } -vv166: - { - $this->token->setOpcode(Compiler::PHVOLT_T_DOUBLE); - $this->token->setValue(substr($this->state->getRawBuffer(), $start, $this->state->getCursor() - $start)); + vv36: + $this->state->incrementStart(); + $this->token->setOpcode(Compiler::PHVOLT_T_COLON); return 0; - } -vv167: - $this->state->incrementStart(); - { - $this->token->setOpcode(Compiler::PHVOLT_T_IDENTICAL); + vv38: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case '=': + goto vv107; + case '>': + goto vv109; + default: + goto vv39; + } + vv39: + $this->token->setOpcode(Compiler::PHVOLT_T_LESS); return 0; - } -vv169: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - case 'A': - case 'B': - case 'C': - case 'D': - case 'E': - case 'F': - case 'G': - case 'H': - case 'I': - case 'J': - case 'K': - case 'L': - case 'M': - case 'N': - case 'O': - case 'P': - case 'Q': - case 'R': - case 'S': - case 'T': - case 'U': - case 'V': - case 'W': - case 'X': - case 'Y': - case 'Z': - case '\\': - case '_': - case 'a': - case 'b': - case 'c': - case 'd': - case 'e': - case 'f': - case 'g': - case 'h': - case 'i': - case 'j': - case 'k': - case 'l': - case 'm': - case 'n': - case 'o': - case 'p': - case 'q': - case 'r': - case 's': - case 't': - case 'u': - case 'v': - case 'w': - case 'x': - case 'y': - case 'z': - goto vv53; - default: - goto vv170; - } -vv170: - { - $this->token->setOpcode(Compiler::PHVOLT_T_AND); + vv40: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case '=': + goto vv111; + default: + goto vv41; + } + vv41: + { + $this->token->setOpcode(Compiler::PHVOLT_T_ASSIGN); + return 0; + } + vv42: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case '=': + goto vv113; + default: + goto vv43; + } + vv43: + { + $this->token->setOpcode(Compiler::PHVOLT_T_GREATER); + return 0; + } + vv44: + $this->state->incrementStart(); + { + $this->token->setOpcode(Compiler::PHVOLT_T_QUESTION); + return 0; + } + vv46: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'N': + case 'n': + goto vv115; + case 'U': + case 'u': + goto vv116; + default: + goto vv54; + } + vv47: + $this->token->setOpcode(Compiler::PHVOLT_T_IDENTIFIER); + $this->token->setValue( + substr($this->state->getRawBuffer(), $start, $this->state->getCursor() - $start) + ); return 0; - } -vv171: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'O': - case 'o': - goto vv211; - default: - goto vv54; - } -vv172: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'C': - case 'c': - goto vv212; - default: - goto vv54; - } -vv173: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'A': - case 'a': - goto vv213; - default: - goto vv54; - } -vv174: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'H': - case 'h': - goto vv214; - default: - goto vv54; - } -vv175: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'L': - case 'l': - goto vv215; - default: - goto vv54; - } -vv176: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'E': - case 'e': - goto vv217; - default: - goto vv54; - } -vv177: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'T': - case 't': - goto vv219; - default: - goto vv54; - } -vv178: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'A': - case 'a': - goto vv220; - case 'I': - case 'i': - goto vv221; - default: - goto vv54; - } -vv179: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'E': - case 'e': - goto vv222; - default: - goto vv54; - } -vv180: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'T': - case 't': - goto vv224; - default: - goto vv54; - } -vv181: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'A': - case 'a': - goto vv225; - case 'B': - case 'b': - goto vv226; - case 'C': - case 'c': - goto vv227; - case 'F': - case 'f': - goto vv228; - case 'I': - case 'i': - goto vv229; - case 'M': - case 'm': - goto vv230; - case 'R': - case 'r': - goto vv231; - case 'S': - case 's': - goto vv232; - default: - goto vv54; - } -vv182: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'N': - case 'n': - goto vv233; - default: - goto vv54; - } -vv183: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'E': - case 'e': - goto vv235; - default: - goto vv54; - } -vv184: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'S': - case 's': - goto vv236; - default: - goto vv54; - } -vv185: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - case 'A': - case 'B': - case 'C': - case 'D': - case 'E': - case 'F': - case 'G': - case 'H': - case 'I': - case 'J': - case 'K': - case 'L': - case 'M': - case 'N': - case 'O': - case 'P': - case 'Q': - case 'R': - case 'S': - case 'T': - case 'U': - case 'V': - case 'W': - case 'X': - case 'Y': - case 'Z': - case '\\': - case '_': - case 'a': - case 'b': - case 'c': - case 'd': - case 'e': - case 'f': - case 'g': - case 'h': - case 'i': - case 'j': - case 'k': - case 'l': - case 'm': - case 'n': - case 'o': - case 'p': - case 'q': - case 'r': - case 's': - case 't': - case 'u': - case 'v': - case 'w': - case 'x': - case 'y': - case 'z': - goto vv53; - default: - goto vv186; - } -vv186: - { - $this->state->statementPosition++; - $this->token->setOpcode(Compiler::PHVOLT_T_FOR); + vv48: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'L': + case 'l': + goto vv117; + case 'R': + case 'r': + goto vv118; + default: + goto vv54; + } + vv49: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'A': + case 'a': + goto vv119; + case 'O': + case 'o': + goto vv120; + default: + goto vv54; + } + vv50: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'E': + case 'e': + goto vv121; + case 'O': + case 'o': + goto vv122; + default: + goto vv54; + } + vv51: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'L': + case 'l': + goto vv124; + case 'M': + case 'm': + goto vv125; + case 'N': + case 'n': + goto vv126; + case 'V': + case 'v': + goto vv127; + case 'X': + case 'x': + goto vv128; + default: + goto vv54; + } + vv52: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'A': + case 'a': + goto vv129; + case 'O': + case 'o': + goto vv130; + default: + goto vv54; + } + vv53: + $vvch = $this->state->incrementStart()->getStart(); + vv54: + switch ($vvch) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': + case '\\': + case '_': + case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': + goto vv53; + default: + goto vv47; + } + vv55: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'F': + case 'f': + goto vv131; + case 'N': + case 'n': + goto vv133; + case 'S': + case 's': + goto vv135; + case 'T': + case 't': + goto vv137; + default: + goto vv54; + } + vv56: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'A': + case 'a': + goto vv138; + default: + goto vv54; + } + vv57: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'O': + case 'o': + goto vv139; + case 'U': + case 'u': + goto vv140; + default: + goto vv54; + } + vv58: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'D': + case 'd': + goto vv141; + case 'R': + case 'r': + goto vv142; + default: + goto vv54; + } + vv59: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'A': + case 'a': + goto vv144; + case 'E': + case 'e': + goto vv145; + default: + goto vv54; + } + vv60: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'C': + case 'c': + goto vv146; + case 'E': + case 'e': + goto vv147; + case 'W': + case 'w': + goto vv148; + default: + goto vv54; + } + vv61: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'R': + case 'r': + goto vv149; + default: + goto vv54; + } + vv62: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'I': + case 'i': + goto vv150; + default: + goto vv54; + } + vv63: + $this->state->incrementStart(); + { + $this->token->setOpcode(Compiler::PHVOLT_T_SBRACKET_OPEN); + return 0; + } + vv65: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': + case '_': + case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': + goto vv53; + default: + goto vv5; + } + vv66: + $this->state->incrementStart(); + { + $this->token->setOpcode(Compiler::PHVOLT_T_SBRACKET_CLOSE); + return 0; + } + vv68: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'F': + case 'f': + goto vv131; + case 'N': + case 'n': + goto vv133; + case 'S': + goto vv135; + case 'T': + case 't': + goto vv137; + case 's': + goto vv151; + default: + goto vv54; + } + vv69: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case '%': + goto vv152; + case '{': + goto vv154; + default: + goto vv70; + } + vv70: + { + $this->token->setOpcode(Compiler::PHVOLT_T_CBRACKET_OPEN); + return 0; + } + vv71: + $this->state->incrementStart(); + { + $this->token->setOpcode(Compiler::PHVOLT_T_PIPE); + return 0; + } + vv73: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case '}': + goto vv156; + default: + goto vv74; + } + vv74: + { + $this->token->setOpcode(Compiler::PHVOLT_T_CBRACKET_CLOSE); + return 0; + } + vv75: + $this->state->incrementStart(); + { + $this->token->setOpcode(Compiler::PHVOLT_T_CONCAT); + return 0; + } + vv77: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case '=': + goto vv158; + default: + goto vv78; + } + vv78: + { + $this->token->setOpcode(Compiler::PHVOLT_T_NOTEQUALS); + return 0; + } + vv79: + $vvch = $this->state->incrementStart()->getStart(); + vv80: + switch ($vvch) { + case 0x00: + goto vv81; + case '"': + goto vv82; + case '\\': + goto vv84; + default: + goto vv79; + } + vv81: + $this->state->setStart($this->state->getMarker()); + switch ($vvaccept) { + case 0: + goto vv5; + case 1: + goto vv28; + case 2: + goto vv35; + default: + goto vv136; + } + vv82: + $this->state->incrementStart(); + $start++; + $this->token->setOpcode(Compiler::PHVOLT_T_STRING); + $this->token->setValue( + substr($this->state->getRawBuffer(), $start, $this->state->getCursor() - $start - 1) + ); + return 0; + vv84: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case '\n': + goto vv81; + default: + goto vv79; + } + vv85: + $this->state->incrementStart(); + $this->state->setMode(Compiler::PHVOLT_MODE_RAW); + $this->token->setOpcode(Compiler::PHVOLT_T_CLOSE_DELIMITER); + return 0; + vv87: + $vvch = $this->state->incrementStart()->getStart(); + vv88: + switch ($vvch) { + case 0x00: + goto vv81; + case '\'': + goto vv82; + case '\\': + goto vv89; + default: + goto vv87; + } + vv89: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case '\n': + goto vv81; + default: + goto vv87; + } + vv90: + $this->state->incrementStart(); + { + $this->token->setOpcode(Compiler::PHVOLT_T_MUL_ASSIGN); + return 0; + } + vv92: + $this->state->incrementStart(); + { + $this->token->setOpcode(Compiler::PHVOLT_T_INCR); + return 0; + } + vv94: + $this->state->incrementStart(); + { + $this->token->setOpcode(Compiler::PHVOLT_T_ADD_ASSIGN); + return 0; + } + vv96: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case '}': + goto vv160; + default: + goto vv81; + } + vv97: + $this->state->incrementStart(); + { + $this->token->setOpcode(Compiler::PHVOLT_T_DECR); + return 0; + } + vv99: + $this->state->incrementStart(); + { + $this->token->setOpcode(Compiler::PHVOLT_T_SUB_ASSIGN); + return 0; + } + vv101: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case '}': + goto vv162; + default: + goto vv81; + } + vv102: + $this->state->incrementStart(); + { + $this->token->setOpcode(Compiler::PHVOLT_T_RANGE); + return 0; + } + vv104: + $this->state->incrementStart(); + { + $this->token->setOpcode(Compiler::PHVOLT_T_DIV_ASSIGN); + return 0; + } + vv106: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + goto vv164; + default: + goto vv81; + } + vv107: + $this->state->incrementStart(); + { + $this->token->setOpcode(Compiler::PHVOLT_T_LESSEQUAL); + return 0; + } + vv109: + $this->state->incrementStart(); + { + $this->token->setOpcode(Compiler::PHVOLT_T_NOTEQUALS); + return 0; + } + vv111: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case '=': + goto vv167; + default: + goto vv112; + } + vv112: + { + $this->token->setOpcode(Compiler::PHVOLT_T_EQUALS); + return 0; + } + vv113: + $this->state->incrementStart(); + { + $this->token->setOpcode(Compiler::PHVOLT_T_GREATEREQUAL); + return 0; + } + vv115: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'D': + case 'd': + goto vv169; + default: + goto vv54; + } + vv116: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'T': + case 't': + goto vv171; + default: + goto vv54; + } + vv117: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'O': + case 'o': + goto vv172; + default: + goto vv54; + } + vv118: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'E': + case 'e': + goto vv173; + default: + goto vv54; + } + vv119: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'C': + case 'c': + goto vv174; + case 'L': + case 'l': + goto vv175; + case 'S': + case 's': + goto vv176; + default: + goto vv54; + } + vv120: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'N': + case 'n': + goto vv177; + default: + goto vv54; + } + vv121: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'F': + case 'f': + goto vv178; + default: + goto vv54; + } + vv122: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': + case '\\': + case '_': + case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': + goto vv53; + default: + goto vv123; + } + vv123: + { + $this->state->statementPosition++; + $this->token->setOpcode(Compiler::PHVOLT_T_DO); + return 0; + } + vv124: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'S': + case 's': + goto vv179; + default: + goto vv54; + } + vv125: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'P': + case 'p': + goto vv180; + default: + goto vv54; + } + vv126: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'D': + case 'd': + goto vv181; + default: + goto vv54; + } + vv127: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'E': + case 'e': + goto vv182; + default: + goto vv54; + } + vv128: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'T': + case 't': + goto vv183; + default: + goto vv54; + } + vv129: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'L': + case 'l': + goto vv184; + default: + goto vv54; + } + vv130: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'R': + case 'r': + goto vv185; + default: + goto vv54; + } + vv131: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': + case '\\': + case '_': + case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': + goto vv53; + default: + goto vv132; + } + vv132: + { + $this->state->statementPosition++; + $this->token->setOpcode(Compiler::PHVOLT_T_IF); + return 0; + } + vv133: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case 'A': + case 'B': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': + case '\\': + case '_': + case 'a': + case 'b': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': + goto vv53; + case 'C': + case 'c': + goto vv187; + default: + goto vv134; + } + vv134: + { + $this->token->setOpcode(Compiler::PHVOLT_T_IN); + return 0; + } + vv135: + $vvaccept = 3; + $vvch = $this->state->incrementStart()->getStart(); + $this->state->setMarker($vvch); + switch ($vvch) { + case ' ': + goto vv188; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': + case '\\': + case '_': + case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': + goto vv53; + default: + goto vv136; + } + vv136: + { + if ($this->state->activeToken === Compiler::PHVOLT_T_DOT) { + $this->token->setOpcode(Compiler::PHVOLT_T_IDENTIFIER); + $this->token->setValue( + substr($this->state->getRawBuffer(), $start, $this->state->getCursor() - $start) + ); + } else { + $this->state->statementPosition++; + $this->token->setOpcode(Compiler::PHVOLT_T_IS); + } + + return 0; + } + vv137: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'E': + case 'e': + goto vv189; + default: + goto vv54; + } + vv138: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'C': + case 'c': + goto vv190; + default: + goto vv54; + } + vv139: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'T': + case 't': + goto vv191; + default: + goto vv54; + } + vv140: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'L': + case 'l': + goto vv193; + case 'M': + case 'm': + goto vv194; + default: + goto vv54; + } + vv141: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'D': + case 'd': + goto vv195; + default: + goto vv54; + } + vv142: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': + case '\\': + case '_': + case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': + goto vv53; + default: + goto vv143; + } + vv143: + { + $this->token->setOpcode(Compiler::PHVOLT_T_OR); + return 0; + } + vv144: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'W': + case 'w': + goto vv197; + default: + goto vv54; + } + vv145: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'T': + case 't': + goto vv199; + default: + goto vv54; + } + vv146: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'A': + case 'a': + goto vv200; + default: + goto vv54; + } + vv147: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'T': + case 't': + goto vv201; + default: + goto vv54; + } + vv148: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'I': + case 'i': + goto vv203; + default: + goto vv54; + } + vv149: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'U': + case 'u': + goto vv204; + default: + goto vv54; + } + vv150: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'T': + case 't': + goto vv205; + default: + goto vv54; + } + vv151: + $vvaccept = 3; + $vvch = $this->state->incrementStart()->getStart(); + $this->state->setMarker($vvch); + switch ($vvch) { + case ' ': + goto vv206; + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': + case '\\': + case '_': + case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': + goto vv53; + default: + goto vv136; + } + vv152: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case '-': + goto vv207; + default: + goto vv153; + } + vv153: + { + $this->state->whitespaceControl = false; + $this->token->setOpcode(Compiler::PHVOLT_T_OPEN_DELIMITER); + return 0; + } + vv154: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case '-': + goto vv209; + default: + goto vv155; + } + vv155: + { + $this->state->whitespaceControl = false; + $this->state->statementPosition++; + $this->token->setOpcode(Compiler::PHVOLT_T_OPEN_EDELIMITER); + return 0; + } + vv156: + $this->state->incrementStart(); + $this->state->setMode(Compiler::PHVOLT_MODE_RAW); + $this->token->setOpcode(Compiler::PHVOLT_T_CLOSE_EDELIMITER); return 0; - } -vv187: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'L': - case 'l': - goto vv237; - default: - goto vv54; - } -vv188: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'N': - case 'n': - goto vv238; - default: - goto vv81; - } -vv189: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'R': - case 'r': - goto vv239; - default: - goto vv54; - } -vv190: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'R': - case 'r': - goto vv240; - default: - goto vv54; - } -vv191: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - case 'A': - case 'B': - case 'C': - case 'D': - case 'E': - case 'F': - case 'G': - case 'H': - case 'I': - case 'J': - case 'K': - case 'L': - case 'M': - case 'N': - case 'O': - case 'P': - case 'Q': - case 'R': - case 'S': - case 'T': - case 'U': - case 'V': - case 'W': - case 'X': - case 'Y': - case 'Z': - case '\\': - case '_': - case 'a': - case 'b': - case 'c': - case 'd': - case 'e': - case 'f': - case 'g': - case 'h': - case 'i': - case 'j': - case 'k': - case 'l': - case 'm': - case 'n': - case 'o': - case 'p': - case 'q': - case 'r': - case 's': - case 't': - case 'u': - case 'v': - case 'w': - case 'x': - case 'y': - case 'z': - goto vv53; - default: - goto vv192; - } -vv192: - { - $this->state->statementPosition++; - $this->token->setOpcode(Compiler::PHVOLT_T_NOT); + vv158: + $this->state->incrementStart(); + $this->token->setOpcode(Compiler::PHVOLT_T_NOTIDENTICAL); return 0; - } -vv193: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'L': - case 'l': - goto vv241; - default: - goto vv54; - } -vv194: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'E': - case 'e': - goto vv243; - default: - goto vv54; - } -vv195: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - case 'A': - case 'B': - case 'C': - case 'D': - case 'E': - case 'F': - case 'G': - case 'H': - case 'I': - case 'J': - case 'K': - case 'L': - case 'M': - case 'N': - case 'O': - case 'P': - case 'Q': - case 'R': - case 'S': - case 'T': - case 'U': - case 'V': - case 'W': - case 'X': - case 'Y': - case 'Z': - case '\\': - case '_': - case 'a': - case 'b': - case 'c': - case 'd': - case 'e': - case 'f': - case 'g': - case 'h': - case 'i': - case 'j': - case 'k': - case 'l': - case 'm': - case 'n': - case 'o': - case 'p': - case 'q': - case 'r': - case 's': - case 't': - case 'u': - case 'v': - case 'w': - case 'x': - case 'y': - case 'z': - goto vv53; - default: - goto vv196; - } -vv196: - { - $this->state->statementPosition++; - $this->token->setOpcode(Compiler::PHVOLT_T_ODD); + vv160: + $this->state->incrementStart(); + $this->state->setMode(Compiler::PHVOLT_MODE_RAW); + $this->state->whitespaceControl = true; + $this->token->setOpcode(Compiler::PHVOLT_T_CLOSE_DELIMITER); + return 0; + vv162: + $this->state->incrementStart(); + $this->state->setMode(Compiler::PHVOLT_MODE_RAW); + $this->state->whitespaceControl = true; + $this->token->setOpcode(Compiler::PHVOLT_T_CLOSE_EDELIMITER); + return 0; + vv164: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + goto vv164; + default: + goto vv166; + } + vv166: + { + $this->token->setOpcode(Compiler::PHVOLT_T_DOUBLE); + $this->token->setValue( + substr($this->state->getRawBuffer(), $start, $this->state->getCursor() - $start) + ); + return 0; + } + vv167: + $this->state->incrementStart(); + { + $this->token->setOpcode(Compiler::PHVOLT_T_IDENTICAL); + return 0; + } + vv169: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': + case '\\': + case '_': + case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': + goto vv53; + default: + goto vv170; + } + vv170: + { + $this->token->setOpcode(Compiler::PHVOLT_T_AND); + return 0; + } + vv171: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'O': + case 'o': + goto vv211; + default: + goto vv54; + } + vv172: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'C': + case 'c': + goto vv212; + default: + goto vv54; + } + vv173: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'A': + case 'a': + goto vv213; + default: + goto vv54; + } + vv174: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'H': + case 'h': + goto vv214; + default: + goto vv54; + } + vv175: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'L': + case 'l': + goto vv215; + default: + goto vv54; + } + vv176: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'E': + case 'e': + goto vv217; + default: + goto vv54; + } + vv177: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'T': + case 't': + goto vv219; + default: + goto vv54; + } + vv178: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'A': + case 'a': + goto vv220; + case 'I': + case 'i': + goto vv221; + default: + goto vv54; + } + vv179: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'E': + case 'e': + goto vv222; + default: + goto vv54; + } + vv180: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'T': + case 't': + goto vv224; + default: + goto vv54; + } + vv181: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'A': + case 'a': + goto vv225; + case 'B': + case 'b': + goto vv226; + case 'C': + case 'c': + goto vv227; + case 'F': + case 'f': + goto vv228; + case 'I': + case 'i': + goto vv229; + case 'M': + case 'm': + goto vv230; + case 'R': + case 'r': + goto vv231; + case 'S': + case 's': + goto vv232; + default: + goto vv54; + } + vv182: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'N': + case 'n': + goto vv233; + default: + goto vv54; + } + vv183: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'E': + case 'e': + goto vv235; + default: + goto vv54; + } + vv184: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'S': + case 's': + goto vv236; + default: + goto vv54; + } + vv185: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': + case '\\': + case '_': + case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': + goto vv53; + default: + goto vv186; + } + vv186: + { + $this->state->statementPosition++; + $this->token->setOpcode(Compiler::PHVOLT_T_FOR); + return 0; + } + vv187: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'L': + case 'l': + goto vv237; + default: + goto vv54; + } + vv188: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'N': + case 'n': + goto vv238; + default: + goto vv81; + } + vv189: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'R': + case 'r': + goto vv239; + default: + goto vv54; + } + vv190: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'R': + case 'r': + goto vv240; + default: + goto vv54; + } + vv191: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': + case '\\': + case '_': + case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': + goto vv53; + default: + goto vv192; + } + vv192: + { + $this->state->statementPosition++; + $this->token->setOpcode(Compiler::PHVOLT_T_NOT); + return 0; + } + vv193: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'L': + case 'l': + goto vv241; + default: + goto vv54; + } + vv194: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'E': + case 'e': + goto vv243; + default: + goto vv54; + } + vv195: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': + case '\\': + case '_': + case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': + goto vv53; + default: + goto vv196; + } + vv196: + { + $this->state->statementPosition++; + $this->token->setOpcode(Compiler::PHVOLT_T_ODD); + return 0; + } + vv197: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': + case '\\': + case '_': + case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': + goto vv53; + default: + goto vv198; + } + vv198: + { + $this->state->statementPosition++; + $this->token->setOpcode(Compiler::PHVOLT_T_RAW); + return 0; + } + vv199: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'U': + case 'u': + goto vv244; + default: + goto vv54; + } + vv200: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'L': + case 'l': + goto vv245; + default: + goto vv54; + } + vv201: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': + case '\\': + case '_': + case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': + goto vv53; + default: + goto vv202; + } + vv202: + { + if ($this->state->activeToken === Compiler::PHVOLT_T_DOT) { + $this->token->setOpcode(Compiler::PHVOLT_T_IDENTIFIER); + $this->token->setValue( + substr($this->state->getRawBuffer(), $start, $this->state->getCursor() - $start) + ); + } else { + $this->token->setOpcode(Compiler::PHVOLT_T_SET); + } + return 0; - } -vv197: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - case 'A': - case 'B': - case 'C': - case 'D': - case 'E': - case 'F': - case 'G': - case 'H': - case 'I': - case 'J': - case 'K': - case 'L': - case 'M': - case 'N': - case 'O': - case 'P': - case 'Q': - case 'R': - case 'S': - case 'T': - case 'U': - case 'V': - case 'W': - case 'X': - case 'Y': - case 'Z': - case '\\': - case '_': - case 'a': - case 'b': - case 'c': - case 'd': - case 'e': - case 'f': - case 'g': - case 'h': - case 'i': - case 'j': - case 'k': - case 'l': - case 'm': - case 'n': - case 'o': - case 'p': - case 'q': - case 'r': - case 's': - case 't': - case 'u': - case 'v': - case 'w': - case 'x': - case 'y': - case 'z': - goto vv53; - default: - goto vv198; - } -vv198: - { - $this->state->statementPosition++; - $this->token->setOpcode(Compiler::PHVOLT_T_RAW); + } + vv203: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'T': + case 't': + goto vv246; + default: + goto vv54; + } + vv204: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'E': + case 'e': + goto vv247; + default: + goto vv54; + } + vv205: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'H': + case 'h': + goto vv249; + default: + goto vv54; + } + vv206: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'N': + case 'n': + goto vv238; + default: + goto vv252; + } + vv207: + $this->state->incrementStart(); + { + $this->state->whitespaceControl = false; + $this->token->setOpcode(Compiler::PHVOLT_T_OPEN_DELIMITER); + return 0; + } + vv209: + $this->state->incrementStart(); + { + $this->state->whitespaceControl = false; + $this->state->statementPosition++; + $this->token->setOpcode(Compiler::PHVOLT_T_OPEN_EDELIMITER); + return 0; + } + vv211: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'E': + case 'e': + goto vv253; + default: + goto vv54; + } + vv212: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'K': + case 'k': + goto vv254; + default: + goto vv54; + } + vv213: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'K': + case 'k': + goto vv256; + default: + goto vv54; + } + vv214: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'E': + case 'e': + goto vv258; + default: + goto vv54; + } + vv215: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': + case '\\': + case '_': + case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': + goto vv53; + default: + goto vv216; + } + vv216: + { + $this->state->statementPosition++; + $this->token->setOpcode(Compiler::PHVOLT_T_CALL); + return 0; + } + vv217: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': + case '\\': + case '_': + case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': + goto vv53; + default: + goto vv218; + } + vv218: + { + $this->token->setOpcode(Compiler::PHVOLT_T_CASE); + return 0; + } + vv219: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'I': + case 'i': + goto vv260; + default: + goto vv54; + } + vv220: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'U': + case 'u': + goto vv261; + default: + goto vv54; + } + vv221: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'N': + case 'n': + goto vv262; + default: + goto vv54; + } + vv222: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'G': + case 'H': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': + case '\\': + case '_': + case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'g': + case 'h': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': + goto vv53; + case 'F': + case 'f': + goto vv263; + case 'I': + case 'i': + goto vv264; + default: + goto vv223; + } + vv223: + { + $this->token->setOpcode(Compiler::PHVOLT_T_ELSE); + return 0; + } + vv224: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'Y': + case 'y': + goto vv265; + default: + goto vv54; + } + vv225: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'U': + case 'u': + goto vv267; + default: + goto vv54; + } + vv226: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'L': + case 'l': + goto vv268; + default: + goto vv54; + } + vv227: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'A': + case 'a': + goto vv269; + default: + goto vv54; + } + vv228: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'O': + case 'o': + goto vv270; + default: + goto vv54; + } + vv229: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'F': + case 'f': + goto vv271; + default: + goto vv54; + } + vv230: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'A': + case 'a': + goto vv273; + default: + goto vv54; + } + vv231: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'A': + case 'a': + goto vv274; + default: + goto vv54; + } + vv232: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'W': + case 'w': + goto vv275; + default: + goto vv54; + } + vv233: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': + case '\\': + case '_': + case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': + goto vv53; + default: + goto vv234; + } + vv234: + { + $this->state->statementPosition++; + $this->token->setOpcode(Compiler::PHVOLT_T_EVEN); + return 0; + } + vv235: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'N': + case 'n': + goto vv276; + default: + goto vv54; + } + vv236: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'E': + case 'e': + goto vv277; + default: + goto vv54; + } + vv237: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'U': + case 'u': + goto vv279; + default: + goto vv54; + } + vv238: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'O': + case 'o': + goto vv280; + default: + goto vv81; + } + vv239: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'A': + case 'a': + goto vv281; + default: + goto vv54; + } + vv240: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'O': + case 'o': + goto vv282; + default: + goto vv54; + } + vv241: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': + case '\\': + case '_': + case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': + goto vv53; + default: + goto vv242; + } + vv242: + { + $this->token->setOpcode(Compiler::PHVOLT_T_NULL); + return 0; + } + vv243: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'R': + case 'r': + goto vv284; + default: + goto vv54; + } + vv244: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'R': + case 'r': + goto vv285; + default: + goto vv54; + } + vv245: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'A': + case 'a': + goto vv286; + default: + goto vv54; + } + vv246: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'C': + case 'c': + goto vv287; + default: + goto vv54; + } + vv247: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': + case '\\': + case '_': + case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': + goto vv53; + default: + goto vv248; + } + vv248: + { + $this->token->setOpcode(Compiler::PHVOLT_T_TRUE); + return 0; + } + vv249: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': + case '\\': + case '_': + case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': + goto vv53; + default: + goto vv250; + } + vv250: + { + $this->token->setOpcode(Compiler::PHVOLT_T_WITH); + return 0; + } + vv251: + $vvch = $this->state->incrementStart()->getStart(); + vv252: + switch ($vvch) { + case ' ': + goto vv251; + case 'n': + goto vv288; + default: + goto vv81; + } + vv253: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'S': + case 's': + goto vv289; + default: + goto vv54; + } + vv254: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': + case '\\': + case '_': + case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': + goto vv53; + default: + goto vv255; + } + vv255: + { + $this->state->statementPosition++; + $this->token->setOpcode(Compiler::PHVOLT_T_BLOCK); + return 0; + } + vv256: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': + case '\\': + case '_': + case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': + goto vv53; + default: + goto vv257; + } + vv257: + { + $this->state->statementPosition++; + $this->token->setOpcode(Compiler::PHVOLT_T_BREAK); + return 0; + } + vv258: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': + case '\\': + case '_': + case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': + goto vv53; + default: + goto vv259; + } + vv259: + { + $this->state->statementPosition++; + $this->token->setOpcode(Compiler::PHVOLT_T_CACHE); + return 0; + } + vv260: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'N': + case 'n': + goto vv290; + default: + goto vv54; + } + vv261: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'L': + case 'l': + goto vv291; + default: + goto vv54; + } + vv262: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'E': + case 'e': + goto vv292; + default: + goto vv54; + } + vv263: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'O': + case 'o': + goto vv293; + default: + goto vv54; + } + vv264: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'F': + case 'f': + goto vv294; + default: + goto vv54; + } + vv265: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': + case '\\': + case '_': + case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': + goto vv53; + default: + goto vv266; + } + vv266: + { + $this->state->statementPosition++; + $this->token->setOpcode(Compiler::PHVOLT_T_EMPTY); + return 0; + } + vv267: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'T': + case 't': + goto vv296; + default: + goto vv54; + } + vv268: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'O': + case 'o': + goto vv297; + default: + goto vv54; + } + vv269: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'C': + case 'c': + goto vv298; + case 'L': + case 'l': + goto vv299; + default: + goto vv54; + } + vv270: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'R': + case 'r': + goto vv300; + default: + goto vv54; + } + vv271: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': + case '\\': + case '_': + case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': + goto vv53; + default: + goto vv272; + } + vv272: + { + $this->token->setOpcode(Compiler::PHVOLT_T_ENDIF); + return 0; + } + vv273: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'C': + case 'c': + goto vv302; + default: + goto vv54; + } + vv274: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'W': + case 'w': + goto vv303; + default: + goto vv54; + } + vv275: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'I': + case 'i': + goto vv305; + default: + goto vv54; + } + vv276: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'D': + case 'd': + goto vv306; + default: + goto vv54; + } + vv277: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': + case '\\': + case '_': + case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': + goto vv53; + default: + goto vv278; + } + vv278: + { + $this->token->setOpcode(Compiler::PHVOLT_T_FALSE); + return 0; + } + vv279: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'D': + case 'd': + goto vv307; + default: + goto vv54; + } + vv280: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'T': + case 't': + goto vv308; + default: + goto vv81; + } + vv281: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'B': + case 'b': + goto vv310; + default: + goto vv54; + } + vv282: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': + case '\\': + case '_': + case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': + goto vv53; + default: + goto vv283; + } + vv283: + { + $this->state->statementPosition++; + $this->token->setOpcode(Compiler::PHVOLT_T_MACRO); + return 0; + } + vv284: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'I': + case 'i': + goto vv311; + default: + goto vv54; + } + vv285: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'N': + case 'n': + goto vv312; + default: + goto vv54; + } + vv286: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'R': + case 'r': + goto vv314; + default: + goto vv54; + } + vv287: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'H': + case 'h': + goto vv316; + default: + goto vv54; + } + vv288: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'o': + goto vv318; + default: + goto vv81; + } + vv289: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'C': + case 'c': + goto vv319; + default: + goto vv54; + } + vv290: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'U': + case 'u': + goto vv320; + default: + goto vv54; + } + vv291: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'T': + case 't': + goto vv321; + default: + goto vv54; + } + vv292: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'D': + case 'd': + goto vv323; + default: + goto vv54; + } + vv293: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'R': + case 'r': + goto vv325; + default: + goto vv54; + } + vv294: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': + case '\\': + case '_': + case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': + goto vv53; + default: + goto vv295; + } + vv295: + { + $this->token->setOpcode(Compiler::PHVOLT_T_ELSEIF); + return 0; + } + vv296: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'O': + case 'o': + goto vv327; + default: + goto vv54; + } + vv297: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'C': + case 'c': + goto vv328; + default: + goto vv54; + } + vv298: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'H': + case 'h': + goto vv329; + default: + goto vv54; + } + vv299: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'L': + case 'l': + goto vv330; + default: + goto vv54; + } + vv300: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': + case '\\': + case '_': + case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': + goto vv53; + default: + goto vv301; + } + vv301: + { + $this->token->setOpcode(Compiler::PHVOLT_T_ENDFOR); + return 0; + } + vv302: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'R': + case 'r': + goto vv332; + default: + goto vv54; + } + vv303: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': + case '\\': + case '_': + case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': + goto vv53; + default: + goto vv304; + } + vv304: + { + $this->state->statementPosition++; + $this->token->setOpcode(Compiler::PHVOLT_T_ENDRAW); + return 0; + } + vv305: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'T': + case 't': + goto vv333; + default: + goto vv54; + } + vv306: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'S': + case 's': + goto vv334; + default: + goto vv54; + } + vv307: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'E': + case 'e': + goto vv336; + default: + goto vv54; + } + vv308: + $this->state->incrementStart(); + { + $this->state->statementPosition++; + $this->token->setOpcode(Compiler::PHVOLT_T_NOTEQUALS); + return 0; + } + vv310: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'L': + case 'l': + goto vv338; + default: + goto vv54; + } + vv311: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'C': + case 'c': + goto vv339; + default: + goto vv54; + } + vv312: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': + case '\\': + case '_': + case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': + goto vv53; + default: + goto vv313; + } + vv313: + { + $this->token->setOpcode(Compiler::PHVOLT_T_RETURN); + return 0; + } + vv314: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': + case '\\': + case '_': + case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': + goto vv53; + default: + goto vv315; + } + vv315: + { + $this->state->statementPosition++; + $this->token->setOpcode(Compiler::PHVOLT_T_SCALAR); + return 0; + } + vv316: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': + case '\\': + case '_': + case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': + goto vv53; + default: + goto vv317; + } + vv317: + { + $this->state->statementPosition++; + $this->token->setOpcode(Compiler::PHVOLT_T_SWITCH); + return 0; + } + vv318: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 't': + goto vv341; + default: + goto vv81; + } + vv319: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'A': + case 'a': + goto vv343; + default: + goto vv54; + } + vv320: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'E': + case 'e': + goto vv344; + default: + goto vv54; + } + vv321: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': + case '\\': + case '_': + case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': + goto vv53; + default: + goto vv322; + } + vv322: + $this->token->setOpcode(Compiler::PHVOLT_T_DEFAULT); + $this->token->setValue( + substr($this->state->getRawBuffer(), $start, $this->state->getCursor() - $start) + ); return 0; - } -vv199: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'U': - case 'u': - goto vv244; - default: - goto vv54; - } -vv200: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'L': - case 'l': - goto vv245; - default: - goto vv54; - } -vv201: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - case 'A': - case 'B': - case 'C': - case 'D': - case 'E': - case 'F': - case 'G': - case 'H': - case 'I': - case 'J': - case 'K': - case 'L': - case 'M': - case 'N': - case 'O': - case 'P': - case 'Q': - case 'R': - case 'S': - case 'T': - case 'U': - case 'V': - case 'W': - case 'X': - case 'Y': - case 'Z': - case '\\': - case '_': - case 'a': - case 'b': - case 'c': - case 'd': - case 'e': - case 'f': - case 'g': - case 'h': - case 'i': - case 'j': - case 'k': - case 'l': - case 'm': - case 'n': - case 'o': - case 'p': - case 'q': - case 'r': - case 's': - case 't': - case 'u': - case 'v': - case 'w': - case 'x': - case 'y': - case 'z': - goto vv53; - default: - goto vv202; - } -vv202: - { - if ($this->state->activeToken === Compiler::PHVOLT_T_DOT) { - $this->token->setOpcode(Compiler::PHVOLT_T_IDENTIFIER); - $this->token->setValue(substr($this->state->getRawBuffer(), $start, $this->state->getCursor() - $start)); - } else { - $this->token->setOpcode(Compiler::PHVOLT_T_SET); + vv323: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': + case '\\': + case '_': + case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': + goto vv53; + default: + goto vv324; + } + vv324: + { + $this->state->statementPosition++; + $this->token->setOpcode(Compiler::PHVOLT_T_DEFINED); + return 0; + } + vv325: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': + case '\\': + case '_': + case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': + goto vv53; + default: + goto vv326; + } + vv326: + { + $this->token->setOpcode(Compiler::PHVOLT_T_ELSEFOR); + return 0; + } + vv327: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'E': + case 'e': + goto vv346; + default: + goto vv54; + } + vv328: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'K': + case 'k': + goto vv347; + default: + goto vv54; + } + vv329: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'E': + case 'e': + goto vv349; + default: + goto vv54; + } + vv330: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': + case '\\': + case '_': + case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': + goto vv53; + default: + goto vv331; + } + vv331: + { + $this->token->setOpcode(Compiler::PHVOLT_T_ENDCALL); + return 0; + } + vv332: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'O': + case 'o': + goto vv351; + default: + goto vv54; + } + vv333: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'C': + case 'c': + goto vv353; + default: + goto vv54; + } + vv334: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': + case '\\': + case '_': + case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': + goto vv53; + default: + goto vv335; + } + vv335: + { + $this->state->statementPosition++; + $this->token->setOpcode(Compiler::PHVOLT_T_EXTENDS); + return 0; + } + vv336: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': + case '\\': + case '_': + case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': + goto vv53; + default: + goto vv337; + } + vv337: + { + $this->state->statementPosition++; + $this->token->setOpcode(Compiler::PHVOLT_T_INCLUDE); + return 0; + } + vv338: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'E': + case 'e': + goto vv354; + default: + goto vv54; + } + vv339: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': + case '\\': + case '_': + case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': + goto vv53; + default: + goto vv340; + } + vv340: + { + $this->state->statementPosition++; + $this->token->setOpcode(Compiler::PHVOLT_T_NUMERIC); + return 0; + } + vv341: + $this->state->incrementStart(); + { + $this->state->statementPosition++; + $this->token->setOpcode(Compiler::PHVOLT_T_NOTEQUALS); + return 0; + } + vv343: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'P': + case 'p': + goto vv356; + default: + goto vv54; + } + vv344: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': + case '\\': + case '_': + case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': + goto vv53; + default: + goto vv345; + } + vv345: + { + $this->state->statementPosition++; + $this->token->setOpcode(Compiler::PHVOLT_T_CONTINUE); + return 0; + } + vv346: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'S': + case 's': + goto vv357; + default: + goto vv54; + } + vv347: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': + case '\\': + case '_': + case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': + goto vv53; + default: + goto vv348; + } + vv348: + { + $this->token->setOpcode(Compiler::PHVOLT_T_ENDBLOCK); + return 0; + } + vv349: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': + case '\\': + case '_': + case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': + goto vv53; + default: + goto vv350; + } + vv350: + { + $this->token->setOpcode(Compiler::PHVOLT_T_ENDCACHE); + return 0; + } + vv351: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': + case '\\': + case '_': + case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': + goto vv53; + default: + goto vv352; + } + vv352: + { + $this->token->setOpcode(Compiler::PHVOLT_T_ENDMACRO); + return 0; + } + vv353: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'H': + case 'h': + goto vv358; + default: + goto vv54; + } + vv354: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': + case '\\': + case '_': + case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': + goto vv53; + default: + goto vv355; + } + vv355: + { + $this->state->statementPosition++; + $this->token->setOpcode(Compiler::PHVOLT_T_ITERABLE); + return 0; + } + vv356: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'E': + case 'e': + goto vv360; + default: + goto vv54; + } + vv357: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'C': + case 'c': + goto vv362; + default: + goto vv54; + } + vv358: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': + case '\\': + case '_': + case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': + goto vv53; + default: + goto vv359; + } + vv359: + { + $this->token->setOpcode(Compiler::PHVOLT_T_ENDSWITCH); + return 0; + } + vv360: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': + case '\\': + case '_': + case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': + goto vv53; + default: + goto vv361; + } + vv361: + { + $this->state->statementPosition++; + $this->token->setOpcode(Compiler::PHVOLT_T_AUTOESCAPE); + return 0; + } + vv362: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'A': + case 'a': + goto vv363; + default: + goto vv54; + } + vv363: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'P': + case 'p': + goto vv364; + default: + goto vv54; + } + vv364: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case 'E': + case 'e': + goto vv365; + default: + goto vv54; + } + vv365: + $vvch = $this->state->incrementStart()->getStart(); + switch ($vvch) { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + case 'A': + case 'B': + case 'C': + case 'D': + case 'E': + case 'F': + case 'G': + case 'H': + case 'I': + case 'J': + case 'K': + case 'L': + case 'M': + case 'N': + case 'O': + case 'P': + case 'Q': + case 'R': + case 'S': + case 'T': + case 'U': + case 'V': + case 'W': + case 'X': + case 'Y': + case 'Z': + case '\\': + case '_': + case 'a': + case 'b': + case 'c': + case 'd': + case 'e': + case 'f': + case 'g': + case 'h': + case 'i': + case 'j': + case 'k': + case 'l': + case 'm': + case 'n': + case 'o': + case 'p': + case 'q': + case 'r': + case 's': + case 't': + case 'u': + case 'v': + case 'w': + case 'x': + case 'y': + case 'z': + goto vv53; + default: + goto vv366; } - - return 0; - } -vv203: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'T': - case 't': - goto vv246; - default: - goto vv54; - } -vv204: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'E': - case 'e': - goto vv247; - default: - goto vv54; - } -vv205: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'H': - case 'h': - goto vv249; - default: - goto vv54; - } -vv206: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'N': - case 'n': - goto vv238; - default: - goto vv252; - } -vv207: - $this->state->incrementStart(); - { - $this->state->whitespaceControl = false; - $this->token->setOpcode(Compiler::PHVOLT_T_OPEN_DELIMITER); - return 0; - } -vv209: - $this->state->incrementStart(); - { - $this->state->whitespaceControl = false; - $this->state->statementPosition++; - $this->token->setOpcode(Compiler::PHVOLT_T_OPEN_EDELIMITER); - return 0; - } -vv211: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'E': - case 'e': - goto vv253; - default: - goto vv54; - } -vv212: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'K': - case 'k': - goto vv254; - default: - goto vv54; - } -vv213: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'K': - case 'k': - goto vv256; - default: - goto vv54; - } -vv214: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'E': - case 'e': - goto vv258; - default: - goto vv54; - } -vv215: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - case 'A': - case 'B': - case 'C': - case 'D': - case 'E': - case 'F': - case 'G': - case 'H': - case 'I': - case 'J': - case 'K': - case 'L': - case 'M': - case 'N': - case 'O': - case 'P': - case 'Q': - case 'R': - case 'S': - case 'T': - case 'U': - case 'V': - case 'W': - case 'X': - case 'Y': - case 'Z': - case '\\': - case '_': - case 'a': - case 'b': - case 'c': - case 'd': - case 'e': - case 'f': - case 'g': - case 'h': - case 'i': - case 'j': - case 'k': - case 'l': - case 'm': - case 'n': - case 'o': - case 'p': - case 'q': - case 'r': - case 's': - case 't': - case 'u': - case 'v': - case 'w': - case 'x': - case 'y': - case 'z': - goto vv53; - default: - goto vv216; - } -vv216: - { - $this->state->statementPosition++; - $this->token->setOpcode(Compiler::PHVOLT_T_CALL); - return 0; - } -vv217: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - case 'A': - case 'B': - case 'C': - case 'D': - case 'E': - case 'F': - case 'G': - case 'H': - case 'I': - case 'J': - case 'K': - case 'L': - case 'M': - case 'N': - case 'O': - case 'P': - case 'Q': - case 'R': - case 'S': - case 'T': - case 'U': - case 'V': - case 'W': - case 'X': - case 'Y': - case 'Z': - case '\\': - case '_': - case 'a': - case 'b': - case 'c': - case 'd': - case 'e': - case 'f': - case 'g': - case 'h': - case 'i': - case 'j': - case 'k': - case 'l': - case 'm': - case 'n': - case 'o': - case 'p': - case 'q': - case 'r': - case 's': - case 't': - case 'u': - case 'v': - case 'w': - case 'x': - case 'y': - case 'z': - goto vv53; - default: - goto vv218; - } -vv218: - { - $this->token->setOpcode(Compiler::PHVOLT_T_CASE); - return 0; - } -vv219: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'I': - case 'i': - goto vv260; - default: - goto vv54; - } -vv220: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'U': - case 'u': - goto vv261; - default: - goto vv54; - } -vv221: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'N': - case 'n': - goto vv262; - default: - goto vv54; - } -vv222: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - case 'A': - case 'B': - case 'C': - case 'D': - case 'E': - case 'G': - case 'H': - case 'J': - case 'K': - case 'L': - case 'M': - case 'N': - case 'O': - case 'P': - case 'Q': - case 'R': - case 'S': - case 'T': - case 'U': - case 'V': - case 'W': - case 'X': - case 'Y': - case 'Z': - case '\\': - case '_': - case 'a': - case 'b': - case 'c': - case 'd': - case 'e': - case 'g': - case 'h': - case 'j': - case 'k': - case 'l': - case 'm': - case 'n': - case 'o': - case 'p': - case 'q': - case 'r': - case 's': - case 't': - case 'u': - case 'v': - case 'w': - case 'x': - case 'y': - case 'z': - goto vv53; - case 'F': - case 'f': - goto vv263; - case 'I': - case 'i': - goto vv264; - default: - goto vv223; - } -vv223: - { - $this->token->setOpcode(Compiler::PHVOLT_T_ELSE); - return 0; - } -vv224: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'Y': - case 'y': - goto vv265; - default: - goto vv54; - } -vv225: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'U': - case 'u': - goto vv267; - default: - goto vv54; - } -vv226: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'L': - case 'l': - goto vv268; - default: - goto vv54; - } -vv227: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'A': - case 'a': - goto vv269; - default: - goto vv54; - } -vv228: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'O': - case 'o': - goto vv270; - default: - goto vv54; - } -vv229: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'F': - case 'f': - goto vv271; - default: - goto vv54; - } -vv230: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'A': - case 'a': - goto vv273; - default: - goto vv54; - } -vv231: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'A': - case 'a': - goto vv274; - default: - goto vv54; - } -vv232: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'W': - case 'w': - goto vv275; - default: - goto vv54; - } -vv233: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - case 'A': - case 'B': - case 'C': - case 'D': - case 'E': - case 'F': - case 'G': - case 'H': - case 'I': - case 'J': - case 'K': - case 'L': - case 'M': - case 'N': - case 'O': - case 'P': - case 'Q': - case 'R': - case 'S': - case 'T': - case 'U': - case 'V': - case 'W': - case 'X': - case 'Y': - case 'Z': - case '\\': - case '_': - case 'a': - case 'b': - case 'c': - case 'd': - case 'e': - case 'f': - case 'g': - case 'h': - case 'i': - case 'j': - case 'k': - case 'l': - case 'm': - case 'n': - case 'o': - case 'p': - case 'q': - case 'r': - case 's': - case 't': - case 'u': - case 'v': - case 'w': - case 'x': - case 'y': - case 'z': - goto vv53; - default: - goto vv234; - } -vv234: - { - $this->state->statementPosition++; - $this->token->setOpcode(Compiler::PHVOLT_T_EVEN); - return 0; - } -vv235: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'N': - case 'n': - goto vv276; - default: - goto vv54; - } -vv236: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'E': - case 'e': - goto vv277; - default: - goto vv54; - } -vv237: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'U': - case 'u': - goto vv279; - default: - goto vv54; - } -vv238: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'O': - case 'o': - goto vv280; - default: - goto vv81; - } -vv239: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'A': - case 'a': - goto vv281; - default: - goto vv54; - } -vv240: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'O': - case 'o': - goto vv282; - default: - goto vv54; - } -vv241: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - case 'A': - case 'B': - case 'C': - case 'D': - case 'E': - case 'F': - case 'G': - case 'H': - case 'I': - case 'J': - case 'K': - case 'L': - case 'M': - case 'N': - case 'O': - case 'P': - case 'Q': - case 'R': - case 'S': - case 'T': - case 'U': - case 'V': - case 'W': - case 'X': - case 'Y': - case 'Z': - case '\\': - case '_': - case 'a': - case 'b': - case 'c': - case 'd': - case 'e': - case 'f': - case 'g': - case 'h': - case 'i': - case 'j': - case 'k': - case 'l': - case 'm': - case 'n': - case 'o': - case 'p': - case 'q': - case 'r': - case 's': - case 't': - case 'u': - case 'v': - case 'w': - case 'x': - case 'y': - case 'z': - goto vv53; - default: - goto vv242; - } -vv242: - { - $this->token->setOpcode(Compiler::PHVOLT_T_NULL); - return 0; - } -vv243: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'R': - case 'r': - goto vv284; - default: - goto vv54; - } -vv244: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'R': - case 'r': - goto vv285; - default: - goto vv54; - } -vv245: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'A': - case 'a': - goto vv286; - default: - goto vv54; - } -vv246: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'C': - case 'c': - goto vv287; - default: - goto vv54; - } -vv247: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - case 'A': - case 'B': - case 'C': - case 'D': - case 'E': - case 'F': - case 'G': - case 'H': - case 'I': - case 'J': - case 'K': - case 'L': - case 'M': - case 'N': - case 'O': - case 'P': - case 'Q': - case 'R': - case 'S': - case 'T': - case 'U': - case 'V': - case 'W': - case 'X': - case 'Y': - case 'Z': - case '\\': - case '_': - case 'a': - case 'b': - case 'c': - case 'd': - case 'e': - case 'f': - case 'g': - case 'h': - case 'i': - case 'j': - case 'k': - case 'l': - case 'm': - case 'n': - case 'o': - case 'p': - case 'q': - case 'r': - case 's': - case 't': - case 'u': - case 'v': - case 'w': - case 'x': - case 'y': - case 'z': - goto vv53; - default: - goto vv248; - } -vv248: - { - $this->token->setOpcode(Compiler::PHVOLT_T_TRUE); - return 0; - } -vv249: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - case 'A': - case 'B': - case 'C': - case 'D': - case 'E': - case 'F': - case 'G': - case 'H': - case 'I': - case 'J': - case 'K': - case 'L': - case 'M': - case 'N': - case 'O': - case 'P': - case 'Q': - case 'R': - case 'S': - case 'T': - case 'U': - case 'V': - case 'W': - case 'X': - case 'Y': - case 'Z': - case '\\': - case '_': - case 'a': - case 'b': - case 'c': - case 'd': - case 'e': - case 'f': - case 'g': - case 'h': - case 'i': - case 'j': - case 'k': - case 'l': - case 'm': - case 'n': - case 'o': - case 'p': - case 'q': - case 'r': - case 's': - case 't': - case 'u': - case 'v': - case 'w': - case 'x': - case 'y': - case 'z': - goto vv53; - default: - goto vv250; - } -vv250: - { - $this->token->setOpcode(Compiler::PHVOLT_T_WITH); - return 0; - } -vv251: - $vvch = $this->state->incrementStart()->getStart(); -vv252: - switch ($vvch) { - case ' ': - goto vv251; - case 'n': - goto vv288; - default: - goto vv81; - } -vv253: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'S': - case 's': - goto vv289; - default: - goto vv54; - } -vv254: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - case 'A': - case 'B': - case 'C': - case 'D': - case 'E': - case 'F': - case 'G': - case 'H': - case 'I': - case 'J': - case 'K': - case 'L': - case 'M': - case 'N': - case 'O': - case 'P': - case 'Q': - case 'R': - case 'S': - case 'T': - case 'U': - case 'V': - case 'W': - case 'X': - case 'Y': - case 'Z': - case '\\': - case '_': - case 'a': - case 'b': - case 'c': - case 'd': - case 'e': - case 'f': - case 'g': - case 'h': - case 'i': - case 'j': - case 'k': - case 'l': - case 'm': - case 'n': - case 'o': - case 'p': - case 'q': - case 'r': - case 's': - case 't': - case 'u': - case 'v': - case 'w': - case 'x': - case 'y': - case 'z': - goto vv53; - default: - goto vv255; - } -vv255: - { - $this->state->statementPosition++; - $this->token->setOpcode(Compiler::PHVOLT_T_BLOCK); - return 0; - } -vv256: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - case 'A': - case 'B': - case 'C': - case 'D': - case 'E': - case 'F': - case 'G': - case 'H': - case 'I': - case 'J': - case 'K': - case 'L': - case 'M': - case 'N': - case 'O': - case 'P': - case 'Q': - case 'R': - case 'S': - case 'T': - case 'U': - case 'V': - case 'W': - case 'X': - case 'Y': - case 'Z': - case '\\': - case '_': - case 'a': - case 'b': - case 'c': - case 'd': - case 'e': - case 'f': - case 'g': - case 'h': - case 'i': - case 'j': - case 'k': - case 'l': - case 'm': - case 'n': - case 'o': - case 'p': - case 'q': - case 'r': - case 's': - case 't': - case 'u': - case 'v': - case 'w': - case 'x': - case 'y': - case 'z': - goto vv53; - default: - goto vv257; - } -vv257: - { - $this->state->statementPosition++; - $this->token->setOpcode(Compiler::PHVOLT_T_BREAK); - return 0; - } -vv258: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - case 'A': - case 'B': - case 'C': - case 'D': - case 'E': - case 'F': - case 'G': - case 'H': - case 'I': - case 'J': - case 'K': - case 'L': - case 'M': - case 'N': - case 'O': - case 'P': - case 'Q': - case 'R': - case 'S': - case 'T': - case 'U': - case 'V': - case 'W': - case 'X': - case 'Y': - case 'Z': - case '\\': - case '_': - case 'a': - case 'b': - case 'c': - case 'd': - case 'e': - case 'f': - case 'g': - case 'h': - case 'i': - case 'j': - case 'k': - case 'l': - case 'm': - case 'n': - case 'o': - case 'p': - case 'q': - case 'r': - case 's': - case 't': - case 'u': - case 'v': - case 'w': - case 'x': - case 'y': - case 'z': - goto vv53; - default: - goto vv259; - } -vv259: - { - $this->state->statementPosition++; - $this->token->setOpcode(Compiler::PHVOLT_T_CACHE); - return 0; - } -vv260: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'N': - case 'n': - goto vv290; - default: - goto vv54; - } -vv261: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'L': - case 'l': - goto vv291; - default: - goto vv54; - } -vv262: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'E': - case 'e': - goto vv292; - default: - goto vv54; - } -vv263: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'O': - case 'o': - goto vv293; - default: - goto vv54; - } -vv264: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'F': - case 'f': - goto vv294; - default: - goto vv54; - } -vv265: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - case 'A': - case 'B': - case 'C': - case 'D': - case 'E': - case 'F': - case 'G': - case 'H': - case 'I': - case 'J': - case 'K': - case 'L': - case 'M': - case 'N': - case 'O': - case 'P': - case 'Q': - case 'R': - case 'S': - case 'T': - case 'U': - case 'V': - case 'W': - case 'X': - case 'Y': - case 'Z': - case '\\': - case '_': - case 'a': - case 'b': - case 'c': - case 'd': - case 'e': - case 'f': - case 'g': - case 'h': - case 'i': - case 'j': - case 'k': - case 'l': - case 'm': - case 'n': - case 'o': - case 'p': - case 'q': - case 'r': - case 's': - case 't': - case 'u': - case 'v': - case 'w': - case 'x': - case 'y': - case 'z': - goto vv53; - default: - goto vv266; - } -vv266: - { - $this->state->statementPosition++; - $this->token->setOpcode(Compiler::PHVOLT_T_EMPTY); - return 0; - } -vv267: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'T': - case 't': - goto vv296; - default: - goto vv54; - } -vv268: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'O': - case 'o': - goto vv297; - default: - goto vv54; - } -vv269: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'C': - case 'c': - goto vv298; - case 'L': - case 'l': - goto vv299; - default: - goto vv54; - } -vv270: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'R': - case 'r': - goto vv300; - default: - goto vv54; - } -vv271: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - case 'A': - case 'B': - case 'C': - case 'D': - case 'E': - case 'F': - case 'G': - case 'H': - case 'I': - case 'J': - case 'K': - case 'L': - case 'M': - case 'N': - case 'O': - case 'P': - case 'Q': - case 'R': - case 'S': - case 'T': - case 'U': - case 'V': - case 'W': - case 'X': - case 'Y': - case 'Z': - case '\\': - case '_': - case 'a': - case 'b': - case 'c': - case 'd': - case 'e': - case 'f': - case 'g': - case 'h': - case 'i': - case 'j': - case 'k': - case 'l': - case 'm': - case 'n': - case 'o': - case 'p': - case 'q': - case 'r': - case 's': - case 't': - case 'u': - case 'v': - case 'w': - case 'x': - case 'y': - case 'z': - goto vv53; - default: - goto vv272; - } -vv272: - { - $this->token->setOpcode(Compiler::PHVOLT_T_ENDIF); - return 0; - } -vv273: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'C': - case 'c': - goto vv302; - default: - goto vv54; - } -vv274: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'W': - case 'w': - goto vv303; - default: - goto vv54; - } -vv275: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'I': - case 'i': - goto vv305; - default: - goto vv54; - } -vv276: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'D': - case 'd': - goto vv306; - default: - goto vv54; - } -vv277: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - case 'A': - case 'B': - case 'C': - case 'D': - case 'E': - case 'F': - case 'G': - case 'H': - case 'I': - case 'J': - case 'K': - case 'L': - case 'M': - case 'N': - case 'O': - case 'P': - case 'Q': - case 'R': - case 'S': - case 'T': - case 'U': - case 'V': - case 'W': - case 'X': - case 'Y': - case 'Z': - case '\\': - case '_': - case 'a': - case 'b': - case 'c': - case 'd': - case 'e': - case 'f': - case 'g': - case 'h': - case 'i': - case 'j': - case 'k': - case 'l': - case 'm': - case 'n': - case 'o': - case 'p': - case 'q': - case 'r': - case 's': - case 't': - case 'u': - case 'v': - case 'w': - case 'x': - case 'y': - case 'z': - goto vv53; - default: - goto vv278; - } -vv278: - { - $this->token->setOpcode(Compiler::PHVOLT_T_FALSE); - return 0; - } -vv279: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'D': - case 'd': - goto vv307; - default: - goto vv54; - } -vv280: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'T': - case 't': - goto vv308; - default: - goto vv81; - } -vv281: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'B': - case 'b': - goto vv310; - default: - goto vv54; - } -vv282: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - case 'A': - case 'B': - case 'C': - case 'D': - case 'E': - case 'F': - case 'G': - case 'H': - case 'I': - case 'J': - case 'K': - case 'L': - case 'M': - case 'N': - case 'O': - case 'P': - case 'Q': - case 'R': - case 'S': - case 'T': - case 'U': - case 'V': - case 'W': - case 'X': - case 'Y': - case 'Z': - case '\\': - case '_': - case 'a': - case 'b': - case 'c': - case 'd': - case 'e': - case 'f': - case 'g': - case 'h': - case 'i': - case 'j': - case 'k': - case 'l': - case 'm': - case 'n': - case 'o': - case 'p': - case 'q': - case 'r': - case 's': - case 't': - case 'u': - case 'v': - case 'w': - case 'x': - case 'y': - case 'z': - goto vv53; - default: - goto vv283; - } -vv283: - { - $this->state->statementPosition++; - $this->token->setOpcode(Compiler::PHVOLT_T_MACRO); - return 0; - } -vv284: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'I': - case 'i': - goto vv311; - default: - goto vv54; - } -vv285: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'N': - case 'n': - goto vv312; - default: - goto vv54; - } -vv286: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'R': - case 'r': - goto vv314; - default: - goto vv54; - } -vv287: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'H': - case 'h': - goto vv316; - default: - goto vv54; - } -vv288: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'o': - goto vv318; - default: - goto vv81; - } -vv289: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'C': - case 'c': - goto vv319; - default: - goto vv54; - } -vv290: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'U': - case 'u': - goto vv320; - default: - goto vv54; - } -vv291: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'T': - case 't': - goto vv321; - default: - goto vv54; - } -vv292: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'D': - case 'd': - goto vv323; - default: - goto vv54; - } -vv293: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'R': - case 'r': - goto vv325; - default: - goto vv54; - } -vv294: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - case 'A': - case 'B': - case 'C': - case 'D': - case 'E': - case 'F': - case 'G': - case 'H': - case 'I': - case 'J': - case 'K': - case 'L': - case 'M': - case 'N': - case 'O': - case 'P': - case 'Q': - case 'R': - case 'S': - case 'T': - case 'U': - case 'V': - case 'W': - case 'X': - case 'Y': - case 'Z': - case '\\': - case '_': - case 'a': - case 'b': - case 'c': - case 'd': - case 'e': - case 'f': - case 'g': - case 'h': - case 'i': - case 'j': - case 'k': - case 'l': - case 'm': - case 'n': - case 'o': - case 'p': - case 'q': - case 'r': - case 's': - case 't': - case 'u': - case 'v': - case 'w': - case 'x': - case 'y': - case 'z': - goto vv53; - default: - goto vv295; - } -vv295: - { - $this->token->setOpcode(Compiler::PHVOLT_T_ELSEIF); - return 0; - } -vv296: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'O': - case 'o': - goto vv327; - default: - goto vv54; - } -vv297: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'C': - case 'c': - goto vv328; - default: - goto vv54; - } -vv298: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'H': - case 'h': - goto vv329; - default: - goto vv54; - } -vv299: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'L': - case 'l': - goto vv330; - default: - goto vv54; - } -vv300: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - case 'A': - case 'B': - case 'C': - case 'D': - case 'E': - case 'F': - case 'G': - case 'H': - case 'I': - case 'J': - case 'K': - case 'L': - case 'M': - case 'N': - case 'O': - case 'P': - case 'Q': - case 'R': - case 'S': - case 'T': - case 'U': - case 'V': - case 'W': - case 'X': - case 'Y': - case 'Z': - case '\\': - case '_': - case 'a': - case 'b': - case 'c': - case 'd': - case 'e': - case 'f': - case 'g': - case 'h': - case 'i': - case 'j': - case 'k': - case 'l': - case 'm': - case 'n': - case 'o': - case 'p': - case 'q': - case 'r': - case 's': - case 't': - case 'u': - case 'v': - case 'w': - case 'x': - case 'y': - case 'z': - goto vv53; - default: - goto vv301; - } -vv301: - { - $this->token->setOpcode(Compiler::PHVOLT_T_ENDFOR); - return 0; - } -vv302: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'R': - case 'r': - goto vv332; - default: - goto vv54; - } -vv303: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - case 'A': - case 'B': - case 'C': - case 'D': - case 'E': - case 'F': - case 'G': - case 'H': - case 'I': - case 'J': - case 'K': - case 'L': - case 'M': - case 'N': - case 'O': - case 'P': - case 'Q': - case 'R': - case 'S': - case 'T': - case 'U': - case 'V': - case 'W': - case 'X': - case 'Y': - case 'Z': - case '\\': - case '_': - case 'a': - case 'b': - case 'c': - case 'd': - case 'e': - case 'f': - case 'g': - case 'h': - case 'i': - case 'j': - case 'k': - case 'l': - case 'm': - case 'n': - case 'o': - case 'p': - case 'q': - case 'r': - case 's': - case 't': - case 'u': - case 'v': - case 'w': - case 'x': - case 'y': - case 'z': - goto vv53; - default: - goto vv304; - } -vv304: - { - $this->state->statementPosition++; - $this->token->setOpcode(Compiler::PHVOLT_T_ENDRAW); - return 0; - } -vv305: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'T': - case 't': - goto vv333; - default: - goto vv54; - } -vv306: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'S': - case 's': - goto vv334; - default: - goto vv54; - } -vv307: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'E': - case 'e': - goto vv336; - default: - goto vv54; - } -vv308: - $this->state->incrementStart(); - { - $this->state->statementPosition++; - $this->token->setOpcode(Compiler::PHVOLT_T_NOTEQUALS); - return 0; - } -vv310: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'L': - case 'l': - goto vv338; - default: - goto vv54; - } -vv311: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'C': - case 'c': - goto vv339; - default: - goto vv54; - } -vv312: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - case 'A': - case 'B': - case 'C': - case 'D': - case 'E': - case 'F': - case 'G': - case 'H': - case 'I': - case 'J': - case 'K': - case 'L': - case 'M': - case 'N': - case 'O': - case 'P': - case 'Q': - case 'R': - case 'S': - case 'T': - case 'U': - case 'V': - case 'W': - case 'X': - case 'Y': - case 'Z': - case '\\': - case '_': - case 'a': - case 'b': - case 'c': - case 'd': - case 'e': - case 'f': - case 'g': - case 'h': - case 'i': - case 'j': - case 'k': - case 'l': - case 'm': - case 'n': - case 'o': - case 'p': - case 'q': - case 'r': - case 's': - case 't': - case 'u': - case 'v': - case 'w': - case 'x': - case 'y': - case 'z': - goto vv53; - default: - goto vv313; - } -vv313: - { - $this->token->setOpcode(Compiler::PHVOLT_T_RETURN); - return 0; - } -vv314: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - case 'A': - case 'B': - case 'C': - case 'D': - case 'E': - case 'F': - case 'G': - case 'H': - case 'I': - case 'J': - case 'K': - case 'L': - case 'M': - case 'N': - case 'O': - case 'P': - case 'Q': - case 'R': - case 'S': - case 'T': - case 'U': - case 'V': - case 'W': - case 'X': - case 'Y': - case 'Z': - case '\\': - case '_': - case 'a': - case 'b': - case 'c': - case 'd': - case 'e': - case 'f': - case 'g': - case 'h': - case 'i': - case 'j': - case 'k': - case 'l': - case 'm': - case 'n': - case 'o': - case 'p': - case 'q': - case 'r': - case 's': - case 't': - case 'u': - case 'v': - case 'w': - case 'x': - case 'y': - case 'z': - goto vv53; - default: - goto vv315; - } -vv315: - { - $this->state->statementPosition++; - $this->token->setOpcode(Compiler::PHVOLT_T_SCALAR); - return 0; - } -vv316: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - case 'A': - case 'B': - case 'C': - case 'D': - case 'E': - case 'F': - case 'G': - case 'H': - case 'I': - case 'J': - case 'K': - case 'L': - case 'M': - case 'N': - case 'O': - case 'P': - case 'Q': - case 'R': - case 'S': - case 'T': - case 'U': - case 'V': - case 'W': - case 'X': - case 'Y': - case 'Z': - case '\\': - case '_': - case 'a': - case 'b': - case 'c': - case 'd': - case 'e': - case 'f': - case 'g': - case 'h': - case 'i': - case 'j': - case 'k': - case 'l': - case 'm': - case 'n': - case 'o': - case 'p': - case 'q': - case 'r': - case 's': - case 't': - case 'u': - case 'v': - case 'w': - case 'x': - case 'y': - case 'z': - goto vv53; - default: - goto vv317; - } -vv317: - { - $this->state->statementPosition++; - $this->token->setOpcode(Compiler::PHVOLT_T_SWITCH); - return 0; - } -vv318: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 't': - goto vv341; - default: - goto vv81; - } -vv319: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'A': - case 'a': - goto vv343; - default: - goto vv54; - } -vv320: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'E': - case 'e': - goto vv344; - default: - goto vv54; - } -vv321: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - case 'A': - case 'B': - case 'C': - case 'D': - case 'E': - case 'F': - case 'G': - case 'H': - case 'I': - case 'J': - case 'K': - case 'L': - case 'M': - case 'N': - case 'O': - case 'P': - case 'Q': - case 'R': - case 'S': - case 'T': - case 'U': - case 'V': - case 'W': - case 'X': - case 'Y': - case 'Z': - case '\\': - case '_': - case 'a': - case 'b': - case 'c': - case 'd': - case 'e': - case 'f': - case 'g': - case 'h': - case 'i': - case 'j': - case 'k': - case 'l': - case 'm': - case 'n': - case 'o': - case 'p': - case 'q': - case 'r': - case 's': - case 't': - case 'u': - case 'v': - case 'w': - case 'x': - case 'y': - case 'z': - goto vv53; - default: - goto vv322; - } -vv322: - $this->token->setOpcode(Compiler::PHVOLT_T_DEFAULT); - $this->token->setValue(substr($this->state->getRawBuffer(), $start, $this->state->getCursor() - $start)); - return 0; -vv323: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - case 'A': - case 'B': - case 'C': - case 'D': - case 'E': - case 'F': - case 'G': - case 'H': - case 'I': - case 'J': - case 'K': - case 'L': - case 'M': - case 'N': - case 'O': - case 'P': - case 'Q': - case 'R': - case 'S': - case 'T': - case 'U': - case 'V': - case 'W': - case 'X': - case 'Y': - case 'Z': - case '\\': - case '_': - case 'a': - case 'b': - case 'c': - case 'd': - case 'e': - case 'f': - case 'g': - case 'h': - case 'i': - case 'j': - case 'k': - case 'l': - case 'm': - case 'n': - case 'o': - case 'p': - case 'q': - case 'r': - case 's': - case 't': - case 'u': - case 'v': - case 'w': - case 'x': - case 'y': - case 'z': - goto vv53; - default: - goto vv324; - } -vv324: - { - $this->state->statementPosition++; - $this->token->setOpcode(Compiler::PHVOLT_T_DEFINED); - return 0; - } -vv325: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - case 'A': - case 'B': - case 'C': - case 'D': - case 'E': - case 'F': - case 'G': - case 'H': - case 'I': - case 'J': - case 'K': - case 'L': - case 'M': - case 'N': - case 'O': - case 'P': - case 'Q': - case 'R': - case 'S': - case 'T': - case 'U': - case 'V': - case 'W': - case 'X': - case 'Y': - case 'Z': - case '\\': - case '_': - case 'a': - case 'b': - case 'c': - case 'd': - case 'e': - case 'f': - case 'g': - case 'h': - case 'i': - case 'j': - case 'k': - case 'l': - case 'm': - case 'n': - case 'o': - case 'p': - case 'q': - case 'r': - case 's': - case 't': - case 'u': - case 'v': - case 'w': - case 'x': - case 'y': - case 'z': - goto vv53; - default: - goto vv326; - } -vv326: - { - $this->token->setOpcode(Compiler::PHVOLT_T_ELSEFOR); - return 0; - } -vv327: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'E': - case 'e': - goto vv346; - default: - goto vv54; - } -vv328: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'K': - case 'k': - goto vv347; - default: - goto vv54; - } -vv329: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'E': - case 'e': - goto vv349; - default: - goto vv54; - } -vv330: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - case 'A': - case 'B': - case 'C': - case 'D': - case 'E': - case 'F': - case 'G': - case 'H': - case 'I': - case 'J': - case 'K': - case 'L': - case 'M': - case 'N': - case 'O': - case 'P': - case 'Q': - case 'R': - case 'S': - case 'T': - case 'U': - case 'V': - case 'W': - case 'X': - case 'Y': - case 'Z': - case '\\': - case '_': - case 'a': - case 'b': - case 'c': - case 'd': - case 'e': - case 'f': - case 'g': - case 'h': - case 'i': - case 'j': - case 'k': - case 'l': - case 'm': - case 'n': - case 'o': - case 'p': - case 'q': - case 'r': - case 's': - case 't': - case 'u': - case 'v': - case 'w': - case 'x': - case 'y': - case 'z': - goto vv53; - default: - goto vv331; - } -vv331: - { - $this->token->setOpcode(Compiler::PHVOLT_T_ENDCALL); - return 0; - } -vv332: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'O': - case 'o': - goto vv351; - default: - goto vv54; - } -vv333: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'C': - case 'c': - goto vv353; - default: - goto vv54; - } -vv334: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - case 'A': - case 'B': - case 'C': - case 'D': - case 'E': - case 'F': - case 'G': - case 'H': - case 'I': - case 'J': - case 'K': - case 'L': - case 'M': - case 'N': - case 'O': - case 'P': - case 'Q': - case 'R': - case 'S': - case 'T': - case 'U': - case 'V': - case 'W': - case 'X': - case 'Y': - case 'Z': - case '\\': - case '_': - case 'a': - case 'b': - case 'c': - case 'd': - case 'e': - case 'f': - case 'g': - case 'h': - case 'i': - case 'j': - case 'k': - case 'l': - case 'm': - case 'n': - case 'o': - case 'p': - case 'q': - case 'r': - case 's': - case 't': - case 'u': - case 'v': - case 'w': - case 'x': - case 'y': - case 'z': - goto vv53; - default: - goto vv335; - } -vv335: - { - $this->state->statementPosition++; - $this->token->setOpcode(Compiler::PHVOLT_T_EXTENDS); - return 0; - } -vv336: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - case 'A': - case 'B': - case 'C': - case 'D': - case 'E': - case 'F': - case 'G': - case 'H': - case 'I': - case 'J': - case 'K': - case 'L': - case 'M': - case 'N': - case 'O': - case 'P': - case 'Q': - case 'R': - case 'S': - case 'T': - case 'U': - case 'V': - case 'W': - case 'X': - case 'Y': - case 'Z': - case '\\': - case '_': - case 'a': - case 'b': - case 'c': - case 'd': - case 'e': - case 'f': - case 'g': - case 'h': - case 'i': - case 'j': - case 'k': - case 'l': - case 'm': - case 'n': - case 'o': - case 'p': - case 'q': - case 'r': - case 's': - case 't': - case 'u': - case 'v': - case 'w': - case 'x': - case 'y': - case 'z': - goto vv53; - default: - goto vv337; - } -vv337: - { - $this->state->statementPosition++; - $this->token->setOpcode(Compiler::PHVOLT_T_INCLUDE); - return 0; - } -vv338: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'E': - case 'e': - goto vv354; - default: - goto vv54; - } -vv339: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - case 'A': - case 'B': - case 'C': - case 'D': - case 'E': - case 'F': - case 'G': - case 'H': - case 'I': - case 'J': - case 'K': - case 'L': - case 'M': - case 'N': - case 'O': - case 'P': - case 'Q': - case 'R': - case 'S': - case 'T': - case 'U': - case 'V': - case 'W': - case 'X': - case 'Y': - case 'Z': - case '\\': - case '_': - case 'a': - case 'b': - case 'c': - case 'd': - case 'e': - case 'f': - case 'g': - case 'h': - case 'i': - case 'j': - case 'k': - case 'l': - case 'm': - case 'n': - case 'o': - case 'p': - case 'q': - case 'r': - case 's': - case 't': - case 'u': - case 'v': - case 'w': - case 'x': - case 'y': - case 'z': - goto vv53; - default: - goto vv340; - } -vv340: - { - $this->state->statementPosition++; - $this->token->setOpcode(Compiler::PHVOLT_T_NUMERIC); - return 0; - } -vv341: - $this->state->incrementStart(); - { - $this->state->statementPosition++; - $this->token->setOpcode(Compiler::PHVOLT_T_NOTEQUALS); - return 0; - } -vv343: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'P': - case 'p': - goto vv356; - default: - goto vv54; - } -vv344: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - case 'A': - case 'B': - case 'C': - case 'D': - case 'E': - case 'F': - case 'G': - case 'H': - case 'I': - case 'J': - case 'K': - case 'L': - case 'M': - case 'N': - case 'O': - case 'P': - case 'Q': - case 'R': - case 'S': - case 'T': - case 'U': - case 'V': - case 'W': - case 'X': - case 'Y': - case 'Z': - case '\\': - case '_': - case 'a': - case 'b': - case 'c': - case 'd': - case 'e': - case 'f': - case 'g': - case 'h': - case 'i': - case 'j': - case 'k': - case 'l': - case 'm': - case 'n': - case 'o': - case 'p': - case 'q': - case 'r': - case 's': - case 't': - case 'u': - case 'v': - case 'w': - case 'x': - case 'y': - case 'z': - goto vv53; - default: - goto vv345; - } -vv345: - { - $this->state->statementPosition++; - $this->token->setOpcode(Compiler::PHVOLT_T_CONTINUE); - return 0; - } -vv346: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'S': - case 's': - goto vv357; - default: - goto vv54; - } -vv347: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - case 'A': - case 'B': - case 'C': - case 'D': - case 'E': - case 'F': - case 'G': - case 'H': - case 'I': - case 'J': - case 'K': - case 'L': - case 'M': - case 'N': - case 'O': - case 'P': - case 'Q': - case 'R': - case 'S': - case 'T': - case 'U': - case 'V': - case 'W': - case 'X': - case 'Y': - case 'Z': - case '\\': - case '_': - case 'a': - case 'b': - case 'c': - case 'd': - case 'e': - case 'f': - case 'g': - case 'h': - case 'i': - case 'j': - case 'k': - case 'l': - case 'm': - case 'n': - case 'o': - case 'p': - case 'q': - case 'r': - case 's': - case 't': - case 'u': - case 'v': - case 'w': - case 'x': - case 'y': - case 'z': - goto vv53; - default: - goto vv348; - } -vv348: - { - $this->token->setOpcode(Compiler::PHVOLT_T_ENDBLOCK); - return 0; - } -vv349: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - case 'A': - case 'B': - case 'C': - case 'D': - case 'E': - case 'F': - case 'G': - case 'H': - case 'I': - case 'J': - case 'K': - case 'L': - case 'M': - case 'N': - case 'O': - case 'P': - case 'Q': - case 'R': - case 'S': - case 'T': - case 'U': - case 'V': - case 'W': - case 'X': - case 'Y': - case 'Z': - case '\\': - case '_': - case 'a': - case 'b': - case 'c': - case 'd': - case 'e': - case 'f': - case 'g': - case 'h': - case 'i': - case 'j': - case 'k': - case 'l': - case 'm': - case 'n': - case 'o': - case 'p': - case 'q': - case 'r': - case 's': - case 't': - case 'u': - case 'v': - case 'w': - case 'x': - case 'y': - case 'z': - goto vv53; - default: - goto vv350; - } -vv350: - { - $this->token->setOpcode(Compiler::PHVOLT_T_ENDCACHE); - return 0; - } -vv351: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - case 'A': - case 'B': - case 'C': - case 'D': - case 'E': - case 'F': - case 'G': - case 'H': - case 'I': - case 'J': - case 'K': - case 'L': - case 'M': - case 'N': - case 'O': - case 'P': - case 'Q': - case 'R': - case 'S': - case 'T': - case 'U': - case 'V': - case 'W': - case 'X': - case 'Y': - case 'Z': - case '\\': - case '_': - case 'a': - case 'b': - case 'c': - case 'd': - case 'e': - case 'f': - case 'g': - case 'h': - case 'i': - case 'j': - case 'k': - case 'l': - case 'm': - case 'n': - case 'o': - case 'p': - case 'q': - case 'r': - case 's': - case 't': - case 'u': - case 'v': - case 'w': - case 'x': - case 'y': - case 'z': - goto vv53; - default: - goto vv352; - } -vv352: - { - $this->token->setOpcode(Compiler::PHVOLT_T_ENDMACRO); - return 0; - } -vv353: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'H': - case 'h': - goto vv358; - default: - goto vv54; - } -vv354: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - case 'A': - case 'B': - case 'C': - case 'D': - case 'E': - case 'F': - case 'G': - case 'H': - case 'I': - case 'J': - case 'K': - case 'L': - case 'M': - case 'N': - case 'O': - case 'P': - case 'Q': - case 'R': - case 'S': - case 'T': - case 'U': - case 'V': - case 'W': - case 'X': - case 'Y': - case 'Z': - case '\\': - case '_': - case 'a': - case 'b': - case 'c': - case 'd': - case 'e': - case 'f': - case 'g': - case 'h': - case 'i': - case 'j': - case 'k': - case 'l': - case 'm': - case 'n': - case 'o': - case 'p': - case 'q': - case 'r': - case 's': - case 't': - case 'u': - case 'v': - case 'w': - case 'x': - case 'y': - case 'z': - goto vv53; - default: - goto vv355; - } -vv355: - { - $this->state->statementPosition++; - $this->token->setOpcode(Compiler::PHVOLT_T_ITERABLE); - return 0; - } -vv356: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'E': - case 'e': - goto vv360; - default: - goto vv54; - } -vv357: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'C': - case 'c': - goto vv362; - default: - goto vv54; - } -vv358: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - case 'A': - case 'B': - case 'C': - case 'D': - case 'E': - case 'F': - case 'G': - case 'H': - case 'I': - case 'J': - case 'K': - case 'L': - case 'M': - case 'N': - case 'O': - case 'P': - case 'Q': - case 'R': - case 'S': - case 'T': - case 'U': - case 'V': - case 'W': - case 'X': - case 'Y': - case 'Z': - case '\\': - case '_': - case 'a': - case 'b': - case 'c': - case 'd': - case 'e': - case 'f': - case 'g': - case 'h': - case 'i': - case 'j': - case 'k': - case 'l': - case 'm': - case 'n': - case 'o': - case 'p': - case 'q': - case 'r': - case 's': - case 't': - case 'u': - case 'v': - case 'w': - case 'x': - case 'y': - case 'z': - goto vv53; - default: - goto vv359; - } -vv359: - { - $this->token->setOpcode(Compiler::PHVOLT_T_ENDSWITCH); - return 0; - } -vv360: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - case 'A': - case 'B': - case 'C': - case 'D': - case 'E': - case 'F': - case 'G': - case 'H': - case 'I': - case 'J': - case 'K': - case 'L': - case 'M': - case 'N': - case 'O': - case 'P': - case 'Q': - case 'R': - case 'S': - case 'T': - case 'U': - case 'V': - case 'W': - case 'X': - case 'Y': - case 'Z': - case '\\': - case '_': - case 'a': - case 'b': - case 'c': - case 'd': - case 'e': - case 'f': - case 'g': - case 'h': - case 'i': - case 'j': - case 'k': - case 'l': - case 'm': - case 'n': - case 'o': - case 'p': - case 'q': - case 'r': - case 's': - case 't': - case 'u': - case 'v': - case 'w': - case 'x': - case 'y': - case 'z': - goto vv53; - default: - goto vv361; - } -vv361: - { + vv366: $this->state->statementPosition++; - $this->token->setOpcode(Compiler::PHVOLT_T_AUTOESCAPE); + $this->token->setOpcode(Compiler::PHVOLT_T_ENDAUTOESCAPE); return 0; } -vv362: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'A': - case 'a': - goto vv363; - default: - goto vv54; - } -vv363: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'P': - case 'p': - goto vv364; - default: - goto vv54; - } -vv364: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case 'E': - case 'e': - goto vv365; - default: - goto vv54; - } -vv365: - $vvch = $this->state->incrementStart()->getStart(); - switch ($vvch) { - case '0': - case '1': - case '2': - case '3': - case '4': - case '5': - case '6': - case '7': - case '8': - case '9': - case 'A': - case 'B': - case 'C': - case 'D': - case 'E': - case 'F': - case 'G': - case 'H': - case 'I': - case 'J': - case 'K': - case 'L': - case 'M': - case 'N': - case 'O': - case 'P': - case 'Q': - case 'R': - case 'S': - case 'T': - case 'U': - case 'V': - case 'W': - case 'X': - case 'Y': - case 'Z': - case '\\': - case '_': - case 'a': - case 'b': - case 'c': - case 'd': - case 'e': - case 'f': - case 'g': - case 'h': - case 'i': - case 'j': - case 'k': - case 'l': - case 'm': - case 'n': - case 'o': - case 'p': - case 'q': - case 'r': - case 's': - case 't': - case 'u': - case 'v': - case 'w': - case 'x': - case 'y': - case 'z': - goto vv53; - default: - goto vv366; - } -vv366: - $this->state->statementPosition++; - $this->token->setOpcode(Compiler::PHVOLT_T_ENDAUTOESCAPE); - return 0; - } } return $status; diff --git a/src/Scanner/State.php b/src/Scanner/State.php index a2ff7b1..47b26bf 100644 --- a/src/Scanner/State.php +++ b/src/Scanner/State.php @@ -18,52 +18,31 @@ class State { public mixed $activeToken = null; - - protected int $mode = Compiler::PHVOLT_MODE_RAW; - - protected ?string $start = null; - - protected int $cursor = 0; - - protected ?string $end = null; - - public mixed $marker = null; - - public int $startLength; - - protected int $activeLine = 1; - - protected string $activeFile = 'eval code'; - - public int $statementPosition = 0; - - public int $extendsMode = 0; - public int $blockLevel = 0; - + public int $extendsMode = 0; + public int $forLevel = 0; + public int $forcedRawState = 0; + public int $ifLevel = 0; public int $macroLevel = 0; - + public mixed $marker = null; + public int $oldIfLevel = 0; public string $rawBuffer; - public int $rawBufferCursor = 0; - public int $rawBufferSize = Compiler::PHVOLT_RAW_BUFFER_SIZE; - - public int $oldIfLevel = 0; - - public int $ifLevel = 0; - - public int $forLevel = 0; - + public int $startLength; + public int $statementPosition = 0; public int $switchLevel = 0; - public bool $whitespaceControl = false; - - public int $forcedRawState = 0; + protected string $activeFile = 'eval code'; + protected int $activeLine = 1; + protected int $cursor = 0; + protected ?string $end = null; + protected int $mode = Compiler::PHVOLT_MODE_RAW; + protected ?string $start = null; public function __construct(string $buffer) { - $this->rawBuffer = $buffer; + $this->rawBuffer = $buffer; $this->startLength = mb_strlen($buffer); if ($this->startLength > 0) { $this->setStart($buffer[0]); @@ -71,21 +50,21 @@ public function __construct(string $buffer) } } - public function getRawBuffer(): string + public function extendsMode(int $extendsMode): self { - return $this->rawBuffer; + $this->extendsMode = $extendsMode; + + return $this; } - public function getCursor(): int + public function getActiveFile(): string { - return $this->cursor; + return $this->activeFile; } - public function setActiveToken(mixed $activeToken): self + public function getActiveLine(): int { - $this->activeToken = $activeToken; - - return $this; + return $this->activeLine; } public function getActiveToken(): mixed @@ -93,28 +72,29 @@ public function getActiveToken(): mixed return $this->activeToken; } - public function setMode(int $mode): self + public function getCursor(): int { - $this->mode = $mode; - - return $this; + return $this->cursor; } - public function getMode(): int + public function getIfLevel(): int { - return $this->mode; + return $this->ifLevel; } - public function setStart(?string $start): self + public function getMarker(): mixed { - $this->start = $start; + return $this->marker; + } - return $this; + public function getMode(): int + { + return $this->mode; } - public function getStart(): ?string + public function getNext(int $increment = 1): ?string { - return $this->start; + return $this->rawBuffer[$this->cursor + $increment] ?? null; } public function getPrevious(int $decrement = 1): ?string @@ -122,60 +102,49 @@ public function getPrevious(int $decrement = 1): ?string return $this->rawBuffer[$this->cursor - $decrement] ?? null; } - public function getNext(int $increment = 1): ?string + public function getRawBuffer(): string { - return $this->rawBuffer[$this->cursor + $increment] ?? null; + return $this->rawBuffer; } - public function incrementStart(int $value = 1): self + public function getRawBufferCursor(): int { - $this->cursor += $value; - $this->setStart($this->rawBuffer[$this->cursor] ?? null); - - return $this; + return $this->rawBufferCursor; } - public function setEnd(?string $end): self + public function getStart(): ?string { - $this->end = $end; - - return $this; + return $this->start; } - public function setMarker(mixed $marker): self + public function getStartLength(): int { - $this->marker = $marker; - - return $this; + return $this->startLength; } - public function getMarker(): mixed + public function getWhitespaceControl(): bool { - return $this->marker; + return $this->whitespaceControl; } - public function setStartLength(int $startLength): self + public function incrementActiveLine(): self { - $this->startLength = $startLength; + $this->activeLine++; return $this; } - public function getStartLength(): int - { - return $this->startLength; - } - - public function setActiveLine(int $activeLine): self + public function incrementRawBufferCursor(): self { - $this->activeLine = $activeLine; + $this->rawBufferCursor++; return $this; } - public function incrementActiveLine(): self + public function incrementStart(int $value = 1): self { - $this->activeLine++; + $this->cursor += $value; + $this->setStart($this->rawBuffer[$this->cursor] ?? null); return $this; } @@ -187,16 +156,16 @@ public function setActiveFile(string $activeFile): self return $this; } - public function setStatementPosition(int $statementPosition): self + public function setActiveLine(int $activeLine): self { - $this->statementPosition = $statementPosition; + $this->activeLine = $activeLine; return $this; } - public function extendsMode(int $extendsMode): self + public function setActiveToken(mixed $activeToken): self { - $this->extendsMode = $extendsMode; + $this->activeToken = $activeToken; return $this; } @@ -208,105 +177,115 @@ public function setBlockLevel(int $blockLevel): self return $this; } - public function setMacroLevel(int $macroLevel): self + public function setEnd(?string $end): self { - $this->macroLevel = $macroLevel; + $this->end = $end; return $this; } - public function setRawBuffer(string $rawBuffer): self + public function setForLevel(int $forLevel): self { - $this->rawBuffer = $rawBuffer; + $this->forLevel = $forLevel; return $this; } - public function setRawBufferCursor(int $rawBufferCursor): self + public function setForcedRawState(int $forcedRawState): self { - $this->rawBufferCursor = $rawBufferCursor; + $this->forcedRawState = $forcedRawState; return $this; } - public function incrementRawBufferCursor(): self + public function setIfLevel(int $ifLevel): self { - $this->rawBufferCursor++; + $this->ifLevel = $ifLevel; return $this; } - public function getRawBufferCursor(): int + public function setMacroLevel(int $macroLevel): self { - return $this->rawBufferCursor; + $this->macroLevel = $macroLevel; + + return $this; } - public function setRawBufferSize(int $rawBufferSize): self + public function setMarker(mixed $marker): self { - $this->rawBufferSize = $rawBufferSize; + $this->marker = $marker; return $this; } - public function setOldIfLevel(int $oldIfLevel): self + public function setMode(int $mode): self { - $this->oldIfLevel = $oldIfLevel; + $this->mode = $mode; return $this; } - public function setIfLevel(int $ifLevel): self + public function setOldIfLevel(int $oldIfLevel): self { - $this->ifLevel = $ifLevel; + $this->oldIfLevel = $oldIfLevel; return $this; } - public function setForLevel(int $forLevel): self + public function setRawBuffer(string $rawBuffer): self { - $this->forLevel = $forLevel; + $this->rawBuffer = $rawBuffer; return $this; } - public function setSwitchLevel(int $switchLevel): self + public function setRawBufferCursor(int $rawBufferCursor): self { - $this->switchLevel = $switchLevel; + $this->rawBufferCursor = $rawBufferCursor; return $this; } - public function setWhitespaceControl(bool $whitespaceControl): self + public function setRawBufferSize(int $rawBufferSize): self { - $this->whitespaceControl = $whitespaceControl; + $this->rawBufferSize = $rawBufferSize; return $this; } - public function getWhitespaceControl(): bool + public function setStart(?string $start): self { - return $this->whitespaceControl; + $this->start = $start; + + return $this; } - public function setForcedRawState(int $forcedRawState): self + public function setStartLength(int $startLength): self { - $this->forcedRawState = $forcedRawState; + $this->startLength = $startLength; return $this; } - public function getActiveFile(): string + public function setStatementPosition(int $statementPosition): self { - return $this->activeFile; + $this->statementPosition = $statementPosition; + + return $this; } - public function getActiveLine(): int + public function setSwitchLevel(int $switchLevel): self { - return $this->activeLine; + $this->switchLevel = $switchLevel; + + return $this; } - public function getIfLevel(): int + public function setWhitespaceControl(bool $whitespaceControl): self { - return $this->ifLevel; + $this->whitespaceControl = $whitespaceControl; + + return $this; } } diff --git a/src/Scanner/Token.php b/src/Scanner/Token.php index 9070084..d5fffcb 100644 --- a/src/Scanner/Token.php +++ b/src/Scanner/Token.php @@ -15,19 +15,19 @@ class Token { - protected mixed $opcode = null; - + protected bool $freeFlag = false; protected int $length = 0; - + protected mixed $opcode = null; protected mixed $value = null; - protected bool $freeFlag = false; - - public function setOpcode(mixed $opcode): self + public function getFreeFlag(): bool { - $this->opcode = $opcode; + return $this->freeFlag; + } - return $this; + public function getLength(): int + { + return $this->length; } public function getOpcode(): mixed @@ -35,6 +35,18 @@ public function getOpcode(): mixed return $this->opcode; } + public function getValue(): ?string + { + return $this->value; + } + + public function setFreeFlag(bool $free): self + { + $this->freeFlag = $free; + + return $this; + } + public function setLength(int $length): self { $this->length = $length; @@ -42,9 +54,11 @@ public function setLength(int $length): self return $this; } - public function getLength(): int + public function setOpcode(mixed $opcode): self { - return $this->length; + $this->opcode = $opcode; + + return $this; } public function setValue(mixed $value): self @@ -56,21 +70,4 @@ public function setValue(mixed $value): self return $this; } - - public function getValue(): ?string - { - return $this->value; - } - - public function setFreeFlag(bool $free): self - { - $this->freeFlag = $free; - - return $this; - } - - public function getFreeFlag(): bool - { - return $this->freeFlag; - } } diff --git a/src/Tokens.php b/src/Tokens.php index 6335362..d818d9f 100644 --- a/src/Tokens.php +++ b/src/Tokens.php @@ -16,89 +16,89 @@ class Tokens { public static array $names = [ - 'INTEGER' => Compiler::PHVOLT_T_INTEGER, - 'DOUBLE' => Compiler::PHVOLT_T_DOUBLE, - 'STRING' => Compiler::PHVOLT_T_STRING, - 'IDENTIFIER' => Compiler::PHVOLT_T_IDENTIFIER, - 'MINUS' => Compiler::PHVOLT_T_MINUS, - '+' => Compiler::PHVOLT_T_ADD, - '-' => Compiler::PHVOLT_T_SUB, - '*' => Compiler::PHVOLT_T_MUL, - '/' => Compiler::PHVOLT_T_DIV, - '%%' => Compiler::PHVOLT_T_MOD, - '!' => Compiler::PHVOLT_T_NOT, - '~' => Compiler::PHVOLT_T_CONCAT, - 'AND' => Compiler::PHVOLT_T_AND, - 'OR' => Compiler::PHVOLT_T_OR, - 'DOT' => Compiler::PHVOLT_T_DOT, - 'COMMA' => Compiler::PHVOLT_T_COMMA, - 'EQUALS' => Compiler::PHVOLT_T_EQUALS, - 'NOT EQUALS' => Compiler::PHVOLT_T_NOTEQUALS, - 'IDENTICAL' => Compiler::PHVOLT_T_IDENTICAL, + 'INTEGER' => Compiler::PHVOLT_T_INTEGER, + 'DOUBLE' => Compiler::PHVOLT_T_DOUBLE, + 'STRING' => Compiler::PHVOLT_T_STRING, + 'IDENTIFIER' => Compiler::PHVOLT_T_IDENTIFIER, + 'MINUS' => Compiler::PHVOLT_T_MINUS, + '+' => Compiler::PHVOLT_T_ADD, + '-' => Compiler::PHVOLT_T_SUB, + '*' => Compiler::PHVOLT_T_MUL, + '/' => Compiler::PHVOLT_T_DIV, + '%%' => Compiler::PHVOLT_T_MOD, + '!' => Compiler::PHVOLT_T_NOT, + '~' => Compiler::PHVOLT_T_CONCAT, + 'AND' => Compiler::PHVOLT_T_AND, + 'OR' => Compiler::PHVOLT_T_OR, + 'DOT' => Compiler::PHVOLT_T_DOT, + 'COMMA' => Compiler::PHVOLT_T_COMMA, + 'EQUALS' => Compiler::PHVOLT_T_EQUALS, + 'NOT EQUALS' => Compiler::PHVOLT_T_NOTEQUALS, + 'IDENTICAL' => Compiler::PHVOLT_T_IDENTICAL, 'NOT IDENTICAL' => Compiler::PHVOLT_T_NOTIDENTICAL, - 'NOT' => Compiler::PHVOLT_T_NOT, - 'RANGE' => Compiler::PHVOLT_T_RANGE, - 'COLON' => Compiler::PHVOLT_T_COLON, + 'NOT' => Compiler::PHVOLT_T_NOT, + 'RANGE' => Compiler::PHVOLT_T_RANGE, + 'COLON' => Compiler::PHVOLT_T_COLON, 'QUESTION MARK' => Compiler::PHVOLT_T_QUESTION, - '<' => Compiler::PHVOLT_T_LESS, - '<=' => Compiler::PHVOLT_T_LESSEQUAL, - '>' => Compiler::PHVOLT_T_GREATER, - '>=' => Compiler::PHVOLT_T_GREATEREQUAL, - '(' => Compiler::PHVOLT_T_PARENTHESES_OPEN, - ')' => Compiler::PHVOLT_T_PARENTHESES_CLOSE, - '[' => Compiler::PHVOLT_T_SBRACKET_OPEN, - ']' => Compiler::PHVOLT_T_SBRACKET_CLOSE, - '{' => Compiler::PHVOLT_T_CBRACKET_OPEN, - '}' => Compiler::PHVOLT_T_CBRACKET_CLOSE, - '{%' => Compiler::PHVOLT_T_OPEN_DELIMITER, - '%}' => Compiler::PHVOLT_T_CLOSE_DELIMITER, - '{{' => Compiler::PHVOLT_T_OPEN_EDELIMITER, - '}}' => Compiler::PHVOLT_T_CLOSE_EDELIMITER, - 'IF' => Compiler::PHVOLT_T_IF, - 'ELSE' => Compiler::PHVOLT_T_ELSE, - 'ELSEIF' => Compiler::PHVOLT_T_ELSEIF, - 'ELSEFOR' => Compiler::PHVOLT_T_ELSEFOR, - 'ENDIF' => Compiler::PHVOLT_T_ENDIF, - 'FOR' => Compiler::PHVOLT_T_FOR, - 'SWITCH' => Compiler::PHVOLT_T_SWITCH, - 'CASE' => Compiler::PHVOLT_T_CASE, - 'DEFAULT' => Compiler::PHVOLT_T_DEFAULT, - 'ENDSWITCH' => Compiler::PHVOLT_T_ENDSWITCH, - 'IN' => Compiler::PHVOLT_T_IN, - 'ENDFOR' => Compiler::PHVOLT_T_ENDFOR, - 'SET' => Compiler::PHVOLT_T_SET, - 'ASSIGN' => Compiler::PHVOLT_T_ASSIGN, - '+=' => Compiler::PHVOLT_T_ADD_ASSIGN, - '-=' => Compiler::PHVOLT_T_SUB_ASSIGN, - '*=' => Compiler::PHVOLT_T_MUL_ASSIGN, - '/=' => Compiler::PHVOLT_T_DIV_ASSIGN, - '++' => Compiler::PHVOLT_T_INCR, - '--' => Compiler::PHVOLT_T_DECR, - 'BLOCK' => Compiler::PHVOLT_T_BLOCK, - 'ENDBLOCK' => Compiler::PHVOLT_T_ENDBLOCK, - 'CACHE' => Compiler::PHVOLT_T_CACHE, - 'ENDCACHE' => Compiler::PHVOLT_T_ENDCACHE, - 'EXTENDS' => Compiler::PHVOLT_T_EXTENDS, - 'IS' => Compiler::PHVOLT_T_IS, - 'DEFINED' => Compiler::PHVOLT_T_DEFINED, - 'EMPTY' => Compiler::PHVOLT_T_EMPTY, - 'EVEN' => Compiler::PHVOLT_T_EVEN, - 'ODD' => Compiler::PHVOLT_T_ODD, - 'NUMERIC' => Compiler::PHVOLT_T_NUMERIC, - 'SCALAR' => Compiler::PHVOLT_T_SCALAR, - 'ITERABLE' => Compiler::PHVOLT_T_ITERABLE, - 'INCLUDE' => Compiler::PHVOLT_T_INCLUDE, - 'DO' => Compiler::PHVOLT_T_DO, - 'WHITESPACE' => Compiler::PHVOLT_T_IGNORE, - 'AUTOESCAPE' => Compiler::PHVOLT_T_AUTOESCAPE, + '<' => Compiler::PHVOLT_T_LESS, + '<=' => Compiler::PHVOLT_T_LESSEQUAL, + '>' => Compiler::PHVOLT_T_GREATER, + '>=' => Compiler::PHVOLT_T_GREATEREQUAL, + '(' => Compiler::PHVOLT_T_PARENTHESES_OPEN, + ')' => Compiler::PHVOLT_T_PARENTHESES_CLOSE, + '[' => Compiler::PHVOLT_T_SBRACKET_OPEN, + ']' => Compiler::PHVOLT_T_SBRACKET_CLOSE, + '{' => Compiler::PHVOLT_T_CBRACKET_OPEN, + '}' => Compiler::PHVOLT_T_CBRACKET_CLOSE, + '{%' => Compiler::PHVOLT_T_OPEN_DELIMITER, + '%}' => Compiler::PHVOLT_T_CLOSE_DELIMITER, + '{{' => Compiler::PHVOLT_T_OPEN_EDELIMITER, + '}}' => Compiler::PHVOLT_T_CLOSE_EDELIMITER, + 'IF' => Compiler::PHVOLT_T_IF, + 'ELSE' => Compiler::PHVOLT_T_ELSE, + 'ELSEIF' => Compiler::PHVOLT_T_ELSEIF, + 'ELSEFOR' => Compiler::PHVOLT_T_ELSEFOR, + 'ENDIF' => Compiler::PHVOLT_T_ENDIF, + 'FOR' => Compiler::PHVOLT_T_FOR, + 'SWITCH' => Compiler::PHVOLT_T_SWITCH, + 'CASE' => Compiler::PHVOLT_T_CASE, + 'DEFAULT' => Compiler::PHVOLT_T_DEFAULT, + 'ENDSWITCH' => Compiler::PHVOLT_T_ENDSWITCH, + 'IN' => Compiler::PHVOLT_T_IN, + 'ENDFOR' => Compiler::PHVOLT_T_ENDFOR, + 'SET' => Compiler::PHVOLT_T_SET, + 'ASSIGN' => Compiler::PHVOLT_T_ASSIGN, + '+=' => Compiler::PHVOLT_T_ADD_ASSIGN, + '-=' => Compiler::PHVOLT_T_SUB_ASSIGN, + '*=' => Compiler::PHVOLT_T_MUL_ASSIGN, + '/=' => Compiler::PHVOLT_T_DIV_ASSIGN, + '++' => Compiler::PHVOLT_T_INCR, + '--' => Compiler::PHVOLT_T_DECR, + 'BLOCK' => Compiler::PHVOLT_T_BLOCK, + 'ENDBLOCK' => Compiler::PHVOLT_T_ENDBLOCK, + 'CACHE' => Compiler::PHVOLT_T_CACHE, + 'ENDCACHE' => Compiler::PHVOLT_T_ENDCACHE, + 'EXTENDS' => Compiler::PHVOLT_T_EXTENDS, + 'IS' => Compiler::PHVOLT_T_IS, + 'DEFINED' => Compiler::PHVOLT_T_DEFINED, + 'EMPTY' => Compiler::PHVOLT_T_EMPTY, + 'EVEN' => Compiler::PHVOLT_T_EVEN, + 'ODD' => Compiler::PHVOLT_T_ODD, + 'NUMERIC' => Compiler::PHVOLT_T_NUMERIC, + 'SCALAR' => Compiler::PHVOLT_T_SCALAR, + 'ITERABLE' => Compiler::PHVOLT_T_ITERABLE, + 'INCLUDE' => Compiler::PHVOLT_T_INCLUDE, + 'DO' => Compiler::PHVOLT_T_DO, + 'WHITESPACE' => Compiler::PHVOLT_T_IGNORE, + 'AUTOESCAPE' => Compiler::PHVOLT_T_AUTOESCAPE, 'ENDAUTOESCAPE' => Compiler::PHVOLT_T_ENDAUTOESCAPE, - 'CONTINUE' => Compiler::PHVOLT_T_CONTINUE, - 'BREAK' => Compiler::PHVOLT_T_BREAK, - 'WITH' => Compiler::PHVOLT_T_WITH, - 'RETURN' => Compiler::PHVOLT_T_RETURN, - 'MACRO' => Compiler::PHVOLT_T_MACRO, - 'ENDMACRO' => Compiler::PHVOLT_T_ENDMACRO, - 'CALL' => Compiler::PHVOLT_T_CALL, - null => 0, + 'CONTINUE' => Compiler::PHVOLT_T_CONTINUE, + 'BREAK' => Compiler::PHVOLT_T_BREAK, + 'WITH' => Compiler::PHVOLT_T_WITH, + 'RETURN' => Compiler::PHVOLT_T_RETURN, + 'MACRO' => Compiler::PHVOLT_T_MACRO, + 'ENDMACRO' => Compiler::PHVOLT_T_ENDMACRO, + 'CALL' => Compiler::PHVOLT_T_CALL, + null => 0, ]; } diff --git a/tests/support/output/.gitkeep b/tests/support/output/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/tests_old/Compiler/AddFunctionCest.php b/tests/unit/AddFunctionTest.php similarity index 53% rename from tests_old/Compiler/AddFunctionCest.php rename to tests/unit/AddFunctionTest.php index f2659d1..55690ed 100644 --- a/tests_old/Compiler/AddFunctionCest.php +++ b/tests/unit/AddFunctionTest.php @@ -11,16 +11,12 @@ declare(strict_types=1); -namespace Phalcon\Tests\Integration\Mvc\View\Engine\Volt\Compiler; +namespace Phalcon\Tests\Unit; -use Codeception\Example; -use IntegrationTester; -use Phalcon\Mvc\View\Engine\Volt\Compiler; +use Phalcon\Volt\Compiler; +use PHPUnit\Framework\TestCase; -/** - * Class AddFunctionCest - */ -class AddFunctionCest +final class AddFunctionTest extends TestCase { /** * Tests Phalcon\Mvc\View\Engine\Volt\Compiler :: addFunction() @@ -30,23 +26,18 @@ class AddFunctionCest * * @dataProvider getVoltAddFunction */ - public function mvcViewEngineVoltCompilerAddFunction(IntegrationTester $I, Example $example) - { - $I->wantToTest("Mvc\View\Engine\Volt\Compiler - addFunction()"); - - $name = $example[0]; - $funcName = $example[1]; - $voltName = $example[2]; - $expected = $example[3]; - - $volt = new Compiler(); - - $volt->addFunction($name, $funcName); - - $I->assertEquals( - $expected, - $volt->compileString($voltName) - ); + public function testMvcViewEngineVoltCompilerAddFunction( + string $name, + string $funcName, + string $voltName, + string $expected + ): void { + $compiler = new Compiler(); + + $compiler->addFunction($name, $funcName); + + $actual = $compiler->compileString($voltName); + $this->assertSame($expected, $actual); } /** @@ -57,31 +48,26 @@ public function mvcViewEngineVoltCompilerAddFunction(IntegrationTester $I, Examp * * @dataProvider getVoltAddFunctionClosure */ - public function mvcViewEngineVoltCompilerAddFunctionClosure(IntegrationTester $I, Example $example) - { - $I->wantToTest("Mvc\View\Engine\Volt\Compiler - addFunction() - closure"); - - $name = $example[0]; - $funcName = $example[1]; - $voltName = $example[2]; - $expected = $example[3]; - - $volt = new Compiler(); - - $volt->addFunction( + public function testMvcViewEngineVoltCompilerAddFunctionClosure( + string $name, + string $funcName, + string $voltName, + string $expected + ): void { + $compiler = new Compiler(); + + $compiler->addFunction( $name, function ($arguments) use ($funcName) { return $funcName . '(' . $arguments . ')'; } ); - $I->assertEquals( - $expected, - $volt->compileString($voltName) - ); + $actual = $compiler->compileString($voltName); + $this->assertSame($expected, $actual); } - private function getVoltAddFunction(): array + public static function getVoltAddFunction(): array { return [ [ @@ -100,7 +86,7 @@ private function getVoltAddFunction(): array ]; } - private function getVoltAddFunctionClosure(): array + public static function getVoltAddFunctionClosure(): array { return [ [ diff --git a/tests/CompilerTest.php b/tests/unit/CompilerTest.php similarity index 94% rename from tests/CompilerTest.php rename to tests/unit/CompilerTest.php index 6e04029..f8db8be 100644 --- a/tests/CompilerTest.php +++ b/tests/unit/CompilerTest.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Tests; +namespace Phalcon\Tests\Unit; use Phalcon\Volt\Compiler; use PHPUnit\Framework\TestCase; diff --git a/tests_old/Compiler/CompileElseIfCest.php b/tests_old/Compiler/CompileElseIfTest.php similarity index 56% rename from tests_old/Compiler/CompileElseIfCest.php rename to tests_old/Compiler/CompileElseIfTest.php index 0095614..cae2911 100644 --- a/tests_old/Compiler/CompileElseIfCest.php +++ b/tests_old/Compiler/CompileElseIfTest.php @@ -13,10 +13,10 @@ namespace Phalcon\Tests\Integration\Mvc\View\Engine\Volt\Compiler; -use IntegrationTester; -use Phalcon\Mvc\View\Engine\Volt\Compiler; +use Phalcon\Volt\Compiler; +use PHPUnit\Framework\TestCase; -class CompileElseIfCest +final class CompileElseIfTest extends TestCase { /** * Tests Phalcon\Mvc\View\Engine\Volt\Compiler :: compileElseIf() @@ -24,19 +24,16 @@ class CompileElseIfCest * @author Sid Roberts * @since 2019-05-22 */ - public function mvcViewEngineVoltCompilerCompileElseIf(IntegrationTester $I) + public function testMvcViewEngineVoltCompilerCompileElseIf() { - $I->wantToTest('Mvc\View\Engine\Volt\Compiler - compileElseIf()'); + $compiler = new Compiler(); - $volt = new Compiler(); - - $compiled = $volt->compileString( + $expected = 'zeroonemore than one'; + $actual = $compiler->compileString( '{% if i == 0 %}zero{% elseif i == 1 %}one{% else %}more than one{% endif %}' ); - $I->assertEquals( - 'zeroonemore than one', - $compiled - ); + $this->assertSame($expected, $actual); } } diff --git a/tests_old/Compiler/CompileIfCest.php b/tests_old/Compiler/CompileIfTest.php similarity index 57% rename from tests_old/Compiler/CompileIfCest.php rename to tests_old/Compiler/CompileIfTest.php index 3adce0d..8d1732b 100644 --- a/tests_old/Compiler/CompileIfCest.php +++ b/tests_old/Compiler/CompileIfTest.php @@ -13,10 +13,10 @@ namespace Phalcon\Tests\Integration\Mvc\View\Engine\Volt\Compiler; -use IntegrationTester; -use Phalcon\Mvc\View\Engine\Volt\Compiler; +use Phalcon\Volt\Compiler; +use PHPUnit\Framework\TestCase; -class CompileIfCest +final class CompileIfTest extends TestCase { /** * Tests Phalcon\Mvc\View\Engine\Volt\Compiler :: compileIf() @@ -24,19 +24,14 @@ class CompileIfCest * @author Sid Roberts * @since 2019-05-22 */ - public function mvcViewEngineVoltCompilerCompileIf(IntegrationTester $I) + public function testMvcViewEngineVoltCompilerCompileIf() { - $I->wantToTest('Mvc\View\Engine\Volt\Compiler - compileIf()'); + $compiler = new Compiler(); - $volt = new Compiler(); - - $compiled = $volt->compileString( + $expected = 'zeronot zero'; + $actual = $compiler->compileString( '{% if i == 0 %}zero{% else %}not zero{% endif %}' ); - - $I->assertEquals( - 'zeronot zero', - $compiled - ); + $this->assertSame($expected, $actual); } } diff --git a/tests_old/Compiler/ParseCest.php b/tests_old/Compiler/ParseTest.php similarity index 87% rename from tests_old/Compiler/ParseCest.php rename to tests_old/Compiler/ParseTest.php index 069e4db..4d5ced2 100644 --- a/tests_old/Compiler/ParseCest.php +++ b/tests_old/Compiler/ParseTest.php @@ -13,17 +13,11 @@ namespace Phalcon\Tests\Integration\Mvc\View\Engine\Volt\Compiler; -use Codeception\Example; -use IntegrationTester; -use Phalcon\Mvc\View\Engine\Volt\Compiler; -use Phalcon\Mvc\View\Exception; +use Phalcon\Volt\Compiler; +use Phalcon\Volt\Exception; +use PHPUnit\Framework\TestCase; -use function is_array; - -/** - * Class ParseCest - */ -class ParseCest +final class ParseTest extends TestCase { /** * Tests Phalcon\Mvc\View\Engine\Volt\Compiler :: parse() @@ -33,18 +27,15 @@ class ParseCest * * @dataProvider getVoltParse */ - public function mvcViewEngineVoltCompilerParse(IntegrationTester $I, Example $example) - { - $I->wantToTest("Mvc\View\Engine\Volt\Compiler - parse()"); - - $param = $example[0]; - $count = $example[1]; + public function testMvcViewEngineVoltCompilerParse( + string $param, + int $count + ): void { + $compiler = new Compiler(); + $actual = $compiler->parse($param); - $volt = new Compiler(); - $actual = $volt->parse($param); - - $I->assertTrue(is_array($actual)); - $I->assertCount($count, $actual); + $this->assertTrue(is_array($actual)); + $this->assertCount($count, $actual); } /** @@ -56,21 +47,16 @@ public function mvcViewEngineVoltCompilerParse(IntegrationTester $I, Example $ex * * @dataProvider getVoltSyntaxErrors */ - public function mvcViewEngineVoltCompilerParseSyntaxError(IntegrationTester $I, Example $example) - { - $I->wantToTest("Mvc\View\Engine\Volt\Compiler - parse() - syntax error"); + public function mvcViewEngineVoltCompilerParseSyntaxError( + string $code, + string $message + ): void { + $compiler = new Compiler(); - $code = $example[0]; - $message = $example[1]; + $this->expectException(Exception::class); + $this->expectExceptionMessage($message); - $volt = new Compiler(); - - $I->expectThrowable( - new Exception($message), - function () use ($volt, $code) { - $volt->parse($code); - } - ); + $compiler->parse($code); } /** @@ -82,24 +68,22 @@ function () use ($volt, $code) { * * @dataProvider getVoltExtendsError */ - public function mvcViewEngineVoltCompilerParseExtendsWithError(IntegrationTester $I, Example $example) - { - $I->wantToTest("Mvc\View\Engine\Volt\Compiler - parse() - extends with error"); + public function mvcViewEngineVoltCompilerParseExtendsWithError( + string $code, + string $message + ): void { + $compiler = new Compiler(); - $code = $example[0]; - $message = $example[1]; + $this->expectException(Exception::class); + $this->expectExceptionMessage($message); - $volt = new Compiler(); - - $I->expectThrowable( - new Exception($message), - function () use ($volt, $code) { - $volt->parse($code); - } - ); + $compiler->parse($code); } - private function getVoltParse(): array + /** + * @return array + */ + public static function getVoltParse(): array { return [ ['', 0], @@ -244,8 +228,10 @@ private function getVoltParse(): array ]; } - - private function getVoltSyntaxErrors(): array + /** + * @return array[] + */ + public static function getVoltSyntaxErrors(): array { return [ [ @@ -312,8 +298,10 @@ private function getVoltSyntaxErrors(): array ]; } - - private function getVoltExtendsError(): array + /** + * @return array[] + */ + public static function getVoltExtendsError(): array { return [ [