Automatically call flex/bison if necessary

ANGLE translator's parser code generation is changed to use the binaries
of flex/bison stored in the cloud.  scripts/run_code_generation.py now
automatically runs these files if the input files change.

Bug: angleproject:3419
Change-Id: Icce4247f93b27baf8ee12dbb16112fa2cc98c111
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/1940572
Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>
Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org>
diff --git a/.gitattributes b/.gitattributes
index 4bf73cb..e6713d0 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1,14 +1,16 @@
-*                    text=auto
-*.sln                eol=crlf
-*.vcxproj            eol=crlf
-*.vcxproj.filters    eol=crlf
-*.bat                eol=crlf
-*.rc                 eol=crlf
-**/compiled/*.h      eol=crlf
-**/shaders/gen/*.inc eol=lf
-*.sh                 eol=lf
-*.gn                 eol=lf
-*.gni                eol=lf
+*                                          text=auto
+*.sln                                      eol=crlf
+*.vcxproj                                  eol=crlf
+*.vcxproj.filters                          eol=crlf
+*.bat                                      eol=crlf
+*.rc                                       eol=crlf
+**/compiled/*.h                            eol=crlf
+**/shaders/gen/*.inc                       eol=lf
+*.sh                                       eol=lf
+*.gn                                       eol=lf
+*.gni                                      eol=lf
+src/compiler/preprocessor/preprocessor_*.* eol=lf
+src/compiler/translator/glslang_*.*        eol=lf
 
 # Git conflict markers in the json file break the code generator.
 # Using a binary merge strategy forces conflicts without changing file contents.
diff --git a/DEPS b/DEPS
index ce14e35..e0c640d 100644
--- a/DEPS
+++ b/DEPS
@@ -385,6 +385,34 @@
                 '-s', 'tools/glslang/glslang_validator.exe.sha1',
     ],
   },
+
+  # Download flex/bison binaries for Linux.
+  {
+    'name': 'linux_flex_bison',
+    'pattern': '.',
+    'condition': 'checkout_linux and not build_with_chromium',
+    'action': [ 'download_from_google_storage',
+                '--no_resume',
+                '--platform=linux*',
+                '--no_auth',
+                '--bucket', 'angle-flex-bison',
+                '-d', 'tools/flex-bison/linux/',
+    ],
+  },
+
+  # Download flex/bison binaries for Windows.
+  {
+    'name': 'win_flex_bison',
+    'pattern': '.',
+    'condition': 'checkout_win and not build_with_chromium',
+    'action': [ 'download_from_google_storage',
+                '--no_resume',
+                '--platform=win32*',
+                '--no_auth',
+                '--bucket', 'angle-flex-bison',
+                '-d', 'tools/flex-bison/windows/',
+    ],
+  },
 ]
 
 recursedeps = [
diff --git a/doc/ContributingCode.md b/doc/ContributingCode.md
index 9a78241..cef5823 100644
--- a/doc/ContributingCode.md
+++ b/doc/ContributingCode.md
@@ -2,112 +2,208 @@
 
 ## Communicate
 
- * Whether you're writing a new feature or fixing an existing bug, it pays to get a second opinion before you get too far. If it's a new feature idea, post to the discussion group ([angleproject](https://groups.google.com/forum/?fromgroups#!forum/angleproject)) and propose it or talk with the ANGLE team on IRC in the #ANGLEproject channel on FreeNode.
- * Not all bugs in our [bug system](https://bugs.chromium.org/p/angleproject/issues/list) are assigned, but if the one you're interested in fixing is, send a note to the person it's assigned to and ask if they would like a patch.
- * Behavior changes and anything nontrivial (i.e. anything other than simple cleanups and style fixes) should generally be tracked in the bug system. Please [file a bug](http://anglebug.com/new) and describe what you're doing if there isn't one already.
- * If you would like bug-editing rights, simply ask a team member via email or the disussion group.
+* Whether you're writing a new feature or fixing an existing bug, it pays to get a second opinion
+  before you get too far. If it's a new feature idea, post to the discussion group
+  ([angleproject][ANGLE-website]) and propose it or talk with the ANGLE team on IRC in the
+  `#ANGLEproject` channel on FreeNode.
+* Not all bugs in our [bug system][anglebug.com] are assigned, but if the one you're interested in
+  fixing is, send a note to the person it's assigned to and ask if they would like a patch.
+* Behavior changes and anything nontrivial (i.e. anything other than simple cleanups and style
+  fixes) should generally be tracked in the bug system. Please [file a bug][anglebug-new] and
+  describe what you're doing if there isn't one already.
+* If you would like bug-editing rights, simply ask a team member via email or the discussion group.
+
+[ANGLE-website]: https://groups.google.com/forum/?fromgroups#!forum/angleproject
+[anglebug.com]: http://anglebug.com
+[anglebug-new]: http://anglebug.com/new
 
 ## Get your code ready
+
 ### Code
- 1. Must conform to the [ANGLE style](CodingStandard.md) guidelines.
- 2. Must be tested. (see the 'Testing' section below)
- 3.  Should be a reasonable size to review.  Giant patches are unlikely to get reviewed quickly.
+
+1. Must conform to the [ANGLE style][ANGLE-style] guidelines.
+2. Must be tested. (see the 'Testing' section below)
+3. Should be a reasonable size to review.  Giant patches are unlikely to get reviewed quickly.
+
+[ANGLE-style]: CodingStandard.md
 
 ### Build maintenance
- 1. If you added or removed source files:
-    * You _must_ update the build files with your changes. See `src/libGLESv2.gni` and `src/compiler.gni`.
- 2. ANGLE's BUILD.gn script is used by [Chromium's gn build](https://www.chromium.org/developers/gn-build-configuration). If you change build files other than to add or remove source files be aware you could break the Chromium build. ANGLE's commit queue (CQ) will detect such breakage. Ask a project member for help with Chromium issues if you don't have a Chromium checkout.
- 3. If you modified `glslang.y` or `glslang.l`:
-    * You _must_ update the bison-generated compiler sources. Download and install the latest 64-bit Bison and flex from official [Cygwin](https://cygwin.com/install.html) on _Windows_. From the Cygwin shell run `generate_parser.sh` in `src/compiler/translator` and update your CL. Do not edit the generated files by hand.
-    * _NOTE:_ You can ignore failing chunk messages if there are no compile errors.
-    * If you modified `ExpressionParser.y` or `Tokenizer.l`, follow the same process by running `src/compiler/preprocessor/generate_parser.sh`.
+
+1. If you added or removed source files:
+   * You _must_ update the build files with your changes. See `src/libGLESv2.gni` and
+   `src/compiler.gni`.
+2. ANGLE's BUILD.gn script is used by [Chromium's gn build][gn-build-config]. If you change build
+   files other than to add or remove source files be aware you could break the Chromium build.
+   ANGLE's commit queue (CQ) will detect such breakage. Ask a project member for help with Chromium
+   issues if you don't have a Chromium checkout.
+3. Some generated code is baked into the repository. If you modify the source of these files, such
+   as the translator's `glslang.l`, or one of the internal shaders in the Vulkan backend, you will
+   need to run `scripts/run_code_generation.py` and include the autogenerated files in your change.
+   `git cl upload` should warn you if you are missing this step.
+    * Note that updating the translator's lexer and parser (using `flex` and `bison`) is only
+      supported on Linux and Windows.
+
+[gn-build-config]: https://www.chromium.org/developers/gn-build-configuration
 
 ### Testing
- * ANGLE uses trybots to test on a variety of platforms. Please run your changes against our bots and check the results before landing changes or requesting reviews.
-    * Upload your change (see [Making changes](#making-changes)).
-    * To kick of a try job, use the 'CQ Dry Run' button, or set the Commit-Queue +1 label to trigger a dry run of the CQ (will not land the change).
-    * If you are not part of the `angle-committers` group, you will need to either ask to be added or ask a member of the group to submit the tryjob for you. Add jmadill or geofflang as a reviewer for assistance.
-    * Wait for the bots to report the result on the code review page. The bot results should be visible in Gerrit as yellow (in-progress), green (passed), or red (failed). This can take up to two hours for some of the debug bots. Click on the colored rectangle to open the bot log to triage failed tests.
-    * If a failure is unexpected, or seems likely unrelated to your change, ask an ANGLE project member for advice.
-    * We do not currently have the capability to run individual bots or tests in a run.
- * Tests can also be run locally, ANGLE's main testing methods are:
-    * `angle_unittests`, `angle_end2end_tests` and `angle_white_box_tests` targets.
-    * The [Top-of-Tree WebGL Conformance tests](https://www.khronos.org/registry/webgl/sdk/tests/webgl-conformance-tests.html).
-      * If you are a Chromium developer, see [Building ANGLE for Chromium Development](BuildingAngleForChromiumDevelopment.md) for instructions on building ANGLE within Chromium.
-      * If you aren't a browser developer, you should be able to drop your compiled DLLs into a Chrome installation, in place of those distributed with Chrome, to check WebGL conformance. [Chrome Canary](https://www.google.com/chrome/browser/canary.html) is well-suited for this.
-    * If your code isn't covered by an existing test, you are *strongly encouraged* to add new test coverage. This both ensures that your code is correct and that new contributors won't break it in the future.
-    * Add new tests to `angle_end2end_tests` for OpenGL-based API tests, `angle_unittests` for cross-platform internal tests, and `angle_white_box_tests` for rendering tests which also need visibility into internal ANGLE classes.
-   * If you are submitting a performance fix, test your code with `angle_perftests` and add a new performance test if it is not covered by the existing benchmarks. For more documentation on `angle_perftests` see the [README](../src/tests/perf_tests/README.md).
-   * The [Chromium GPU FYI bot waterfall](http://build.chromium.org/p/chromium.gpu.fyi/console) provides continuous integration for ANGLE patches that have been committed.  There may be hardware configurations that are not tested by the ANGLE trybots, if you notice breakage on this waterfall after landing a patch, please notify a project member.
-   * ANGLE also includes the [drawElements Quality Program (dEQP)](dEQP.md) for additional testing. If you're working on a new feature, there may be some extensive tests for it already written.
+
+* ANGLE uses trybots to test on a variety of platforms. Please run your changes against our bots
+  and check the results before landing changes or requesting reviews.
+   * Upload your change (see [Making changes](#making-changes)).
+   * To kick off a try job, use the 'CQ Dry Run' button, or set the Commit-Queue +1 label to trigger
+     a dry run of the CQ (will not land the change).
+   * If you are not part of the `angle-committers` group, you will need to either ask to be added or
+     ask a member of the group to submit the tryjob for you. Add jmadill or geofflang as a reviewer
+     for assistance.
+   * Wait for the bots to report the result on the code review page. The bot results should be
+     visible in Gerrit as yellow (in-progress), green (passed), or red (failed). This can take up to
+     two hours for some of the debug bots. Click on the colored rectangle to open the bot log to
+     triage failed tests.
+   * If a failure is unexpected, or seems likely unrelated to your change, ask an ANGLE project
+     member for advice.
+   * We do not currently have the capability to run individual bots or tests in a run.
+* Tests can also be run locally, ANGLE's main testing methods are:
+   * `angle_unittests`, `angle_end2end_tests` and `angle_white_box_tests` targets.
+   * The [Top-of-Tree WebGL Conformance tests][WebGL-CTS].
+     * If you are a Chromium developer, see
+       [Building ANGLE for Chromium Development][build-ANGLE-for-chromium] for instructions on
+       building ANGLE within Chromium.
+     * If you aren't a browser developer, you should be able to drop your compiled DLLs into a
+       Chrome installation, in place of those distributed with Chrome, to check WebGL conformance.
+       [Chrome Canary][Chrome-Canary] is well-suited for this.
+   * If your code isn't covered by an existing test, you are *strongly encouraged* to add new test
+     coverage. This both ensures that your code is correct and that new contributors won't break it
+     in the future.
+   * Add new tests to `angle_end2end_tests` for OpenGL-based API tests, `angle_unittests` for
+     cross-platform internal tests, and `angle_white_box_tests` for rendering tests which also need
+     visibility into internal ANGLE classes.
+  * If you are submitting a performance fix, test your code with `angle_perftests` and add a new
+    performance test if it is not covered by the existing benchmarks. For more documentation on
+    `angle_perftests` see the [README][README].
+  * The [Chromium GPU FYI bot waterfall][Chromium-waterfall] provides continuous integration for
+    ANGLE patches that have been committed.  There may be hardware configurations that are not
+    tested by the ANGLE trybots, if you notice breakage on this waterfall after landing a patch,
+    please notify a project member.
+  * ANGLE also includes the [drawElements Quality Program (dEQP)](dEQP.md) for additional testing.
+    If you're working on a new feature, there may be some extensive tests for it already written.
+
+[WebGL-CTS]: https://www.khronos.org/registry/webgl/sdk/tests/webgl-conformance-tests.html
+[build-ANGLE-for-Chromium]: BuildingAngleForChromiumDevelopment.md
+[Chrome-Canary]: https://www.google.com/chrome/browser/canary.html
+[README]: ../src/tests/perf_tests/README.md
+[Chromium-waterfall]: https://ci.chromium.org/p/chromium/g/chromium.gpu.fyi/console
 
 ### Legal
- 1. You must complete the [Individual Contributor License Agreement](https://cla.developers.google.com/about/google-individual). You can do this online, and it only takes a minute. If you are contributing on behalf of a corporation, you must fill out the [Corporate Contributor License Agreement](https://cla.developers.google.com/about/google-corporate) and send it to Google as described on that page.
- 2. Once you've submitted the CLA, please email the following information (as entered on the CLA) to `shannonwoods at chromium dot org` for record keeping purposes:
-    * Full Name:
-    * Email:
-    * Company (If applicable):
- 3. If you've never submitted code before, you must add your (or your organization's) name and contact info to the [AUTHORS](../AUTHORS) file.
- 4. *NOTE TO REVIEWERS*: Follow the [External Contributor Checklist](http://www.chromium.org/developers/contributing-code/external-contributor-checklist).
+
+1. You must complete the [Individual Contributor License Agreement][Individual-CLA]. You can do this
+   online, and it only takes a minute. If you are contributing on behalf of a corporation, you must
+   fill out the [Corporate Contributor License Agreement][Corporate-CLA] and send it to Google as
+   described on that page.
+2. Once you've submitted the CLA, please email the following information (as entered on the CLA) to
+   `shannonwoods at chromium dot org` for record keeping purposes:
+   * Full Name:
+   * Email:
+   * Company (If applicable):
+3. If you've never submitted code before, you must add your (or your organization's) name and
+   contact info to the [AUTHORS](../AUTHORS) file.
+4. *NOTE TO REVIEWERS*: Follow the [External Contributor Checklist][Contributor-checklist].
+
+[Individual-CLA]: https://cla.developers.google.com/about/google-individual
+[Corporate-CLA]: https://cla.developers.google.com/about/google-corporate
+[Contributor-checklist]: http://www.chromium.org/developers/contributing-code/external-contributor-checklist
 
 ## Life of a Change List
 
 ### Getting started with Gerrit for ANGLE
-  1. Go to [https://chromium-review.googlesource.com/new-password](https://chromium-review.googlesource.com/new-password)
-  2. Log in with the email you use for your git commits.
-  3. Follow the directions on the new-password page to set up authentication with your Google account.
-  4. Make sure to set your real name.
-     * Visit [https://chromium-review.googlesource.com/#/settings](https://chromium-review.googlesource.com/#/settings) and check the "Full Name" field.
-  5. Check out the repository (see [DevSetup](DevSetup.md)).
-  6. Install the Gerrit `commit_msg` hook
-     * Gerrit requires a hook to append a change ID tag to each commit, so that it can associate your CL with a particular review, and track dependencies between commits.
-     * Download the hook from [https://chromium-review.googlesource.com/tools/hooks/commit-msg](https://chromium-review.googlesource.com/tools/hooks/commit-msg) and copy this file to `.git/hooks/commit-msg` within your local repository. On non-Windows, platforms, ensure that permissions are set to allow execution.
-     * *BE AWARE:* Some patch management tools, such as StGit, currently bypass git hooks. They should not currently be used with changes intended for review.
+
+1. Go to [https://chromium-review.googlesource.com/new-password][CR-passwd]
+2. Log in with the email you use for your git commits.
+3. Follow the directions on the new-password page to set up authentication with your Google account.
+4. Make sure to set your real name.
+   * Visit [https://chromium-review.googlesource.com/#/settings][CR-settings] and check the "Full
+     Name" field.
+5. Check out the repository (see [DevSetup](DevSetup.md)).
+6. Install the Gerrit `commit_msg` hook
+   * Gerrit requires a hook to append a change ID tag to each commit, so that it can associate your
+     CL with a particular review, and track dependencies between commits.
+   * Download the hook from
+     [https://chromium-review.googlesource.com/tools/hooks/commit-msg][commit-msg-hook] and copy
+     this file to `.git/hooks/commit-msg` within your local repository. On non-Windows, platforms,
+     ensure that permissions are set to allow execution.
+   * *BE AWARE:* Some patch management tools, such as StGit, currently bypass git hooks. They should
+     not currently be used with changes intended for review.
+
+[CR-passwd]: https://chromium-review.googlesource.com/new-password
+[CR-settings]: https://chromium-review.googlesource.com/#/settings
+[commit-msg-hook]: https://chromium-review.googlesource.com/tools/hooks/commit-msg
 
 ### Making changes
- 1. Commit your changes locally:
-    * `git add src/../FileName.cpp`
-    * `git commit`
-    * A text editor will open. Add a description at the top of the file.
-       * If your changes are associated with an issue in the issue tracker (e.g. a fix for a reported bug), please associate the CL with that issue by adding the following line to the commit message: `BUG=angleproject:<issue number>`.
-    * Save.
-    * Close the text editor.
-    * Use `git commit --amend` to update your CL with new changes.
-    * Use `git cl format` to amend the style of your CL. This saves both your time and the reviewers'!
- 2. Ensure your code is landed on top of latest changes
-    * `git pull --rebase`
-    * Resolve conflicts if necessary
- 3. Upload the change list
-    * `git cl upload`
-    * The change list and modified files will be uploaded to
-      [ANGLE Gerrit](https://chromium-review.googlesource.com/q/project:angle/angle).
-    * Follow the generated URL to the new issue.
-    * Take a moment to perform a self-review of your code. Gerrit's viewer makes it easy to see whitespace errors, erroneous tabs, and other simple style problems.
-    * [Select reviewers](#selecting-reviewers).  If you don't do this, reviewers may not realize you're requesting a review!
-    * Make changes, upload and repeat as necessary.
-    * Project members and others will review your code as described in the [CodeReviewProcess](CodeReviewProcess.md).
- 5. If your change list needs revision:
-    * If you have correctly installed the commit hook from the section above, Gerrit will be able to track your changes by Change-Id.
-    * You should need only to update your commit with `git commit --amend` and re-upload with `git cl upload`.
- 6. Landing change after it receives +2 Code Review:
-    * If you are a committer, you may submit the change yourself via the Gerrit web interface.
-    * If you are not a committer, ask your reviewer to submit the change list.
- 7. Pull and integrate reviewed CL:
-    * `git pull --rebase`
+
+1. Commit your changes locally:
+   * `git add src/../FileName.cpp`
+   * `git commit`
+   * A text editor will open. Add a description at the top of the file.
+      * If your changes are associated with an issue in the issue tracker (e.g. a fix for a reported
+        bug), please associate the CL with that issue by adding the following line to the commit
+        message: `Bug: angleproject:<issue number>`.
+   * Save.
+   * Close the text editor.
+   * Use `git commit --amend` to update your CL with new changes.
+   * Use `git cl format` to amend the style of your CL. This saves both your time and the reviewers'!
+2. Ensure your code is landed on top of latest changes
+   * `git pull --rebase`
+   * Resolve conflicts if necessary
+3. Upload the change list
+   * `git cl upload`
+   * The change list and modified files will be uploaded to [ANGLE Gerrit][ANGLE-Gerrit].
+   * Follow the generated URL to the new issue.
+   * Take a moment to perform a self-review of your code. Gerrit's viewer makes it easy to see
+     whitespace errors, erroneous tabs, and other simple style problems.
+   * [Select reviewers](#selecting-reviewers).  If you don't do this, reviewers may not realize
+     you're requesting a review!
+   * Make changes, upload and repeat as necessary.
+   * Project members and others will review your code as described in the
+     [CodeReviewProcess](CodeReviewProcess.md).
+5. If your change list needs revision:
+   * If you have correctly installed the commit hook from the section above, Gerrit will be able to
+     track your changes by Change-Id.
+   * You should need only to update your commit with `git commit --amend` and re-upload with
+     `git cl upload`.
+6. Landing change after it receives +2 Code Review:
+   * If you are a committer, you may submit the change yourself via the Gerrit web interface.
+   * If you are not a committer, ask your reviewer to submit the change list.
+7. Pull and integrate reviewed CL:
+   * `git pull --rebase`
+
+[ANGLE-Gerrit]: https://chromium-review.googlesource.com/q/project:angle/angle
 
 ### Selecting reviewers
-When your CL is ready to review, add any of the following reviewers. They will be able to route your CL to additional reviewers as neccssary and answer any questions you may have about the process. All non-trival CLs should be reviewed by two reviewers.
- * `geofflang at chromium dot org`
- * `jmadill at chromium dot org`
- * `syoussefi at chromium dot org`
- * `ynovikov at chromium dot org`
+
+When your CL is ready to review, add any of the following reviewers. They will be able to route your
+CL to additional reviewers as neccessary and answer any questions you may have about the process. All
+non-trival CLs should be reviewed by two reviewers.
+
+* `geofflang at chromium dot org`
+* `jmadill at chromium dot org`
+* `syoussefi at chromium dot org`
+* `ynovikov at chromium dot org`
 
 ### Committer status
-Similar to [Chromium's committer status](https://dev.chromium.org/getting-involved/become-a-committer), long-term contributors to the ANGLE project may request to join the `angle-committers` group.  This allows you to give `+2` on code reviews and land patches without assistance.  After about 6 months of regular contributions, you may request committer status from a core ANGLE team member via email or code review.  Chromium committers may ask at any time.
+
+Similar to [Chromium's committer status][Committer-status], long-term contributors to the ANGLE
+project may request to join the `angle-committers` group.  This allows you to give `+2` on code
+reviews and land patches without assistance.  After about 6 months of regular contributions, you may
+request committer status from a core ANGLE team member via email or code review.  Chromium
+committers may ask at any time.
 
 See also:
 
-* [ANGLE Gerrit](https://chromium-review.googlesource.com/q/project:angle/angle)
-* [Chromium Projects: Contributing Code](http://www.chromium.org/developers/contributing-code/)
-* [depot_tools tutorial](http://commondatastorage.googleapis.com/chrome-infra-docs/flat/depot_tools/docs/html/depot_tools_tutorial.html)
-* [angle_perftests README](../src/tests/perf_tests/README.md)
+* [ANGLE Gerrit][ANGLE-Gerrit]
+* [Chromium Projects: Contributing Code][Contributing-code]
+* [depot_tools tutorial][depot-tools-tutorial]
+* [angle_perftests README][Perftest-README]
+
+[Committer-status]: https://dev.chromium.org/getting-involved/become-a-committer
+[Contributing-code]: http://www.chromium.org/developers/contributing-code/
+[depot-tools-tutorial]: http://commondatastorage.googleapis.com/chrome-infra-docs/flat/depot_tools/docs/html/depot_tools_tutorial.html
+[Perftest-README]: ../src/tests/perf_tests/README.md
diff --git a/doc/DevSetup.md b/doc/DevSetup.md
index f00abc0..8866480 100644
--- a/doc/DevSetup.md
+++ b/doc/DevSetup.md
@@ -20,8 +20,6 @@
  * [Visual Studio Community 2019](https://visualstudio.microsoft.com/vs/)
  * [Windows 10 Standalone SDK version 10.0.17134 exactly](https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk).
    * Comes with additional features that aid development, such as the Debug runtime for D3D11. Required for the D3D Compiler DLL.
- * (optional) [Cygwin's Bison, flex, and patch](https://cygwin.com/setup-x86_64.exe)
-   * This is only required if you need to modify GLSL ES grammar files (`glslang.l` and `glslang.y` under `src/compiler/translator`, or `ExpressionParser.y` and `Tokenizer.l` in `src/compiler/preprocessor`).
  * (optional) See the [Chromium Windows build instructions](https://chromium.googlesource.com/chromium/src/+/master/docs/windows_build_instructions.md) for more info.
 
 On Linux:
diff --git a/scripts/code_generation_hashes/ANGLE_shader_preprocessor.json b/scripts/code_generation_hashes/ANGLE_shader_preprocessor.json
new file mode 100644
index 0000000..99a7154
--- /dev/null
+++ b/scripts/code_generation_hashes/ANGLE_shader_preprocessor.json
@@ -0,0 +1,28 @@
+{
+  "src/compiler/preprocessor/generate_parser.py":
+    "cc871de99688a35bfe32ef501f965d5a",
+  "src/compiler/preprocessor/preprocessor.l":
+    "143dec2269b9a49a9588391bb57580ec",
+  "src/compiler/preprocessor/preprocessor.y":
+    "a3a7dcbf9fd1cf1721ab635cea0189b2",
+  "src/compiler/preprocessor/preprocessor_lex_autogen.cpp":
+    "5e2dd7b0f74393db96ca6d9b0adeae0b",
+  "src/compiler/preprocessor/preprocessor_tab_autogen.cpp":
+    "1faa877557cf67e564cabc547aa3f3c0",
+  "tools/flex-bison/linux/bison.sha1":
+    "efa86001f00e7bcfdbe899dd15fc88e0",
+  "tools/flex-bison/linux/flex.sha1":
+    "3e73ddbd801cf3e8ed759c49572c8bf2",
+  "tools/flex-bison/windows/bison.exe.sha1":
+    "ad6345f2fbf1112bae67f0d54a92e574",
+  "tools/flex-bison/windows/flex.exe.sha1":
+    "45668fa0dafd4a7e68c2b0480e50e650",
+  "tools/flex-bison/windows/m4.exe.sha1":
+    "0e0332c889b12576458bc481f34d6142",
+  "tools/flex-bison/windows/msys-2.0.dll.sha1":
+    "59854139bd445e5193812e2b910dc7b5",
+  "tools/flex-bison/windows/msys-iconv-2.dll.sha1":
+    "5da154b537d340991bb4cd06eca6d523",
+  "tools/flex-bison/windows/msys-intl-8.dll.sha1":
+    "3b5cd216061b9dff4d2ae3956bc344a8"
+}
\ No newline at end of file
diff --git a/scripts/code_generation_hashes/ANGLE_shader_translator.json b/scripts/code_generation_hashes/ANGLE_shader_translator.json
new file mode 100644
index 0000000..5a768b4
--- /dev/null
+++ b/scripts/code_generation_hashes/ANGLE_shader_translator.json
@@ -0,0 +1,30 @@
+{
+  "src/compiler/translator/generate_parser.py":
+    "566178ecdfae3a29803b3687fc518ebb",
+  "src/compiler/translator/glslang.l":
+    "84952cb3af3498f56f4cf9c0435285f2",
+  "src/compiler/translator/glslang.y":
+    "e32a1376309bd63368e45a968362d375",
+  "src/compiler/translator/glslang_lex_autogen.cpp":
+    "53be7b052dea27573461ae8faf9d837c",
+  "src/compiler/translator/glslang_tab_autogen.cpp":
+    "ce4d6a80cebfee9b0c28ebfd51287fea",
+  "src/compiler/translator/glslang_tab_autogen.h":
+    "4133ae84a4c17051cf114f404fea0046",
+  "tools/flex-bison/linux/bison.sha1":
+    "efa86001f00e7bcfdbe899dd15fc88e0",
+  "tools/flex-bison/linux/flex.sha1":
+    "3e73ddbd801cf3e8ed759c49572c8bf2",
+  "tools/flex-bison/windows/bison.exe.sha1":
+    "ad6345f2fbf1112bae67f0d54a92e574",
+  "tools/flex-bison/windows/flex.exe.sha1":
+    "45668fa0dafd4a7e68c2b0480e50e650",
+  "tools/flex-bison/windows/m4.exe.sha1":
+    "0e0332c889b12576458bc481f34d6142",
+  "tools/flex-bison/windows/msys-2.0.dll.sha1":
+    "59854139bd445e5193812e2b910dc7b5",
+  "tools/flex-bison/windows/msys-iconv-2.dll.sha1":
+    "5da154b537d340991bb4cd06eca6d523",
+  "tools/flex-bison/windows/msys-intl-8.dll.sha1":
+    "3b5cd216061b9dff4d2ae3956bc344a8"
+}
\ No newline at end of file
diff --git a/scripts/run_code_generation.py b/scripts/run_code_generation.py
index 545b296..b912bd7 100755
--- a/scripts/run_code_generation.py
+++ b/scripts/run_code_generation.py
@@ -73,6 +73,10 @@
         'src/libANGLE/renderer/gen_angle_format_table.py',
     'ANGLE load functions table':
         'src/libANGLE/renderer/gen_load_functions_table.py',
+    'ANGLE shader preprocessor':
+        'src/compiler/preprocessor/generate_parser.py',
+    'ANGLE shader translator':
+        'src/compiler/translator/generate_parser.py',
     'D3D11 blit shader selection':
         'src/libANGLE/renderer/d3d/d3d11/gen_blit11helper.py',
     'D3D11 format':
diff --git a/src/compiler.gni b/src/compiler.gni
index ed31ecb..25d575e 100644
--- a/src/compiler.gni
+++ b/src/compiler.gni
@@ -108,9 +108,9 @@
   "src/compiler/translator/VariablePacker.h",
   "src/compiler/translator/blocklayout.cpp",
   "src/compiler/translator/glslang.h",
-  "src/compiler/translator/glslang_lex.cpp",
-  "src/compiler/translator/glslang_tab.cpp",
-  "src/compiler/translator/glslang_tab.h",
+  "src/compiler/translator/glslang_lex_autogen.cpp",
+  "src/compiler/translator/glslang_tab_autogen.cpp",
+  "src/compiler/translator/glslang_tab_autogen.h",
   "src/compiler/translator/length_limits.h",
   "src/compiler/translator/util.cpp",
   "src/compiler/translator/util.h",
@@ -325,7 +325,6 @@
   "src/compiler/preprocessor/DirectiveHandlerBase.h",
   "src/compiler/preprocessor/DirectiveParser.cpp",
   "src/compiler/preprocessor/DirectiveParser.h",
-  "src/compiler/preprocessor/ExpressionParser.cpp",
   "src/compiler/preprocessor/ExpressionParser.h",
   "src/compiler/preprocessor/Input.cpp",
   "src/compiler/preprocessor/Input.h",
@@ -335,12 +334,13 @@
   "src/compiler/preprocessor/Macro.h",
   "src/compiler/preprocessor/MacroExpander.cpp",
   "src/compiler/preprocessor/MacroExpander.h",
+  "src/compiler/preprocessor/preprocessor_lex_autogen.cpp",
+  "src/compiler/preprocessor/preprocessor_tab_autogen.cpp",
   "src/compiler/preprocessor/Preprocessor.cpp",
   "src/compiler/preprocessor/Preprocessor.h",
   "src/compiler/preprocessor/SourceLocation.h",
   "src/compiler/preprocessor/Token.cpp",
   "src/compiler/preprocessor/Token.h",
-  "src/compiler/preprocessor/Tokenizer.cpp",
   "src/compiler/preprocessor/Tokenizer.h",
   "src/compiler/preprocessor/numeric_lex.h",
 ]
diff --git a/src/compiler/generate_parser_tools.py b/src/compiler/generate_parser_tools.py
new file mode 100644
index 0000000..38ede1c
--- /dev/null
+++ b/src/compiler/generate_parser_tools.py
@@ -0,0 +1,153 @@
+#!/usr/bin/python
+# Copyright 2019 The ANGLE Project Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+#
+# generate_parser_tools.py:
+#   Common functionality to call flex and bison to generate lexer and parser of
+#   the translator and preprocessor.
+
+import os
+import platform
+import subprocess
+import sys
+
+is_linux = platform.system() == 'Linux'
+is_windows = platform.system() == 'Windows'
+
+
+def get_tool_path_platform(tool_name, platform):
+    exe_path = os.path.join(sys.path[0], '..', '..', '..', 'tools', 'flex-bison', platform)
+
+    return os.path.join(exe_path, tool_name)
+
+
+def get_tool_path(tool_name):
+    if is_linux:
+        platform = 'linux'
+        ext = ''
+    else:
+        assert (is_windows)
+        platform = 'windows'
+        ext = '.exe'
+
+    return get_tool_path_platform(tool_name + ext, platform)
+
+
+def get_tool_file_sha1s():
+    files = [
+        get_tool_path_platform('flex', 'linux'),
+        get_tool_path_platform('bison', 'linux'),
+        get_tool_path_platform('flex.exe', 'windows'),
+        get_tool_path_platform('bison.exe', 'windows'),
+        get_tool_path_platform('m4.exe', 'windows')
+    ]
+
+    files += [
+        get_tool_path_platform(dll, 'windows')
+        for dll in ['msys-2.0.dll', 'msys-iconv-2.dll', 'msys-intl-8.dll']
+    ]
+
+    return [f + '.sha1' for f in files]
+
+
+def run_flex(basename):
+    flex = get_tool_path('flex')
+    input_file = basename + '.l'
+    output_source = basename + '_lex_autogen.cpp'
+
+    flex_args = [flex, '--noline', '--nounistd', '--outfile=' + output_source, input_file]
+
+    flex_env = os.environ.copy()
+    if is_windows:
+        flex_env['M4'] = get_tool_path_platform('m4.exe', 'windows')
+
+    process = subprocess.Popen(flex_args, env=flex_env, cwd=sys.path[0])
+    process.communicate()
+    if process.returncode != 0:
+        return process.returncode
+
+    # Patch flex output for 64-bit.  The patch is simple enough that we could do a string
+    # replacement.  More importantly, the location of the line of code that needs to be substituted
+    # can vary based on flex version, and the string substitution will find the correct place
+    # automatically.
+
+    patch_in = """
+		YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
+			yyg->yy_n_chars, num_to_read );"""
+    patch_out = """
+		yy_size_t ret = 0;
+		YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
+			ret, num_to_read );
+		yyg->yy_n_chars = static_cast<int>(ret);"""
+
+    with open(output_source, 'r') as flex_output:
+        output = flex_output.read()
+
+        # If flex's output changes such that this line no longer exists, the patch needs to be
+        # updated, or possibly removed.
+        assert (output.find(patch_in) != -1)
+
+        patched = output.replace(patch_in, patch_out)
+
+    with open(output_source, 'w') as flex_output_patched:
+        flex_output_patched.write(patched)
+
+    return 0
+
+
+def run_bison(basename, generate_header):
+    bison = get_tool_path('bison')
+    input_file = basename + '.y'
+    output_header = basename + '_tab_autogen.h'
+    output_source = basename + '_tab_autogen.cpp'
+
+    bison_args = [bison, '--no-lines', '--skeleton=yacc.c']
+    if generate_header:
+        bison_args += ['--defines=' + output_header]
+    bison_args += ['--output=' + output_source, input_file]
+
+    bison_env = os.environ.copy()
+    bison_env['BISON_PKGDATADIR'] = get_tool_path_platform('', 'third_party')
+    if is_windows:
+        bison_env['M4'] = get_tool_path_platform('m4.exe', 'windows')
+
+    process = subprocess.Popen(bison_args, env=bison_env, cwd=sys.path[0])
+    process.communicate()
+    return process.returncode
+
+
+def get_input_files(basename):
+    files = [basename + '.l', basename + '.y']
+    return [os.path.join(sys.path[0], f) for f in files]
+
+
+def get_output_files(basename, generate_header):
+    optional_header = [basename + '_tab_autogen.h'] if generate_header else []
+    files = [basename + '_lex_autogen.cpp', basename + '_tab_autogen.cpp'] + optional_header
+    return [os.path.join(sys.path[0], f) for f in files]
+
+
+def generate_parser(basename, generate_header):
+    # Handle inputs/outputs for run_code_generation.py's auto_script
+    if len(sys.argv) > 1:
+        if sys.argv[1] == 'inputs':
+            inputs = get_tool_file_sha1s()
+            inputs += get_input_files(basename)
+            print(','.join(inputs))
+        if sys.argv[1] == 'outputs':
+            print(','.join(get_output_files(basename, generate_header)))
+        return 0
+
+    # Call flex and bison to generate the lexer and parser.
+    flex_result = run_flex(basename)
+    if flex_result != 0:
+        print 'Failed to run flex. Error ' + str(flex_result)
+        return 1
+
+    bison_result = run_bison(basename, generate_header)
+    if bison_result != 0:
+        print 'Failed to run bison. Error ' + str(bison_result)
+        return 2
+
+    return 0
diff --git a/src/compiler/preprocessor/64bit-tokenizer-safety.patch b/src/compiler/preprocessor/64bit-tokenizer-safety.patch
deleted file mode 100644
index 0c3b936..0000000
--- a/src/compiler/preprocessor/64bit-tokenizer-safety.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-diff --git a/src/compiler/preprocessor/Tokenizer.cpp b/src/compiler/preprocessor/Tokenizer.cpp
-index 0d7ad58..5ef0e5e 100644
---- a/src/compiler/preprocessor/Tokenizer.cpp
-+++ b/src/compiler/preprocessor/Tokenizer.cpp
-@@ -1746,8 +1746,10 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
- 			num_to_read = YY_READ_BUF_SIZE;
- 
- 		/* Read in more data. */
-+		yy_size_t ret = 0;
- 		YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
--			yyg->yy_n_chars, num_to_read );
-+			ret, num_to_read );
-+		yyg->yy_n_chars = static_cast<int>(ret);
- 
- 		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
- 		}
diff --git a/src/compiler/preprocessor/ExpressionParser.cpp b/src/compiler/preprocessor/ExpressionParser.cpp
deleted file mode 100644
index 1b71ef7..0000000
--- a/src/compiler/preprocessor/ExpressionParser.cpp
+++ /dev/null
@@ -1,1909 +0,0 @@
-/* A Bison parser, made by GNU Bison 3.0.4.  */
-
-/* Bison implementation for Yacc-like parsers in C
-
-   Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
-
-   This program is free software: you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation, either version 3 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
-
-/* As a special exception, you may create a larger work that contains
-   part or all of the Bison parser skeleton and distribute that work
-   under terms of your choice, so long as that work isn't itself a
-   parser generator using the skeleton or a modified version thereof
-   as a parser skeleton.  Alternatively, if you modify or redistribute
-   the parser skeleton itself, you may (at your option) remove this
-   special exception, which will cause the skeleton and the resulting
-   Bison output files to be licensed under the GNU General Public
-   License without this special exception.
-
-   This special exception was added by the Free Software Foundation in
-   version 2.2 of Bison.  */
-
-/* C LALR(1) parser skeleton written by Richard Stallman, by
-   simplifying the original so-called "semantic" parser.  */
-
-/* All symbols defined below should begin with yy or YY, to avoid
-   infringing on user name space.  This should be done even for local
-   variables, as they might otherwise be expanded by user macros.
-   There are some unavoidable exceptions within include files to
-   define necessary library symbols; they are noted "INFRINGES ON
-   USER NAME SPACE" below.  */
-
-/* Identify Bison output.  */
-#define YYBISON 1
-
-/* Bison version.  */
-#define YYBISON_VERSION "3.0.4"
-
-/* Skeleton name.  */
-#define YYSKELETON_NAME "yacc.c"
-
-/* Pure parsers.  */
-#define YYPURE 1
-
-/* Push parsers.  */
-#define YYPUSH 0
-
-/* Pull parsers.  */
-#define YYPULL 1
-
-/* Substitute the variable and function names.  */
-#define yyparse ppparse
-#define yylex pplex
-#define yyerror pperror
-#define yydebug ppdebug
-#define yynerrs ppnerrs
-
-/* Copy the first part of user declarations.  */
-
-//
-// Copyright 2012 The ANGLE Project Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-
-// This file is auto-generated by generate_parser.sh. DO NOT EDIT!
-
-#if defined(__GNUC__)
-// Triggered by the auto-generated pplval variable.
-#    if !defined(__clang__) && ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7))
-#        pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
-#    else
-#        pragma GCC diagnostic ignored "-Wuninitialized"
-#    endif
-#elif defined(_MSC_VER)
-#    pragma warning(disable : 4065 4244 4701 4702)
-#endif
-#if defined(__clang__)
-#    pragma clang diagnostic ignored "-Wunreachable-code"
-#endif
-
-#include "ExpressionParser.h"
-
-#if defined(_MSC_VER)
-#    include <malloc.h>
-#else
-#    include <stdlib.h>
-#endif
-
-#include <stdint.h>
-#include <cassert>
-#include <sstream>
-
-#include "DiagnosticsBase.h"
-#include "Lexer.h"
-#include "Token.h"
-#include "common/mathutil.h"
-
-typedef int32_t YYSTYPE;
-typedef uint32_t UNSIGNED_TYPE;
-
-#define YYENABLE_NLS 0
-#define YYLTYPE_IS_TRIVIAL 1
-#define YYSTYPE_IS_TRIVIAL 1
-#define YYSTYPE_IS_DECLARED 1
-
-namespace
-{
-struct Context
-{
-    angle::pp::Diagnostics *diagnostics;
-    angle::pp::Lexer *lexer;
-    angle::pp::Token *token;
-    int *result;
-    bool parsePresetToken;
-
-    angle::pp::ExpressionParser::ErrorSettings errorSettings;
-    bool *valid;
-
-    void startIgnoreErrors() { ++ignoreErrors; }
-    void endIgnoreErrors() { --ignoreErrors; }
-
-    bool isIgnoringErrors() { return ignoreErrors > 0; }
-
-    int ignoreErrors;
-};
-}  // namespace
-
-static int yylex(YYSTYPE *lvalp, Context *context);
-static void yyerror(Context *context, const char *reason);
-
-#ifndef YY_NULLPTR
-#    if defined __cplusplus && 201103L <= __cplusplus
-#        define YY_NULLPTR nullptr
-#    else
-#        define YY_NULLPTR 0
-#    endif
-#endif
-
-/* Enabling verbose error messages.  */
-#ifdef YYERROR_VERBOSE
-#    undef YYERROR_VERBOSE
-#    define YYERROR_VERBOSE 1
-#else
-#    define YYERROR_VERBOSE 0
-#endif
-
-/* Debug traces.  */
-#ifndef YYDEBUG
-#    define YYDEBUG 0
-#endif
-#if YYDEBUG
-extern int ppdebug;
-#endif
-
-/* Token type.  */
-#ifndef YYTOKENTYPE
-#    define YYTOKENTYPE
-enum yytokentype
-{
-    TOK_CONST_INT  = 258,
-    TOK_IDENTIFIER = 259,
-    TOK_OP_OR      = 260,
-    TOK_OP_AND     = 261,
-    TOK_OP_EQ      = 262,
-    TOK_OP_NE      = 263,
-    TOK_OP_LE      = 264,
-    TOK_OP_GE      = 265,
-    TOK_OP_LEFT    = 266,
-    TOK_OP_RIGHT   = 267,
-    TOK_UNARY      = 268
-};
-#endif
-
-/* Value type.  */
-#if !defined YYSTYPE && !defined YYSTYPE_IS_DECLARED
-typedef int YYSTYPE;
-#    define YYSTYPE_IS_TRIVIAL 1
-#    define YYSTYPE_IS_DECLARED 1
-#endif
-
-int ppparse(Context *context);
-
-/* Copy the second part of user declarations.  */
-
-#ifdef short
-#    undef short
-#endif
-
-#ifdef YYTYPE_UINT8
-typedef YYTYPE_UINT8 yytype_uint8;
-#else
-typedef unsigned char yytype_uint8;
-#endif
-
-#ifdef YYTYPE_INT8
-typedef YYTYPE_INT8 yytype_int8;
-#else
-typedef signed char yytype_int8;
-#endif
-
-#ifdef YYTYPE_UINT16
-typedef YYTYPE_UINT16 yytype_uint16;
-#else
-typedef unsigned short int yytype_uint16;
-#endif
-
-#ifdef YYTYPE_INT16
-typedef YYTYPE_INT16 yytype_int16;
-#else
-typedef short int yytype_int16;
-#endif
-
-#ifndef YYSIZE_T
-#    ifdef __SIZE_TYPE__
-#        define YYSIZE_T __SIZE_TYPE__
-#    elif defined size_t
-#        define YYSIZE_T size_t
-#    elif !defined YYSIZE_T
-#        include <stddef.h> /* INFRINGES ON USER NAME SPACE */
-#        define YYSIZE_T size_t
-#    else
-#        define YYSIZE_T unsigned int
-#    endif
-#endif
-
-#define YYSIZE_MAXIMUM ((YYSIZE_T)-1)
-
-#ifndef YY_
-#    if defined YYENABLE_NLS && YYENABLE_NLS
-#        if ENABLE_NLS
-#            include <libintl.h> /* INFRINGES ON USER NAME SPACE */
-#            define YY_(Msgid) dgettext("bison-runtime", Msgid)
-#        endif
-#    endif
-#    ifndef YY_
-#        define YY_(Msgid) Msgid
-#    endif
-#endif
-
-#ifndef YY_ATTRIBUTE
-#    if (defined __GNUC__ && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) || \
-        defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
-#        define YY_ATTRIBUTE(Spec) __attribute__(Spec)
-#    else
-#        define YY_ATTRIBUTE(Spec) /* empty */
-#    endif
-#endif
-
-#ifndef YY_ATTRIBUTE_PURE
-#    define YY_ATTRIBUTE_PURE YY_ATTRIBUTE((__pure__))
-#endif
-
-#ifndef YY_ATTRIBUTE_UNUSED
-#    define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE((__unused__))
-#endif
-
-#if !defined _Noreturn && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
-#    if defined _MSC_VER && 1200 <= _MSC_VER
-#        define _Noreturn __declspec(noreturn)
-#    else
-#        define _Noreturn YY_ATTRIBUTE((__noreturn__))
-#    endif
-#endif
-
-/* Suppress unused-variable warnings by "using" E.  */
-#if !defined lint || defined __GNUC__
-#    define YYUSE(E) ((void)(E))
-#else
-#    define YYUSE(E) /* empty */
-#endif
-
-#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
-/* Suppress an incorrect diagnostic about yylval being uninitialized.  */
-#    define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN                                              \
-        _Pragma("GCC diagnostic push") _Pragma("GCC diagnostic ignored \"-Wuninitialized\"") \
-            _Pragma("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
-#    define YY_IGNORE_MAYBE_UNINITIALIZED_END _Pragma("GCC diagnostic pop")
-#else
-#    define YY_INITIAL_VALUE(Value) Value
-#endif
-#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
-#    define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
-#    define YY_IGNORE_MAYBE_UNINITIALIZED_END
-#endif
-#ifndef YY_INITIAL_VALUE
-#    define YY_INITIAL_VALUE(Value) /* Nothing. */
-#endif
-
-#if !defined yyoverflow || YYERROR_VERBOSE
-
-/* The parser invokes alloca or malloc; define the necessary symbols.  */
-
-#    ifdef YYSTACK_USE_ALLOCA
-#        if YYSTACK_USE_ALLOCA
-#            ifdef __GNUC__
-#                define YYSTACK_ALLOC __builtin_alloca
-#            elif defined __BUILTIN_VA_ARG_INCR
-#                include <alloca.h> /* INFRINGES ON USER NAME SPACE */
-#            elif defined _AIX
-#                define YYSTACK_ALLOC __alloca
-#            elif defined _MSC_VER
-#                include <malloc.h> /* INFRINGES ON USER NAME SPACE */
-#                define alloca _alloca
-#            else
-#                define YYSTACK_ALLOC alloca
-#                if !defined _ALLOCA_H && !defined EXIT_SUCCESS
-#                    include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
-/* Use EXIT_SUCCESS as a witness for stdlib.h.  */
-#                    ifndef EXIT_SUCCESS
-#                        define EXIT_SUCCESS 0
-#                    endif
-#                endif
-#            endif
-#        endif
-#    endif
-
-#    ifdef YYSTACK_ALLOC
-/* Pacify GCC's 'empty if-body' warning.  */
-#        define YYSTACK_FREE(Ptr) \
-            do                    \
-            { /* empty */         \
-                ;                 \
-            } while (0)
-#        ifndef YYSTACK_ALLOC_MAXIMUM
-/* The OS might guarantee only one guard page at the bottom of the stack,
-   and a page size can be as small as 4096 bytes.  So we cannot safely
-   invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
-   to allow for a few compiler-allocated temporary stack slots.  */
-#            define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
-#        endif
-#    else
-#        define YYSTACK_ALLOC YYMALLOC
-#        define YYSTACK_FREE YYFREE
-#        ifndef YYSTACK_ALLOC_MAXIMUM
-#            define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
-#        endif
-#        if (defined __cplusplus && !defined EXIT_SUCCESS && \
-             !((defined YYMALLOC || defined malloc) && (defined YYFREE || defined free)))
-#            include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
-#            ifndef EXIT_SUCCESS
-#                define EXIT_SUCCESS 0
-#            endif
-#        endif
-#        ifndef YYMALLOC
-#            define YYMALLOC malloc
-#            if !defined malloc && !defined EXIT_SUCCESS
-void *malloc(YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
-#            endif
-#        endif
-#        ifndef YYFREE
-#            define YYFREE free
-#            if !defined free && !defined EXIT_SUCCESS
-void free(void *);      /* INFRINGES ON USER NAME SPACE */
-#            endif
-#        endif
-#    endif
-#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
-
-#if (!defined yyoverflow && \
-     (!defined __cplusplus || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
-
-/* A type that is properly aligned for any stack member.  */
-union yyalloc
-{
-    yytype_int16 yyss_alloc;
-    YYSTYPE yyvs_alloc;
-};
-
-/* The size of the maximum gap between one aligned stack and the next.  */
-#    define YYSTACK_GAP_MAXIMUM (sizeof(union yyalloc) - 1)
-
-/* The size of an array large to enough to hold all stacks, each with
-   N elements.  */
-#    define YYSTACK_BYTES(N) ((N) * (sizeof(yytype_int16) + sizeof(YYSTYPE)) + YYSTACK_GAP_MAXIMUM)
-
-#    define YYCOPY_NEEDED 1
-
-/* Relocate STACK from its old location to the new one.  The
-   local variables YYSIZE and YYSTACKSIZE give the old and new number of
-   elements in the stack, and YYPTR gives the new location of the
-   stack.  Advance YYPTR to a properly aligned location for the next
-   stack.  */
-#    define YYSTACK_RELOCATE(Stack_alloc, Stack)                             \
-        do                                                                   \
-        {                                                                    \
-            YYSIZE_T yynewbytes;                                             \
-            YYCOPY(&yyptr->Stack_alloc, Stack, yysize);                      \
-            Stack      = &yyptr->Stack_alloc;                                \
-            yynewbytes = yystacksize * sizeof(*Stack) + YYSTACK_GAP_MAXIMUM; \
-            yyptr += yynewbytes / sizeof(*yyptr);                            \
-        } while (0)
-
-#endif
-
-#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
-/* Copy COUNT objects from SRC to DST.  The source and destination do
-   not overlap.  */
-#    ifndef YYCOPY
-#        if defined __GNUC__ && 1 < __GNUC__
-#            define YYCOPY(Dst, Src, Count) __builtin_memcpy(Dst, Src, (Count) * sizeof(*(Src)))
-#        else
-#            define YYCOPY(Dst, Src, Count)             \
-                do                                      \
-                {                                       \
-                    YYSIZE_T yyi;                       \
-                    for (yyi = 0; yyi < (Count); yyi++) \
-                        (Dst)[yyi] = (Src)[yyi];        \
-                } while (0)
-#        endif
-#    endif
-#endif /* !YYCOPY_NEEDED */
-
-/* YYFINAL -- State number of the termination state.  */
-#define YYFINAL 15
-/* YYLAST -- Last index in YYTABLE.  */
-#define YYLAST 176
-
-/* YYNTOKENS -- Number of terminals.  */
-#define YYNTOKENS 28
-/* YYNNTS -- Number of nonterminals.  */
-#define YYNNTS 5
-/* YYNRULES -- Number of rules.  */
-#define YYNRULES 29
-/* YYNSTATES -- Number of states.  */
-#define YYNSTATES 55
-
-/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
-   by yylex, with out-of-bounds checking.  */
-#define YYUNDEFTOK 2
-#define YYMAXUTOK 268
-
-#define YYTRANSLATE(YYX) ((unsigned int)(YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
-
-/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
-   as returned by yylex, without out-of-bounds checking.  */
-static const yytype_uint8 yytranslate[] = {
-    0, 2, 2, 2, 2, 2, 2,  2, 2,  2, 2,  2, 2, 2,  2,  2,  2,  2, 2,  2,  2,  2,  2,  2,  2,  2, 2,
-    2, 2, 2, 2, 2, 2, 24, 2, 2,  2, 22, 9, 2, 26, 27, 20, 18, 2, 19, 2,  21, 2,  2,  2,  2,  2, 2,
-    2, 2, 2, 2, 2, 2, 12, 2, 13, 2, 2,  2, 2, 2,  2,  2,  2,  2, 2,  2,  2,  2,  2,  2,  2,  2, 2,
-    2, 2, 2, 2, 2, 2, 2,  2, 2,  2, 2,  2, 2, 8,  2,  2,  2,  2, 2,  2,  2,  2,  2,  2,  2,  2, 2,
-    2, 2, 2, 2, 2, 2, 2,  2, 2,  2, 2,  2, 2, 2,  2,  2,  7,  2, 25, 2,  2,  2,  2,  2,  2,  2, 2,
-    2, 2, 2, 2, 2, 2, 2,  2, 2,  2, 2,  2, 2, 2,  2,  2,  2,  2, 2,  2,  2,  2,  2,  2,  2,  2, 2,
-    2, 2, 2, 2, 2, 2, 2,  2, 2,  2, 2,  2, 2, 2,  2,  2,  2,  2, 2,  2,  2,  2,  2,  2,  2,  2, 2,
-    2, 2, 2, 2, 2, 2, 2,  2, 2,  2, 2,  2, 2, 2,  2,  2,  2,  2, 2,  2,  2,  2,  2,  2,  2,  2, 2,
-    2, 2, 2, 2, 2, 2, 2,  2, 2,  2, 2,  2, 2, 2,  2,  2,  2,  2, 2,  2,  2,  2,  2,  2,  2,  2, 2,
-    2, 2, 2, 2, 2, 2, 2,  2, 2,  2, 2,  2, 2, 1,  2,  3,  4,  5, 6,  10, 11, 14, 15, 16, 17, 23};
-
-#if YYDEBUG
-/* YYRLINE[YYN] -- Source line where rule number YYN was defined.  */
-static const yytype_uint16 yyrline[] = {0,   111, 111, 118, 119, 130, 130, 151, 151, 172,
-                                        175, 178, 181, 184, 187, 190, 193, 196, 199, 224,
-                                        246, 249, 252, 278, 305, 308, 311, 314, 326, 329};
-#endif
-
-#if YYDEBUG || YYERROR_VERBOSE || 0
-/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
-   First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
-static const char *const yytname[] = {
-    "$end",       "error",       "$undefined",   "TOK_CONST_INT", "TOK_IDENTIFIER",
-    "TOK_OP_OR",  "TOK_OP_AND",  "'|'",          "'^'",           "'&'",
-    "TOK_OP_EQ",  "TOK_OP_NE",   "'<'",          "'>'",           "TOK_OP_LE",
-    "TOK_OP_GE",  "TOK_OP_LEFT", "TOK_OP_RIGHT", "'+'",           "'-'",
-    "'*'",        "'/'",         "'%'",          "TOK_UNARY",     "'!'",
-    "'~'",        "'('",         "')'",          "$accept",       "input",
-    "expression", "$@1",         "$@2",          YY_NULLPTR};
-#endif
-
-#ifdef YYPRINT
-/* YYTOKNUM[NUM] -- (External) token number corresponding to the
-   (internal) symbol number NUM (which must be that of a token).  */
-static const yytype_uint16 yytoknum[] = {0,   256, 257, 258, 259, 260, 261, 124, 94, 38,
-                                         262, 263, 60,  62,  264, 265, 266, 267, 43, 45,
-                                         42,  47,  37,  268, 33,  126, 40,  41};
-#endif
-
-#define YYPACT_NINF -12
-
-#define yypact_value_is_default(Yystate) (!!((Yystate) == (-12)))
-
-#define YYTABLE_NINF -1
-
-#define yytable_value_is_error(Yytable_value) 0
-
-/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
-   STATE-NUM.  */
-static const yytype_int16 yypact[] = {
-    31,  -12, -12, 31,  31,  31,  31,  31,  51,  76,  -12, -12, -12, -12, 53,  -12, -12, -12, 31,
-    31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  31,  -12, 31,  31,  124,
-    138, 26,  149, 149, -11, -11, -11, -11, 154, 154, -8,  -8,  -12, -12, -12, 93,  109};
-
-/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
-   Performed when YYTABLE does not specify something else to do.  Zero
-   means the default is an error.  */
-static const yytype_uint8 yydefact[] = {0,  3,  4,  0,  0,  0,  0,  0,  0,  2,  28, 27, 25, 26,
-                                        0,  1,  5,  7,  0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
-                                        0,  0,  0,  0,  0,  0,  29, 0,  0,  9,  10, 11, 13, 12,
-                                        17, 16, 15, 14, 19, 18, 21, 20, 24, 23, 22, 6,  8};
-
-/* YYPGOTO[NTERM-NUM].  */
-static const yytype_int8 yypgoto[] = {-12, -12, -3, -12, -12};
-
-/* YYDEFGOTO[NTERM-NUM].  */
-static const yytype_int8 yydefgoto[] = {-1, 8, 9, 35, 36};
-
-/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM.  If
-   positive, shift that token.  If negative, reduce the rule whose
-   number is the opposite.  If YYTABLE_NINF, syntax error.  */
-static const yytype_uint8 yytable[] = {
-    10, 11, 12, 13, 14, 27, 28, 29, 30, 31, 32, 33, 31, 32, 33, 37, 38, 39, 40, 41, 42, 43, 44,
-    45, 46, 47, 48, 49, 50, 51, 52, 0,  53, 54, 1,  2,  21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
-    31, 32, 33, 3,  4,  15, 0,  0,  0,  5,  6,  7,  16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
-    27, 28, 29, 30, 31, 32, 33, 0,  0,  0,  0,  34, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
-    27, 28, 29, 30, 31, 32, 33, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
-    33, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 19, 20, 21, 22, 23, 24,
-    25, 26, 27, 28, 29, 30, 31, 32, 33, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
-    23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 29, 30, 31, 32, 33};
-
-static const yytype_int8 yycheck[] = {
-    3,  4,  5,  6,  7,  16, 17, 18, 19, 20, 21, 22, 20, 21, 22, 18, 19, 20, 21, 22, 23, 24, 25,
-    26, 27, 28, 29, 30, 31, 32, 33, -1, 35, 36, 3,  4,  10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
-    20, 21, 22, 18, 19, 0,  -1, -1, -1, 24, 25, 26, 5,  6,  7,  8,  9,  10, 11, 12, 13, 14, 15,
-    16, 17, 18, 19, 20, 21, 22, -1, -1, -1, -1, 27, 5,  6,  7,  8,  9,  10, 11, 12, 13, 14, 15,
-    16, 17, 18, 19, 20, 21, 22, 6,  7,  8,  9,  10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
-    22, 7,  8,  9,  10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 8,  9,  10, 11, 12, 13,
-    14, 15, 16, 17, 18, 19, 20, 21, 22, 9,  10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
-    12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 18, 19, 20, 21, 22};
-
-/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
-   symbol of state STATE-NUM.  */
-static const yytype_uint8 yystos[] = {0,  3,  4,  18, 19, 24, 25, 26, 29, 30, 30, 30, 30, 30,
-                                      30, 0,  5,  6,  7,  8,  9,  10, 11, 12, 13, 14, 15, 16,
-                                      17, 18, 19, 20, 21, 22, 27, 31, 32, 30, 30, 30, 30, 30,
-                                      30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30};
-
-/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
-static const yytype_uint8 yyr1[] = {0,  28, 29, 30, 30, 31, 30, 32, 30, 30, 30, 30, 30, 30, 30,
-                                    30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30};
-
-/* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN.  */
-static const yytype_uint8 yyr2[] = {0, 2, 1, 1, 1, 0, 4, 0, 4, 3, 3, 3, 3, 3, 3,
-                                    3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 2, 2, 2, 3};
-
-#define yyerrok (yyerrstatus = 0)
-#define yyclearin (yychar = YYEMPTY)
-#define YYEMPTY (-2)
-#define YYEOF 0
-
-#define YYACCEPT goto yyacceptlab
-#define YYABORT goto yyabortlab
-#define YYERROR goto yyerrorlab
-
-#define YYRECOVERING() (!!yyerrstatus)
-
-#define YYBACKUP(Token, Value)                                     \
-    do                                                             \
-        if (yychar == YYEMPTY)                                     \
-        {                                                          \
-            yychar = (Token);                                      \
-            yylval = (Value);                                      \
-            YYPOPSTACK(yylen);                                     \
-            yystate = *yyssp;                                      \
-            goto yybackup;                                         \
-        }                                                          \
-        else                                                       \
-        {                                                          \
-            yyerror(context, YY_("syntax error: cannot back up")); \
-            YYERROR;                                               \
-        }                                                          \
-    while (0)
-
-/* Error token number */
-#define YYTERROR 1
-#define YYERRCODE 256
-
-/* Enable debugging if requested.  */
-#if YYDEBUG
-
-#    ifndef YYFPRINTF
-#        include <stdio.h> /* INFRINGES ON USER NAME SPACE */
-#        define YYFPRINTF fprintf
-#    endif
-
-#    define YYDPRINTF(Args)     \
-        do                      \
-        {                       \
-            if (yydebug)        \
-                YYFPRINTF Args; \
-        } while (0)
-
-/* This macro is provided for backward compatibility. */
-#    ifndef YY_LOCATION_PRINT
-#        define YY_LOCATION_PRINT(File, Loc) ((void)0)
-#    endif
-
-#    define YY_SYMBOL_PRINT(Title, Type, Value, Location)      \
-        do                                                     \
-        {                                                      \
-            if (yydebug)                                       \
-            {                                                  \
-                YYFPRINTF(stderr, "%s ", Title);               \
-                yy_symbol_print(stderr, Type, Value, context); \
-                YYFPRINTF(stderr, "\n");                       \
-            }                                                  \
-        } while (0)
-
-/*----------------------------------------.
-| Print this symbol's value on YYOUTPUT.  |
-`----------------------------------------*/
-
-static void yy_symbol_value_print(FILE *yyoutput,
-                                  int yytype,
-                                  YYSTYPE const *const yyvaluep,
-                                  Context *context)
-{
-    FILE *yyo = yyoutput;
-    YYUSE(yyo);
-    YYUSE(context);
-    if (!yyvaluep)
-        return;
-#    ifdef YYPRINT
-    if (yytype < YYNTOKENS)
-        YYPRINT(yyoutput, yytoknum[yytype], *yyvaluep);
-#    endif
-    YYUSE(yytype);
-}
-
-/*--------------------------------.
-| Print this symbol on YYOUTPUT.  |
-`--------------------------------*/
-
-static void yy_symbol_print(FILE *yyoutput,
-                            int yytype,
-                            YYSTYPE const *const yyvaluep,
-                            Context *context)
-{
-    YYFPRINTF(yyoutput, "%s %s (", yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
-
-    yy_symbol_value_print(yyoutput, yytype, yyvaluep, context);
-    YYFPRINTF(yyoutput, ")");
-}
-
-/*------------------------------------------------------------------.
-| yy_stack_print -- Print the state stack from its BOTTOM up to its |
-| TOP (included).                                                   |
-`------------------------------------------------------------------*/
-
-static void yy_stack_print(yytype_int16 *yybottom, yytype_int16 *yytop)
-{
-    YYFPRINTF(stderr, "Stack now");
-    for (; yybottom <= yytop; yybottom++)
-    {
-        int yybot = *yybottom;
-        YYFPRINTF(stderr, " %d", yybot);
-    }
-    YYFPRINTF(stderr, "\n");
-}
-
-#    define YY_STACK_PRINT(Bottom, Top)          \
-        do                                       \
-        {                                        \
-            if (yydebug)                         \
-                yy_stack_print((Bottom), (Top)); \
-        } while (0)
-
-/*------------------------------------------------.
-| Report that the YYRULE is going to be reduced.  |
-`------------------------------------------------*/
-
-static void yy_reduce_print(yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule, Context *context)
-{
-    unsigned long int yylno = yyrline[yyrule];
-    int yynrhs              = yyr2[yyrule];
-    int yyi;
-    YYFPRINTF(stderr, "Reducing stack by rule %d (line %lu):\n", yyrule - 1, yylno);
-    /* The symbols being reduced.  */
-    for (yyi = 0; yyi < yynrhs; yyi++)
-    {
-        YYFPRINTF(stderr, "   $%d = ", yyi + 1);
-        yy_symbol_print(stderr, yystos[yyssp[yyi + 1 - yynrhs]], &(yyvsp[(yyi + 1) - (yynrhs)]),
-                        context);
-        YYFPRINTF(stderr, "\n");
-    }
-}
-
-#    define YY_REDUCE_PRINT(Rule)                             \
-        do                                                    \
-        {                                                     \
-            if (yydebug)                                      \
-                yy_reduce_print(yyssp, yyvsp, Rule, context); \
-        } while (0)
-
-/* Nonzero means print parse trace.  It is left uninitialized so that
-   multiple parsers can coexist.  */
-int yydebug;
-#else /* !YYDEBUG */
-#    define YYDPRINTF(Args)
-#    define YY_SYMBOL_PRINT(Title, Type, Value, Location)
-#    define YY_STACK_PRINT(Bottom, Top)
-#    define YY_REDUCE_PRINT(Rule)
-#endif /* !YYDEBUG */
-
-/* YYINITDEPTH -- initial size of the parser's stacks.  */
-#ifndef YYINITDEPTH
-#    define YYINITDEPTH 200
-#endif
-
-/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
-   if the built-in stack extension method is used).
-
-   Do not make this value too large; the results are undefined if
-   YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
-   evaluated with infinite-precision integer arithmetic.  */
-
-#ifndef YYMAXDEPTH
-#    define YYMAXDEPTH 10000
-#endif
-
-#if YYERROR_VERBOSE
-
-#    ifndef yystrlen
-#        if defined __GLIBC__ && defined _STRING_H
-#            define yystrlen strlen
-#        else
-/* Return the length of YYSTR.  */
-static YYSIZE_T yystrlen(const char *yystr)
-{
-    YYSIZE_T yylen;
-    for (yylen = 0; yystr[yylen]; yylen++)
-        continue;
-    return yylen;
-}
-#        endif
-#    endif
-
-#    ifndef yystpcpy
-#        if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
-#            define yystpcpy stpcpy
-#        else
-/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
-   YYDEST.  */
-static char *yystpcpy(char *yydest, const char *yysrc)
-{
-    char *yyd       = yydest;
-    const char *yys = yysrc;
-
-    while ((*yyd++ = *yys++) != '\0')
-        continue;
-
-    return yyd - 1;
-}
-#        endif
-#    endif
-
-#    ifndef yytnamerr
-/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
-   quotes and backslashes, so that it's suitable for yyerror.  The
-   heuristic is that double-quoting is unnecessary unless the string
-   contains an apostrophe, a comma, or backslash (other than
-   backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
-   null, do not copy; instead, return the length of what the result
-   would have been.  */
-static YYSIZE_T yytnamerr(char *yyres, const char *yystr)
-{
-    if (*yystr == '"')
-    {
-        YYSIZE_T yyn    = 0;
-        char const *yyp = yystr;
-
-        for (;;)
-            switch (*++yyp)
-            {
-                case '\'':
-                case ',':
-                    goto do_not_strip_quotes;
-
-                case '\\':
-                    if (*++yyp != '\\')
-                        goto do_not_strip_quotes;
-                    /* Fall through.  */
-                default:
-                    if (yyres)
-                        yyres[yyn] = *yyp;
-                    yyn++;
-                    break;
-
-                case '"':
-                    if (yyres)
-                        yyres[yyn] = '\0';
-                    return yyn;
-            }
-    do_not_strip_quotes:;
-    }
-
-    if (!yyres)
-        return yystrlen(yystr);
-
-    return yystpcpy(yyres, yystr) - yyres;
-}
-#    endif
-
-/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
-   about the unexpected token YYTOKEN for the state stack whose top is
-   YYSSP.
-
-   Return 0 if *YYMSG was successfully written.  Return 1 if *YYMSG is
-   not large enough to hold the message.  In that case, also set
-   *YYMSG_ALLOC to the required number of bytes.  Return 2 if the
-   required number of bytes is too large to store.  */
-static int yysyntax_error(YYSIZE_T *yymsg_alloc, char **yymsg, yytype_int16 *yyssp, int yytoken)
-{
-    YYSIZE_T yysize0 = yytnamerr(YY_NULLPTR, yytname[yytoken]);
-    YYSIZE_T yysize  = yysize0;
-    enum
-    {
-        YYERROR_VERBOSE_ARGS_MAXIMUM = 5
-    };
-    /* Internationalized format string. */
-    const char *yyformat = YY_NULLPTR;
-    /* Arguments of yyformat. */
-    char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
-    /* Number of reported tokens (one for the "unexpected", one per
-       "expected"). */
-    int yycount = 0;
-
-    /* There are many possibilities here to consider:
-       - If this state is a consistent state with a default action, then
-         the only way this function was invoked is if the default action
-         is an error action.  In that case, don't check for expected
-         tokens because there are none.
-       - The only way there can be no lookahead present (in yychar) is if
-         this state is a consistent state with a default action.  Thus,
-         detecting the absence of a lookahead is sufficient to determine
-         that there is no unexpected or expected token to report.  In that
-         case, just report a simple "syntax error".
-       - Don't assume there isn't a lookahead just because this state is a
-         consistent state with a default action.  There might have been a
-         previous inconsistent state, consistent state with a non-default
-         action, or user semantic action that manipulated yychar.
-       - Of course, the expected token list depends on states to have
-         correct lookahead information, and it depends on the parser not
-         to perform extra reductions after fetching a lookahead from the
-         scanner and before detecting a syntax error.  Thus, state merging
-         (from LALR or IELR) and default reductions corrupt the expected
-         token list.  However, the list is correct for canonical LR with
-         one exception: it will still contain any token that will not be
-         accepted due to an error action in a later state.
-    */
-    if (yytoken != YYEMPTY)
-    {
-        int yyn          = yypact[*yyssp];
-        yyarg[yycount++] = yytname[yytoken];
-        if (!yypact_value_is_default(yyn))
-        {
-            /* Start YYX at -YYN if negative to avoid negative indexes in
-               YYCHECK.  In other words, skip the first -YYN actions for
-               this state because they are default actions.  */
-            int yyxbegin = yyn < 0 ? -yyn : 0;
-            /* Stay within bounds of both yycheck and yytname.  */
-            int yychecklim = YYLAST - yyn + 1;
-            int yyxend     = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
-            int yyx;
-
-            for (yyx = yyxbegin; yyx < yyxend; ++yyx)
-                if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR &&
-                    !yytable_value_is_error(yytable[yyx + yyn]))
-                {
-                    if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
-                    {
-                        yycount = 1;
-                        yysize  = yysize0;
-                        break;
-                    }
-                    yyarg[yycount++] = yytname[yyx];
-                    {
-                        YYSIZE_T yysize1 = yysize + yytnamerr(YY_NULLPTR, yytname[yyx]);
-                        if (!(yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
-                            return 2;
-                        yysize = yysize1;
-                    }
-                }
-        }
-    }
-
-    switch (yycount)
-    {
-#    define YYCASE_(N, S) \
-        case N:           \
-            yyformat = S; \
-            break
-        YYCASE_(0, YY_("syntax error"));
-        YYCASE_(1, YY_("syntax error, unexpected %s"));
-        YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
-        YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
-        YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
-        YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
-#    undef YYCASE_
-    }
-
-    {
-        YYSIZE_T yysize1 = yysize + yystrlen(yyformat);
-        if (!(yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
-            return 2;
-        yysize = yysize1;
-    }
-
-    if (*yymsg_alloc < yysize)
-    {
-        *yymsg_alloc = 2 * yysize;
-        if (!(yysize <= *yymsg_alloc && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
-            *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
-        return 1;
-    }
-
-    /* Avoid sprintf, as that infringes on the user's name space.
-       Don't have undefined behavior even if the translation
-       produced a string with the wrong number of "%s"s.  */
-    {
-        char *yyp = *yymsg;
-        int yyi   = 0;
-        while ((*yyp = *yyformat) != '\0')
-            if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
-            {
-                yyp += yytnamerr(yyp, yyarg[yyi++]);
-                yyformat += 2;
-            }
-            else
-            {
-                yyp++;
-                yyformat++;
-            }
-    }
-    return 0;
-}
-#endif /* YYERROR_VERBOSE */
-
-/*-----------------------------------------------.
-| Release the memory associated to this symbol.  |
-`-----------------------------------------------*/
-
-static void yydestruct(const char *yymsg, int yytype, YYSTYPE *yyvaluep, Context *context)
-{
-    YYUSE(yyvaluep);
-    YYUSE(context);
-    if (!yymsg)
-        yymsg = "Deleting";
-    YY_SYMBOL_PRINT(yymsg, yytype, yyvaluep, yylocationp);
-
-    YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
-    YYUSE(yytype);
-    YY_IGNORE_MAYBE_UNINITIALIZED_END
-}
-
-/*----------.
-| yyparse.  |
-`----------*/
-
-int yyparse(Context *context)
-{
-    /* The lookahead symbol.  */
-    int yychar;
-
-    /* The semantic value of the lookahead symbol.  */
-    /* Default value used for initialization, for pacifying older GCCs
-       or non-GCC compilers.  */
-    YY_INITIAL_VALUE(static YYSTYPE yyval_default;)
-    YYSTYPE yylval YY_INITIAL_VALUE(= yyval_default);
-
-    /* Number of syntax errors so far.  */
-    int yynerrs;
-
-    int yystate;
-    /* Number of tokens to shift before error messages enabled.  */
-    int yyerrstatus;
-
-    /* The stacks and their tools:
-       'yyss': related to states.
-       'yyvs': related to semantic values.
-
-       Refer to the stacks through separate pointers, to allow yyoverflow
-       to reallocate them elsewhere.  */
-
-    /* The state stack.  */
-    yytype_int16 yyssa[YYINITDEPTH];
-    yytype_int16 *yyss;
-    yytype_int16 *yyssp;
-
-    /* The semantic value stack.  */
-    YYSTYPE yyvsa[YYINITDEPTH];
-    YYSTYPE *yyvs;
-    YYSTYPE *yyvsp;
-
-    YYSIZE_T yystacksize;
-
-    int yyn;
-    int yyresult;
-    /* Lookahead token as an internal (translated) token number.  */
-    int yytoken = 0;
-    /* The variables used to return semantic value and location from the
-       action routines.  */
-    YYSTYPE yyval;
-
-#if YYERROR_VERBOSE
-    /* Buffer for error messages, and its allocated size.  */
-    char yymsgbuf[128];
-    char *yymsg          = yymsgbuf;
-    YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
-#endif
-
-#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
-
-    /* The number of symbols on the RHS of the reduced rule.
-       Keep to zero when no symbol should be popped.  */
-    int yylen = 0;
-
-    yyssp = yyss = yyssa;
-    yyvsp = yyvs = yyvsa;
-    yystacksize  = YYINITDEPTH;
-
-    YYDPRINTF((stderr, "Starting parse\n"));
-
-    yystate     = 0;
-    yyerrstatus = 0;
-    yynerrs     = 0;
-    yychar      = YYEMPTY; /* Cause a token to be read.  */
-    goto yysetstate;
-
-    /*------------------------------------------------------------.
-    | yynewstate -- Push a new state, which is found in yystate.  |
-    `------------------------------------------------------------*/
-yynewstate:
-    /* In all cases, when you get here, the value and location stacks
-       have just been pushed.  So pushing a state here evens the stacks.  */
-    yyssp++;
-
-yysetstate:
-    *yyssp = yystate;
-
-    if (yyss + yystacksize - 1 <= yyssp)
-    {
-        /* Get the current used size of the three stacks, in elements.  */
-        YYSIZE_T yysize = yyssp - yyss + 1;
-
-#ifdef yyoverflow
-        {
-            /* Give user a chance to reallocate the stack.  Use copies of
-               these so that the &'s don't force the real ones into
-               memory.  */
-            YYSTYPE *yyvs1      = yyvs;
-            yytype_int16 *yyss1 = yyss;
-
-            /* Each stack pointer address is followed by the size of the
-               data in use in that stack, in bytes.  This used to be a
-               conditional around just the two extra args, but that might
-               be undefined if yyoverflow is a macro.  */
-            yyoverflow(YY_("memory exhausted"), &yyss1, yysize * sizeof(*yyssp), &yyvs1,
-                       yysize * sizeof(*yyvsp), &yystacksize);
-
-            yyss = yyss1;
-            yyvs = yyvs1;
-        }
-#else /* no yyoverflow */
-#    ifndef YYSTACK_RELOCATE
-        goto yyexhaustedlab;
-#    else
-        /* Extend the stack our own way.  */
-        if (YYMAXDEPTH <= yystacksize)
-            goto yyexhaustedlab;
-        yystacksize *= 2;
-        if (YYMAXDEPTH < yystacksize)
-            yystacksize = YYMAXDEPTH;
-
-        {
-            yytype_int16 *yyss1  = yyss;
-            union yyalloc *yyptr = (union yyalloc *)YYSTACK_ALLOC(YYSTACK_BYTES(yystacksize));
-            if (!yyptr)
-                goto yyexhaustedlab;
-            YYSTACK_RELOCATE(yyss_alloc, yyss);
-            YYSTACK_RELOCATE(yyvs_alloc, yyvs);
-#        undef YYSTACK_RELOCATE
-            if (yyss1 != yyssa)
-                YYSTACK_FREE(yyss1);
-        }
-#    endif
-#endif /* no yyoverflow */
-
-        yyssp = yyss + yysize - 1;
-        yyvsp = yyvs + yysize - 1;
-
-        YYDPRINTF((stderr, "Stack size increased to %lu\n", (unsigned long int)yystacksize));
-
-        if (yyss + yystacksize - 1 <= yyssp)
-            YYABORT;
-    }
-
-    YYDPRINTF((stderr, "Entering state %d\n", yystate));
-
-    if (yystate == YYFINAL)
-        YYACCEPT;
-
-    goto yybackup;
-
-/*-----------.
-| yybackup.  |
-`-----------*/
-yybackup:
-
-    /* Do appropriate processing given the current state.  Read a
-       lookahead token if we need one and don't already have one.  */
-
-    /* First try to decide what to do without reference to lookahead token.  */
-    yyn = yypact[yystate];
-    if (yypact_value_is_default(yyn))
-        goto yydefault;
-
-    /* Not known => get a lookahead token if don't already have one.  */
-
-    /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
-    if (yychar == YYEMPTY)
-    {
-        YYDPRINTF((stderr, "Reading a token: "));
-        yychar = yylex(&yylval, context);
-    }
-
-    if (yychar <= YYEOF)
-    {
-        yychar = yytoken = YYEOF;
-        YYDPRINTF((stderr, "Now at end of input.\n"));
-    }
-    else
-    {
-        yytoken = YYTRANSLATE(yychar);
-        YY_SYMBOL_PRINT("Next token is", yytoken, &yylval, &yylloc);
-    }
-
-    /* If the proper action on seeing token YYTOKEN is to reduce or to
-       detect an error, take that action.  */
-    yyn += yytoken;
-    if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
-        goto yydefault;
-    yyn = yytable[yyn];
-    if (yyn <= 0)
-    {
-        if (yytable_value_is_error(yyn))
-            goto yyerrlab;
-        yyn = -yyn;
-        goto yyreduce;
-    }
-
-    /* Count tokens shifted since error; after three, turn off error
-       status.  */
-    if (yyerrstatus)
-        yyerrstatus--;
-
-    /* Shift the lookahead token.  */
-    YY_SYMBOL_PRINT("Shifting", yytoken, &yylval, &yylloc);
-
-    /* Discard the shifted token.  */
-    yychar = YYEMPTY;
-
-    yystate = yyn;
-    YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
-    *++yyvsp = yylval;
-    YY_IGNORE_MAYBE_UNINITIALIZED_END
-
-    goto yynewstate;
-
-/*-----------------------------------------------------------.
-| yydefault -- do the default action for the current state.  |
-`-----------------------------------------------------------*/
-yydefault:
-    yyn = yydefact[yystate];
-    if (yyn == 0)
-        goto yyerrlab;
-    goto yyreduce;
-
-/*-----------------------------.
-| yyreduce -- Do a reduction.  |
-`-----------------------------*/
-yyreduce:
-    /* yyn is the number of a rule to reduce with.  */
-    yylen = yyr2[yyn];
-
-    /* If YYLEN is nonzero, implement the default value of the action:
-       '$$ = $1'.
-
-       Otherwise, the following line sets YYVAL to garbage.
-       This behavior is undocumented and Bison
-       users should not rely upon it.  Assigning to YYVAL
-       unconditionally makes the parser a bit smaller, and it avoids a
-       GCC warning that YYVAL may be used uninitialized.  */
-    yyval = yyvsp[1 - yylen];
-
-    YY_REDUCE_PRINT(yyn);
-    switch (yyn)
-    {
-        case 2:
-
-        {
-            *(context->result) = static_cast<int>((yyvsp[0]));
-            YYACCEPT;
-        }
-
-        break;
-
-        case 4:
-
-        {
-            if (!context->isIgnoringErrors())
-            {
-                // This rule should be applied right after the token is lexed, so we can
-                // refer to context->token in the error message.
-                context->diagnostics->report(context->errorSettings.unexpectedIdentifier,
-                                             context->token->location, context->token->text);
-                *(context->valid) = false;
-            }
-            (yyval) = (yyvsp[0]);
-        }
-
-        break;
-
-        case 5:
-
-        {
-            if ((yyvsp[-1]) != 0)
-            {
-                // Ignore errors in the short-circuited part of the expression.
-                // ESSL3.00 section 3.4:
-                // If an operand is not evaluated, the presence of undefined identifiers
-                // in the operand will not cause an error.
-                // Unevaluated division by zero should not cause an error either.
-                context->startIgnoreErrors();
-            }
-        }
-
-        break;
-
-        case 6:
-
-        {
-            if ((yyvsp[-3]) != 0)
-            {
-                context->endIgnoreErrors();
-                (yyval) = static_cast<YYSTYPE>(1);
-            }
-            else
-            {
-                (yyval) = (yyvsp[-3]) || (yyvsp[0]);
-            }
-        }
-
-        break;
-
-        case 7:
-
-        {
-            if ((yyvsp[-1]) == 0)
-            {
-                // Ignore errors in the short-circuited part of the expression.
-                // ESSL3.00 section 3.4:
-                // If an operand is not evaluated, the presence of undefined identifiers
-                // in the operand will not cause an error.
-                // Unevaluated division by zero should not cause an error either.
-                context->startIgnoreErrors();
-            }
-        }
-
-        break;
-
-        case 8:
-
-        {
-            if ((yyvsp[-3]) == 0)
-            {
-                context->endIgnoreErrors();
-                (yyval) = static_cast<YYSTYPE>(0);
-            }
-            else
-            {
-                (yyval) = (yyvsp[-3]) && (yyvsp[0]);
-            }
-        }
-
-        break;
-
-        case 9:
-
-        {
-            (yyval) = (yyvsp[-2]) | (yyvsp[0]);
-        }
-
-        break;
-
-        case 10:
-
-        {
-            (yyval) = (yyvsp[-2]) ^ (yyvsp[0]);
-        }
-
-        break;
-
-        case 11:
-
-        {
-            (yyval) = (yyvsp[-2]) & (yyvsp[0]);
-        }
-
-        break;
-
-        case 12:
-
-        {
-            (yyval) = (yyvsp[-2]) != (yyvsp[0]);
-        }
-
-        break;
-
-        case 13:
-
-        {
-            (yyval) = (yyvsp[-2]) == (yyvsp[0]);
-        }
-
-        break;
-
-        case 14:
-
-        {
-            (yyval) = (yyvsp[-2]) >= (yyvsp[0]);
-        }
-
-        break;
-
-        case 15:
-
-        {
-            (yyval) = (yyvsp[-2]) <= (yyvsp[0]);
-        }
-
-        break;
-
-        case 16:
-
-        {
-            (yyval) = (yyvsp[-2]) > (yyvsp[0]);
-        }
-
-        break;
-
-        case 17:
-
-        {
-            (yyval) = (yyvsp[-2]) < (yyvsp[0]);
-        }
-
-        break;
-
-        case 18:
-
-        {
-            if ((yyvsp[0]) < 0 || (yyvsp[0]) > 31)
-            {
-                if (!context->isIgnoringErrors())
-                {
-                    std::ostringstream stream;
-                    stream << (yyvsp[-2]) << " >> " << (yyvsp[0]);
-                    std::string text = stream.str();
-                    context->diagnostics->report(angle::pp::Diagnostics::PP_UNDEFINED_SHIFT,
-                                                 context->token->location, text.c_str());
-                    *(context->valid) = false;
-                }
-                (yyval) = static_cast<YYSTYPE>(0);
-            }
-            else if ((yyvsp[-2]) < 0)
-            {
-                // Logical shift right.
-                (yyval) =
-                    static_cast<YYSTYPE>(static_cast<UNSIGNED_TYPE>((yyvsp[-2])) >> (yyvsp[0]));
-            }
-            else
-            {
-                (yyval) = (yyvsp[-2]) >> (yyvsp[0]);
-            }
-        }
-
-        break;
-
-        case 19:
-
-        {
-            if ((yyvsp[0]) < 0 || (yyvsp[0]) > 31)
-            {
-                if (!context->isIgnoringErrors())
-                {
-                    std::ostringstream stream;
-                    stream << (yyvsp[-2]) << " << " << (yyvsp[0]);
-                    std::string text = stream.str();
-                    context->diagnostics->report(angle::pp::Diagnostics::PP_UNDEFINED_SHIFT,
-                                                 context->token->location, text.c_str());
-                    *(context->valid) = false;
-                }
-                (yyval) = static_cast<YYSTYPE>(0);
-            }
-            else
-            {
-                // Logical shift left. Casting to unsigned is needed to ensure there's no signed
-                // integer overflow, which some tools treat as an error.
-                (yyval) =
-                    static_cast<YYSTYPE>(static_cast<UNSIGNED_TYPE>((yyvsp[-2])) << (yyvsp[0]));
-            }
-        }
-
-        break;
-
-        case 20:
-
-        {
-            (yyval) = gl::WrappingDiff<YYSTYPE>((yyvsp[-2]), (yyvsp[0]));
-        }
-
-        break;
-
-        case 21:
-
-        {
-            (yyval) = gl::WrappingSum<YYSTYPE>((yyvsp[-2]), (yyvsp[0]));
-        }
-
-        break;
-
-        case 22:
-
-        {
-            if ((yyvsp[0]) == 0)
-            {
-                if (!context->isIgnoringErrors())
-                {
-                    std::ostringstream stream;
-                    stream << (yyvsp[-2]) << " % " << (yyvsp[0]);
-                    std::string text = stream.str();
-                    context->diagnostics->report(angle::pp::Diagnostics::PP_DIVISION_BY_ZERO,
-                                                 context->token->location, text.c_str());
-                    *(context->valid) = false;
-                }
-                (yyval) = static_cast<YYSTYPE>(0);
-            }
-            else if (((yyvsp[-2]) == std::numeric_limits<YYSTYPE>::min()) && ((yyvsp[0]) == -1))
-            {
-                // Check for the special case where the minimum representable number is
-                // divided by -1. If left alone this has undefined results.
-                (yyval) = 0;
-            }
-            else
-            {
-                (yyval) = (yyvsp[-2]) % (yyvsp[0]);
-            }
-        }
-
-        break;
-
-        case 23:
-
-        {
-            if ((yyvsp[0]) == 0)
-            {
-                if (!context->isIgnoringErrors())
-                {
-                    std::ostringstream stream;
-                    stream << (yyvsp[-2]) << " / " << (yyvsp[0]);
-                    std::string text = stream.str();
-                    context->diagnostics->report(angle::pp::Diagnostics::PP_DIVISION_BY_ZERO,
-                                                 context->token->location, text.c_str());
-                    *(context->valid) = false;
-                }
-                (yyval) = static_cast<YYSTYPE>(0);
-            }
-            else if (((yyvsp[-2]) == std::numeric_limits<YYSTYPE>::min()) && ((yyvsp[0]) == -1))
-            {
-                // Check for the special case where the minimum representable number is
-                // divided by -1. If left alone this leads to integer overflow in C++, which
-                // has undefined results.
-                (yyval) = std::numeric_limits<YYSTYPE>::max();
-            }
-            else
-            {
-                (yyval) = (yyvsp[-2]) / (yyvsp[0]);
-            }
-        }
-
-        break;
-
-        case 24:
-
-        {
-            (yyval) = gl::WrappingMul((yyvsp[-2]), (yyvsp[0]));
-        }
-
-        break;
-
-        case 25:
-
-        {
-            (yyval) = !(yyvsp[0]);
-        }
-
-        break;
-
-        case 26:
-
-        {
-            (yyval) = ~(yyvsp[0]);
-        }
-
-        break;
-
-        case 27:
-
-        {
-            // Check for negation of minimum representable integer to prevent undefined signed int
-            // overflow.
-            if ((yyvsp[0]) == std::numeric_limits<YYSTYPE>::min())
-            {
-                (yyval) = std::numeric_limits<YYSTYPE>::min();
-            }
-            else
-            {
-                (yyval) = -(yyvsp[0]);
-            }
-        }
-
-        break;
-
-        case 28:
-
-        {
-            (yyval) = +(yyvsp[0]);
-        }
-
-        break;
-
-        case 29:
-
-        {
-            (yyval) = (yyvsp[-1]);
-        }
-
-        break;
-
-        default:
-            break;
-    }
-    /* User semantic actions sometimes alter yychar, and that requires
-       that yytoken be updated with the new translation.  We take the
-       approach of translating immediately before every use of yytoken.
-       One alternative is translating here after every semantic action,
-       but that translation would be missed if the semantic action invokes
-       YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
-       if it invokes YYBACKUP.  In the case of YYABORT or YYACCEPT, an
-       incorrect destructor might then be invoked immediately.  In the
-       case of YYERROR or YYBACKUP, subsequent parser actions might lead
-       to an incorrect destructor call or verbose syntax error message
-       before the lookahead is translated.  */
-    YY_SYMBOL_PRINT("-> $$ =", yyr1[yyn], &yyval, &yyloc);
-
-    YYPOPSTACK(yylen);
-    yylen = 0;
-    YY_STACK_PRINT(yyss, yyssp);
-
-    *++yyvsp = yyval;
-
-    /* Now 'shift' the result of the reduction.  Determine what state
-       that goes to, based on the state we popped back to and the rule
-       number reduced by.  */
-
-    yyn = yyr1[yyn];
-
-    yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
-    if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
-        yystate = yytable[yystate];
-    else
-        yystate = yydefgoto[yyn - YYNTOKENS];
-
-    goto yynewstate;
-
-/*--------------------------------------.
-| yyerrlab -- here on detecting error.  |
-`--------------------------------------*/
-yyerrlab:
-    /* Make sure we have latest lookahead translation.  See comments at
-       user semantic actions for why this is necessary.  */
-    yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE(yychar);
-
-    /* If not already recovering from an error, report this error.  */
-    if (!yyerrstatus)
-    {
-        ++yynerrs;
-#if !YYERROR_VERBOSE
-        yyerror(context, YY_("syntax error"));
-#else
-#    define YYSYNTAX_ERROR yysyntax_error(&yymsg_alloc, &yymsg, yyssp, yytoken)
-        {
-            char const *yymsgp = YY_("syntax error");
-            int yysyntax_error_status;
-            yysyntax_error_status = YYSYNTAX_ERROR;
-            if (yysyntax_error_status == 0)
-                yymsgp = yymsg;
-            else if (yysyntax_error_status == 1)
-            {
-                if (yymsg != yymsgbuf)
-                    YYSTACK_FREE(yymsg);
-                yymsg = (char *)YYSTACK_ALLOC(yymsg_alloc);
-                if (!yymsg)
-                {
-                    yymsg                 = yymsgbuf;
-                    yymsg_alloc           = sizeof yymsgbuf;
-                    yysyntax_error_status = 2;
-                }
-                else
-                {
-                    yysyntax_error_status = YYSYNTAX_ERROR;
-                    yymsgp                = yymsg;
-                }
-            }
-            yyerror(context, yymsgp);
-            if (yysyntax_error_status == 2)
-                goto yyexhaustedlab;
-        }
-#    undef YYSYNTAX_ERROR
-#endif
-    }
-
-    if (yyerrstatus == 3)
-    {
-        /* If just tried and failed to reuse lookahead token after an
-           error, discard it.  */
-
-        if (yychar <= YYEOF)
-        {
-            /* Return failure if at end of input.  */
-            if (yychar == YYEOF)
-                YYABORT;
-        }
-        else
-        {
-            yydestruct("Error: discarding", yytoken, &yylval, context);
-            yychar = YYEMPTY;
-        }
-    }
-
-    /* Else will try to reuse lookahead token after shifting the error
-       token.  */
-    goto yyerrlab1;
-
-/*---------------------------------------------------.
-| yyerrorlab -- error raised explicitly by YYERROR.  |
-`---------------------------------------------------*/
-yyerrorlab:
-
-    /* Pacify compilers like GCC when the user code never invokes
-       YYERROR and the label yyerrorlab therefore never appears in user
-       code.  */
-    if (/*CONSTCOND*/ 0)
-        goto yyerrorlab;
-
-    /* Do not reclaim the symbols of the rule whose action triggered
-       this YYERROR.  */
-    YYPOPSTACK(yylen);
-    yylen = 0;
-    YY_STACK_PRINT(yyss, yyssp);
-    yystate = *yyssp;
-    goto yyerrlab1;
-
-/*-------------------------------------------------------------.
-| yyerrlab1 -- common code for both syntax error and YYERROR.  |
-`-------------------------------------------------------------*/
-yyerrlab1:
-    yyerrstatus = 3; /* Each real token shifted decrements this.  */
-
-    for (;;)
-    {
-        yyn = yypact[yystate];
-        if (!yypact_value_is_default(yyn))
-        {
-            yyn += YYTERROR;
-            if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
-            {
-                yyn = yytable[yyn];
-                if (0 < yyn)
-                    break;
-            }
-        }
-
-        /* Pop the current state because it cannot handle the error token.  */
-        if (yyssp == yyss)
-            YYABORT;
-
-        yydestruct("Error: popping", yystos[yystate], yyvsp, context);
-        YYPOPSTACK(1);
-        yystate = *yyssp;
-        YY_STACK_PRINT(yyss, yyssp);
-    }
-
-    YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
-    *++yyvsp = yylval;
-    YY_IGNORE_MAYBE_UNINITIALIZED_END
-
-    /* Shift the error token.  */
-    YY_SYMBOL_PRINT("Shifting", yystos[yyn], yyvsp, yylsp);
-
-    yystate = yyn;
-    goto yynewstate;
-
-/*-------------------------------------.
-| yyacceptlab -- YYACCEPT comes here.  |
-`-------------------------------------*/
-yyacceptlab:
-    yyresult = 0;
-    goto yyreturn;
-
-/*-----------------------------------.
-| yyabortlab -- YYABORT comes here.  |
-`-----------------------------------*/
-yyabortlab:
-    yyresult = 1;
-    goto yyreturn;
-
-#if !defined yyoverflow || YYERROR_VERBOSE
-/*-------------------------------------------------.
-| yyexhaustedlab -- memory exhaustion comes here.  |
-`-------------------------------------------------*/
-yyexhaustedlab:
-    yyerror(context, YY_("memory exhausted"));
-    yyresult = 2;
-    /* Fall through.  */
-#endif
-
-yyreturn:
-    if (yychar != YYEMPTY)
-    {
-        /* Make sure we have latest lookahead translation.  See comments at
-           user semantic actions for why this is necessary.  */
-        yytoken = YYTRANSLATE(yychar);
-        yydestruct("Cleanup: discarding lookahead", yytoken, &yylval, context);
-    }
-    /* Do not reclaim the symbols of the rule whose action triggered
-       this YYABORT or YYACCEPT.  */
-    YYPOPSTACK(yylen);
-    YY_STACK_PRINT(yyss, yyssp);
-    while (yyssp != yyss)
-    {
-        yydestruct("Cleanup: popping", yystos[*yyssp], yyvsp, context);
-        YYPOPSTACK(1);
-    }
-#ifndef yyoverflow
-    if (yyss != yyssa)
-        YYSTACK_FREE(yyss);
-#endif
-#if YYERROR_VERBOSE
-    if (yymsg != yymsgbuf)
-        YYSTACK_FREE(yymsg);
-#endif
-    return yyresult;
-}
-
-int yylex(YYSTYPE *lvalp, Context *context)
-{
-    angle::pp::Token *token = context->token;
-    if (!context->parsePresetToken)
-    {
-        context->lexer->lex(token);
-    }
-    context->parsePresetToken = false;
-
-    int type = 0;
-
-    switch (token->type)
-    {
-        case angle::pp::Token::CONST_INT:
-        {
-            unsigned int val = 0;
-            int testVal      = 0;
-            if (!token->uValue(&val) ||
-                (!token->iValue(&testVal) &&
-                 context->errorSettings.integerLiteralsMustFit32BitSignedRange))
-            {
-                context->diagnostics->report(angle::pp::Diagnostics::PP_INTEGER_OVERFLOW,
-                                             token->location, token->text);
-                *(context->valid) = false;
-            }
-            *lvalp = static_cast<YYSTYPE>(val);
-            type   = TOK_CONST_INT;
-            break;
-        }
-        case angle::pp::Token::IDENTIFIER:
-            *lvalp = static_cast<YYSTYPE>(-1);
-            type   = TOK_IDENTIFIER;
-            break;
-        case angle::pp::Token::OP_OR:
-            type = TOK_OP_OR;
-            break;
-        case angle::pp::Token::OP_AND:
-            type = TOK_OP_AND;
-            break;
-        case angle::pp::Token::OP_NE:
-            type = TOK_OP_NE;
-            break;
-        case angle::pp::Token::OP_EQ:
-            type = TOK_OP_EQ;
-            break;
-        case angle::pp::Token::OP_GE:
-            type = TOK_OP_GE;
-            break;
-        case angle::pp::Token::OP_LE:
-            type = TOK_OP_LE;
-            break;
-        case angle::pp::Token::OP_RIGHT:
-            type = TOK_OP_RIGHT;
-            break;
-        case angle::pp::Token::OP_LEFT:
-            type = TOK_OP_LEFT;
-            break;
-        case '|':
-        case '^':
-        case '&':
-        case '>':
-        case '<':
-        case '-':
-        case '+':
-        case '%':
-        case '/':
-        case '*':
-        case '!':
-        case '~':
-        case '(':
-        case ')':
-            type = token->type;
-            break;
-
-        default:
-            break;
-    }
-
-    return type;
-}
-
-void yyerror(Context *context, const char *reason)
-{
-    context->diagnostics->report(angle::pp::Diagnostics::PP_INVALID_EXPRESSION,
-                                 context->token->location, reason);
-}
-
-namespace angle
-{
-
-namespace pp
-{
-
-ExpressionParser::ExpressionParser(Lexer *lexer, Diagnostics *diagnostics)
-    : mLexer(lexer), mDiagnostics(diagnostics)
-{}
-
-bool ExpressionParser::parse(Token *token,
-                             int *result,
-                             bool parsePresetToken,
-                             const ErrorSettings &errorSettings,
-                             bool *valid)
-{
-    Context context;
-    context.diagnostics      = mDiagnostics;
-    context.lexer            = mLexer;
-    context.token            = token;
-    context.result           = result;
-    context.ignoreErrors     = 0;
-    context.parsePresetToken = parsePresetToken;
-    context.errorSettings    = errorSettings;
-    context.valid            = valid;
-    int ret                  = yyparse(&context);
-    switch (ret)
-    {
-        case 0:
-        case 1:
-            break;
-
-        case 2:
-            mDiagnostics->report(Diagnostics::PP_OUT_OF_MEMORY, token->location, "");
-            break;
-
-        default:
-            assert(false);
-            mDiagnostics->report(Diagnostics::PP_INTERNAL_ERROR, token->location, "");
-            break;
-    }
-
-    return ret == 0;
-}
-
-}  // namespace pp
-
-}  // namespace angle
diff --git a/src/compiler/preprocessor/Tokenizer.cpp b/src/compiler/preprocessor/Tokenizer.cpp
deleted file mode 100644
index ce98877..0000000
--- a/src/compiler/preprocessor/Tokenizer.cpp
+++ /dev/null
@@ -1,2619 +0,0 @@
-#line 16 "./Tokenizer.l"
-//
-// Copyright 2011 The ANGLE Project Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-
-// This file is auto-generated by generate_parser.sh. DO NOT EDIT!
-
-#define YY_INT_ALIGNED short int
-
-/* A lexical scanner generated by flex */
-
-#define FLEX_SCANNER
-#define YY_FLEX_MAJOR_VERSION 2
-#define YY_FLEX_MINOR_VERSION 6
-#define YY_FLEX_SUBMINOR_VERSION 4
-#if YY_FLEX_SUBMINOR_VERSION > 0
-#    define FLEX_BETA
-#endif
-
-#ifdef yy_create_buffer
-#    define pp_create_buffer_ALREADY_DEFINED
-#else
-#    define yy_create_buffer pp_create_buffer
-#endif
-
-#ifdef yy_delete_buffer
-#    define pp_delete_buffer_ALREADY_DEFINED
-#else
-#    define yy_delete_buffer pp_delete_buffer
-#endif
-
-#ifdef yy_scan_buffer
-#    define pp_scan_buffer_ALREADY_DEFINED
-#else
-#    define yy_scan_buffer pp_scan_buffer
-#endif
-
-#ifdef yy_scan_string
-#    define pp_scan_string_ALREADY_DEFINED
-#else
-#    define yy_scan_string pp_scan_string
-#endif
-
-#ifdef yy_scan_bytes
-#    define pp_scan_bytes_ALREADY_DEFINED
-#else
-#    define yy_scan_bytes pp_scan_bytes
-#endif
-
-#ifdef yy_init_buffer
-#    define pp_init_buffer_ALREADY_DEFINED
-#else
-#    define yy_init_buffer pp_init_buffer
-#endif
-
-#ifdef yy_flush_buffer
-#    define pp_flush_buffer_ALREADY_DEFINED
-#else
-#    define yy_flush_buffer pp_flush_buffer
-#endif
-
-#ifdef yy_load_buffer_state
-#    define pp_load_buffer_state_ALREADY_DEFINED
-#else
-#    define yy_load_buffer_state pp_load_buffer_state
-#endif
-
-#ifdef yy_switch_to_buffer
-#    define pp_switch_to_buffer_ALREADY_DEFINED
-#else
-#    define yy_switch_to_buffer pp_switch_to_buffer
-#endif
-
-#ifdef yypush_buffer_state
-#    define pppush_buffer_state_ALREADY_DEFINED
-#else
-#    define yypush_buffer_state pppush_buffer_state
-#endif
-
-#ifdef yypop_buffer_state
-#    define pppop_buffer_state_ALREADY_DEFINED
-#else
-#    define yypop_buffer_state pppop_buffer_state
-#endif
-
-#ifdef yyensure_buffer_stack
-#    define ppensure_buffer_stack_ALREADY_DEFINED
-#else
-#    define yyensure_buffer_stack ppensure_buffer_stack
-#endif
-
-#ifdef yylex
-#    define pplex_ALREADY_DEFINED
-#else
-#    define yylex pplex
-#endif
-
-#ifdef yyrestart
-#    define pprestart_ALREADY_DEFINED
-#else
-#    define yyrestart pprestart
-#endif
-
-#ifdef yylex_init
-#    define pplex_init_ALREADY_DEFINED
-#else
-#    define yylex_init pplex_init
-#endif
-
-#ifdef yylex_init_extra
-#    define pplex_init_extra_ALREADY_DEFINED
-#else
-#    define yylex_init_extra pplex_init_extra
-#endif
-
-#ifdef yylex_destroy
-#    define pplex_destroy_ALREADY_DEFINED
-#else
-#    define yylex_destroy pplex_destroy
-#endif
-
-#ifdef yyget_debug
-#    define ppget_debug_ALREADY_DEFINED
-#else
-#    define yyget_debug ppget_debug
-#endif
-
-#ifdef yyset_debug
-#    define ppset_debug_ALREADY_DEFINED
-#else
-#    define yyset_debug ppset_debug
-#endif
-
-#ifdef yyget_extra
-#    define ppget_extra_ALREADY_DEFINED
-#else
-#    define yyget_extra ppget_extra
-#endif
-
-#ifdef yyset_extra
-#    define ppset_extra_ALREADY_DEFINED
-#else
-#    define yyset_extra ppset_extra
-#endif
-
-#ifdef yyget_in
-#    define ppget_in_ALREADY_DEFINED
-#else
-#    define yyget_in ppget_in
-#endif
-
-#ifdef yyset_in
-#    define ppset_in_ALREADY_DEFINED
-#else
-#    define yyset_in ppset_in
-#endif
-
-#ifdef yyget_out
-#    define ppget_out_ALREADY_DEFINED
-#else
-#    define yyget_out ppget_out
-#endif
-
-#ifdef yyset_out
-#    define ppset_out_ALREADY_DEFINED
-#else
-#    define yyset_out ppset_out
-#endif
-
-#ifdef yyget_leng
-#    define ppget_leng_ALREADY_DEFINED
-#else
-#    define yyget_leng ppget_leng
-#endif
-
-#ifdef yyget_text
-#    define ppget_text_ALREADY_DEFINED
-#else
-#    define yyget_text ppget_text
-#endif
-
-#ifdef yyget_lineno
-#    define ppget_lineno_ALREADY_DEFINED
-#else
-#    define yyget_lineno ppget_lineno
-#endif
-
-#ifdef yyset_lineno
-#    define ppset_lineno_ALREADY_DEFINED
-#else
-#    define yyset_lineno ppset_lineno
-#endif
-
-#ifdef yyget_column
-#    define ppget_column_ALREADY_DEFINED
-#else
-#    define yyget_column ppget_column
-#endif
-
-#ifdef yyset_column
-#    define ppset_column_ALREADY_DEFINED
-#else
-#    define yyset_column ppset_column
-#endif
-
-#ifdef yywrap
-#    define ppwrap_ALREADY_DEFINED
-#else
-#    define yywrap ppwrap
-#endif
-
-#ifdef yyget_lval
-#    define ppget_lval_ALREADY_DEFINED
-#else
-#    define yyget_lval ppget_lval
-#endif
-
-#ifdef yyset_lval
-#    define ppset_lval_ALREADY_DEFINED
-#else
-#    define yyset_lval ppset_lval
-#endif
-
-#ifdef yyget_lloc
-#    define ppget_lloc_ALREADY_DEFINED
-#else
-#    define yyget_lloc ppget_lloc
-#endif
-
-#ifdef yyset_lloc
-#    define ppset_lloc_ALREADY_DEFINED
-#else
-#    define yyset_lloc ppset_lloc
-#endif
-
-#ifdef yyalloc
-#    define ppalloc_ALREADY_DEFINED
-#else
-#    define yyalloc ppalloc
-#endif
-
-#ifdef yyrealloc
-#    define pprealloc_ALREADY_DEFINED
-#else
-#    define yyrealloc pprealloc
-#endif
-
-#ifdef yyfree
-#    define ppfree_ALREADY_DEFINED
-#else
-#    define yyfree ppfree
-#endif
-
-/* First, we deal with  platform-specific or compiler-specific issues. */
-
-/* begin standard C headers. */
-#include <errno.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-/* end standard C headers. */
-
-/* flex integer type definitions */
-
-#ifndef FLEXINT_H
-#    define FLEXINT_H
-
-/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
-
-#    if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
-
-/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
- * if you want the limit (max/min) macros for int types.
- */
-#        ifndef __STDC_LIMIT_MACROS
-#            define __STDC_LIMIT_MACROS 1
-#        endif
-
-#        include <inttypes.h>
-typedef int8_t flex_int8_t;
-typedef uint8_t flex_uint8_t;
-typedef int16_t flex_int16_t;
-typedef uint16_t flex_uint16_t;
-typedef int32_t flex_int32_t;
-typedef uint32_t flex_uint32_t;
-#    else
-typedef signed char flex_int8_t;
-typedef short int flex_int16_t;
-typedef int flex_int32_t;
-typedef unsigned char flex_uint8_t;
-typedef unsigned short int flex_uint16_t;
-typedef unsigned int flex_uint32_t;
-
-/* Limits of integral types. */
-#        ifndef INT8_MIN
-#            define INT8_MIN (-128)
-#        endif
-#        ifndef INT16_MIN
-#            define INT16_MIN (-32767 - 1)
-#        endif
-#        ifndef INT32_MIN
-#            define INT32_MIN (-2147483647 - 1)
-#        endif
-#        ifndef INT8_MAX
-#            define INT8_MAX (127)
-#        endif
-#        ifndef INT16_MAX
-#            define INT16_MAX (32767)
-#        endif
-#        ifndef INT32_MAX
-#            define INT32_MAX (2147483647)
-#        endif
-#        ifndef UINT8_MAX
-#            define UINT8_MAX (255U)
-#        endif
-#        ifndef UINT16_MAX
-#            define UINT16_MAX (65535U)
-#        endif
-#        ifndef UINT32_MAX
-#            define UINT32_MAX (4294967295U)
-#        endif
-
-#        ifndef SIZE_MAX
-#            define SIZE_MAX (~(size_t)0)
-#        endif
-
-#    endif /* ! C99 */
-
-#endif /* ! FLEXINT_H */
-
-/* begin standard C++ headers. */
-
-/* TODO: this is always defined, so inline it */
-#define yyconst const
-
-#if defined(__GNUC__) && __GNUC__ >= 3
-#    define yynoreturn __attribute__((__noreturn__))
-#else
-#    define yynoreturn
-#endif
-
-/* Returned upon end-of-file. */
-#define YY_NULL 0
-
-/* Promotes a possibly negative, possibly signed char to an
- *   integer in range [0..255] for use as an array index.
- */
-#define YY_SC_TO_UI(c) ((YY_CHAR)(c))
-
-/* An opaque pointer. */
-#ifndef YY_TYPEDEF_YY_SCANNER_T
-#    define YY_TYPEDEF_YY_SCANNER_T
-typedef void *yyscan_t;
-#endif
-
-/* For convenience, these vars (plus the bison vars far below)
-   are macros in the reentrant scanner. */
-#define yyin yyg->yyin_r
-#define yyout yyg->yyout_r
-#define yyextra yyg->yyextra_r
-#define yyleng yyg->yyleng_r
-#define yytext yyg->yytext_r
-#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
-#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
-#define yy_flex_debug yyg->yy_flex_debug_r
-
-/* Enter a start condition.  This macro really ought to take a parameter,
- * but we do it the disgusting crufty way forced on us by the ()-less
- * definition of BEGIN.
- */
-#define BEGIN yyg->yy_start = 1 + 2 *
-/* Translate the current start state into a value that can be later handed
- * to BEGIN to return to the state.  The YYSTATE alias is for lex
- * compatibility.
- */
-#define YY_START ((yyg->yy_start - 1) / 2)
-#define YYSTATE YY_START
-/* Action number for EOF rule of a given start state. */
-#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
-/* Special action meaning "start processing a new file". */
-#define YY_NEW_FILE yyrestart(yyin, yyscanner)
-#define YY_END_OF_BUFFER_CHAR 0
-
-/* Size of default input buffer. */
-#ifndef YY_BUF_SIZE
-#    ifdef __ia64__
-/* On IA-64, the buffer size is 16k, not 8k.
- * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
- * Ditto for the __ia64__ case accordingly.
- */
-#        define YY_BUF_SIZE 32768
-#    else
-#        define YY_BUF_SIZE 16384
-#    endif /* __ia64__ */
-#endif
-
-/* The state buf must be large enough to hold one state per character in the main buffer.
- */
-#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
-
-#ifndef YY_TYPEDEF_YY_BUFFER_STATE
-#    define YY_TYPEDEF_YY_BUFFER_STATE
-typedef struct yy_buffer_state *YY_BUFFER_STATE;
-#endif
-
-#ifndef YY_TYPEDEF_YY_SIZE_T
-#    define YY_TYPEDEF_YY_SIZE_T
-typedef size_t yy_size_t;
-#endif
-
-#define EOB_ACT_CONTINUE_SCAN 0
-#define EOB_ACT_END_OF_FILE 1
-#define EOB_ACT_LAST_MATCH 2
-
-#define YY_LESS_LINENO(n)
-#define YY_LINENO_REWIND_TO(ptr)
-
-/* Return all but the first "n" matched characters back to the input stream. */
-#define yyless(n)                                                         \
-    do                                                                    \
-    {                                                                     \
-        /* Undo effects of setting up yytext. */                          \
-        int yyless_macro_arg = (n);                                       \
-        YY_LESS_LINENO(yyless_macro_arg);                                 \
-        *yy_cp = yyg->yy_hold_char;                                       \
-        YY_RESTORE_YY_MORE_OFFSET                                         \
-        yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
-        YY_DO_BEFORE_ACTION; /* set up yytext again */                    \
-    } while (0)
-#define unput(c) yyunput(c, yyg->yytext_ptr, yyscanner)
-
-#ifndef YY_STRUCT_YY_BUFFER_STATE
-#    define YY_STRUCT_YY_BUFFER_STATE
-struct yy_buffer_state
-{
-    FILE *yy_input_file;
-
-    char *yy_ch_buf;  /* input buffer */
-    char *yy_buf_pos; /* current position in input buffer */
-
-    /* Size of input buffer in bytes, not including room for EOB
-     * characters.
-     */
-    int yy_buf_size;
-
-    /* Number of characters read into yy_ch_buf, not including EOB
-     * characters.
-     */
-    int yy_n_chars;
-
-    /* Whether we "own" the buffer - i.e., we know we created it,
-     * and can realloc() it to grow it, and should free() it to
-     * delete it.
-     */
-    int yy_is_our_buffer;
-
-    /* Whether this is an "interactive" input source; if so, and
-     * if we're using stdio for input, then we want to use getc()
-     * instead of fread(), to make sure we stop fetching input after
-     * each newline.
-     */
-    int yy_is_interactive;
-
-    /* Whether we're considered to be at the beginning of a line.
-     * If so, '^' rules will be active on the next match, otherwise
-     * not.
-     */
-    int yy_at_bol;
-
-    int yy_bs_lineno; /**< The line count. */
-    int yy_bs_column; /**< The column count. */
-
-    /* Whether to try to fill the input buffer when we reach the
-     * end of it.
-     */
-    int yy_fill_buffer;
-
-    int yy_buffer_status;
-
-#    define YY_BUFFER_NEW 0
-#    define YY_BUFFER_NORMAL 1
-    /* When an EOF's been seen but there's still some text to process
-     * then we mark the buffer as YY_EOF_PENDING, to indicate that we
-     * shouldn't try reading from the input source any more.  We might
-     * still have a bunch of tokens to match, though, because of
-     * possible backing-up.
-     *
-     * When we actually see the EOF, we change the status to "new"
-     * (via yyrestart()), so that the user can continue scanning by
-     * just pointing yyin at a new input file.
-     */
-#    define YY_BUFFER_EOF_PENDING 2
-};
-#endif /* !YY_STRUCT_YY_BUFFER_STATE */
-
-/* We provide macros for accessing buffer states in case in the
- * future we want to put the buffer states in a more general
- * "scanner state".
- *
- * Returns the top of the stack, or NULL.
- */
-#define YY_CURRENT_BUFFER \
-    (yyg->yy_buffer_stack ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] : NULL)
-/* Same as previous macro, but useful when we know that the buffer stack is not
- * NULL or when we need an lvalue. For internal use only.
- */
-#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
-
-void yyrestart(FILE *input_file, yyscan_t yyscanner);
-void yy_switch_to_buffer(YY_BUFFER_STATE new_buffer, yyscan_t yyscanner);
-YY_BUFFER_STATE yy_create_buffer(FILE *file, int size, yyscan_t yyscanner);
-void yy_delete_buffer(YY_BUFFER_STATE b, yyscan_t yyscanner);
-void yy_flush_buffer(YY_BUFFER_STATE b, yyscan_t yyscanner);
-void yypush_buffer_state(YY_BUFFER_STATE new_buffer, yyscan_t yyscanner);
-void yypop_buffer_state(yyscan_t yyscanner);
-
-static void yyensure_buffer_stack(yyscan_t yyscanner);
-static void yy_load_buffer_state(yyscan_t yyscanner);
-static void yy_init_buffer(YY_BUFFER_STATE b, FILE *file, yyscan_t yyscanner);
-#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER, yyscanner)
-
-YY_BUFFER_STATE yy_scan_buffer(char *base, yy_size_t size, yyscan_t yyscanner);
-YY_BUFFER_STATE yy_scan_string(const char *yy_str, yyscan_t yyscanner);
-YY_BUFFER_STATE yy_scan_bytes(const char *bytes, int len, yyscan_t yyscanner);
-
-void *yyalloc(yy_size_t, yyscan_t yyscanner);
-void *yyrealloc(void *, yy_size_t, yyscan_t yyscanner);
-void yyfree(void *, yyscan_t yyscanner);
-
-#define yy_new_buffer yy_create_buffer
-#define yy_set_interactive(is_interactive)                                             \
-    {                                                                                  \
-        if (!YY_CURRENT_BUFFER)                                                        \
-        {                                                                              \
-            yyensure_buffer_stack(yyscanner);                                          \
-            YY_CURRENT_BUFFER_LVALUE = yy_create_buffer(yyin, YY_BUF_SIZE, yyscanner); \
-        }                                                                              \
-        YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive;                  \
-    }
-#define yy_set_bol(at_bol)                                                             \
-    {                                                                                  \
-        if (!YY_CURRENT_BUFFER)                                                        \
-        {                                                                              \
-            yyensure_buffer_stack(yyscanner);                                          \
-            YY_CURRENT_BUFFER_LVALUE = yy_create_buffer(yyin, YY_BUF_SIZE, yyscanner); \
-        }                                                                              \
-        YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol;                                  \
-    }
-#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
-
-/* Begin user sect3 */
-
-#define ppwrap(yyscanner) (/*CONSTCOND*/ 1)
-#define YY_SKIP_YYWRAP
-typedef flex_uint8_t YY_CHAR;
-
-typedef int yy_state_type;
-
-#define yytext_ptr yytext_r
-
-static yy_state_type yy_get_previous_state(yyscan_t yyscanner);
-static yy_state_type yy_try_NUL_trans(yy_state_type current_state, yyscan_t yyscanner);
-static int yy_get_next_buffer(yyscan_t yyscanner);
-static void yynoreturn yy_fatal_error(const char *msg, yyscan_t yyscanner);
-
-/* Done after the current pattern has been matched and before the
- * corresponding action - sets up yytext.
- */
-#define YY_DO_BEFORE_ACTION                   \
-    yyg->yytext_ptr   = yy_bp;                \
-    yyleng            = (int)(yy_cp - yy_bp); \
-    yyg->yy_hold_char = *yy_cp;               \
-    *yy_cp            = '\0';                 \
-    yyg->yy_c_buf_p   = yy_cp;
-#define YY_NUM_RULES 37
-#define YY_END_OF_BUFFER 38
-/* This struct is not used in this scanner,
-   but its presence is necessary. */
-struct yy_trans_info
-{
-    flex_int32_t yy_verify;
-    flex_int32_t yy_nxt;
-};
-static const flex_int16_t yy_accept[95] = {
-    0,  0,  0,  0,  0,  38, 36, 34, 35, 35, 33, 7,  33, 33, 33, 33, 33, 33, 33, 33, 9, 9,  33, 33,
-    33, 8,  33, 33, 3,  5,  5,  4,  34, 35, 19, 27, 20, 30, 25, 12, 23, 13, 24, 10, 2, 1,  26, 10,
-    9,  11, 11, 11, 9,  11, 9,  9,  14, 16, 18, 17, 15, 8,  31, 21, 32, 22, 3,  5,  6, 11, 10, 11,
-    10, 1,  10, 11, 10, 0,  10, 9,  9,  9,  28, 29, 0,  10, 10, 10, 10, 9,  10, 10, 9, 10, 0
-
-};
-
-static const YY_CHAR yy_ec[256] = {
-    0,  1,  1,  1,  1,  1,  1,  1,  1,  2,  3,  2,  2,  4,  1,  1,  1,  1,  1,  1,  1,
-    1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  2,  5,  1,  6,  1,  7,  8,  1,  9,  9,
-    10, 11, 9,  12, 13, 14, 15, 16, 16, 16, 16, 16, 16, 16, 17, 17, 9,  9,  18, 19, 20,
-    9,  1,  21, 21, 21, 21, 22, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
-    24, 25, 24, 24, 26, 24, 24, 9,  1,  9,  27, 24, 1,  21, 21, 21, 21,
-
-    22, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 25, 24, 24, 26, 24,
-    24, 9,  28, 9,  9,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,
-    1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,
-    1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,
-    1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,
-
-    1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,
-    1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,
-    1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1};
-
-static const YY_CHAR yy_meta[29] = {0, 1, 1, 2, 2, 1, 1, 1, 1, 1, 3, 1, 1, 4, 1,
-                                    5, 5, 5, 1, 1, 1, 5, 5, 5, 5, 5, 5, 1, 1};
-
-static const flex_int16_t yy_base[100] = {
-    0,   0,   0,   26,  28,  133, 195, 130, 195, 128, 105, 195, 104, 25,  195, 100, 23,
-    27,  32,  31,  38,  50,  38,  93,  49,  0,   16,  51,  0,   195, 105, 87,  93,  195,
-    195, 195, 195, 195, 195, 195, 195, 195, 195, 67,  195, 0,   195, 81,  55,  84,  98,
-    110, 53,  61,  0,   52,  39,  195, 195, 195, 33,  0,   195, 195, 195, 195, 0,   195,
-    195, 113, 0,   126, 0,   0,   0,   133, 0,   56,  128, 0,   133, 0,   195, 195, 101,
-    141, 143, 145, 0,   15,  154, 195, 0,   195, 195, 177, 32,  182, 187, 189
-
-};
-
-static const flex_int16_t yy_def[100] = {
-    0,  94, 1,  95, 95, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    20, 94, 94, 94, 96, 94, 94, 97, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
-    94, 94, 94, 98, 94, 94, 20, 20, 49, 50, 50, 99, 21, 50, 94, 94, 94, 94, 94, 96, 94,
-    94, 94, 94, 97, 94, 94, 43, 43, 69, 69, 98, 47, 50, 50, 94, 51, 50, 99, 50, 94, 94,
-    94, 71, 75, 94, 50, 50, 94, 94, 50, 94, 0,  94, 94, 94, 94, 94
-
-};
-
-static const flex_int16_t yy_nxt[224] = {
-    0,  6,  7,  8,  9,  10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 21, 22, 23, 24, 25, 25,
-    25, 25, 25, 25, 26, 27, 29, 30, 29, 30, 36, 39, 62, 31, 61, 31, 41, 92, 44, 40, 63, 37, 45,
-    42, 43, 43, 43, 46, 47, 83, 48, 48, 49, 56, 57, 82, 50, 51, 50, 50, 52, 53, 54, 54, 54, 59,
-    60, 64, 87, 87, 87, 50, 55, 50, 81, 79, 65, 69, 50, 70, 70, 70, 50, 50, 50, 69, 71, 72, 69,
-    69, 69, 50, 32, 74, 74, 74, 49, 49,
-
-    68, 50, 75, 76, 50, 50, 50, 67, 50, 50, 50, 58, 50, 50, 50, 90, 90, 90, 38, 50, 77, 77, 35,
-    34, 78, 78, 78, 69, 69, 69, 33, 32, 94, 94, 69, 69, 84, 84, 94, 94, 85, 85, 85, 84, 84, 50,
-    94, 86, 86, 86, 88, 94, 94, 94, 94, 94, 50, 89, 50, 87, 87, 87, 94, 72, 94, 76, 94, 91, 90,
-    90, 90, 94, 94, 94, 94, 94, 93, 28, 28, 28, 28, 28, 66, 94, 94, 66, 66, 73, 94, 73, 73, 73,
-    80, 80, 5,  94, 94, 94, 94, 94,
-
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94};
-
-static const flex_int16_t yy_chk[224] = {
-    0,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,  1,
-    1,  1,  1,  1,  1,  1,  3,  3,  4,  4,  13, 16, 26, 3,  96, 4,  17, 89, 19, 16, 26, 13, 19,
-    17, 18, 18, 18, 19, 20, 60, 20, 20, 20, 22, 22, 56, 20, 20, 20, 20, 20, 20, 21, 21, 21, 24,
-    24, 27, 77, 77, 77, 53, 21, 21, 55, 52, 27, 43, 48, 43, 43, 43, 53, 53, 53, 43, 43, 43, 43,
-    43, 43, 47, 32, 47, 47, 47, 49, 49,
-
-    31, 47, 47, 47, 47, 47, 47, 30, 49, 49, 50, 23, 50, 50, 50, 84, 84, 84, 15, 50, 51, 51, 12,
-    10, 51, 51, 51, 69, 69, 69, 9,  7,  5,  0,  69, 69, 71, 71, 78, 78, 71, 71, 71, 75, 75, 80,
-    0,  75, 75, 75, 78, 85, 85, 86, 86, 0,  80, 80, 80, 87, 87, 87, 0,  85, 0,  86, 0,  87, 90,
-    90, 90, 0,  0,  0,  0,  0,  90, 95, 95, 95, 95, 95, 97, 0,  0,  97, 97, 98, 0,  98, 98, 98,
-    99, 99, 94, 94, 94, 94, 94, 94,
-
-    94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94};
-
-/* The intent behind this definition is that it'll catch
- * any uses of REJECT which flex missed.
- */
-#define REJECT reject_used_but_not_detected
-#define yymore() yymore_used_but_not_detected
-#define YY_MORE_ADJ 0
-#define YY_RESTORE_YY_MORE_OFFSET
-/*
-//
-// Copyright 2002 The ANGLE Project Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-
-This file contains the Lex specification for GLSL ES preprocessor.
-Based on Microsoft Visual Studio 2010 Preprocessor Grammar:
-http://msdn.microsoft.com/en-us/library/2scxys89.aspx
-
-IF YOU MODIFY THIS FILE YOU ALSO NEED TO RUN generate_parser.sh.
-*/
-
-#if defined(_MSC_VER)
-#    pragma warning(disable : 4005)
-#endif
-
-#include "compiler/preprocessor/Tokenizer.h"
-
-#include "compiler/preprocessor/DiagnosticsBase.h"
-#include "compiler/preprocessor/Token.h"
-
-#if defined(__GNUC__)
-// Triggered by the auto-generated yy_fatal_error function.
-#    pragma GCC diagnostic ignored "-Wmissing-noreturn"
-#elif defined(_MSC_VER)
-#    pragma warning(disable : 4244)
-#endif
-#if defined(__clang__)
-// Flex uses `/*FALLTHROUGH*/` instead of dedicated statements.
-#    pragma clang diagnostic ignored "-Wimplicit-fallthrough"
-#    if defined(__APPLE__)
-// Older clang versions don't have -Wextra-semi-stmt, and detecting Apple clang versions is
-// difficult because they use different yet overlapping version numbers vs. regular clang.
-#        pragma clang diagnostic ignored "-Wunknown-warning-option"
-#    endif
-// Flex isn't semi-colon clean.
-#    pragma clang diagnostic ignored "-Wextra-semi-stmt"
-#    pragma clang diagnostic ignored "-Wunreachable-code"
-#endif
-
-// Workaround for flex using the register keyword, deprecated in C++11.
-#ifdef __cplusplus
-#    if __cplusplus > 199711L
-#        define register
-#    endif
-#endif
-
-typedef std::string YYSTYPE;
-typedef angle::pp::SourceLocation YYLTYPE;
-
-// Use the unused yycolumn variable to track file (string) number.
-#define yyfileno yycolumn
-
-#define YY_USER_INIT                   \
-    do                                 \
-    {                                  \
-        yyfileno              = 0;     \
-        yylineno              = 1;     \
-        yyextra->leadingSpace = false; \
-        yyextra->lineStart    = true;  \
-    } while (0);
-
-#define YY_NO_INPUT
-#define YY_USER_ACTION                                              \
-    do                                                              \
-    {                                                               \
-        angle::pp::Input *input             = &yyextra->input;      \
-        angle::pp::Input::Location *scanLoc = &yyextra->scanLoc;    \
-        while ((scanLoc->sIndex < input->count()) &&                \
-               (scanLoc->cIndex >= input->length(scanLoc->sIndex))) \
-        {                                                           \
-            scanLoc->cIndex -= input->length(scanLoc->sIndex++);    \
-            ++yyfileno;                                             \
-            yylineno = 1;                                           \
-        }                                                           \
-        yylloc->file = yyfileno;                                    \
-        yylloc->line = yylineno;                                    \
-        scanLoc->cIndex += yyleng;                                  \
-    } while (0);
-
-#define YY_INPUT(buf, result, maxSize) result = yyextra->input.read(buf, maxSize, &yylineno);
-
-#define INITIAL 0
-#define COMMENT 1
-
-#define YY_EXTRA_TYPE angle::pp::Tokenizer::Context *
-
-/* Holds the entire state of the reentrant scanner. */
-struct yyguts_t
-{
-
-    /* User-defined. Not touched by flex. */
-    YY_EXTRA_TYPE yyextra_r;
-
-    /* The rest are the same as the globals declared in the non-reentrant scanner. */
-    FILE *yyin_r, *yyout_r;
-    size_t yy_buffer_stack_top;       /**< index of top of stack. */
-    size_t yy_buffer_stack_max;       /**< capacity of stack. */
-    YY_BUFFER_STATE *yy_buffer_stack; /**< Stack as an array. */
-    char yy_hold_char;
-    int yy_n_chars;
-    int yyleng_r;
-    char *yy_c_buf_p;
-    int yy_init;
-    int yy_start;
-    int yy_did_buffer_switch_on_eof;
-    int yy_start_stack_ptr;
-    int yy_start_stack_depth;
-    int *yy_start_stack;
-    yy_state_type yy_last_accepting_state;
-    char *yy_last_accepting_cpos;
-
-    int yylineno_r;
-    int yy_flex_debug_r;
-
-    char *yytext_r;
-    int yy_more_flag;
-    int yy_more_len;
-
-    YYSTYPE *yylval_r;
-
-    YYLTYPE *yylloc_r;
-
-}; /* end struct yyguts_t */
-
-static int yy_init_globals(yyscan_t yyscanner);
-
-/* This must go here because YYSTYPE and YYLTYPE are included
- * from bison output in section 1.*/
-#define yylval yyg->yylval_r
-
-#define yylloc yyg->yylloc_r
-
-int yylex_init(yyscan_t *scanner);
-
-int yylex_init_extra(YY_EXTRA_TYPE user_defined, yyscan_t *scanner);
-
-/* Accessor methods to globals.
-   These are made visible to non-reentrant scanners for convenience. */
-
-int yylex_destroy(yyscan_t yyscanner);
-
-int yyget_debug(yyscan_t yyscanner);
-
-void yyset_debug(int debug_flag, yyscan_t yyscanner);
-
-YY_EXTRA_TYPE yyget_extra(yyscan_t yyscanner);
-
-void yyset_extra(YY_EXTRA_TYPE user_defined, yyscan_t yyscanner);
-
-FILE *yyget_in(yyscan_t yyscanner);
-
-void yyset_in(FILE *_in_str, yyscan_t yyscanner);
-
-FILE *yyget_out(yyscan_t yyscanner);
-
-void yyset_out(FILE *_out_str, yyscan_t yyscanner);
-
-int yyget_leng(yyscan_t yyscanner);
-
-char *yyget_text(yyscan_t yyscanner);
-
-int yyget_lineno(yyscan_t yyscanner);
-
-void yyset_lineno(int _line_number, yyscan_t yyscanner);
-
-int yyget_column(yyscan_t yyscanner);
-
-void yyset_column(int _column_no, yyscan_t yyscanner);
-
-YYSTYPE *yyget_lval(yyscan_t yyscanner);
-
-void yyset_lval(YYSTYPE *yylval_param, yyscan_t yyscanner);
-
-YYLTYPE *yyget_lloc(yyscan_t yyscanner);
-
-void yyset_lloc(YYLTYPE *yylloc_param, yyscan_t yyscanner);
-
-/* Macros after this point can all be overridden by user definitions in
- * section 1.
- */
-
-#ifndef YY_SKIP_YYWRAP
-#    ifdef __cplusplus
-extern "C" int yywrap(yyscan_t yyscanner);
-#    else
-extern int yywrap(yyscan_t yyscanner);
-#    endif
-#endif
-
-#ifndef YY_NO_UNPUT
-
-#endif
-
-#ifndef yytext_ptr
-static void yy_flex_strncpy(char *, const char *, int, yyscan_t yyscanner);
-#endif
-
-#ifdef YY_NEED_STRLEN
-static int yy_flex_strlen(const char *, yyscan_t yyscanner);
-#endif
-
-#ifndef YY_NO_INPUT
-#    ifdef __cplusplus
-static int yyinput(yyscan_t yyscanner);
-#    else
-static int input(yyscan_t yyscanner);
-#    endif
-
-#endif
-
-/* Amount of stuff to slurp up with each read. */
-#ifndef YY_READ_BUF_SIZE
-#    ifdef __ia64__
-/* On IA-64, the buffer size is 16k, not 8k */
-#        define YY_READ_BUF_SIZE 16384
-#    else
-#        define YY_READ_BUF_SIZE 8192
-#    endif /* __ia64__ */
-#endif
-
-/* Copy whatever the last rule matched to the standard output. */
-#ifndef ECHO
-/* This used to be an fputs(), but since the string might contain NUL's,
- * we now use fwrite().
- */
-#    define ECHO                                          \
-        do                                                \
-        {                                                 \
-            if (fwrite(yytext, (size_t)yyleng, 1, yyout)) \
-            {                                             \
-            }                                             \
-        } while (0)
-#endif
-
-/* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
- * is returned in "result".
- */
-#ifndef YY_INPUT
-#    define YY_INPUT(buf, result, max_size)                                                       \
-        if (YY_CURRENT_BUFFER_LVALUE->yy_is_interactive)                                          \
-        {                                                                                         \
-            int c = '*';                                                                          \
-            int n;                                                                                \
-            for (n = 0; n < max_size && (c = getc(yyin)) != EOF && c != '\n'; ++n)                \
-                buf[n] = (char)c;                                                                 \
-            if (c == '\n')                                                                        \
-                buf[n++] = (char)c;                                                               \
-            if (c == EOF && ferror(yyin))                                                         \
-                YY_FATAL_ERROR("input in flex scanner failed");                                   \
-            result = n;                                                                           \
-        }                                                                                         \
-        else                                                                                      \
-        {                                                                                         \
-            errno = 0;                                                                            \
-            while ((result = (int)fread(buf, 1, (yy_size_t)max_size, yyin)) == 0 && ferror(yyin)) \
-            {                                                                                     \
-                if (errno != EINTR)                                                               \
-                {                                                                                 \
-                    YY_FATAL_ERROR("input in flex scanner failed");                               \
-                    break;                                                                        \
-                }                                                                                 \
-                errno = 0;                                                                        \
-                clearerr(yyin);                                                                   \
-            }                                                                                     \
-        }
-
-#endif
-
-/* No semi-colon after return; correct usage is to write "yyterminate();" -
- * we don't want an extra ';' after the "return" because that will cause
- * some compilers to complain about unreachable statements.
- */
-#ifndef yyterminate
-#    define yyterminate() return YY_NULL
-#endif
-
-/* Number of entries by which start-condition stack grows. */
-#ifndef YY_START_STACK_INCR
-#    define YY_START_STACK_INCR 25
-#endif
-
-/* Report a fatal error. */
-#ifndef YY_FATAL_ERROR
-#    define YY_FATAL_ERROR(msg) yy_fatal_error(msg, yyscanner)
-#endif
-
-/* end tables serialization structures and prototypes */
-
-/* Default declaration of generated scanner - a define so the user can
- * easily add parameters.
- */
-#ifndef YY_DECL
-#    define YY_DECL_IS_OURS 1
-
-extern int yylex(YYSTYPE *yylval_param, YYLTYPE *yylloc_param, yyscan_t yyscanner);
-
-#    define YY_DECL int yylex(YYSTYPE *yylval_param, YYLTYPE *yylloc_param, yyscan_t yyscanner)
-#endif /* !YY_DECL */
-
-/* Code executed at the beginning of each rule, after yytext and yyleng
- * have been set up.
- */
-#ifndef YY_USER_ACTION
-#    define YY_USER_ACTION
-#endif
-
-/* Code executed at the end of each rule. */
-#ifndef YY_BREAK
-#    define YY_BREAK /*LINTED*/ break;
-#endif
-
-#define YY_RULE_SETUP YY_USER_ACTION
-
-/** The main scanner function which does all the work.
- */
-YY_DECL
-{
-    yy_state_type yy_current_state;
-    char *yy_cp, *yy_bp;
-    int yy_act;
-    struct yyguts_t *yyg = (struct yyguts_t *)yyscanner;
-
-    yylval = yylval_param;
-
-    yylloc = yylloc_param;
-
-    if (!yyg->yy_init)
-    {
-        yyg->yy_init = 1;
-
-#ifdef YY_USER_INIT
-        YY_USER_INIT;
-#endif
-
-        if (!yyg->yy_start)
-            yyg->yy_start = 1; /* first start state */
-
-        if (!yyin)
-            yyin = stdin;
-
-        if (!yyout)
-            yyout = stdout;
-
-        if (!YY_CURRENT_BUFFER)
-        {
-            yyensure_buffer_stack(yyscanner);
-            YY_CURRENT_BUFFER_LVALUE = yy_create_buffer(yyin, YY_BUF_SIZE, yyscanner);
-        }
-
-        yy_load_buffer_state(yyscanner);
-    }
-
-    {
-
-        /* Line comment */
-
-        while (/*CONSTCOND*/ 1) /* loops until end-of-file is reached */
-        {
-            yy_cp = yyg->yy_c_buf_p;
-
-            /* Support of yytext. */
-            *yy_cp = yyg->yy_hold_char;
-
-            /* yy_bp points to the position in yy_ch_buf of the start of
-             * the current run.
-             */
-            yy_bp = yy_cp;
-
-            yy_current_state = yyg->yy_start;
-        yy_match:
-            do
-            {
-                YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
-                if (yy_accept[yy_current_state])
-                {
-                    yyg->yy_last_accepting_state = yy_current_state;
-                    yyg->yy_last_accepting_cpos  = yy_cp;
-                }
-                while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state)
-                {
-                    yy_current_state = (int)yy_def[yy_current_state];
-                    if (yy_current_state >= 95)
-                        yy_c = yy_meta[yy_c];
-                }
-                yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
-                ++yy_cp;
-            } while (yy_current_state != 94);
-            yy_cp            = yyg->yy_last_accepting_cpos;
-            yy_current_state = yyg->yy_last_accepting_state;
-
-        yy_find_action:
-            yy_act = yy_accept[yy_current_state];
-
-            YY_DO_BEFORE_ACTION;
-
-        do_action: /* This label is used only to access EOF actions. */
-
-            switch (yy_act)
-            {           /* beginning of action switch */
-                case 0: /* must back up */
-                    /* undo the effects of YY_DO_BEFORE_ACTION */
-                    *yy_cp           = yyg->yy_hold_char;
-                    yy_cp            = yyg->yy_last_accepting_cpos;
-                    yy_current_state = yyg->yy_last_accepting_state;
-                    goto yy_find_action;
-
-                case 1:
-                    YY_RULE_SETUP
-
-                    YY_BREAK
-                /* Block comment */
-                /* Line breaks are just counted - not returned. */
-                /* The comment is replaced by a single space. */
-                case 2:
-                    YY_RULE_SETUP { BEGIN(COMMENT); }
-                    YY_BREAK
-                case 3:
-                    YY_RULE_SETUP
-
-                    YY_BREAK
-                case 4:
-                    YY_RULE_SETUP
-
-                    YY_BREAK
-                case 5:
-                    /* rule 5 can match eol */
-                    YY_RULE_SETUP
-                    {
-                        if (yylineno == INT_MAX)
-                        {
-                            *yylval = "Integer overflow on line number";
-                            return angle::pp::Token::GOT_ERROR;
-                        }
-                        ++yylineno;
-                    }
-                    YY_BREAK
-                case 6:
-                    YY_RULE_SETUP
-                    {
-                        yyextra->leadingSpace = true;
-                        BEGIN(INITIAL);
-                    }
-                    YY_BREAK
-                case 7:
-                    YY_RULE_SETUP
-                    {
-                        // # is only valid at start of line for preprocessor directives.
-                        yylval->assign(1, yytext[0]);
-                        return yyextra->lineStart ? angle::pp::Token::PP_HASH
-                                                  : angle::pp::Token::PP_OTHER;
-                    }
-                    YY_BREAK
-                case 8:
-                    YY_RULE_SETUP
-                    {
-                        yylval->assign(yytext, yyleng);
-                        return angle::pp::Token::IDENTIFIER;
-                    }
-                    YY_BREAK
-                case 9:
-                    YY_RULE_SETUP
-                    {
-                        yylval->assign(yytext, yyleng);
-                        return angle::pp::Token::CONST_INT;
-                    }
-                    YY_BREAK
-                case 10:
-                    YY_RULE_SETUP
-                    {
-                        yylval->assign(yytext, yyleng);
-                        return angle::pp::Token::CONST_FLOAT;
-                    }
-                    YY_BREAK
-                /* Anything that starts with a {DIGIT} or .{DIGIT} must be a number. */
-                /* Rule to catch all invalid integers and floats. */
-                case 11:
-                    YY_RULE_SETUP
-                    {
-                        yylval->assign(yytext, yyleng);
-                        return angle::pp::Token::PP_NUMBER;
-                    }
-                    YY_BREAK
-                case 12:
-                    YY_RULE_SETUP
-                    {
-                        yylval->assign(yytext, yyleng);
-                        return angle::pp::Token::OP_INC;
-                    }
-                    YY_BREAK
-                case 13:
-                    YY_RULE_SETUP
-                    {
-                        yylval->assign(yytext, yyleng);
-                        return angle::pp::Token::OP_DEC;
-                    }
-                    YY_BREAK
-                case 14:
-                    YY_RULE_SETUP
-                    {
-                        yylval->assign(yytext, yyleng);
-                        return angle::pp::Token::OP_LEFT;
-                    }
-                    YY_BREAK
-                case 15:
-                    YY_RULE_SETUP
-                    {
-                        yylval->assign(yytext, yyleng);
-                        return angle::pp::Token::OP_RIGHT;
-                    }
-                    YY_BREAK
-                case 16:
-                    YY_RULE_SETUP
-                    {
-                        yylval->assign(yytext, yyleng);
-                        return angle::pp::Token::OP_LE;
-                    }
-                    YY_BREAK
-                case 17:
-                    YY_RULE_SETUP
-                    {
-                        yylval->assign(yytext, yyleng);
-                        return angle::pp::Token::OP_GE;
-                    }
-                    YY_BREAK
-                case 18:
-                    YY_RULE_SETUP
-                    {
-                        yylval->assign(yytext, yyleng);
-                        return angle::pp::Token::OP_EQ;
-                    }
-                    YY_BREAK
-                case 19:
-                    YY_RULE_SETUP
-                    {
-                        yylval->assign(yytext, yyleng);
-                        return angle::pp::Token::OP_NE;
-                    }
-                    YY_BREAK
-                case 20:
-                    YY_RULE_SETUP
-                    {
-                        yylval->assign(yytext, yyleng);
-                        return angle::pp::Token::OP_AND;
-                    }
-                    YY_BREAK
-                case 21:
-                    YY_RULE_SETUP
-                    {
-                        yylval->assign(yytext, yyleng);
-                        return angle::pp::Token::OP_XOR;
-                    }
-                    YY_BREAK
-                case 22:
-                    YY_RULE_SETUP
-                    {
-                        yylval->assign(yytext, yyleng);
-                        return angle::pp::Token::OP_OR;
-                    }
-                    YY_BREAK
-                case 23:
-                    YY_RULE_SETUP
-                    {
-                        yylval->assign(yytext, yyleng);
-                        return angle::pp::Token::OP_ADD_ASSIGN;
-                    }
-                    YY_BREAK
-                case 24:
-                    YY_RULE_SETUP
-                    {
-                        yylval->assign(yytext, yyleng);
-                        return angle::pp::Token::OP_SUB_ASSIGN;
-                    }
-                    YY_BREAK
-                case 25:
-                    YY_RULE_SETUP
-                    {
-                        yylval->assign(yytext, yyleng);
-                        return angle::pp::Token::OP_MUL_ASSIGN;
-                    }
-                    YY_BREAK
-                case 26:
-                    YY_RULE_SETUP
-                    {
-                        yylval->assign(yytext, yyleng);
-                        return angle::pp::Token::OP_DIV_ASSIGN;
-                    }
-                    YY_BREAK
-                case 27:
-                    YY_RULE_SETUP
-                    {
-                        yylval->assign(yytext, yyleng);
-                        return angle::pp::Token::OP_MOD_ASSIGN;
-                    }
-                    YY_BREAK
-                case 28:
-                    YY_RULE_SETUP
-                    {
-                        yylval->assign(yytext, yyleng);
-                        return angle::pp::Token::OP_LEFT_ASSIGN;
-                    }
-                    YY_BREAK
-                case 29:
-                    YY_RULE_SETUP
-                    {
-                        yylval->assign(yytext, yyleng);
-                        return angle::pp::Token::OP_RIGHT_ASSIGN;
-                    }
-                    YY_BREAK
-                case 30:
-                    YY_RULE_SETUP
-                    {
-                        yylval->assign(yytext, yyleng);
-                        return angle::pp::Token::OP_AND_ASSIGN;
-                    }
-                    YY_BREAK
-                case 31:
-                    YY_RULE_SETUP
-                    {
-                        yylval->assign(yytext, yyleng);
-                        return angle::pp::Token::OP_XOR_ASSIGN;
-                    }
-                    YY_BREAK
-                case 32:
-                    YY_RULE_SETUP
-                    {
-                        yylval->assign(yytext, yyleng);
-                        return angle::pp::Token::OP_OR_ASSIGN;
-                    }
-                    YY_BREAK
-                case 33:
-                    YY_RULE_SETUP
-                    {
-                        yylval->assign(1, yytext[0]);
-                        return yytext[0];
-                    }
-                    YY_BREAK
-                case 34:
-                    YY_RULE_SETUP { yyextra->leadingSpace = true; }
-                    YY_BREAK
-                case 35:
-                    /* rule 35 can match eol */
-                    YY_RULE_SETUP
-                    {
-                        if (yylineno == INT_MAX)
-                        {
-                            *yylval = "Integer overflow on line number";
-                            return angle::pp::Token::GOT_ERROR;
-                        }
-                        ++yylineno;
-                        yylval->assign(1, '\n');
-                        return '\n';
-                    }
-                    YY_BREAK
-                case 36:
-                    YY_RULE_SETUP
-                    {
-                        yylval->assign(1, yytext[0]);
-                        return angle::pp::Token::PP_OTHER;
-                    }
-                    YY_BREAK
-                case YY_STATE_EOF(INITIAL):
-                case YY_STATE_EOF(COMMENT):
-                {
-                    // YY_USER_ACTION is not invoked for handling EOF.
-                    // Set the location for EOF token manually.
-                    angle::pp::Input *input             = &yyextra->input;
-                    angle::pp::Input::Location *scanLoc = &yyextra->scanLoc;
-                    yy_size_t sIndexMax                 = input->count() ? input->count() - 1 : 0;
-                    if (scanLoc->sIndex != sIndexMax)
-                    {
-                        // We can only reach here if there are empty strings at the
-                        // end of the input.
-                        scanLoc->sIndex = sIndexMax;
-                        scanLoc->cIndex = 0;
-                        // FIXME: this is not 64-bit clean.
-                        yyfileno = static_cast<int>(sIndexMax);
-                        yylineno = 1;
-                    }
-                    yylloc->file = yyfileno;
-                    yylloc->line = yylineno;
-                    yylval->clear();
-
-                    // Line number overflows fake EOFs to exit early, check for this case.
-                    if (yylineno == INT_MAX)
-                    {
-                        yyextra->diagnostics->report(angle::pp::Diagnostics::PP_TOKENIZER_ERROR,
-                                                     angle::pp::SourceLocation(yyfileno, yylineno),
-                                                     "Integer overflow on line number");
-                    }
-                    else if (YY_START == COMMENT)
-                    {
-                        yyextra->diagnostics->report(angle::pp::Diagnostics::PP_EOF_IN_COMMENT,
-                                                     angle::pp::SourceLocation(yyfileno, yylineno),
-                                                     "EOF while in a comment");
-                    }
-                    yyterminate();
-                }
-                    YY_BREAK
-                case 37:
-                    YY_RULE_SETUP
-                    ECHO;
-                    YY_BREAK
-
-                case YY_END_OF_BUFFER:
-                {
-                    /* Amount of text matched not including the EOB char. */
-                    int yy_amount_of_matched_text = (int)(yy_cp - yyg->yytext_ptr) - 1;
-
-                    /* Undo the effects of YY_DO_BEFORE_ACTION. */
-                    *yy_cp = yyg->yy_hold_char;
-                    YY_RESTORE_YY_MORE_OFFSET
-
-                    if (YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW)
-                    {
-                        /* We're scanning a new file or input source.  It's
-                         * possible that this happened because the user
-                         * just pointed yyin at a new source and called
-                         * yylex().  If so, then we have to assure
-                         * consistency between YY_CURRENT_BUFFER and our
-                         * globals.  Here is the right place to do so, because
-                         * this is the first action (other than possibly a
-                         * back-up) that will match for the new input source.
-                         */
-                        yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
-                        YY_CURRENT_BUFFER_LVALUE->yy_input_file    = yyin;
-                        YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
-                    }
-
-                    /* Note that here we test for yy_c_buf_p "<=" to the position
-                     * of the first EOB in the buffer, since yy_c_buf_p will
-                     * already have been incremented past the NUL character
-                     * (since all states make transitions on EOB to the
-                     * end-of-buffer state).  Contrast this with the test
-                     * in input().
-                     */
-                    if (yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars])
-                    { /* This was really a NUL. */
-                        yy_state_type yy_next_state;
-
-                        yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
-
-                        yy_current_state = yy_get_previous_state(yyscanner);
-
-                        /* Okay, we're now positioned to make the NUL
-                         * transition.  We couldn't have
-                         * yy_get_previous_state() go ahead and do it
-                         * for us because it doesn't know how to deal
-                         * with the possibility of jamming (and we don't
-                         * want to build jamming into it because then it
-                         * will run more slowly).
-                         */
-
-                        yy_next_state = yy_try_NUL_trans(yy_current_state, yyscanner);
-
-                        yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
-
-                        if (yy_next_state)
-                        {
-                            /* Consume the NUL. */
-                            yy_cp            = ++yyg->yy_c_buf_p;
-                            yy_current_state = yy_next_state;
-                            goto yy_match;
-                        }
-
-                        else
-                        {
-                            yy_cp            = yyg->yy_last_accepting_cpos;
-                            yy_current_state = yyg->yy_last_accepting_state;
-                            goto yy_find_action;
-                        }
-                    }
-
-                    else
-                        switch (yy_get_next_buffer(yyscanner))
-                        {
-                            case EOB_ACT_END_OF_FILE:
-                            {
-                                yyg->yy_did_buffer_switch_on_eof = 0;
-
-                                if (yywrap(yyscanner))
-                                {
-                                    /* Note: because we've taken care in
-                                     * yy_get_next_buffer() to have set up
-                                     * yytext, we can now set up
-                                     * yy_c_buf_p so that if some total
-                                     * hoser (like flex itself) wants to
-                                     * call the scanner after we return the
-                                     * YY_NULL, it'll still work - another
-                                     * YY_NULL will get returned.
-                                     */
-                                    yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
-
-                                    yy_act = YY_STATE_EOF(YY_START);
-                                    goto do_action;
-                                }
-
-                                else
-                                {
-                                    if (!yyg->yy_did_buffer_switch_on_eof)
-                                        YY_NEW_FILE;
-                                }
-                                break;
-                            }
-
-                            case EOB_ACT_CONTINUE_SCAN:
-                                yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
-
-                                yy_current_state = yy_get_previous_state(yyscanner);
-
-                                yy_cp = yyg->yy_c_buf_p;
-                                yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
-                                goto yy_match;
-
-                            case EOB_ACT_LAST_MATCH:
-                                yyg->yy_c_buf_p =
-                                    &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
-
-                                yy_current_state = yy_get_previous_state(yyscanner);
-
-                                yy_cp = yyg->yy_c_buf_p;
-                                yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
-                                goto yy_find_action;
-                        }
-                    break;
-                }
-
-                default:
-                    YY_FATAL_ERROR("fatal flex scanner internal error--no action found");
-            } /* end of action switch */
-        }     /* end of scanning one token */
-    }         /* end of user's declarations */
-} /* end of yylex */
-
-/* yy_get_next_buffer - try to read in a new buffer
- *
- * Returns a code representing an action:
- *	EOB_ACT_LAST_MATCH -
- *	EOB_ACT_CONTINUE_SCAN - continue scanning from current position
- *	EOB_ACT_END_OF_FILE - end of file
- */
-static int yy_get_next_buffer(yyscan_t yyscanner)
-{
-    struct yyguts_t *yyg = (struct yyguts_t *)yyscanner;
-    char *dest           = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
-    char *source         = yyg->yytext_ptr;
-    int number_to_move, i;
-    int ret_val;
-
-    if (yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1])
-        YY_FATAL_ERROR("fatal flex scanner internal error--end of buffer missed");
-
-    if (YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0)
-    { /* Don't try to fill the buffer, so this is an EOF. */
-        if (yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1)
-        {
-            /* We matched a single character, the EOB, so
-             * treat this as a final EOF.
-             */
-            return EOB_ACT_END_OF_FILE;
-        }
-
-        else
-        {
-            /* We matched some text prior to the EOB, first
-             * process it.
-             */
-            return EOB_ACT_LAST_MATCH;
-        }
-    }
-
-    /* Try to read more data. */
-
-    /* First move last chars to start of buffer. */
-    number_to_move = (int)(yyg->yy_c_buf_p - yyg->yytext_ptr - 1);
-
-    for (i = 0; i < number_to_move; ++i)
-        *(dest++) = *(source++);
-
-    if (YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING)
-        /* don't do the read, it's not guaranteed to return an EOF,
-         * just force an EOF
-         */
-        YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
-
-    else
-    {
-        int num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
-
-        while (num_to_read <= 0)
-        { /* Not enough room in the buffer - grow it. */
-
-            /* just a shorter name for the current buffer */
-            YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
-
-            int yy_c_buf_p_offset = (int)(yyg->yy_c_buf_p - b->yy_ch_buf);
-
-            if (b->yy_is_our_buffer)
-            {
-                int new_size = b->yy_buf_size * 2;
-
-                if (new_size <= 0)
-                    b->yy_buf_size += b->yy_buf_size / 8;
-                else
-                    b->yy_buf_size *= 2;
-
-                b->yy_ch_buf = (char *)
-                    /* Include room in for 2 EOB chars. */
-                    yyrealloc((void *)b->yy_ch_buf, (yy_size_t)(b->yy_buf_size + 2), yyscanner);
-            }
-            else
-                /* Can't grow it, we don't own it. */
-                b->yy_ch_buf = NULL;
-
-            if (!b->yy_ch_buf)
-                YY_FATAL_ERROR("fatal error - scanner input buffer overflow");
-
-            yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
-
-            num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
-        }
-
-        if (num_to_read > YY_READ_BUF_SIZE)
-            num_to_read = YY_READ_BUF_SIZE;
-
-        /* Read in more data. */
-        yy_size_t ret = 0;
-        YY_INPUT((&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), ret, num_to_read);
-        yyg->yy_n_chars = static_cast<int>(ret);
-
-        YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
-    }
-
-    if (yyg->yy_n_chars == 0)
-    {
-        if (number_to_move == YY_MORE_ADJ)
-        {
-            ret_val = EOB_ACT_END_OF_FILE;
-            yyrestart(yyin, yyscanner);
-        }
-
-        else
-        {
-            ret_val                                    = EOB_ACT_LAST_MATCH;
-            YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_EOF_PENDING;
-        }
-    }
-
-    else
-        ret_val = EOB_ACT_CONTINUE_SCAN;
-
-    if ((yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size)
-    {
-        /* Extend the array by 50%, plus the number we really need. */
-        int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
-        YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *)yyrealloc(
-            (void *)YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t)new_size, yyscanner);
-        if (!YY_CURRENT_BUFFER_LVALUE->yy_ch_buf)
-            YY_FATAL_ERROR("out of dynamic memory in yy_get_next_buffer()");
-        /* "- 2" to take care of EOB's */
-        YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int)(new_size - 2);
-    }
-
-    yyg->yy_n_chars += number_to_move;
-    YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars]     = YY_END_OF_BUFFER_CHAR;
-    YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
-
-    yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
-
-    return ret_val;
-}
-
-/* yy_get_previous_state - get the state just before the EOB char was reached */
-
-static yy_state_type yy_get_previous_state(yyscan_t yyscanner)
-{
-    yy_state_type yy_current_state;
-    char *yy_cp;
-    struct yyguts_t *yyg = (struct yyguts_t *)yyscanner;
-
-    yy_current_state = yyg->yy_start;
-
-    for (yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp)
-    {
-        YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
-        if (yy_accept[yy_current_state])
-        {
-            yyg->yy_last_accepting_state = yy_current_state;
-            yyg->yy_last_accepting_cpos  = yy_cp;
-        }
-        while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state)
-        {
-            yy_current_state = (int)yy_def[yy_current_state];
-            if (yy_current_state >= 95)
-                yy_c = yy_meta[yy_c];
-        }
-        yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
-    }
-
-    return yy_current_state;
-}
-
-/* yy_try_NUL_trans - try to make a transition on the NUL character
- *
- * synopsis
- *	next_state = yy_try_NUL_trans( current_state );
- */
-static yy_state_type yy_try_NUL_trans(yy_state_type yy_current_state, yyscan_t yyscanner)
-{
-    int yy_is_jam;
-    struct yyguts_t *yyg =
-        (struct yyguts_t *)yyscanner; /* This var may be unused depending upon options. */
-    char *yy_cp = yyg->yy_c_buf_p;
-
-    YY_CHAR yy_c = 1;
-    if (yy_accept[yy_current_state])
-    {
-        yyg->yy_last_accepting_state = yy_current_state;
-        yyg->yy_last_accepting_cpos  = yy_cp;
-    }
-    while (yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state)
-    {
-        yy_current_state = (int)yy_def[yy_current_state];
-        if (yy_current_state >= 95)
-            yy_c = yy_meta[yy_c];
-    }
-    yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
-    yy_is_jam        = (yy_current_state == 94);
-
-    (void)yyg;
-    return yy_is_jam ? 0 : yy_current_state;
-}
-
-#ifndef YY_NO_UNPUT
-
-#endif
-
-#ifndef YY_NO_INPUT
-#    ifdef __cplusplus
-static int yyinput(yyscan_t yyscanner)
-#    else
-static int input(yyscan_t yyscanner)
-#    endif
-
-{
-    int c;
-    struct yyguts_t *yyg = (struct yyguts_t *)yyscanner;
-
-    *yyg->yy_c_buf_p = yyg->yy_hold_char;
-
-    if (*yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR)
-    {
-        /* yy_c_buf_p now points to the character we want to return.
-         * If this occurs *before* the EOB characters, then it's a
-         * valid NUL; if not, then we've hit the end of the buffer.
-         */
-        if (yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars])
-            /* This was really a NUL. */
-            *yyg->yy_c_buf_p = '\0';
-
-        else
-        { /* need more input */
-            int offset = (int)(yyg->yy_c_buf_p - yyg->yytext_ptr);
-            ++yyg->yy_c_buf_p;
-
-            switch (yy_get_next_buffer(yyscanner))
-            {
-                case EOB_ACT_LAST_MATCH:
-                    /* This happens because yy_g_n_b()
-                     * sees that we've accumulated a
-                     * token and flags that we need to
-                     * try matching the token before
-                     * proceeding.  But for input(),
-                     * there's no matching to consider.
-                     * So convert the EOB_ACT_LAST_MATCH
-                     * to EOB_ACT_END_OF_FILE.
-                     */
-
-                    /* Reset buffer status. */
-                    yyrestart(yyin, yyscanner);
-
-                    /*FALLTHROUGH*/
-
-                case EOB_ACT_END_OF_FILE:
-                {
-                    if (yywrap(yyscanner))
-                        return 0;
-
-                    if (!yyg->yy_did_buffer_switch_on_eof)
-                        YY_NEW_FILE;
-#    ifdef __cplusplus
-                    return yyinput(yyscanner);
-#    else
-                    return input(yyscanner);
-#    endif
-                }
-
-                case EOB_ACT_CONTINUE_SCAN:
-                    yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
-                    break;
-            }
-        }
-    }
-
-    c                 = *(unsigned char *)yyg->yy_c_buf_p; /* cast for 8-bit char's */
-    *yyg->yy_c_buf_p  = '\0';                              /* preserve yytext */
-    yyg->yy_hold_char = *++yyg->yy_c_buf_p;
-
-    return c;
-}
-#endif /* ifndef YY_NO_INPUT */
-
-/** Immediately switch to a different input stream.
- * @param input_file A readable stream.
- * @param yyscanner The scanner object.
- * @note This function does not reset the start condition to @c INITIAL .
- */
-void yyrestart(FILE *input_file, yyscan_t yyscanner)
-{
-    struct yyguts_t *yyg = (struct yyguts_t *)yyscanner;
-
-    if (!YY_CURRENT_BUFFER)
-    {
-        yyensure_buffer_stack(yyscanner);
-        YY_CURRENT_BUFFER_LVALUE = yy_create_buffer(yyin, YY_BUF_SIZE, yyscanner);
-    }
-
-    yy_init_buffer(YY_CURRENT_BUFFER, input_file, yyscanner);
-    yy_load_buffer_state(yyscanner);
-}
-
-/** Switch to a different input buffer.
- * @param new_buffer The new input buffer.
- * @param yyscanner The scanner object.
- */
-void yy_switch_to_buffer(YY_BUFFER_STATE new_buffer, yyscan_t yyscanner)
-{
-    struct yyguts_t *yyg = (struct yyguts_t *)yyscanner;
-
-    /* TODO. We should be able to replace this entire function body
-     * with
-     *		yypop_buffer_state();
-     *		yypush_buffer_state(new_buffer);
-     */
-    yyensure_buffer_stack(yyscanner);
-    if (YY_CURRENT_BUFFER == new_buffer)
-        return;
-
-    if (YY_CURRENT_BUFFER)
-    {
-        /* Flush out information for old buffer. */
-        *yyg->yy_c_buf_p                     = yyg->yy_hold_char;
-        YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
-        YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
-    }
-
-    YY_CURRENT_BUFFER_LVALUE = new_buffer;
-    yy_load_buffer_state(yyscanner);
-
-    /* We don't actually know whether we did this switch during
-     * EOF (yywrap()) processing, but the only time this flag
-     * is looked at is after yywrap() is called, so it's safe
-     * to go ahead and always set it.
-     */
-    yyg->yy_did_buffer_switch_on_eof = 1;
-}
-
-static void yy_load_buffer_state(yyscan_t yyscanner)
-{
-    struct yyguts_t *yyg = (struct yyguts_t *)yyscanner;
-    yyg->yy_n_chars      = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
-    yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
-    yyin                              = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
-    yyg->yy_hold_char                 = *yyg->yy_c_buf_p;
-}
-
-/** Allocate and initialize an input buffer state.
- * @param file A readable stream.
- * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
- * @param yyscanner The scanner object.
- * @return the allocated buffer state.
- */
-YY_BUFFER_STATE yy_create_buffer(FILE *file, int size, yyscan_t yyscanner)
-{
-    YY_BUFFER_STATE b;
-
-    b = (YY_BUFFER_STATE)yyalloc(sizeof(struct yy_buffer_state), yyscanner);
-    if (!b)
-        YY_FATAL_ERROR("out of dynamic memory in yy_create_buffer()");
-
-    b->yy_buf_size = size;
-
-    /* yy_ch_buf has to be 2 characters longer than the size given because
-     * we need to put in 2 end-of-buffer characters.
-     */
-    b->yy_ch_buf = (char *)yyalloc((yy_size_t)(b->yy_buf_size + 2), yyscanner);
-    if (!b->yy_ch_buf)
-        YY_FATAL_ERROR("out of dynamic memory in yy_create_buffer()");
-
-    b->yy_is_our_buffer = 1;
-
-    yy_init_buffer(b, file, yyscanner);
-
-    return b;
-}
-
-/** Destroy the buffer.
- * @param b a buffer created with yy_create_buffer()
- * @param yyscanner The scanner object.
- */
-void yy_delete_buffer(YY_BUFFER_STATE b, yyscan_t yyscanner)
-{
-    struct yyguts_t *yyg = (struct yyguts_t *)yyscanner;
-
-    if (!b)
-        return;
-
-    if (b == YY_CURRENT_BUFFER) /* Not sure if we should pop here. */
-        YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE)0;
-
-    if (b->yy_is_our_buffer)
-        yyfree((void *)b->yy_ch_buf, yyscanner);
-
-    yyfree((void *)b, yyscanner);
-}
-
-/* Initializes or reinitializes a buffer.
- * This function is sometimes called more than once on the same buffer,
- * such as during a yyrestart() or at EOF.
- */
-static void yy_init_buffer(YY_BUFFER_STATE b, FILE *file, yyscan_t yyscanner)
-
-{
-    int oerrno           = errno;
-    struct yyguts_t *yyg = (struct yyguts_t *)yyscanner;
-
-    yy_flush_buffer(b, yyscanner);
-
-    b->yy_input_file  = file;
-    b->yy_fill_buffer = 1;
-
-    /* If b is the current buffer, then yy_init_buffer was _probably_
-     * called from yyrestart() or through yy_get_next_buffer.
-     * In that case, we don't want to reset the lineno or column.
-     */
-    if (b != YY_CURRENT_BUFFER)
-    {
-        b->yy_bs_lineno = 1;
-        b->yy_bs_column = 0;
-    }
-
-    b->yy_is_interactive = 0;
-
-    errno = oerrno;
-}
-
-/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
- * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
- * @param yyscanner The scanner object.
- */
-void yy_flush_buffer(YY_BUFFER_STATE b, yyscan_t yyscanner)
-{
-    struct yyguts_t *yyg = (struct yyguts_t *)yyscanner;
-    if (!b)
-        return;
-
-    b->yy_n_chars = 0;
-
-    /* We always need two end-of-buffer characters.  The first causes
-     * a transition to the end-of-buffer state.  The second causes
-     * a jam in that state.
-     */
-    b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
-    b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
-
-    b->yy_buf_pos = &b->yy_ch_buf[0];
-
-    b->yy_at_bol        = 1;
-    b->yy_buffer_status = YY_BUFFER_NEW;
-
-    if (b == YY_CURRENT_BUFFER)
-        yy_load_buffer_state(yyscanner);
-}
-
-/** Pushes the new state onto the stack. The new state becomes
- *  the current state. This function will allocate the stack
- *  if necessary.
- *  @param new_buffer The new state.
- *  @param yyscanner The scanner object.
- */
-void yypush_buffer_state(YY_BUFFER_STATE new_buffer, yyscan_t yyscanner)
-{
-    struct yyguts_t *yyg = (struct yyguts_t *)yyscanner;
-    if (new_buffer == NULL)
-        return;
-
-    yyensure_buffer_stack(yyscanner);
-
-    /* This block is copied from yy_switch_to_buffer. */
-    if (YY_CURRENT_BUFFER)
-    {
-        /* Flush out information for old buffer. */
-        *yyg->yy_c_buf_p                     = yyg->yy_hold_char;
-        YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
-        YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
-    }
-
-    /* Only push if top exists. Otherwise, replace top. */
-    if (YY_CURRENT_BUFFER)
-        yyg->yy_buffer_stack_top++;
-    YY_CURRENT_BUFFER_LVALUE = new_buffer;
-
-    /* copied from yy_switch_to_buffer. */
-    yy_load_buffer_state(yyscanner);
-    yyg->yy_did_buffer_switch_on_eof = 1;
-}
-
-/** Removes and deletes the top of the stack, if present.
- *  The next element becomes the new top.
- *  @param yyscanner The scanner object.
- */
-void yypop_buffer_state(yyscan_t yyscanner)
-{
-    struct yyguts_t *yyg = (struct yyguts_t *)yyscanner;
-    if (!YY_CURRENT_BUFFER)
-        return;
-
-    yy_delete_buffer(YY_CURRENT_BUFFER, yyscanner);
-    YY_CURRENT_BUFFER_LVALUE = NULL;
-    if (yyg->yy_buffer_stack_top > 0)
-        --yyg->yy_buffer_stack_top;
-
-    if (YY_CURRENT_BUFFER)
-    {
-        yy_load_buffer_state(yyscanner);
-        yyg->yy_did_buffer_switch_on_eof = 1;
-    }
-}
-
-/* Allocates the stack if it does not exist.
- *  Guarantees space for at least one push.
- */
-static void yyensure_buffer_stack(yyscan_t yyscanner)
-{
-    yy_size_t num_to_alloc;
-    struct yyguts_t *yyg = (struct yyguts_t *)yyscanner;
-
-    if (!yyg->yy_buffer_stack)
-    {
-
-        /* First allocation is just for 2 elements, since we don't know if this
-         * scanner will even need a stack. We use 2 instead of 1 to avoid an
-         * immediate realloc on the next call.
-         */
-        num_to_alloc         = 1; /* After all that talk, this was set to 1 anyways... */
-        yyg->yy_buffer_stack = (struct yy_buffer_state **)yyalloc(
-            num_to_alloc * sizeof(struct yy_buffer_state *), yyscanner);
-        if (!yyg->yy_buffer_stack)
-            YY_FATAL_ERROR("out of dynamic memory in yyensure_buffer_stack()");
-
-        memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state *));
-
-        yyg->yy_buffer_stack_max = num_to_alloc;
-        yyg->yy_buffer_stack_top = 0;
-        return;
-    }
-
-    if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1)
-    {
-
-        /* Increase the buffer to prepare for a possible push. */
-        yy_size_t grow_size = 8 /* arbitrary grow size */;
-
-        num_to_alloc         = yyg->yy_buffer_stack_max + grow_size;
-        yyg->yy_buffer_stack = (struct yy_buffer_state **)yyrealloc(
-            yyg->yy_buffer_stack, num_to_alloc * sizeof(struct yy_buffer_state *), yyscanner);
-        if (!yyg->yy_buffer_stack)
-            YY_FATAL_ERROR("out of dynamic memory in yyensure_buffer_stack()");
-
-        /* zero only the new slots.*/
-        memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0,
-               grow_size * sizeof(struct yy_buffer_state *));
-        yyg->yy_buffer_stack_max = num_to_alloc;
-    }
-}
-
-/** Setup the input buffer state to scan directly from a user-specified character buffer.
- * @param base the character buffer
- * @param size the size in bytes of the character buffer
- * @param yyscanner The scanner object.
- * @return the newly allocated buffer state object.
- */
-YY_BUFFER_STATE yy_scan_buffer(char *base, yy_size_t size, yyscan_t yyscanner)
-{
-    YY_BUFFER_STATE b;
-
-    if (size < 2 || base[size - 2] != YY_END_OF_BUFFER_CHAR ||
-        base[size - 1] != YY_END_OF_BUFFER_CHAR)
-        /* They forgot to leave room for the EOB's. */
-        return NULL;
-
-    b = (YY_BUFFER_STATE)yyalloc(sizeof(struct yy_buffer_state), yyscanner);
-    if (!b)
-        YY_FATAL_ERROR("out of dynamic memory in yy_scan_buffer()");
-
-    b->yy_buf_size = (int)(size - 2); /* "- 2" to take care of EOB's */
-    b->yy_buf_pos = b->yy_ch_buf = base;
-    b->yy_is_our_buffer          = 0;
-    b->yy_input_file             = NULL;
-    b->yy_n_chars                = b->yy_buf_size;
-    b->yy_is_interactive         = 0;
-    b->yy_at_bol                 = 1;
-    b->yy_fill_buffer            = 0;
-    b->yy_buffer_status          = YY_BUFFER_NEW;
-
-    yy_switch_to_buffer(b, yyscanner);
-
-    return b;
-}
-
-/** Setup the input buffer state to scan a string. The next call to yylex() will
- * scan from a @e copy of @a str.
- * @param yystr a NUL-terminated string to scan
- * @param yyscanner The scanner object.
- * @return the newly allocated buffer state object.
- * @note If you want to scan bytes that may contain NUL values, then use
- *       yy_scan_bytes() instead.
- */
-YY_BUFFER_STATE yy_scan_string(const char *yystr, yyscan_t yyscanner)
-{
-
-    return yy_scan_bytes(yystr, (int)strlen(yystr), yyscanner);
-}
-
-/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
- * scan from a @e copy of @a bytes.
- * @param yybytes the byte buffer to scan
- * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
- * @param yyscanner The scanner object.
- * @return the newly allocated buffer state object.
- */
-YY_BUFFER_STATE yy_scan_bytes(const char *yybytes, int _yybytes_len, yyscan_t yyscanner)
-{
-    YY_BUFFER_STATE b;
-    char *buf;
-    yy_size_t n;
-    int i;
-
-    /* Get memory for full buffer, including space for trailing EOB's. */
-    n   = (yy_size_t)(_yybytes_len + 2);
-    buf = (char *)yyalloc(n, yyscanner);
-    if (!buf)
-        YY_FATAL_ERROR("out of dynamic memory in yy_scan_bytes()");
-
-    for (i = 0; i < _yybytes_len; ++i)
-        buf[i] = yybytes[i];
-
-    buf[_yybytes_len] = buf[_yybytes_len + 1] = YY_END_OF_BUFFER_CHAR;
-
-    b = yy_scan_buffer(buf, n, yyscanner);
-    if (!b)
-        YY_FATAL_ERROR("bad buffer in yy_scan_bytes()");
-
-    /* It's okay to grow etc. this buffer, and we should throw it
-     * away when we're done.
-     */
-    b->yy_is_our_buffer = 1;
-
-    return b;
-}
-
-#ifndef YY_EXIT_FAILURE
-#    define YY_EXIT_FAILURE 2
-#endif
-
-static void yynoreturn yy_fatal_error(const char *msg, yyscan_t yyscanner)
-{
-    struct yyguts_t *yyg = (struct yyguts_t *)yyscanner;
-    (void)yyg;
-    fprintf(stderr, "%s\n", msg);
-    exit(YY_EXIT_FAILURE);
-}
-
-/* Redefine yyless() so it works in section 3 code. */
-
-#undef yyless
-#define yyless(n)                                      \
-    do                                                 \
-    {                                                  \
-        /* Undo effects of setting up yytext. */       \
-        int yyless_macro_arg = (n);                    \
-        YY_LESS_LINENO(yyless_macro_arg);              \
-        yytext[yyleng]    = yyg->yy_hold_char;         \
-        yyg->yy_c_buf_p   = yytext + yyless_macro_arg; \
-        yyg->yy_hold_char = *yyg->yy_c_buf_p;          \
-        *yyg->yy_c_buf_p  = '\0';                      \
-        yyleng            = yyless_macro_arg;          \
-    } while (0)
-
-/* Accessor  methods (get/set functions) to struct members. */
-
-/** Get the user-defined data for this scanner.
- * @param yyscanner The scanner object.
- */
-YY_EXTRA_TYPE yyget_extra(yyscan_t yyscanner)
-{
-    struct yyguts_t *yyg = (struct yyguts_t *)yyscanner;
-    return yyextra;
-}
-
-/** Get the current line number.
- * @param yyscanner The scanner object.
- */
-int yyget_lineno(yyscan_t yyscanner)
-{
-    struct yyguts_t *yyg = (struct yyguts_t *)yyscanner;
-
-    if (!YY_CURRENT_BUFFER)
-        return 0;
-
-    return yylineno;
-}
-
-/** Get the current column number.
- * @param yyscanner The scanner object.
- */
-int yyget_column(yyscan_t yyscanner)
-{
-    struct yyguts_t *yyg = (struct yyguts_t *)yyscanner;
-
-    if (!YY_CURRENT_BUFFER)
-        return 0;
-
-    return yycolumn;
-}
-
-/** Get the input stream.
- * @param yyscanner The scanner object.
- */
-FILE *yyget_in(yyscan_t yyscanner)
-{
-    struct yyguts_t *yyg = (struct yyguts_t *)yyscanner;
-    return yyin;
-}
-
-/** Get the output stream.
- * @param yyscanner The scanner object.
- */
-FILE *yyget_out(yyscan_t yyscanner)
-{
-    struct yyguts_t *yyg = (struct yyguts_t *)yyscanner;
-    return yyout;
-}
-
-/** Get the length of the current token.
- * @param yyscanner The scanner object.
- */
-int yyget_leng(yyscan_t yyscanner)
-{
-    struct yyguts_t *yyg = (struct yyguts_t *)yyscanner;
-    return yyleng;
-}
-
-/** Get the current token.
- * @param yyscanner The scanner object.
- */
-
-char *yyget_text(yyscan_t yyscanner)
-{
-    struct yyguts_t *yyg = (struct yyguts_t *)yyscanner;
-    return yytext;
-}
-
-/** Set the user-defined data. This data is never touched by the scanner.
- * @param user_defined The data to be associated with this scanner.
- * @param yyscanner The scanner object.
- */
-void yyset_extra(YY_EXTRA_TYPE user_defined, yyscan_t yyscanner)
-{
-    struct yyguts_t *yyg = (struct yyguts_t *)yyscanner;
-    yyextra              = user_defined;
-}
-
-/** Set the current line number.
- * @param _line_number line number
- * @param yyscanner The scanner object.
- */
-void yyset_lineno(int _line_number, yyscan_t yyscanner)
-{
-    struct yyguts_t *yyg = (struct yyguts_t *)yyscanner;
-
-    /* lineno is only valid if an input buffer exists. */
-    if (!YY_CURRENT_BUFFER)
-        YY_FATAL_ERROR("yyset_lineno called with no buffer");
-
-    yylineno = _line_number;
-}
-
-/** Set the current column.
- * @param _column_no column number
- * @param yyscanner The scanner object.
- */
-void yyset_column(int _column_no, yyscan_t yyscanner)
-{
-    struct yyguts_t *yyg = (struct yyguts_t *)yyscanner;
-
-    /* column is only valid if an input buffer exists. */
-    if (!YY_CURRENT_BUFFER)
-        YY_FATAL_ERROR("yyset_column called with no buffer");
-
-    yycolumn = _column_no;
-}
-
-/** Set the input stream. This does not discard the current
- * input buffer.
- * @param _in_str A readable stream.
- * @param yyscanner The scanner object.
- * @see yy_switch_to_buffer
- */
-void yyset_in(FILE *_in_str, yyscan_t yyscanner)
-{
-    struct yyguts_t *yyg = (struct yyguts_t *)yyscanner;
-    yyin                 = _in_str;
-}
-
-void yyset_out(FILE *_out_str, yyscan_t yyscanner)
-{
-    struct yyguts_t *yyg = (struct yyguts_t *)yyscanner;
-    yyout                = _out_str;
-}
-
-int yyget_debug(yyscan_t yyscanner)
-{
-    struct yyguts_t *yyg = (struct yyguts_t *)yyscanner;
-    return yy_flex_debug;
-}
-
-void yyset_debug(int _bdebug, yyscan_t yyscanner)
-{
-    struct yyguts_t *yyg = (struct yyguts_t *)yyscanner;
-    yy_flex_debug        = _bdebug;
-}
-
-/* Accessor methods for yylval and yylloc */
-
-YYSTYPE *yyget_lval(yyscan_t yyscanner)
-{
-    struct yyguts_t *yyg = (struct yyguts_t *)yyscanner;
-    return yylval;
-}
-
-void yyset_lval(YYSTYPE *yylval_param, yyscan_t yyscanner)
-{
-    struct yyguts_t *yyg = (struct yyguts_t *)yyscanner;
-    yylval               = yylval_param;
-}
-
-YYLTYPE *yyget_lloc(yyscan_t yyscanner)
-{
-    struct yyguts_t *yyg = (struct yyguts_t *)yyscanner;
-    return yylloc;
-}
-
-void yyset_lloc(YYLTYPE *yylloc_param, yyscan_t yyscanner)
-{
-    struct yyguts_t *yyg = (struct yyguts_t *)yyscanner;
-    yylloc               = yylloc_param;
-}
-
-/* User-visible API */
-
-/* yylex_init is special because it creates the scanner itself, so it is
- * the ONLY reentrant function that doesn't take the scanner as the last argument.
- * That's why we explicitly handle the declaration, instead of using our macros.
- */
-int yylex_init(yyscan_t *ptr_yy_globals)
-{
-    if (ptr_yy_globals == NULL)
-    {
-        errno = EINVAL;
-        return 1;
-    }
-
-    *ptr_yy_globals = (yyscan_t)yyalloc(sizeof(struct yyguts_t), NULL);
-
-    if (*ptr_yy_globals == NULL)
-    {
-        errno = ENOMEM;
-        return 1;
-    }
-
-    /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
-    memset(*ptr_yy_globals, 0x00, sizeof(struct yyguts_t));
-
-    return yy_init_globals(*ptr_yy_globals);
-}
-
-/* yylex_init_extra has the same functionality as yylex_init, but follows the
- * convention of taking the scanner as the last argument. Note however, that
- * this is a *pointer* to a scanner, as it will be allocated by this call (and
- * is the reason, too, why this function also must handle its own declaration).
- * The user defined value in the first argument will be available to yyalloc in
- * the yyextra field.
- */
-int yylex_init_extra(YY_EXTRA_TYPE yy_user_defined, yyscan_t *ptr_yy_globals)
-{
-    struct yyguts_t dummy_yyguts;
-
-    yyset_extra(yy_user_defined, &dummy_yyguts);
-
-    if (ptr_yy_globals == NULL)
-    {
-        errno = EINVAL;
-        return 1;
-    }
-
-    *ptr_yy_globals = (yyscan_t)yyalloc(sizeof(struct yyguts_t), &dummy_yyguts);
-
-    if (*ptr_yy_globals == NULL)
-    {
-        errno = ENOMEM;
-        return 1;
-    }
-
-    /* By setting to 0xAA, we expose bugs in
-    yy_init_globals. Leave at 0x00 for releases. */
-    memset(*ptr_yy_globals, 0x00, sizeof(struct yyguts_t));
-
-    yyset_extra(yy_user_defined, *ptr_yy_globals);
-
-    return yy_init_globals(*ptr_yy_globals);
-}
-
-static int yy_init_globals(yyscan_t yyscanner)
-{
-    struct yyguts_t *yyg = (struct yyguts_t *)yyscanner;
-    /* Initialization is the same as for the non-reentrant scanner.
-     * This function is called from yylex_destroy(), so don't allocate here.
-     */
-
-    yyg->yy_buffer_stack     = NULL;
-    yyg->yy_buffer_stack_top = 0;
-    yyg->yy_buffer_stack_max = 0;
-    yyg->yy_c_buf_p          = NULL;
-    yyg->yy_init             = 0;
-    yyg->yy_start            = 0;
-
-    yyg->yy_start_stack_ptr   = 0;
-    yyg->yy_start_stack_depth = 0;
-    yyg->yy_start_stack       = NULL;
-
-/* Defined in main.c */
-#ifdef YY_STDINIT
-    yyin  = stdin;
-    yyout = stdout;
-#else
-    yyin  = NULL;
-    yyout = NULL;
-#endif
-
-    /* For future reference: Set errno on error, since we are called by
-     * yylex_init()
-     */
-    return 0;
-}
-
-/* yylex_destroy is for both reentrant and non-reentrant scanners. */
-int yylex_destroy(yyscan_t yyscanner)
-{
-    struct yyguts_t *yyg = (struct yyguts_t *)yyscanner;
-
-    /* Pop the buffer stack, destroying each element. */
-    while (YY_CURRENT_BUFFER)
-    {
-        yy_delete_buffer(YY_CURRENT_BUFFER, yyscanner);
-        YY_CURRENT_BUFFER_LVALUE = NULL;
-        yypop_buffer_state(yyscanner);
-    }
-
-    /* Destroy the stack itself. */
-    yyfree(yyg->yy_buffer_stack, yyscanner);
-    yyg->yy_buffer_stack = NULL;
-
-    /* Destroy the start condition stack. */
-    yyfree(yyg->yy_start_stack, yyscanner);
-    yyg->yy_start_stack = NULL;
-
-    /* Reset the globals. This is important in a non-reentrant scanner so the next time
-     * yylex() is called, initialization will occur. */
-    yy_init_globals(yyscanner);
-
-    /* Destroy the main struct (reentrant only). */
-    yyfree(yyscanner, yyscanner);
-    yyscanner = NULL;
-    return 0;
-}
-
-/*
- * Internal utility routines.
- */
-
-#ifndef yytext_ptr
-static void yy_flex_strncpy(char *s1, const char *s2, int n, yyscan_t yyscanner)
-{
-    struct yyguts_t *yyg = (struct yyguts_t *)yyscanner;
-    (void)yyg;
-
-    int i;
-    for (i = 0; i < n; ++i)
-        s1[i] = s2[i];
-}
-#endif
-
-#ifdef YY_NEED_STRLEN
-static int yy_flex_strlen(const char *s, yyscan_t yyscanner)
-{
-    int n;
-    for (n = 0; s[n]; ++n)
-        ;
-
-    return n;
-}
-#endif
-
-void *yyalloc(yy_size_t size, yyscan_t yyscanner)
-{
-    struct yyguts_t *yyg = (struct yyguts_t *)yyscanner;
-    (void)yyg;
-    return malloc(size);
-}
-
-void *yyrealloc(void *ptr, yy_size_t size, yyscan_t yyscanner)
-{
-    struct yyguts_t *yyg = (struct yyguts_t *)yyscanner;
-    (void)yyg;
-
-    /* The cast to (char *) in the following accommodates both
-     * implementations that use char* generic pointers, and those
-     * that use void* generic pointers.  It works with the latter
-     * because both ANSI C and C++ allow castless assignment from
-     * any pointer type to void*, and deal with argument conversions
-     * as though doing an assignment.
-     */
-    return realloc(ptr, size);
-}
-
-void yyfree(void *ptr, yyscan_t yyscanner)
-{
-    struct yyguts_t *yyg = (struct yyguts_t *)yyscanner;
-    (void)yyg;
-    free((char *)ptr); /* see yyrealloc() for (char *) cast */
-}
-
-#define YYTABLES_NAME "yytables"
-
-namespace angle
-{
-
-namespace pp
-{
-
-Tokenizer::Tokenizer(Diagnostics *diagnostics) : mHandle(nullptr), mMaxTokenSize(256)
-{
-    mContext.diagnostics = diagnostics;
-}
-
-Tokenizer::~Tokenizer()
-{
-    destroyScanner();
-}
-
-bool Tokenizer::init(size_t count, const char *const string[], const int length[])
-{
-    if ((count > 0) && (string == 0))
-        return false;
-
-    mContext.input = Input(count, string, length);
-    return initScanner();
-}
-
-void Tokenizer::setFileNumber(int file)
-{
-    // We use column number as file number.
-    // See macro yyfileno.
-    yyset_column(file, mHandle);
-}
-
-void Tokenizer::setLineNumber(int line)
-{
-    yyset_lineno(line, mHandle);
-}
-
-void Tokenizer::setMaxTokenSize(size_t maxTokenSize)
-{
-    mMaxTokenSize = maxTokenSize;
-}
-
-void Tokenizer::lex(Token *token)
-{
-    int tokenType = yylex(&token->text, &token->location, mHandle);
-
-    if (tokenType == Token::GOT_ERROR)
-    {
-        mContext.diagnostics->report(Diagnostics::PP_TOKENIZER_ERROR, token->location, token->text);
-        token->type = Token::LAST;
-    }
-    else
-    {
-        token->type = tokenType;
-    }
-
-    if (token->text.size() > mMaxTokenSize)
-    {
-        mContext.diagnostics->report(Diagnostics::PP_TOKEN_TOO_LONG, token->location, token->text);
-        token->text.erase(mMaxTokenSize);
-    }
-
-    token->flags = 0;
-
-    token->setAtStartOfLine(mContext.lineStart);
-    mContext.lineStart = token->type == '\n';
-
-    token->setHasLeadingSpace(mContext.leadingSpace);
-    mContext.leadingSpace = false;
-}
-
-bool Tokenizer::initScanner()
-{
-    if ((mHandle == nullptr) && yylex_init_extra(&mContext, &mHandle))
-        return false;
-
-    yyrestart(0, mHandle);
-    return true;
-}
-
-void Tokenizer::destroyScanner()
-{
-    if (mHandle == nullptr)
-        return;
-
-    yylex_destroy(mHandle);
-    mHandle = nullptr;
-}
-
-}  // namespace pp
-
-}  // namespace angle
diff --git a/src/compiler/preprocessor/generate_parser.py b/src/compiler/preprocessor/generate_parser.py
new file mode 100755
index 0000000..607d8d8
--- /dev/null
+++ b/src/compiler/preprocessor/generate_parser.py
@@ -0,0 +1,22 @@
+#!/usr/bin/python
+# Copyright 2019 The ANGLE Project Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+#
+# generate_parser.py:
+#   Generate lexer and parser for ANGLE's shader preprocessor.
+
+import sys
+
+sys.path.append('..')
+import generate_parser_tools
+
+basename = 'preprocessor'
+
+
+def main():
+    return generate_parser_tools.generate_parser(basename, False)
+
+
+if __name__ == '__main__':
+    sys.exit(main())
diff --git a/src/compiler/preprocessor/generate_parser.sh b/src/compiler/preprocessor/generate_parser.sh
deleted file mode 100755
index 68b2856..0000000
--- a/src/compiler/preprocessor/generate_parser.sh
+++ /dev/null
@@ -1,27 +0,0 @@
-#!/bin/bash
-# Copyright 2012 The ANGLE Project Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# Generates various components of GLSL ES preprocessor.
-
-run_flex()
-{
-input_file=$script_dir/$1
-output_source=$script_dir/$2
-flex --noline --nounistd --outfile=$output_source $input_file
-}
-
-run_bison()
-{
-input_file=$script_dir/$1
-output_source=$script_dir/$2
-bison --no-lines --skeleton=yacc.c --output=$output_source $input_file
-}
-
-script_dir=$(dirname $0)
-
-# Generate preprocessor
-run_flex Tokenizer.l Tokenizer.cpp
-run_bison ExpressionParser.y ExpressionParser.cpp
-patch --silent --forward < 64bit-tokenizer-safety.patch
diff --git a/src/compiler/preprocessor/Tokenizer.l b/src/compiler/preprocessor/preprocessor.l
similarity index 96%
rename from src/compiler/preprocessor/Tokenizer.l
rename to src/compiler/preprocessor/preprocessor.l
index 145406b..4d2d1d3 100644
--- a/src/compiler/preprocessor/Tokenizer.l
+++ b/src/compiler/preprocessor/preprocessor.l
@@ -9,17 +9,21 @@
 Based on Microsoft Visual Studio 2010 Preprocessor Grammar:
 http://msdn.microsoft.com/en-us/library/2scxys89.aspx
 
-IF YOU MODIFY THIS FILE YOU ALSO NEED TO RUN generate_parser.sh.
+IF YOU MODIFY THIS FILE YOU ALSO NEED TO RUN scripts/run_code_generation.py
 */
 
 %top{
+// GENERATED FILE - DO NOT EDIT.
+// Generated by generate_parser.py from preprocessor.l
 //
-// Copyright 2011 The ANGLE Project Authors. All rights reserved.
+// Copyright 2019 The ANGLE Project Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 //
+// preprocessor.l:
+//   Lexer for the OpenGL shading language preprocessor.
 
-// This file is auto-generated by generate_parser.sh. DO NOT EDIT!
+// clang-format off
 }
 
 %{
diff --git a/src/compiler/preprocessor/ExpressionParser.y b/src/compiler/preprocessor/preprocessor.y
similarity index 97%
rename from src/compiler/preprocessor/ExpressionParser.y
rename to src/compiler/preprocessor/preprocessor.y
index 16544d4..cb64e03 100644
--- a/src/compiler/preprocessor/ExpressionParser.y
+++ b/src/compiler/preprocessor/preprocessor.y
@@ -7,18 +7,22 @@
 
 This file contains the Yacc grammar for GLSL ES preprocessor expression.
 
-IF YOU MODIFY THIS FILE YOU ALSO NEED TO RUN generate_parser.sh,
+IF YOU MODIFY THIS FILE YOU ALSO NEED TO RUN scripts/run_code_generation.py
 WHICH GENERATES THE GLSL ES preprocessor expression parser.
 */
 
 %{
+// GENERATED FILE - DO NOT EDIT.
+// Generated by generate_parser.py from preprocessor.y
 //
-// Copyright 2012 The ANGLE Project Authors. All rights reserved.
+// Copyright 2019 The ANGLE Project Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 //
+// preprocessor.y:
+//   Parser for the OpenGL shading language preprocessor.
 
-// This file is auto-generated by generate_parser.sh. DO NOT EDIT!
+// clang-format off
 
 #if defined(__GNUC__)
 // Triggered by the auto-generated pplval variable.
diff --git a/src/compiler/preprocessor/preprocessor_lex_autogen.cpp b/src/compiler/preprocessor/preprocessor_lex_autogen.cpp
new file mode 100644
index 0000000..7f63ed6
--- /dev/null
+++ b/src/compiler/preprocessor/preprocessor_lex_autogen.cpp
@@ -0,0 +1,3089 @@
+#line 16 "preprocessor.l"
+// GENERATED FILE - DO NOT EDIT.
+// Generated by generate_parser.py from preprocessor.l
+//
+// Copyright 2019 The ANGLE Project Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+// preprocessor.l:
+//   Lexer for the OpenGL shading language preprocessor.
+
+// clang-format off
+
+
+
+#define  YY_INT_ALIGNED short int
+
+/* A lexical scanner generated by flex */
+
+
+
+
+
+
+
+
+
+
+#define FLEX_SCANNER
+#define YY_FLEX_MAJOR_VERSION 2
+#define YY_FLEX_MINOR_VERSION 6
+#define YY_FLEX_SUBMINOR_VERSION 4
+#if YY_FLEX_SUBMINOR_VERSION > 0
+#define FLEX_BETA
+#endif
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+#ifdef yy_create_buffer
+#define pp_create_buffer_ALREADY_DEFINED
+#else
+#define yy_create_buffer pp_create_buffer
+#endif
+
+    
+#ifdef yy_delete_buffer
+#define pp_delete_buffer_ALREADY_DEFINED
+#else
+#define yy_delete_buffer pp_delete_buffer
+#endif
+
+    
+#ifdef yy_scan_buffer
+#define pp_scan_buffer_ALREADY_DEFINED
+#else
+#define yy_scan_buffer pp_scan_buffer
+#endif
+
+    
+#ifdef yy_scan_string
+#define pp_scan_string_ALREADY_DEFINED
+#else
+#define yy_scan_string pp_scan_string
+#endif
+
+    
+#ifdef yy_scan_bytes
+#define pp_scan_bytes_ALREADY_DEFINED
+#else
+#define yy_scan_bytes pp_scan_bytes
+#endif
+
+    
+#ifdef yy_init_buffer
+#define pp_init_buffer_ALREADY_DEFINED
+#else
+#define yy_init_buffer pp_init_buffer
+#endif
+
+    
+#ifdef yy_flush_buffer
+#define pp_flush_buffer_ALREADY_DEFINED
+#else
+#define yy_flush_buffer pp_flush_buffer
+#endif
+
+    
+#ifdef yy_load_buffer_state
+#define pp_load_buffer_state_ALREADY_DEFINED
+#else
+#define yy_load_buffer_state pp_load_buffer_state
+#endif
+
+    
+#ifdef yy_switch_to_buffer
+#define pp_switch_to_buffer_ALREADY_DEFINED
+#else
+#define yy_switch_to_buffer pp_switch_to_buffer
+#endif
+
+    
+#ifdef yypush_buffer_state
+#define pppush_buffer_state_ALREADY_DEFINED
+#else
+#define yypush_buffer_state pppush_buffer_state
+#endif
+
+    
+#ifdef yypop_buffer_state
+#define pppop_buffer_state_ALREADY_DEFINED
+#else
+#define yypop_buffer_state pppop_buffer_state
+#endif
+
+    
+#ifdef yyensure_buffer_stack
+#define ppensure_buffer_stack_ALREADY_DEFINED
+#else
+#define yyensure_buffer_stack ppensure_buffer_stack
+#endif
+
+    
+#ifdef yylex
+#define pplex_ALREADY_DEFINED
+#else
+#define yylex pplex
+#endif
+
+    
+#ifdef yyrestart
+#define pprestart_ALREADY_DEFINED
+#else
+#define yyrestart pprestart
+#endif
+
+    
+#ifdef yylex_init
+#define pplex_init_ALREADY_DEFINED
+#else
+#define yylex_init pplex_init
+#endif
+
+    
+#ifdef yylex_init_extra
+#define pplex_init_extra_ALREADY_DEFINED
+#else
+#define yylex_init_extra pplex_init_extra
+#endif
+
+    
+#ifdef yylex_destroy
+#define pplex_destroy_ALREADY_DEFINED
+#else
+#define yylex_destroy pplex_destroy
+#endif
+
+    
+#ifdef yyget_debug
+#define ppget_debug_ALREADY_DEFINED
+#else
+#define yyget_debug ppget_debug
+#endif
+
+    
+#ifdef yyset_debug
+#define ppset_debug_ALREADY_DEFINED
+#else
+#define yyset_debug ppset_debug
+#endif
+
+    
+#ifdef yyget_extra
+#define ppget_extra_ALREADY_DEFINED
+#else
+#define yyget_extra ppget_extra
+#endif
+
+    
+#ifdef yyset_extra
+#define ppset_extra_ALREADY_DEFINED
+#else
+#define yyset_extra ppset_extra
+#endif
+
+    
+#ifdef yyget_in
+#define ppget_in_ALREADY_DEFINED
+#else
+#define yyget_in ppget_in
+#endif
+
+    
+#ifdef yyset_in
+#define ppset_in_ALREADY_DEFINED
+#else
+#define yyset_in ppset_in
+#endif
+
+    
+#ifdef yyget_out
+#define ppget_out_ALREADY_DEFINED
+#else
+#define yyget_out ppget_out
+#endif
+
+    
+#ifdef yyset_out
+#define ppset_out_ALREADY_DEFINED
+#else
+#define yyset_out ppset_out
+#endif
+
+    
+#ifdef yyget_leng
+#define ppget_leng_ALREADY_DEFINED
+#else
+#define yyget_leng ppget_leng
+#endif
+
+    
+#ifdef yyget_text
+#define ppget_text_ALREADY_DEFINED
+#else
+#define yyget_text ppget_text
+#endif
+
+    
+#ifdef yyget_lineno
+#define ppget_lineno_ALREADY_DEFINED
+#else
+#define yyget_lineno ppget_lineno
+#endif
+
+    
+#ifdef yyset_lineno
+#define ppset_lineno_ALREADY_DEFINED
+#else
+#define yyset_lineno ppset_lineno
+#endif
+
+    
+        
+#ifdef yyget_column
+#define ppget_column_ALREADY_DEFINED
+#else
+#define yyget_column ppget_column
+#endif
+
+        
+#ifdef yyset_column
+#define ppset_column_ALREADY_DEFINED
+#else
+#define yyset_column ppset_column
+#endif
+
+    
+    
+#ifdef yywrap
+#define ppwrap_ALREADY_DEFINED
+#else
+#define yywrap ppwrap
+#endif
+
+
+
+
+    
+#ifdef yyget_lval
+#define ppget_lval_ALREADY_DEFINED
+#else
+#define yyget_lval ppget_lval
+#endif
+
+    
+#ifdef yyset_lval
+#define ppset_lval_ALREADY_DEFINED
+#else
+#define yyset_lval ppset_lval
+#endif
+
+
+
+
+    
+#ifdef yyget_lloc
+#define ppget_lloc_ALREADY_DEFINED
+#else
+#define yyget_lloc ppget_lloc
+#endif
+
+    
+#ifdef yyset_lloc
+#define ppset_lloc_ALREADY_DEFINED
+#else
+#define yyset_lloc ppset_lloc
+#endif
+
+
+
+
+#ifdef yyalloc
+#define ppalloc_ALREADY_DEFINED
+#else
+#define yyalloc ppalloc
+#endif
+
+    
+#ifdef yyrealloc
+#define pprealloc_ALREADY_DEFINED
+#else
+#define yyrealloc pprealloc
+#endif
+
+    
+#ifdef yyfree
+#define ppfree_ALREADY_DEFINED
+#else
+#define yyfree ppfree
+#endif
+
+
+
+
+
+
+
+
+
+/* First, we deal with  platform-specific or compiler-specific issues. */
+
+/* begin standard C headers. */
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+#include <stdlib.h>
+
+/* end standard C headers. */
+
+/* flex integer type definitions */
+
+#ifndef FLEXINT_H
+#define FLEXINT_H
+
+/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
+
+#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+
+/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
+ * if you want the limit (max/min) macros for int types. 
+ */
+#ifndef __STDC_LIMIT_MACROS
+#define __STDC_LIMIT_MACROS 1
+#endif
+
+#include <inttypes.h>
+typedef int8_t flex_int8_t;
+typedef uint8_t flex_uint8_t;
+typedef int16_t flex_int16_t;
+typedef uint16_t flex_uint16_t;
+typedef int32_t flex_int32_t;
+typedef uint32_t flex_uint32_t;
+#else
+typedef signed char flex_int8_t;
+typedef short int flex_int16_t;
+typedef int flex_int32_t;
+typedef unsigned char flex_uint8_t; 
+typedef unsigned short int flex_uint16_t;
+typedef unsigned int flex_uint32_t;
+
+/* Limits of integral types. */
+#ifndef INT8_MIN
+#define INT8_MIN               (-128)
+#endif
+#ifndef INT16_MIN
+#define INT16_MIN              (-32767-1)
+#endif
+#ifndef INT32_MIN
+#define INT32_MIN              (-2147483647-1)
+#endif
+#ifndef INT8_MAX
+#define INT8_MAX               (127)
+#endif
+#ifndef INT16_MAX
+#define INT16_MAX              (32767)
+#endif
+#ifndef INT32_MAX
+#define INT32_MAX              (2147483647)
+#endif
+#ifndef UINT8_MAX
+#define UINT8_MAX              (255U)
+#endif
+#ifndef UINT16_MAX
+#define UINT16_MAX             (65535U)
+#endif
+#ifndef UINT32_MAX
+#define UINT32_MAX             (4294967295U)
+#endif
+
+#ifndef SIZE_MAX
+#define SIZE_MAX               (~(size_t)0)
+#endif
+
+#endif /* ! C99 */
+
+#endif /* ! FLEXINT_H */
+
+
+/* begin standard C++ headers. */
+
+/* TODO: this is always defined, so inline it */
+#define yyconst const
+
+#if defined(__GNUC__) && __GNUC__ >= 3
+#define yynoreturn __attribute__((__noreturn__))
+#else
+#define yynoreturn
+#endif
+
+/* Returned upon end-of-file. */
+#define YY_NULL 0
+
+
+/* Promotes a possibly negative, possibly signed char to an
+ *   integer in range [0..255] for use as an array index.
+ */
+#define YY_SC_TO_UI(c) ((YY_CHAR) (c))
+
+
+
+
+
+/* An opaque pointer. */
+#ifndef YY_TYPEDEF_YY_SCANNER_T
+#define YY_TYPEDEF_YY_SCANNER_T
+typedef void* yyscan_t;
+#endif
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+/* For convenience, these vars (plus the bison vars far below)
+   are macros in the reentrant scanner. */
+#define yyin yyg->yyin_r
+#define yyout yyg->yyout_r
+#define yyextra yyg->yyextra_r
+#define yyleng yyg->yyleng_r
+#define yytext yyg->yytext_r
+#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
+#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
+#define yy_flex_debug yyg->yy_flex_debug_r
+
+
+
+
+
+
+
+
+
+
+
+
+
+/* Enter a start condition.  This macro really ought to take a parameter,
+ * but we do it the disgusting crufty way forced on us by the ()-less
+ * definition of BEGIN.
+ */
+#define BEGIN yyg->yy_start = 1 + 2 *
+/* Translate the current start state into a value that can be later handed
+ * to BEGIN to return to the state.  The YYSTATE alias is for lex
+ * compatibility.
+ */
+#define YY_START ((yyg->yy_start - 1) / 2)
+#define YYSTATE YY_START
+/* Action number for EOF rule of a given start state. */
+#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
+/* Special action meaning "start processing a new file". */
+#define YY_NEW_FILE yyrestart( yyin , yyscanner )
+#define YY_END_OF_BUFFER_CHAR 0
+
+
+/* Size of default input buffer. */
+#ifndef YY_BUF_SIZE
+#ifdef __ia64__
+/* On IA-64, the buffer size is 16k, not 8k.
+ * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
+ * Ditto for the __ia64__ case accordingly.
+ */
+#define YY_BUF_SIZE 32768
+#else
+#define YY_BUF_SIZE 16384
+#endif /* __ia64__ */
+#endif
+
+
+/* The state buf must be large enough to hold one state per character in the main buffer.
+ */
+#define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
+
+
+
+#ifndef YY_TYPEDEF_YY_BUFFER_STATE
+#define YY_TYPEDEF_YY_BUFFER_STATE
+typedef struct yy_buffer_state *YY_BUFFER_STATE;
+#endif
+
+#ifndef YY_TYPEDEF_YY_SIZE_T
+#define YY_TYPEDEF_YY_SIZE_T
+typedef size_t yy_size_t;
+#endif
+
+
+
+
+#define EOB_ACT_CONTINUE_SCAN 0
+#define EOB_ACT_END_OF_FILE 1
+#define EOB_ACT_LAST_MATCH 2
+    
+    #define YY_LESS_LINENO(n)
+    #define YY_LINENO_REWIND_TO(ptr)
+    
+/* Return all but the first "n" matched characters back to the input stream. */
+#define yyless(n) \
+	do \
+		{ \
+		/* Undo effects of setting up yytext. */ \
+        int yyless_macro_arg = (n); \
+        YY_LESS_LINENO(yyless_macro_arg);\
+		*yy_cp = yyg->yy_hold_char; \
+		YY_RESTORE_YY_MORE_OFFSET \
+		yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
+		YY_DO_BEFORE_ACTION; /* set up yytext again */ \
+		} \
+	while ( 0 )
+#define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
+
+
+#ifndef YY_STRUCT_YY_BUFFER_STATE
+#define YY_STRUCT_YY_BUFFER_STATE
+struct yy_buffer_state
+	{
+	FILE *yy_input_file;
+
+
+
+	char *yy_ch_buf;		/* input buffer */
+	char *yy_buf_pos;		/* current position in input buffer */
+
+	/* Size of input buffer in bytes, not including room for EOB
+	 * characters.
+	 */
+	int yy_buf_size;
+
+	/* Number of characters read into yy_ch_buf, not including EOB
+	 * characters.
+	 */
+	int yy_n_chars;
+
+	/* Whether we "own" the buffer - i.e., we know we created it,
+	 * and can realloc() it to grow it, and should free() it to
+	 * delete it.
+	 */
+	int yy_is_our_buffer;
+
+	/* Whether this is an "interactive" input source; if so, and
+	 * if we're using stdio for input, then we want to use getc()
+	 * instead of fread(), to make sure we stop fetching input after
+	 * each newline.
+	 */
+	int yy_is_interactive;
+
+	/* Whether we're considered to be at the beginning of a line.
+	 * If so, '^' rules will be active on the next match, otherwise
+	 * not.
+	 */
+	int yy_at_bol;
+
+    int yy_bs_lineno; /**< The line count. */
+    int yy_bs_column; /**< The column count. */
+
+
+	/* Whether to try to fill the input buffer when we reach the
+	 * end of it.
+	 */
+	int yy_fill_buffer;
+
+	int yy_buffer_status;
+
+#define YY_BUFFER_NEW 0
+#define YY_BUFFER_NORMAL 1
+	/* When an EOF's been seen but there's still some text to process
+	 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
+	 * shouldn't try reading from the input source any more.  We might
+	 * still have a bunch of tokens to match, though, because of
+	 * possible backing-up.
+	 *
+	 * When we actually see the EOF, we change the status to "new"
+	 * (via yyrestart()), so that the user can continue scanning by
+	 * just pointing yyin at a new input file.
+	 */
+#define YY_BUFFER_EOF_PENDING 2
+
+	};
+#endif /* !YY_STRUCT_YY_BUFFER_STATE */
+
+
+
+
+/* We provide macros for accessing buffer states in case in the
+ * future we want to put the buffer states in a more general
+ * "scanner state".
+ *
+ * Returns the top of the stack, or NULL.
+ */
+#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
+                          ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
+                          : NULL)
+/* Same as previous macro, but useful when we know that the buffer stack is not
+ * NULL or when we need an lvalue. For internal use only.
+ */
+#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
+
+
+
+
+
+void yyrestart ( FILE *input_file , yyscan_t yyscanner );
+void yy_switch_to_buffer ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );
+YY_BUFFER_STATE yy_create_buffer ( FILE *file, int size , yyscan_t yyscanner );
+void yy_delete_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );
+void yy_flush_buffer ( YY_BUFFER_STATE b , yyscan_t yyscanner );
+void yypush_buffer_state ( YY_BUFFER_STATE new_buffer , yyscan_t yyscanner );
+void yypop_buffer_state ( yyscan_t yyscanner );
+
+
+static void yyensure_buffer_stack ( yyscan_t yyscanner );
+static void yy_load_buffer_state ( yyscan_t yyscanner );
+static void yy_init_buffer ( YY_BUFFER_STATE b, FILE *file , yyscan_t yyscanner );
+#define YY_FLUSH_BUFFER yy_flush_buffer( YY_CURRENT_BUFFER , yyscanner)
+
+
+YY_BUFFER_STATE yy_scan_buffer ( char *base, yy_size_t size , yyscan_t yyscanner );
+YY_BUFFER_STATE yy_scan_string ( const char *yy_str , yyscan_t yyscanner );
+YY_BUFFER_STATE yy_scan_bytes ( const char *bytes, int len , yyscan_t yyscanner );
+
+
+void *yyalloc ( yy_size_t , yyscan_t yyscanner );
+void *yyrealloc ( void *, yy_size_t , yyscan_t yyscanner );
+void yyfree ( void * , yyscan_t yyscanner );
+
+
+#define yy_new_buffer yy_create_buffer
+#define yy_set_interactive(is_interactive) \
+	{ \
+	if ( ! YY_CURRENT_BUFFER ){ \
+        yyensure_buffer_stack (yyscanner); \
+		YY_CURRENT_BUFFER_LVALUE =    \
+            yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \
+	} \
+	YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
+	}
+#define yy_set_bol(at_bol) \
+	{ \
+	if ( ! YY_CURRENT_BUFFER ){\
+        yyensure_buffer_stack (yyscanner); \
+		YY_CURRENT_BUFFER_LVALUE =    \
+            yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner); \
+	} \
+	YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
+	}
+#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
+
+
+/* Begin user sect3 */
+
+#define ppwrap(yyscanner) (/*CONSTCOND*/1)
+#define YY_SKIP_YYWRAP
+typedef flex_uint8_t YY_CHAR;
+
+
+typedef int yy_state_type;
+
+#define yytext_ptr yytext_r
+
+
+
+
+
+
+static yy_state_type yy_get_previous_state ( yyscan_t yyscanner );
+static yy_state_type yy_try_NUL_trans ( yy_state_type current_state  , yyscan_t yyscanner);
+static int yy_get_next_buffer ( yyscan_t yyscanner );
+static void yynoreturn yy_fatal_error ( const char* msg , yyscan_t yyscanner );
+
+
+
+
+/* Done after the current pattern has been matched and before the
+ * corresponding action - sets up yytext.
+ */
+#define YY_DO_BEFORE_ACTION \
+	yyg->yytext_ptr = yy_bp; \
+	yyleng = (int) (yy_cp - yy_bp); \
+	yyg->yy_hold_char = *yy_cp; \
+	*yy_cp = '\0'; \
+	yyg->yy_c_buf_p = yy_cp;
+#define YY_NUM_RULES 37
+#define YY_END_OF_BUFFER 38
+/* This struct is not used in this scanner,
+   but its presence is necessary. */
+struct yy_trans_info
+	{
+	flex_int32_t yy_verify;
+	flex_int32_t yy_nxt;
+	};
+static const flex_int16_t yy_accept[95] =
+    {   0,
+        0,    0,    0,    0,   38,   36,   34,   35,   35,   33,
+        7,   33,   33,   33,   33,   33,   33,   33,   33,    9,
+        9,   33,   33,   33,    8,   33,   33,    3,    5,    5,
+        4,   34,   35,   19,   27,   20,   30,   25,   12,   23,
+       13,   24,   10,    2,    1,   26,   10,    9,   11,   11,
+       11,    9,   11,    9,    9,   14,   16,   18,   17,   15,
+        8,   31,   21,   32,   22,    3,    5,    6,   11,   10,
+       11,   10,    1,   10,   11,   10,    0,   10,    9,    9,
+        9,   28,   29,    0,   10,   10,   10,   10,    9,   10,
+       10,    9,   10,    0
+
+    } ;
+
+static const YY_CHAR yy_ec[256] =
+    {   0,
+        1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
+        2,    2,    4,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    2,    5,    1,    6,    1,    7,    8,    1,    9,
+        9,   10,   11,    9,   12,   13,   14,   15,   16,   16,
+       16,   16,   16,   16,   16,   17,   17,    9,    9,   18,
+       19,   20,    9,    1,   21,   21,   21,   21,   22,   23,
+       24,   24,   24,   24,   24,   24,   24,   24,   24,   24,
+       24,   24,   24,   24,   25,   24,   24,   26,   24,   24,
+        9,    1,    9,   27,   24,    1,   21,   21,   21,   21,
+
+       22,   23,   24,   24,   24,   24,   24,   24,   24,   24,
+       24,   24,   24,   24,   24,   24,   25,   24,   24,   26,
+       24,   24,    9,   28,    9,    9,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1
+    } ;
+
+static const YY_CHAR yy_meta[29] =
+    {   0,
+        1,    1,    2,    2,    1,    1,    1,    1,    1,    3,
+        1,    1,    4,    1,    5,    5,    5,    1,    1,    1,
+        5,    5,    5,    5,    5,    5,    1,    1
+    } ;
+
+static const flex_int16_t yy_base[100] =
+    {   0,
+        0,    0,   26,   28,  133,  195,  130,  195,  128,  105,
+      195,  104,   25,  195,  100,   23,   27,   32,   31,   38,
+       50,   38,   93,   49,    0,   16,   51,    0,  195,  105,
+       87,   93,  195,  195,  195,  195,  195,  195,  195,  195,
+      195,  195,   67,  195,    0,  195,   81,   55,   84,   98,
+      110,   53,   61,    0,   52,   39,  195,  195,  195,   33,
+        0,  195,  195,  195,  195,    0,  195,  195,  113,    0,
+      126,    0,    0,    0,  133,    0,   56,  128,    0,  133,
+        0,  195,  195,  101,  141,  143,  145,    0,   15,  154,
+      195,    0,  195,  195,  177,   32,  182,  187,  189
+
+    } ;
+
+static const flex_int16_t yy_def[100] =
+    {   0,
+       94,    1,   95,   95,   94,   94,   94,   94,   94,   94,
+       94,   94,   94,   94,   94,   94,   94,   94,   94,   94,
+       20,   94,   94,   94,   96,   94,   94,   97,   94,   94,
+       94,   94,   94,   94,   94,   94,   94,   94,   94,   94,
+       94,   94,   94,   94,   98,   94,   94,   20,   20,   49,
+       50,   50,   99,   21,   50,   94,   94,   94,   94,   94,
+       96,   94,   94,   94,   94,   97,   94,   94,   43,   43,
+       69,   69,   98,   47,   50,   50,   94,   51,   50,   99,
+       50,   94,   94,   94,   71,   75,   94,   50,   50,   94,
+       94,   50,   94,    0,   94,   94,   94,   94,   94
+
+    } ;
+
+static const flex_int16_t yy_nxt[224] =
+    {   0,
+        6,    7,    8,    9,   10,   11,   12,   13,   14,   15,
+       16,   17,   18,   19,   20,   21,   21,   22,   23,   24,
+       25,   25,   25,   25,   25,   25,   26,   27,   29,   30,
+       29,   30,   36,   39,   62,   31,   61,   31,   41,   92,
+       44,   40,   63,   37,   45,   42,   43,   43,   43,   46,
+       47,   83,   48,   48,   49,   56,   57,   82,   50,   51,
+       50,   50,   52,   53,   54,   54,   54,   59,   60,   64,
+       87,   87,   87,   50,   55,   50,   81,   79,   65,   69,
+       50,   70,   70,   70,   50,   50,   50,   69,   71,   72,
+       69,   69,   69,   50,   32,   74,   74,   74,   49,   49,
+
+       68,   50,   75,   76,   50,   50,   50,   67,   50,   50,
+       50,   58,   50,   50,   50,   90,   90,   90,   38,   50,
+       77,   77,   35,   34,   78,   78,   78,   69,   69,   69,
+       33,   32,   94,   94,   69,   69,   84,   84,   94,   94,
+       85,   85,   85,   84,   84,   50,   94,   86,   86,   86,
+       88,   94,   94,   94,   94,   94,   50,   89,   50,   87,
+       87,   87,   94,   72,   94,   76,   94,   91,   90,   90,
+       90,   94,   94,   94,   94,   94,   93,   28,   28,   28,
+       28,   28,   66,   94,   94,   66,   66,   73,   94,   73,
+       73,   73,   80,   80,    5,   94,   94,   94,   94,   94,
+
+       94,   94,   94,   94,   94,   94,   94,   94,   94,   94,
+       94,   94,   94,   94,   94,   94,   94,   94,   94,   94,
+       94,   94,   94
+    } ;
+
+static const flex_int16_t yy_chk[224] =
+    {   0,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    3,    3,
+        4,    4,   13,   16,   26,    3,   96,    4,   17,   89,
+       19,   16,   26,   13,   19,   17,   18,   18,   18,   19,
+       20,   60,   20,   20,   20,   22,   22,   56,   20,   20,
+       20,   20,   20,   20,   21,   21,   21,   24,   24,   27,
+       77,   77,   77,   53,   21,   21,   55,   52,   27,   43,
+       48,   43,   43,   43,   53,   53,   53,   43,   43,   43,
+       43,   43,   43,   47,   32,   47,   47,   47,   49,   49,
+
+       31,   47,   47,   47,   47,   47,   47,   30,   49,   49,
+       50,   23,   50,   50,   50,   84,   84,   84,   15,   50,
+       51,   51,   12,   10,   51,   51,   51,   69,   69,   69,
+        9,    7,    5,    0,   69,   69,   71,   71,   78,   78,
+       71,   71,   71,   75,   75,   80,    0,   75,   75,   75,
+       78,   85,   85,   86,   86,    0,   80,   80,   80,   87,
+       87,   87,    0,   85,    0,   86,    0,   87,   90,   90,
+       90,    0,    0,    0,    0,    0,   90,   95,   95,   95,
+       95,   95,   97,    0,    0,   97,   97,   98,    0,   98,
+       98,   98,   99,   99,   94,   94,   94,   94,   94,   94,
+
+       94,   94,   94,   94,   94,   94,   94,   94,   94,   94,
+       94,   94,   94,   94,   94,   94,   94,   94,   94,   94,
+       94,   94,   94
+    } ;
+
+/* The intent behind this definition is that it'll catch
+ * any uses of REJECT which flex missed.
+ */
+#define REJECT reject_used_but_not_detected
+#define yymore() yymore_used_but_not_detected
+#define YY_MORE_ADJ 0
+#define YY_RESTORE_YY_MORE_OFFSET
+/*
+//
+// Copyright 2002 The ANGLE Project Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+
+This file contains the Lex specification for GLSL ES preprocessor.
+Based on Microsoft Visual Studio 2010 Preprocessor Grammar:
+http://msdn.microsoft.com/en-us/library/2scxys89.aspx
+
+IF YOU MODIFY THIS FILE YOU ALSO NEED TO RUN scripts/run_code_generation.py
+*/
+
+#if defined(_MSC_VER)
+#pragma warning(disable: 4005)
+#endif
+
+#include "compiler/preprocessor/Tokenizer.h"
+
+#include "compiler/preprocessor/DiagnosticsBase.h"
+#include "compiler/preprocessor/Token.h"
+
+#if defined(__GNUC__)
+// Triggered by the auto-generated yy_fatal_error function.
+#pragma GCC diagnostic ignored "-Wmissing-noreturn"
+#elif defined(_MSC_VER)
+#pragma warning(disable: 4244)
+#endif
+#if defined(__clang__)
+// Flex uses `/*FALLTHROUGH*/` instead of dedicated statements.
+#pragma clang diagnostic ignored "-Wimplicit-fallthrough"
+#if defined(__APPLE__)
+// Older clang versions don't have -Wextra-semi-stmt, and detecting Apple clang versions is
+// difficult because they use different yet overlapping version numbers vs. regular clang.
+#pragma clang diagnostic ignored "-Wunknown-warning-option"
+#endif
+// Flex isn't semi-colon clean.
+#pragma clang diagnostic ignored "-Wextra-semi-stmt"
+#pragma clang diagnostic ignored "-Wunreachable-code"
+#endif
+
+// Workaround for flex using the register keyword, deprecated in C++11.
+#ifdef __cplusplus
+#if __cplusplus > 199711L
+#define register
+#endif
+#endif
+
+typedef std::string YYSTYPE;
+typedef angle::pp::SourceLocation YYLTYPE;
+
+// Use the unused yycolumn variable to track file (string) number.
+#define yyfileno yycolumn
+
+#define YY_USER_INIT                   \
+    do {                               \
+        yyfileno = 0;                  \
+        yylineno = 1;                  \
+        yyextra->leadingSpace = false; \
+        yyextra->lineStart = true;     \
+    } while(0);
+
+#define YY_NO_INPUT
+#define YY_USER_ACTION                                              \
+    do                                                              \
+    {                                                               \
+        angle::pp::Input* input = &yyextra->input;                  \
+        angle::pp::Input::Location* scanLoc = &yyextra->scanLoc;    \
+        while ((scanLoc->sIndex < input->count()) &&                \
+               (scanLoc->cIndex >= input->length(scanLoc->sIndex))) \
+        {                                                           \
+            scanLoc->cIndex -= input->length(scanLoc->sIndex++);    \
+            ++yyfileno; yylineno = 1;                               \
+        }                                                           \
+        yylloc->file = yyfileno;                                    \
+        yylloc->line = yylineno;                                    \
+        scanLoc->cIndex += yyleng;                                  \
+    } while(0);
+
+#define YY_INPUT(buf, result, maxSize) \
+    result = yyextra->input.read(buf, maxSize, &yylineno);
+
+
+
+
+
+#define INITIAL 0
+#define COMMENT 1
+
+
+
+
+
+
+#define YY_EXTRA_TYPE angle::pp::Tokenizer::Context*
+
+
+
+
+/* Holds the entire state of the reentrant scanner. */
+struct yyguts_t
+    {
+
+    /* User-defined. Not touched by flex. */
+    YY_EXTRA_TYPE yyextra_r;
+
+    /* The rest are the same as the globals declared in the non-reentrant scanner. */
+    FILE *yyin_r, *yyout_r;
+    size_t yy_buffer_stack_top; /**< index of top of stack. */
+    size_t yy_buffer_stack_max; /**< capacity of stack. */
+    YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
+    char yy_hold_char;
+    int yy_n_chars;
+    int yyleng_r;
+    char *yy_c_buf_p;
+    int yy_init;
+    int yy_start;
+    int yy_did_buffer_switch_on_eof;
+    int yy_start_stack_ptr;
+    int yy_start_stack_depth;
+    int *yy_start_stack;
+    yy_state_type yy_last_accepting_state;
+    char* yy_last_accepting_cpos;
+
+    int yylineno_r;
+    int yy_flex_debug_r;
+
+
+
+
+    char *yytext_r;
+    int yy_more_flag;
+    int yy_more_len;
+
+
+
+    YYSTYPE * yylval_r;
+
+
+
+    YYLTYPE * yylloc_r;
+
+
+    }; /* end struct yyguts_t */
+
+
+
+
+static int yy_init_globals ( yyscan_t yyscanner );
+
+
+
+
+    
+    /* This must go here because YYSTYPE and YYLTYPE are included
+     * from bison output in section 1.*/
+    #    define yylval yyg->yylval_r
+    
+
+    
+    #    define yylloc yyg->yylloc_r
+    
+
+
+int yylex_init (yyscan_t* scanner);
+
+int yylex_init_extra ( YY_EXTRA_TYPE user_defined, yyscan_t* scanner);
+
+
+
+/* Accessor methods to globals.
+   These are made visible to non-reentrant scanners for convenience. */
+
+
+int yylex_destroy ( yyscan_t yyscanner );
+
+
+
+int yyget_debug ( yyscan_t yyscanner );
+
+
+
+void yyset_debug ( int debug_flag , yyscan_t yyscanner );
+
+
+
+YY_EXTRA_TYPE yyget_extra ( yyscan_t yyscanner );
+
+
+
+void yyset_extra ( YY_EXTRA_TYPE user_defined , yyscan_t yyscanner );
+
+
+
+FILE *yyget_in ( yyscan_t yyscanner );
+
+
+
+void yyset_in  ( FILE * _in_str , yyscan_t yyscanner );
+
+
+
+FILE *yyget_out ( yyscan_t yyscanner );
+
+
+
+void yyset_out  ( FILE * _out_str , yyscan_t yyscanner );
+
+
+
+			int yyget_leng ( yyscan_t yyscanner );
+
+
+
+char *yyget_text ( yyscan_t yyscanner );
+
+
+
+int yyget_lineno ( yyscan_t yyscanner );
+
+
+
+void yyset_lineno ( int _line_number , yyscan_t yyscanner );
+
+
+
+
+int yyget_column  ( yyscan_t yyscanner );
+
+
+
+
+
+void yyset_column ( int _column_no , yyscan_t yyscanner );
+
+
+
+
+YYSTYPE * yyget_lval ( yyscan_t yyscanner );
+
+
+void yyset_lval ( YYSTYPE * yylval_param , yyscan_t yyscanner );
+
+
+    
+       YYLTYPE *yyget_lloc ( yyscan_t yyscanner );
+    
+
+    
+        void yyset_lloc ( YYLTYPE * yylloc_param , yyscan_t yyscanner );
+    
+
+
+/* Macros after this point can all be overridden by user definitions in
+ * section 1.
+ */
+
+#ifndef YY_SKIP_YYWRAP
+#ifdef __cplusplus
+extern "C" int yywrap ( yyscan_t yyscanner );
+#else
+extern int yywrap ( yyscan_t yyscanner );
+#endif
+#endif
+
+#ifndef YY_NO_UNPUT
+    
+#endif
+
+
+#ifndef yytext_ptr
+static void yy_flex_strncpy ( char *, const char *, int , yyscan_t yyscanner);
+#endif
+
+#ifdef YY_NEED_STRLEN
+static int yy_flex_strlen ( const char * , yyscan_t yyscanner);
+#endif
+
+#ifndef YY_NO_INPUT
+#ifdef __cplusplus
+static int yyinput ( yyscan_t yyscanner );
+#else
+static int input ( yyscan_t yyscanner );
+#endif
+
+#endif
+
+
+
+
+
+
+
+
+/* Amount of stuff to slurp up with each read. */
+#ifndef YY_READ_BUF_SIZE
+#ifdef __ia64__
+/* On IA-64, the buffer size is 16k, not 8k */
+#define YY_READ_BUF_SIZE 16384
+#else
+#define YY_READ_BUF_SIZE 8192
+#endif /* __ia64__ */
+#endif
+
+
+/* Copy whatever the last rule matched to the standard output. */
+#ifndef ECHO
+/* This used to be an fputs(), but since the string might contain NUL's,
+ * we now use fwrite().
+ */
+#define ECHO do { if (fwrite( yytext, (size_t) yyleng, 1, yyout )) {} } while (0)
+#endif
+
+
+
+/* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
+ * is returned in "result".
+ */
+#ifndef YY_INPUT
+#define YY_INPUT(buf,result,max_size) \
+	if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
+		{ \
+		int c = '*'; \
+		int n; \
+		for ( n = 0; n < max_size && \
+			     (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
+			buf[n] = (char) c; \
+		if ( c == '\n' ) \
+			buf[n++] = (char) c; \
+		if ( c == EOF && ferror( yyin ) ) \
+			YY_FATAL_ERROR( "input in flex scanner failed" ); \
+		result = n; \
+		} \
+	else \
+		{ \
+		errno=0; \
+		while ( (result = (int) fread(buf, 1, (yy_size_t) max_size, yyin)) == 0 && ferror(yyin)) \
+			{ \
+			if( errno != EINTR) \
+				{ \
+				YY_FATAL_ERROR( "input in flex scanner failed" ); \
+				break; \
+				} \
+			errno=0; \
+			clearerr(yyin); \
+			} \
+		}\
+\
+
+#endif
+
+
+
+/* No semi-colon after return; correct usage is to write "yyterminate();" -
+ * we don't want an extra ';' after the "return" because that will cause
+ * some compilers to complain about unreachable statements.
+ */
+#ifndef yyterminate
+#define yyterminate() return YY_NULL
+#endif
+
+
+/* Number of entries by which start-condition stack grows. */
+#ifndef YY_START_STACK_INCR
+#define YY_START_STACK_INCR 25
+#endif
+
+
+/* Report a fatal error. */
+#ifndef YY_FATAL_ERROR
+#define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
+#endif
+
+
+
+/* end tables serialization structures and prototypes */
+
+
+
+/* Default declaration of generated scanner - a define so the user can
+ * easily add parameters.
+ */
+#ifndef YY_DECL
+#define YY_DECL_IS_OURS 1
+
+
+
+
+
+
+        
+    
+    
+
+
+
+    
+    
+    
+
+
+extern int yylex \
+               (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner);
+
+#define YY_DECL int yylex \
+               (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner)
+#endif /* !YY_DECL */
+
+
+/* Code executed at the beginning of each rule, after yytext and yyleng
+ * have been set up.
+ */
+#ifndef YY_USER_ACTION
+#define YY_USER_ACTION
+#endif
+
+
+
+/* Code executed at the end of each rule. */
+#ifndef YY_BREAK
+#define YY_BREAK /*LINTED*/break;
+#endif
+
+
+
+#define YY_RULE_SETUP \
+	YY_USER_ACTION
+
+
+/** The main scanner function which does all the work.
+ */
+YY_DECL
+{
+	yy_state_type yy_current_state;
+	char *yy_cp, *yy_bp;
+	int yy_act;
+    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+
+
+
+
+    yylval = yylval_param;
+
+
+
+    yylloc = yylloc_param;
+
+
+	if ( !yyg->yy_init )
+		{
+		yyg->yy_init = 1;
+
+#ifdef YY_USER_INIT
+		YY_USER_INIT;
+#endif
+
+
+
+		if ( ! yyg->yy_start )
+			yyg->yy_start = 1;	/* first start state */
+
+		if ( ! yyin )
+			yyin = stdin;
+
+		if ( ! yyout )
+			yyout = stdout;
+
+		if ( ! YY_CURRENT_BUFFER ) {
+			yyensure_buffer_stack (yyscanner);
+			YY_CURRENT_BUFFER_LVALUE =
+				yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner);
+		}
+
+		yy_load_buffer_state( yyscanner );
+		}
+
+	{
+
+
+    /* Line comment */
+
+	while ( /*CONSTCOND*/1 )		/* loops until end-of-file is reached */
+		{
+		yy_cp = yyg->yy_c_buf_p;
+
+		/* Support of yytext. */
+		*yy_cp = yyg->yy_hold_char;
+
+		/* yy_bp points to the position in yy_ch_buf of the start of
+		 * the current run.
+		 */
+		yy_bp = yy_cp;
+
+		yy_current_state = yyg->yy_start;
+yy_match:
+		do
+			{
+			YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ;
+			if ( yy_accept[yy_current_state] )
+				{
+				yyg->yy_last_accepting_state = yy_current_state;
+				yyg->yy_last_accepting_cpos = yy_cp;
+				}
+			while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+				{
+				yy_current_state = (int) yy_def[yy_current_state];
+				if ( yy_current_state >= 95 )
+					yy_c = yy_meta[yy_c];
+				}
+			yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
+			++yy_cp;
+			}
+		while ( yy_current_state != 94 );
+		yy_cp = yyg->yy_last_accepting_cpos;
+		yy_current_state = yyg->yy_last_accepting_state;
+
+yy_find_action:
+		yy_act = yy_accept[yy_current_state];
+
+		YY_DO_BEFORE_ACTION;
+
+
+
+do_action:	/* This label is used only to access EOF actions. */
+
+
+		switch ( yy_act )
+	{ /* beginning of action switch */
+			case 0: /* must back up */
+			/* undo the effects of YY_DO_BEFORE_ACTION */
+			*yy_cp = yyg->yy_hold_char;
+			yy_cp = yyg->yy_last_accepting_cpos;
+			yy_current_state = yyg->yy_last_accepting_state;
+			goto yy_find_action;
+
+case 1:
+YY_RULE_SETUP
+
+	YY_BREAK
+/* Block comment */
+/* Line breaks are just counted - not returned. */
+/* The comment is replaced by a single space. */
+case 2:
+YY_RULE_SETUP
+{ BEGIN(COMMENT); }
+	YY_BREAK
+case 3:
+YY_RULE_SETUP
+
+	YY_BREAK
+case 4:
+YY_RULE_SETUP
+
+	YY_BREAK
+case 5:
+/* rule 5 can match eol */
+YY_RULE_SETUP
+{
+    if (yylineno == INT_MAX)
+    {
+        *yylval = "Integer overflow on line number";
+        return angle::pp::Token::GOT_ERROR;
+    }
+    ++yylineno;
+}
+	YY_BREAK
+case 6:
+YY_RULE_SETUP
+{
+    yyextra->leadingSpace = true;
+    BEGIN(INITIAL);
+}
+	YY_BREAK
+case 7:
+YY_RULE_SETUP
+{
+    // # is only valid at start of line for preprocessor directives.
+    yylval->assign(1, yytext[0]);
+    return yyextra->lineStart ? angle::pp::Token::PP_HASH : angle::pp::Token::PP_OTHER;
+}
+	YY_BREAK
+case 8:
+YY_RULE_SETUP
+{
+    yylval->assign(yytext, yyleng);
+    return angle::pp::Token::IDENTIFIER;
+}
+	YY_BREAK
+case 9:
+YY_RULE_SETUP
+{
+    yylval->assign(yytext, yyleng);
+    return angle::pp::Token::CONST_INT;
+}
+	YY_BREAK
+case 10:
+YY_RULE_SETUP
+{
+    yylval->assign(yytext, yyleng);
+    return angle::pp::Token::CONST_FLOAT;
+}
+	YY_BREAK
+/* Anything that starts with a {DIGIT} or .{DIGIT} must be a number. */
+/* Rule to catch all invalid integers and floats. */
+case 11:
+YY_RULE_SETUP
+{
+    yylval->assign(yytext, yyleng);
+    return angle::pp::Token::PP_NUMBER;
+}
+	YY_BREAK
+case 12:
+YY_RULE_SETUP
+{
+    yylval->assign(yytext, yyleng);
+    return angle::pp::Token::OP_INC;
+}
+	YY_BREAK
+case 13:
+YY_RULE_SETUP
+{
+    yylval->assign(yytext, yyleng);
+    return angle::pp::Token::OP_DEC;
+}
+	YY_BREAK
+case 14:
+YY_RULE_SETUP
+{
+    yylval->assign(yytext, yyleng);
+    return angle::pp::Token::OP_LEFT;
+}
+	YY_BREAK
+case 15:
+YY_RULE_SETUP
+{
+    yylval->assign(yytext, yyleng);
+    return angle::pp::Token::OP_RIGHT;
+}
+	YY_BREAK
+case 16:
+YY_RULE_SETUP
+{
+    yylval->assign(yytext, yyleng);
+    return angle::pp::Token::OP_LE;
+}
+	YY_BREAK
+case 17:
+YY_RULE_SETUP
+{
+    yylval->assign(yytext, yyleng);
+    return angle::pp::Token::OP_GE;
+}
+	YY_BREAK
+case 18:
+YY_RULE_SETUP
+{
+    yylval->assign(yytext, yyleng);
+    return angle::pp::Token::OP_EQ;
+}
+	YY_BREAK
+case 19:
+YY_RULE_SETUP
+{
+    yylval->assign(yytext, yyleng);
+    return angle::pp::Token::OP_NE;
+}
+	YY_BREAK
+case 20:
+YY_RULE_SETUP
+{
+    yylval->assign(yytext, yyleng);
+    return angle::pp::Token::OP_AND;
+}
+	YY_BREAK
+case 21:
+YY_RULE_SETUP
+{
+    yylval->assign(yytext, yyleng);
+    return angle::pp::Token::OP_XOR;
+}
+	YY_BREAK
+case 22:
+YY_RULE_SETUP
+{
+    yylval->assign(yytext, yyleng);
+    return angle::pp::Token::OP_OR;
+}
+	YY_BREAK
+case 23:
+YY_RULE_SETUP
+{
+    yylval->assign(yytext, yyleng);
+    return angle::pp::Token::OP_ADD_ASSIGN;
+}
+	YY_BREAK
+case 24:
+YY_RULE_SETUP
+{
+    yylval->assign(yytext, yyleng);
+    return angle::pp::Token::OP_SUB_ASSIGN;
+}
+	YY_BREAK
+case 25:
+YY_RULE_SETUP
+{
+    yylval->assign(yytext, yyleng);
+    return angle::pp::Token::OP_MUL_ASSIGN;
+}
+	YY_BREAK
+case 26:
+YY_RULE_SETUP
+{
+    yylval->assign(yytext, yyleng);
+    return angle::pp::Token::OP_DIV_ASSIGN;
+}
+	YY_BREAK
+case 27:
+YY_RULE_SETUP
+{
+    yylval->assign(yytext, yyleng);
+    return angle::pp::Token::OP_MOD_ASSIGN;
+}
+	YY_BREAK
+case 28:
+YY_RULE_SETUP
+{
+    yylval->assign(yytext, yyleng);
+    return angle::pp::Token::OP_LEFT_ASSIGN;
+}
+	YY_BREAK
+case 29:
+YY_RULE_SETUP
+{
+    yylval->assign(yytext, yyleng);
+    return angle::pp::Token::OP_RIGHT_ASSIGN;
+}
+	YY_BREAK
+case 30:
+YY_RULE_SETUP
+{
+    yylval->assign(yytext, yyleng);
+    return angle::pp::Token::OP_AND_ASSIGN;
+}
+	YY_BREAK
+case 31:
+YY_RULE_SETUP
+{
+    yylval->assign(yytext, yyleng);
+    return angle::pp::Token::OP_XOR_ASSIGN;
+}
+	YY_BREAK
+case 32:
+YY_RULE_SETUP
+{
+    yylval->assign(yytext, yyleng);
+    return angle::pp::Token::OP_OR_ASSIGN;
+}
+	YY_BREAK
+case 33:
+YY_RULE_SETUP
+{
+    yylval->assign(1, yytext[0]);
+    return yytext[0];
+}
+	YY_BREAK
+case 34:
+YY_RULE_SETUP
+{ yyextra->leadingSpace = true; }
+	YY_BREAK
+case 35:
+/* rule 35 can match eol */
+YY_RULE_SETUP
+{
+    if (yylineno == INT_MAX)
+    {
+        *yylval = "Integer overflow on line number";
+        return angle::pp::Token::GOT_ERROR;
+    }
+    ++yylineno;
+    yylval->assign(1, '\n');
+    return '\n';
+}
+	YY_BREAK
+case 36:
+YY_RULE_SETUP
+{
+    yylval->assign(1, yytext[0]);
+    return angle::pp::Token::PP_OTHER;
+}
+	YY_BREAK
+case YY_STATE_EOF(INITIAL):
+case YY_STATE_EOF(COMMENT):
+{
+    // YY_USER_ACTION is not invoked for handling EOF.
+    // Set the location for EOF token manually.
+    angle::pp::Input* input = &yyextra->input;
+    angle::pp::Input::Location* scanLoc = &yyextra->scanLoc;
+    yy_size_t sIndexMax = input->count() ? input->count() - 1 : 0;
+    if (scanLoc->sIndex != sIndexMax)
+    {
+        // We can only reach here if there are empty strings at the
+        // end of the input.
+        scanLoc->sIndex = sIndexMax; scanLoc->cIndex = 0;
+        // FIXME: this is not 64-bit clean.
+        yyfileno = static_cast<int>(sIndexMax); yylineno = 1;
+    }
+    yylloc->file = yyfileno;
+    yylloc->line = yylineno;
+    yylval->clear();
+
+    // Line number overflows fake EOFs to exit early, check for this case.
+    if (yylineno == INT_MAX) {
+        yyextra->diagnostics->report(angle::pp::Diagnostics::PP_TOKENIZER_ERROR,
+                angle::pp::SourceLocation(yyfileno, yylineno),
+                "Integer overflow on line number");
+    }
+    else if (YY_START == COMMENT)
+    {
+        yyextra->diagnostics->report(angle::pp::Diagnostics::PP_EOF_IN_COMMENT,
+                                     angle::pp::SourceLocation(yyfileno, yylineno),
+                                     "EOF while in a comment");
+    }
+    yyterminate();
+}
+	YY_BREAK
+case 37:
+YY_RULE_SETUP
+ECHO;
+	YY_BREAK
+
+	case YY_END_OF_BUFFER:
+		{
+		/* Amount of text matched not including the EOB char. */
+		int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
+
+		/* Undo the effects of YY_DO_BEFORE_ACTION. */
+		*yy_cp = yyg->yy_hold_char;
+		YY_RESTORE_YY_MORE_OFFSET
+
+		if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
+			{
+			/* We're scanning a new file or input source.  It's
+			 * possible that this happened because the user
+			 * just pointed yyin at a new source and called
+			 * yylex().  If so, then we have to assure
+			 * consistency between YY_CURRENT_BUFFER and our
+			 * globals.  Here is the right place to do so, because
+			 * this is the first action (other than possibly a
+			 * back-up) that will match for the new input source.
+			 */
+			yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
+			YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
+			YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
+			}
+
+		/* Note that here we test for yy_c_buf_p "<=" to the position
+		 * of the first EOB in the buffer, since yy_c_buf_p will
+		 * already have been incremented past the NUL character
+		 * (since all states make transitions on EOB to the
+		 * end-of-buffer state).  Contrast this with the test
+		 * in input().
+		 */
+		if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
+			{ /* This was really a NUL. */
+			yy_state_type yy_next_state;
+
+			yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
+
+			yy_current_state = yy_get_previous_state( yyscanner );
+
+			/* Okay, we're now positioned to make the NUL
+			 * transition.  We couldn't have
+			 * yy_get_previous_state() go ahead and do it
+			 * for us because it doesn't know how to deal
+			 * with the possibility of jamming (and we don't
+			 * want to build jamming into it because then it
+			 * will run more slowly).
+			 */
+
+			yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
+
+			yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
+
+			if ( yy_next_state )
+				{
+				/* Consume the NUL. */
+				yy_cp = ++yyg->yy_c_buf_p;
+				yy_current_state = yy_next_state;
+				goto yy_match;
+				}
+
+			else
+				{
+				yy_cp = yyg->yy_last_accepting_cpos;
+				yy_current_state = yyg->yy_last_accepting_state;
+				goto yy_find_action;
+				}
+			}
+
+		else switch ( yy_get_next_buffer( yyscanner ) )
+			{
+			case EOB_ACT_END_OF_FILE:
+				{
+				yyg->yy_did_buffer_switch_on_eof = 0;
+
+				if ( yywrap( yyscanner ) )
+					{
+					/* Note: because we've taken care in
+					 * yy_get_next_buffer() to have set up
+					 * yytext, we can now set up
+					 * yy_c_buf_p so that if some total
+					 * hoser (like flex itself) wants to
+					 * call the scanner after we return the
+					 * YY_NULL, it'll still work - another
+					 * YY_NULL will get returned.
+					 */
+					yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
+
+					yy_act = YY_STATE_EOF(YY_START);
+					goto do_action;
+					}
+
+				else
+					{
+					if ( ! yyg->yy_did_buffer_switch_on_eof )
+						YY_NEW_FILE;
+					}
+				break;
+				}
+
+			case EOB_ACT_CONTINUE_SCAN:
+				yyg->yy_c_buf_p =
+					yyg->yytext_ptr + yy_amount_of_matched_text;
+
+				yy_current_state = yy_get_previous_state( yyscanner );
+
+				yy_cp = yyg->yy_c_buf_p;
+				yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
+				goto yy_match;
+
+			case EOB_ACT_LAST_MATCH:
+				yyg->yy_c_buf_p =
+				&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
+
+				yy_current_state = yy_get_previous_state( yyscanner );
+
+				yy_cp = yyg->yy_c_buf_p;
+				yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
+				goto yy_find_action;
+			}
+		break;
+		}
+
+	default:
+		YY_FATAL_ERROR(
+			"fatal flex scanner internal error--no action found" );
+	} /* end of action switch */
+		} /* end of scanning one token */
+	} /* end of user's declarations */
+} /* end of yylex */
+
+
+
+
+
+/* yy_get_next_buffer - try to read in a new buffer
+ *
+ * Returns a code representing an action:
+ *	EOB_ACT_LAST_MATCH -
+ *	EOB_ACT_CONTINUE_SCAN - continue scanning from current position
+ *	EOB_ACT_END_OF_FILE - end of file
+ */
+static int yy_get_next_buffer (yyscan_t yyscanner)
+{
+    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+	char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
+	char *source = yyg->yytext_ptr;
+	int number_to_move, i;
+	int ret_val;
+
+	if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
+		YY_FATAL_ERROR(
+		"fatal flex scanner internal error--end of buffer missed" );
+
+	if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
+		{ /* Don't try to fill the buffer, so this is an EOF. */
+		if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
+			{
+			/* We matched a single character, the EOB, so
+			 * treat this as a final EOF.
+			 */
+			return EOB_ACT_END_OF_FILE;
+			}
+
+		else
+			{
+			/* We matched some text prior to the EOB, first
+			 * process it.
+			 */
+			return EOB_ACT_LAST_MATCH;
+			}
+		}
+
+	/* Try to read more data. */
+
+	/* First move last chars to start of buffer. */
+	number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr - 1);
+
+	for ( i = 0; i < number_to_move; ++i )
+		*(dest++) = *(source++);
+
+	if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
+		/* don't do the read, it's not guaranteed to return an EOF,
+		 * just force an EOF
+		 */
+		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
+
+	else
+		{
+			int num_to_read =
+			YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
+
+		while ( num_to_read <= 0 )
+			{ /* Not enough room in the buffer - grow it. */
+
+			/* just a shorter name for the current buffer */
+			YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;
+
+			int yy_c_buf_p_offset =
+				(int) (yyg->yy_c_buf_p - b->yy_ch_buf);
+
+			if ( b->yy_is_our_buffer )
+				{
+				int new_size = b->yy_buf_size * 2;
+
+				if ( new_size <= 0 )
+					b->yy_buf_size += b->yy_buf_size / 8;
+				else
+					b->yy_buf_size *= 2;
+
+				b->yy_ch_buf = (char *)
+					/* Include room in for 2 EOB chars. */
+					yyrealloc( (void *) b->yy_ch_buf,
+							 (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
+				}
+			else
+				/* Can't grow it, we don't own it. */
+				b->yy_ch_buf = NULL;
+
+			if ( ! b->yy_ch_buf )
+				YY_FATAL_ERROR(
+				"fatal error - scanner input buffer overflow" );
+
+			yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
+
+			num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
+						number_to_move - 1;
+
+			}
+
+		if ( num_to_read > YY_READ_BUF_SIZE )
+			num_to_read = YY_READ_BUF_SIZE;
+
+		/* Read in more data. */
+		yy_size_t ret = 0;
+		YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
+			ret, num_to_read );
+		yyg->yy_n_chars = static_cast<int>(ret);
+
+		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
+		}
+
+	if ( yyg->yy_n_chars == 0 )
+		{
+		if ( number_to_move == YY_MORE_ADJ )
+			{
+			ret_val = EOB_ACT_END_OF_FILE;
+			yyrestart( yyin  , yyscanner);
+			}
+
+		else
+			{
+			ret_val = EOB_ACT_LAST_MATCH;
+			YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
+				YY_BUFFER_EOF_PENDING;
+			}
+		}
+
+	else
+		ret_val = EOB_ACT_CONTINUE_SCAN;
+
+	if ((yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
+		/* Extend the array by 50%, plus the number we really need. */
+		int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
+		YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc(
+			(void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size , yyscanner );
+		if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
+			YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
+		/* "- 2" to take care of EOB's */
+		YY_CURRENT_BUFFER_LVALUE->yy_buf_size = (int) (new_size - 2);
+	}
+
+	yyg->yy_n_chars += number_to_move;
+	YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
+	YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
+
+	yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
+
+	return ret_val;
+}
+
+
+/* yy_get_previous_state - get the state just before the EOB char was reached */
+
+    static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
+{
+	yy_state_type yy_current_state;
+	char *yy_cp;
+    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+
+	yy_current_state = yyg->yy_start;
+
+	for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
+		{
+		YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
+		if ( yy_accept[yy_current_state] )
+			{
+			yyg->yy_last_accepting_state = yy_current_state;
+			yyg->yy_last_accepting_cpos = yy_cp;
+			}
+		while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+			{
+			yy_current_state = (int) yy_def[yy_current_state];
+			if ( yy_current_state >= 95 )
+				yy_c = yy_meta[yy_c];
+			}
+		yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
+		}
+
+	return yy_current_state;
+}
+
+
+/* yy_try_NUL_trans - try to make a transition on the NUL character
+ *
+ * synopsis
+ *	next_state = yy_try_NUL_trans( current_state );
+ */
+    static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state , yyscan_t yyscanner)
+{
+	int yy_is_jam;
+    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
+	char *yy_cp = yyg->yy_c_buf_p;
+
+	YY_CHAR yy_c = 1;
+	if ( yy_accept[yy_current_state] )
+		{
+		yyg->yy_last_accepting_state = yy_current_state;
+		yyg->yy_last_accepting_cpos = yy_cp;
+		}
+	while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+		{
+		yy_current_state = (int) yy_def[yy_current_state];
+		if ( yy_current_state >= 95 )
+			yy_c = yy_meta[yy_c];
+		}
+	yy_current_state = yy_nxt[yy_base[yy_current_state] + yy_c];
+	yy_is_jam = (yy_current_state == 94);
+
+	(void)yyg;
+	return yy_is_jam ? 0 : yy_current_state;
+}
+
+
+#ifndef YY_NO_UNPUT
+
+#endif
+
+#ifndef YY_NO_INPUT
+#ifdef __cplusplus
+    static int yyinput (yyscan_t yyscanner)
+#else
+    static int input  (yyscan_t yyscanner)
+#endif
+
+{
+	int c;
+    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+
+	*yyg->yy_c_buf_p = yyg->yy_hold_char;
+
+	if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
+		{
+		/* yy_c_buf_p now points to the character we want to return.
+		 * If this occurs *before* the EOB characters, then it's a
+		 * valid NUL; if not, then we've hit the end of the buffer.
+		 */
+		if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
+			/* This was really a NUL. */
+			*yyg->yy_c_buf_p = '\0';
+
+		else
+			{ /* need more input */
+			int offset = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr);
+			++yyg->yy_c_buf_p;
+
+			switch ( yy_get_next_buffer( yyscanner ) )
+				{
+				case EOB_ACT_LAST_MATCH:
+					/* This happens because yy_g_n_b()
+					 * sees that we've accumulated a
+					 * token and flags that we need to
+					 * try matching the token before
+					 * proceeding.  But for input(),
+					 * there's no matching to consider.
+					 * So convert the EOB_ACT_LAST_MATCH
+					 * to EOB_ACT_END_OF_FILE.
+					 */
+
+					/* Reset buffer status. */
+					yyrestart( yyin , yyscanner);
+
+					/*FALLTHROUGH*/
+
+				case EOB_ACT_END_OF_FILE:
+					{
+					if ( yywrap( yyscanner ) )
+						return 0;
+
+					if ( ! yyg->yy_did_buffer_switch_on_eof )
+						YY_NEW_FILE;
+#ifdef __cplusplus
+					return yyinput(yyscanner);
+#else
+					return input(yyscanner);
+#endif
+					}
+
+				case EOB_ACT_CONTINUE_SCAN:
+					yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
+					break;
+				}
+			}
+		}
+
+	c = *(unsigned char *) yyg->yy_c_buf_p;	/* cast for 8-bit char's */
+	*yyg->yy_c_buf_p = '\0';	/* preserve yytext */
+	yyg->yy_hold_char = *++yyg->yy_c_buf_p;
+
+
+	return c;
+}
+#endif	/* ifndef YY_NO_INPUT */
+
+/** Immediately switch to a different input stream.
+ * @param input_file A readable stream.
+ * @param yyscanner The scanner object.
+ * @note This function does not reset the start condition to @c INITIAL .
+ */
+    void yyrestart  (FILE * input_file , yyscan_t yyscanner)
+{
+    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+
+	if ( ! YY_CURRENT_BUFFER ){
+        yyensure_buffer_stack (yyscanner);
+		YY_CURRENT_BUFFER_LVALUE =
+            yy_create_buffer( yyin, YY_BUF_SIZE , yyscanner);
+	}
+
+	yy_init_buffer( YY_CURRENT_BUFFER, input_file , yyscanner);
+	yy_load_buffer_state( yyscanner );
+}
+
+
+/** Switch to a different input buffer.
+ * @param new_buffer The new input buffer.
+ * @param yyscanner The scanner object.
+ */
+    void yy_switch_to_buffer  (YY_BUFFER_STATE  new_buffer , yyscan_t yyscanner)
+{
+    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+
+	/* TODO. We should be able to replace this entire function body
+	 * with
+	 *		yypop_buffer_state();
+	 *		yypush_buffer_state(new_buffer);
+     */
+	yyensure_buffer_stack (yyscanner);
+	if ( YY_CURRENT_BUFFER == new_buffer )
+		return;
+
+	if ( YY_CURRENT_BUFFER )
+		{
+		/* Flush out information for old buffer. */
+		*yyg->yy_c_buf_p = yyg->yy_hold_char;
+		YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
+		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
+		}
+
+	YY_CURRENT_BUFFER_LVALUE = new_buffer;
+	yy_load_buffer_state( yyscanner );
+
+	/* We don't actually know whether we did this switch during
+	 * EOF (yywrap()) processing, but the only time this flag
+	 * is looked at is after yywrap() is called, so it's safe
+	 * to go ahead and always set it.
+	 */
+	yyg->yy_did_buffer_switch_on_eof = 1;
+}
+
+
+static void yy_load_buffer_state  (yyscan_t yyscanner)
+{
+    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+	yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
+	yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
+	yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
+	yyg->yy_hold_char = *yyg->yy_c_buf_p;
+}
+
+/** Allocate and initialize an input buffer state.
+ * @param file A readable stream.
+ * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
+ * @param yyscanner The scanner object.
+ * @return the allocated buffer state.
+ */
+    YY_BUFFER_STATE yy_create_buffer  (FILE * file, int  size , yyscan_t yyscanner)
+{
+	YY_BUFFER_STATE b;
+    
+	b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner );
+	if ( ! b )
+		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
+
+	b->yy_buf_size = size;
+
+	/* yy_ch_buf has to be 2 characters longer than the size given because
+	 * we need to put in 2 end-of-buffer characters.
+	 */
+	b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
+	if ( ! b->yy_ch_buf )
+		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
+
+	b->yy_is_our_buffer = 1;
+
+	yy_init_buffer( b, file , yyscanner);
+
+	return b;
+}
+
+
+/** Destroy the buffer.
+ * @param b a buffer created with yy_create_buffer()
+ * @param yyscanner The scanner object.
+ */
+    void yy_delete_buffer (YY_BUFFER_STATE  b , yyscan_t yyscanner)
+{
+    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+
+	if ( ! b )
+		return;
+
+	if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
+		YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
+
+	if ( b->yy_is_our_buffer )
+		yyfree( (void *) b->yy_ch_buf , yyscanner );
+
+	yyfree( (void *) b , yyscanner );
+}
+
+
+/* Initializes or reinitializes a buffer.
+ * This function is sometimes called more than once on the same buffer,
+ * such as during a yyrestart() or at EOF.
+ */
+    static void yy_init_buffer  (YY_BUFFER_STATE  b, FILE * file , yyscan_t yyscanner)
+
+{
+	int oerrno = errno;
+    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+
+	yy_flush_buffer( b , yyscanner);
+
+	b->yy_input_file = file;
+	b->yy_fill_buffer = 1;
+
+    /* If b is the current buffer, then yy_init_buffer was _probably_
+     * called from yyrestart() or through yy_get_next_buffer.
+     * In that case, we don't want to reset the lineno or column.
+     */
+    if (b != YY_CURRENT_BUFFER){
+        b->yy_bs_lineno = 1;
+        b->yy_bs_column = 0;
+    }
+
+
+    
+        b->yy_is_interactive = 0;
+    
+
+	errno = oerrno;
+}
+
+/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
+ * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
+ * @param yyscanner The scanner object.
+ */
+    void yy_flush_buffer (YY_BUFFER_STATE  b , yyscan_t yyscanner)
+{
+    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+	if ( ! b )
+		return;
+
+	b->yy_n_chars = 0;
+
+	/* We always need two end-of-buffer characters.  The first causes
+	 * a transition to the end-of-buffer state.  The second causes
+	 * a jam in that state.
+	 */
+	b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
+	b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
+
+	b->yy_buf_pos = &b->yy_ch_buf[0];
+
+	b->yy_at_bol = 1;
+	b->yy_buffer_status = YY_BUFFER_NEW;
+
+	if ( b == YY_CURRENT_BUFFER )
+		yy_load_buffer_state( yyscanner );
+}
+
+/** Pushes the new state onto the stack. The new state becomes
+ *  the current state. This function will allocate the stack
+ *  if necessary.
+ *  @param new_buffer The new state.
+ *  @param yyscanner The scanner object.
+ */
+void yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
+{
+    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+	if (new_buffer == NULL)
+		return;
+
+	yyensure_buffer_stack(yyscanner);
+
+	/* This block is copied from yy_switch_to_buffer. */
+	if ( YY_CURRENT_BUFFER )
+		{
+		/* Flush out information for old buffer. */
+		*yyg->yy_c_buf_p = yyg->yy_hold_char;
+		YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
+		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
+		}
+
+	/* Only push if top exists. Otherwise, replace top. */
+	if (YY_CURRENT_BUFFER)
+		yyg->yy_buffer_stack_top++;
+	YY_CURRENT_BUFFER_LVALUE = new_buffer;
+
+	/* copied from yy_switch_to_buffer. */
+	yy_load_buffer_state( yyscanner );
+	yyg->yy_did_buffer_switch_on_eof = 1;
+}
+
+
+/** Removes and deletes the top of the stack, if present.
+ *  The next element becomes the new top.
+ *  @param yyscanner The scanner object.
+ */
+void yypop_buffer_state (yyscan_t yyscanner)
+{
+    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+	if (!YY_CURRENT_BUFFER)
+		return;
+
+	yy_delete_buffer(YY_CURRENT_BUFFER , yyscanner);
+	YY_CURRENT_BUFFER_LVALUE = NULL;
+	if (yyg->yy_buffer_stack_top > 0)
+		--yyg->yy_buffer_stack_top;
+
+	if (YY_CURRENT_BUFFER) {
+		yy_load_buffer_state( yyscanner );
+		yyg->yy_did_buffer_switch_on_eof = 1;
+	}
+}
+
+
+/* Allocates the stack if it does not exist.
+ *  Guarantees space for at least one push.
+ */
+static void yyensure_buffer_stack (yyscan_t yyscanner)
+{
+	yy_size_t num_to_alloc;
+    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+
+	if (!yyg->yy_buffer_stack) {
+
+		/* First allocation is just for 2 elements, since we don't know if this
+		 * scanner will even need a stack. We use 2 instead of 1 to avoid an
+		 * immediate realloc on the next call.
+         */
+      num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */
+		yyg->yy_buffer_stack = (struct yy_buffer_state**)yyalloc
+								(num_to_alloc * sizeof(struct yy_buffer_state*)
+								, yyscanner);
+		if ( ! yyg->yy_buffer_stack )
+			YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
+
+
+		memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
+
+		yyg->yy_buffer_stack_max = num_to_alloc;
+		yyg->yy_buffer_stack_top = 0;
+		return;
+	}
+
+	if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
+
+		/* Increase the buffer to prepare for a possible push. */
+		yy_size_t grow_size = 8 /* arbitrary grow size */;
+
+		num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
+		yyg->yy_buffer_stack = (struct yy_buffer_state**)yyrealloc
+								(yyg->yy_buffer_stack,
+								num_to_alloc * sizeof(struct yy_buffer_state*)
+								, yyscanner);
+		if ( ! yyg->yy_buffer_stack )
+			YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
+
+		/* zero only the new slots.*/
+		memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
+		yyg->yy_buffer_stack_max = num_to_alloc;
+	}
+}
+
+
+
+
+
+/** Setup the input buffer state to scan directly from a user-specified character buffer.
+ * @param base the character buffer
+ * @param size the size in bytes of the character buffer
+ * @param yyscanner The scanner object.
+ * @return the newly allocated buffer state object.
+ */
+YY_BUFFER_STATE yy_scan_buffer  (char * base, yy_size_t  size , yyscan_t yyscanner)
+{
+	YY_BUFFER_STATE b;
+    
+	if ( size < 2 ||
+	     base[size-2] != YY_END_OF_BUFFER_CHAR ||
+	     base[size-1] != YY_END_OF_BUFFER_CHAR )
+		/* They forgot to leave room for the EOB's. */
+		return NULL;
+
+	b = (YY_BUFFER_STATE) yyalloc( sizeof( struct yy_buffer_state ) , yyscanner );
+	if ( ! b )
+		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
+
+	b->yy_buf_size = (int) (size - 2);	/* "- 2" to take care of EOB's */
+	b->yy_buf_pos = b->yy_ch_buf = base;
+	b->yy_is_our_buffer = 0;
+	b->yy_input_file = NULL;
+	b->yy_n_chars = b->yy_buf_size;
+	b->yy_is_interactive = 0;
+	b->yy_at_bol = 1;
+	b->yy_fill_buffer = 0;
+	b->yy_buffer_status = YY_BUFFER_NEW;
+
+	yy_switch_to_buffer( b , yyscanner );
+
+	return b;
+}
+
+
+
+
+/** Setup the input buffer state to scan a string. The next call to yylex() will
+ * scan from a @e copy of @a str.
+ * @param yystr a NUL-terminated string to scan
+ * @param yyscanner The scanner object.
+ * @return the newly allocated buffer state object.
+ * @note If you want to scan bytes that may contain NUL values, then use
+ *       yy_scan_bytes() instead.
+ */
+YY_BUFFER_STATE yy_scan_string (const char * yystr , yyscan_t yyscanner)
+{
+    
+	return yy_scan_bytes( yystr, (int) strlen(yystr) , yyscanner);
+}
+
+
+
+
+/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
+ * scan from a @e copy of @a bytes.
+ * @param yybytes the byte buffer to scan
+ * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
+ * @param yyscanner The scanner object.
+ * @return the newly allocated buffer state object.
+ */
+YY_BUFFER_STATE yy_scan_bytes  (const char * yybytes, int  _yybytes_len , yyscan_t yyscanner)
+{
+	YY_BUFFER_STATE b;
+	char *buf;
+	yy_size_t n;
+	int i;
+    
+	/* Get memory for full buffer, including space for trailing EOB's. */
+	n = (yy_size_t) (_yybytes_len + 2);
+	buf = (char *) yyalloc( n , yyscanner );
+	if ( ! buf )
+		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
+
+	for ( i = 0; i < _yybytes_len; ++i )
+		buf[i] = yybytes[i];
+
+	buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
+
+	b = yy_scan_buffer( buf, n , yyscanner);
+	if ( ! b )
+		YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
+
+	/* It's okay to grow etc. this buffer, and we should throw it
+	 * away when we're done.
+	 */
+	b->yy_is_our_buffer = 1;
+
+	return b;
+}
+
+
+
+
+
+
+
+
+
+
+
+#ifndef YY_EXIT_FAILURE
+#define YY_EXIT_FAILURE 2
+#endif
+
+static void yynoreturn yy_fatal_error (const char* msg , yyscan_t yyscanner)
+{
+	struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+	(void)yyg;
+	fprintf( stderr, "%s\n", msg );
+	exit( YY_EXIT_FAILURE );
+}
+
+/* Redefine yyless() so it works in section 3 code. */
+
+#undef yyless
+#define yyless(n) \
+	do \
+		{ \
+		/* Undo effects of setting up yytext. */ \
+        int yyless_macro_arg = (n); \
+        YY_LESS_LINENO(yyless_macro_arg);\
+		yytext[yyleng] = yyg->yy_hold_char; \
+		yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
+		yyg->yy_hold_char = *yyg->yy_c_buf_p; \
+		*yyg->yy_c_buf_p = '\0'; \
+		yyleng = yyless_macro_arg; \
+		} \
+	while ( 0 )
+
+
+
+/* Accessor  methods (get/set functions) to struct members. */
+
+
+/** Get the user-defined data for this scanner.
+ * @param yyscanner The scanner object.
+ */
+YY_EXTRA_TYPE yyget_extra  (yyscan_t yyscanner)
+{
+    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+    return yyextra;
+}
+
+
+
+/** Get the current line number.
+ * @param yyscanner The scanner object.
+ */
+int yyget_lineno  (yyscan_t yyscanner)
+{
+    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+
+    
+        if (! YY_CURRENT_BUFFER)
+            return 0;
+    
+    return yylineno;
+}
+
+
+
+
+/** Get the current column number.
+ * @param yyscanner The scanner object.
+ */
+int yyget_column  (yyscan_t yyscanner)
+{
+    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+
+    
+        if (! YY_CURRENT_BUFFER)
+            return 0;
+    
+    return yycolumn;
+}
+
+
+
+
+/** Get the input stream.
+ * @param yyscanner The scanner object.
+ */
+FILE *yyget_in  (yyscan_t yyscanner)
+{
+    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+    return yyin;
+}
+
+
+
+/** Get the output stream.
+ * @param yyscanner The scanner object.
+ */
+FILE *yyget_out  (yyscan_t yyscanner)
+{
+    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+    return yyout;
+}
+
+
+
+/** Get the length of the current token.
+ * @param yyscanner The scanner object.
+ */
+int yyget_leng  (yyscan_t yyscanner)
+{
+    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+    return yyleng;
+}
+
+
+/** Get the current token.
+ * @param yyscanner The scanner object.
+ */
+
+char *yyget_text  (yyscan_t yyscanner)
+{
+    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+    return yytext;
+}
+
+
+
+/** Set the user-defined data. This data is never touched by the scanner.
+ * @param user_defined The data to be associated with this scanner.
+ * @param yyscanner The scanner object.
+ */
+void yyset_extra (YY_EXTRA_TYPE  user_defined , yyscan_t yyscanner)
+{
+    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+    yyextra = user_defined ;
+}
+
+
+
+/** Set the current line number.
+ * @param _line_number line number
+ * @param yyscanner The scanner object.
+ */
+void yyset_lineno (int  _line_number , yyscan_t yyscanner)
+{
+    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+
+    
+        /* lineno is only valid if an input buffer exists. */
+        if (! YY_CURRENT_BUFFER )
+           YY_FATAL_ERROR( "yyset_lineno called with no buffer" );
+    
+    yylineno = _line_number;
+}
+
+
+
+
+/** Set the current column.
+ * @param _column_no column number
+ * @param yyscanner The scanner object.
+ */
+void yyset_column (int  _column_no , yyscan_t yyscanner)
+{
+    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+
+    
+        /* column is only valid if an input buffer exists. */
+        if (! YY_CURRENT_BUFFER )
+           YY_FATAL_ERROR( "yyset_column called with no buffer" );
+    
+    yycolumn = _column_no;
+}
+
+
+
+
+
+/** Set the input stream. This does not discard the current
+ * input buffer.
+ * @param _in_str A readable stream.
+ * @param yyscanner The scanner object.
+ * @see yy_switch_to_buffer
+ */
+void yyset_in (FILE *  _in_str , yyscan_t yyscanner)
+{
+    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+    yyin = _in_str ;
+}
+
+
+
+void yyset_out (FILE *  _out_str , yyscan_t yyscanner)
+{
+    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+    yyout = _out_str ;
+}
+
+
+
+
+int yyget_debug  (yyscan_t yyscanner)
+{
+    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+    return yy_flex_debug;
+}
+
+
+
+void yyset_debug (int  _bdebug , yyscan_t yyscanner)
+{
+    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+    yy_flex_debug = _bdebug ;
+}
+
+
+/* Accessor methods for yylval and yylloc */
+
+
+YYSTYPE * yyget_lval  (yyscan_t yyscanner)
+{
+    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+    return yylval;
+}
+
+
+
+void yyset_lval (YYSTYPE *  yylval_param , yyscan_t yyscanner)
+{
+    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+    yylval = yylval_param;
+}
+
+
+
+    
+YYLTYPE *yyget_lloc  (yyscan_t yyscanner)
+{
+    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+    return yylloc;
+}
+    
+
+    
+void yyset_lloc (YYLTYPE *  yylloc_param , yyscan_t yyscanner)
+{
+    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+    yylloc = yylloc_param;
+}
+    
+
+
+
+
+/* User-visible API */
+
+/* yylex_init is special because it creates the scanner itself, so it is
+ * the ONLY reentrant function that doesn't take the scanner as the last argument.
+ * That's why we explicitly handle the declaration, instead of using our macros.
+ */
+int yylex_init(yyscan_t* ptr_yy_globals)
+{
+    if (ptr_yy_globals == NULL){
+        errno = EINVAL;
+        return 1;
+    }
+
+    *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL );
+
+    if (*ptr_yy_globals == NULL){
+        errno = ENOMEM;
+        return 1;
+    }
+
+    /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
+    memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
+
+    return yy_init_globals ( *ptr_yy_globals );
+}
+
+
+/* yylex_init_extra has the same functionality as yylex_init, but follows the
+ * convention of taking the scanner as the last argument. Note however, that
+ * this is a *pointer* to a scanner, as it will be allocated by this call (and
+ * is the reason, too, why this function also must handle its own declaration).
+ * The user defined value in the first argument will be available to yyalloc in
+ * the yyextra field.
+ */
+int yylex_init_extra( YY_EXTRA_TYPE yy_user_defined, yyscan_t* ptr_yy_globals )
+{
+    struct yyguts_t dummy_yyguts;
+
+    yyset_extra (yy_user_defined, &dummy_yyguts);
+
+    if (ptr_yy_globals == NULL){
+        errno = EINVAL;
+        return 1;
+    }
+
+    *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
+
+    if (*ptr_yy_globals == NULL){
+        errno = ENOMEM;
+        return 1;
+    }
+
+    /* By setting to 0xAA, we expose bugs in
+    yy_init_globals. Leave at 0x00 for releases. */
+    memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
+
+    yyset_extra (yy_user_defined, *ptr_yy_globals);
+
+    return yy_init_globals ( *ptr_yy_globals );
+}
+
+
+static int yy_init_globals (yyscan_t yyscanner)
+{
+    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+    /* Initialization is the same as for the non-reentrant scanner.
+     * This function is called from yylex_destroy(), so don't allocate here.
+     */
+
+
+    yyg->yy_buffer_stack = NULL;
+    yyg->yy_buffer_stack_top = 0;
+    yyg->yy_buffer_stack_max = 0;
+    yyg->yy_c_buf_p = NULL;
+    yyg->yy_init = 0;
+    yyg->yy_start = 0;
+
+
+    yyg->yy_start_stack_ptr = 0;
+    yyg->yy_start_stack_depth = 0;
+    yyg->yy_start_stack =  NULL;
+
+
+
+
+
+
+/* Defined in main.c */
+#ifdef YY_STDINIT
+    yyin = stdin;
+    yyout = stdout;
+#else
+    yyin = NULL;
+    yyout = NULL;
+#endif
+
+    /* For future reference: Set errno on error, since we are called by
+     * yylex_init()
+     */
+    return 0;
+}
+
+
+/* yylex_destroy is for both reentrant and non-reentrant scanners. */
+int yylex_destroy  (yyscan_t yyscanner)
+{
+    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+
+    /* Pop the buffer stack, destroying each element. */
+	while(YY_CURRENT_BUFFER){
+		yy_delete_buffer( YY_CURRENT_BUFFER , yyscanner );
+		YY_CURRENT_BUFFER_LVALUE = NULL;
+		yypop_buffer_state(yyscanner);
+	}
+
+	/* Destroy the stack itself. */
+	yyfree(yyg->yy_buffer_stack , yyscanner);
+	yyg->yy_buffer_stack = NULL;
+
+
+    /* Destroy the start condition stack. */
+        yyfree( yyg->yy_start_stack , yyscanner );
+        yyg->yy_start_stack = NULL;
+
+
+
+
+    /* Reset the globals. This is important in a non-reentrant scanner so the next time
+     * yylex() is called, initialization will occur. */
+    yy_init_globals( yyscanner);
+
+    /* Destroy the main struct (reentrant only). */
+    yyfree ( yyscanner , yyscanner );
+    yyscanner = NULL;
+    return 0;
+}
+
+
+
+/*
+ * Internal utility routines.
+ */
+
+
+
+#ifndef yytext_ptr
+static void yy_flex_strncpy (char* s1, const char * s2, int n , yyscan_t yyscanner)
+{
+	struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+	(void)yyg;
+
+	int i;
+	for ( i = 0; i < n; ++i )
+		s1[i] = s2[i];
+}
+#endif
+
+
+
+#ifdef YY_NEED_STRLEN
+static int yy_flex_strlen (const char * s , yyscan_t yyscanner)
+{
+	int n;
+	for ( n = 0; s[n]; ++n )
+		;
+
+	return n;
+}
+#endif
+
+
+
+void *yyalloc (yy_size_t  size , yyscan_t yyscanner)
+{
+	struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+	(void)yyg;
+	return malloc(size);
+}
+
+
+
+void *yyrealloc  (void * ptr, yy_size_t  size , yyscan_t yyscanner)
+{
+	struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+	(void)yyg;
+
+	/* The cast to (char *) in the following accommodates both
+	 * implementations that use char* generic pointers, and those
+	 * that use void* generic pointers.  It works with the latter
+	 * because both ANSI C and C++ allow castless assignment from
+	 * any pointer type to void*, and deal with argument conversions
+	 * as though doing an assignment.
+	 */
+	return realloc(ptr, size);
+}
+
+
+
+void yyfree (void * ptr , yyscan_t yyscanner)
+{
+	struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+	(void)yyg;
+	free( (char *) ptr );	/* see yyrealloc() for (char *) cast */
+}
+
+
+#define YYTABLES_NAME "yytables"
+
+
+
+
+
+
+
+
+namespace angle {
+
+namespace pp {
+
+Tokenizer::Tokenizer(Diagnostics *diagnostics) : mHandle(nullptr), mMaxTokenSize(256)
+{
+    mContext.diagnostics = diagnostics;
+}
+
+Tokenizer::~Tokenizer()
+{
+    destroyScanner();
+}
+
+bool Tokenizer::init(size_t count, const char * const string[], const int length[])
+{
+    if ((count > 0) && (string == 0))
+        return false;
+
+    mContext.input = Input(count, string, length);
+    return initScanner();
+}
+
+void Tokenizer::setFileNumber(int file)
+{
+    // We use column number as file number.
+    // See macro yyfileno.
+    yyset_column(file, mHandle);
+}
+
+void Tokenizer::setLineNumber(int line)
+{
+    yyset_lineno(line, mHandle);
+}
+
+void Tokenizer::setMaxTokenSize(size_t maxTokenSize)
+{
+    mMaxTokenSize = maxTokenSize;
+}
+
+void Tokenizer::lex(Token *token)
+{
+    int tokenType = yylex(&token->text, &token->location, mHandle);
+
+    if (tokenType == Token::GOT_ERROR)
+    {
+        mContext.diagnostics->report(Diagnostics::PP_TOKENIZER_ERROR, token->location, token->text);
+        token->type = Token::LAST;
+    }
+    else
+    {
+        token->type = tokenType;
+    }
+
+    if (token->text.size() > mMaxTokenSize)
+    {
+        mContext.diagnostics->report(Diagnostics::PP_TOKEN_TOO_LONG,
+                                     token->location, token->text);
+        token->text.erase(mMaxTokenSize);
+    }
+
+    token->flags = 0;
+
+    token->setAtStartOfLine(mContext.lineStart);
+    mContext.lineStart = token->type == '\n';
+
+    token->setHasLeadingSpace(mContext.leadingSpace);
+    mContext.leadingSpace = false;
+}
+
+bool Tokenizer::initScanner()
+{
+    if ((mHandle == nullptr) && yylex_init_extra(&mContext, &mHandle))
+        return false;
+
+    yyrestart(0, mHandle);
+    return true;
+}
+
+void Tokenizer::destroyScanner()
+{
+    if (mHandle == nullptr)
+        return;
+
+    yylex_destroy(mHandle);
+    mHandle = nullptr;
+}
+
+}  // namespace pp
+
+} // namespace angle
+
+
diff --git a/src/compiler/preprocessor/preprocessor_tab_autogen.cpp b/src/compiler/preprocessor/preprocessor_tab_autogen.cpp
new file mode 100644
index 0000000..16bf0a2
--- /dev/null
+++ b/src/compiler/preprocessor/preprocessor_tab_autogen.cpp
@@ -0,0 +1,2063 @@
+/* A Bison parser, made by GNU Bison 3.3.2.  */
+
+/* Bison implementation for Yacc-like parsers in C
+
+   Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2019 Free Software Foundation,
+   Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+/* As a special exception, you may create a larger work that contains
+   part or all of the Bison parser skeleton and distribute that work
+   under terms of your choice, so long as that work isn't itself a
+   parser generator using the skeleton or a modified version thereof
+   as a parser skeleton.  Alternatively, if you modify or redistribute
+   the parser skeleton itself, you may (at your option) remove this
+   special exception, which will cause the skeleton and the resulting
+   Bison output files to be licensed under the GNU General Public
+   License without this special exception.
+
+   This special exception was added by the Free Software Foundation in
+   version 2.2 of Bison.  */
+
+/* C LALR(1) parser skeleton written by Richard Stallman, by
+   simplifying the original so-called "semantic" parser.  */
+
+/* All symbols defined below should begin with yy or YY, to avoid
+   infringing on user name space.  This should be done even for local
+   variables, as they might otherwise be expanded by user macros.
+   There are some unavoidable exceptions within include files to
+   define necessary library symbols; they are noted "INFRINGES ON
+   USER NAME SPACE" below.  */
+
+/* Undocumented macros, especially those whose name start with YY_,
+   are private implementation details.  Do not rely on them.  */
+
+/* Identify Bison output.  */
+#define YYBISON 1
+
+/* Bison version.  */
+#define YYBISON_VERSION "3.3.2"
+
+/* Skeleton name.  */
+#define YYSKELETON_NAME "yacc.c"
+
+/* Pure parsers.  */
+#define YYPURE 1
+
+/* Push parsers.  */
+#define YYPUSH 0
+
+/* Pull parsers.  */
+#define YYPULL 1
+
+/* Substitute the variable and function names.  */
+#define yyparse ppparse
+#define yylex pplex
+#define yyerror pperror
+#define yydebug ppdebug
+#define yynerrs ppnerrs
+
+/* First part of user prologue.  */
+
+// GENERATED FILE - DO NOT EDIT.
+// Generated by generate_parser.py from preprocessor.y
+//
+// Copyright 2019 The ANGLE Project Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+// preprocessor.y:
+//   Parser for the OpenGL shading language preprocessor.
+
+// clang-format off
+
+#if defined(__GNUC__)
+// Triggered by the auto-generated pplval variable.
+#if !defined(__clang__) && ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7))
+#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
+#else
+#pragma GCC diagnostic ignored "-Wuninitialized"
+#endif
+#elif defined(_MSC_VER)
+#pragma warning(disable: 4065 4244 4701 4702)
+#endif
+#if defined(__clang__)
+#pragma clang diagnostic ignored "-Wunreachable-code"
+#endif
+
+#include "ExpressionParser.h"
+
+#if defined(_MSC_VER)
+#include <malloc.h>
+#else
+#include <stdlib.h>
+#endif
+
+#include <cassert>
+#include <sstream>
+#include <stdint.h>
+
+#include "DiagnosticsBase.h"
+#include "Lexer.h"
+#include "Token.h"
+#include "common/mathutil.h"
+
+typedef int32_t YYSTYPE;
+typedef uint32_t UNSIGNED_TYPE;
+
+#define YYENABLE_NLS 0
+#define YYLTYPE_IS_TRIVIAL 1
+#define YYSTYPE_IS_TRIVIAL 1
+#define YYSTYPE_IS_DECLARED 1
+
+namespace {
+struct Context
+{
+    angle::pp::Diagnostics *diagnostics;
+    angle::pp::Lexer *lexer;
+    angle::pp::Token *token;
+    int* result;
+    bool parsePresetToken;
+
+    angle::pp::ExpressionParser::ErrorSettings errorSettings;
+    bool *valid;
+
+    void startIgnoreErrors() { ++ignoreErrors; }
+    void endIgnoreErrors() { --ignoreErrors; }
+
+    bool isIgnoringErrors() { return ignoreErrors > 0; }
+
+    int ignoreErrors;
+};
+}  // namespace
+
+
+static int yylex(YYSTYPE* lvalp, Context* context);
+static void yyerror(Context* context, const char* reason);
+
+
+# ifndef YY_NULLPTR
+#  if defined __cplusplus
+#   if 201103L <= __cplusplus
+#    define YY_NULLPTR nullptr
+#   else
+#    define YY_NULLPTR 0
+#   endif
+#  else
+#   define YY_NULLPTR ((void*)0)
+#  endif
+# endif
+
+/* Enabling verbose error messages.  */
+#ifdef YYERROR_VERBOSE
+# undef YYERROR_VERBOSE
+# define YYERROR_VERBOSE 1
+#else
+# define YYERROR_VERBOSE 0
+#endif
+
+
+/* Debug traces.  */
+#ifndef YYDEBUG
+# define YYDEBUG 0
+#endif
+#if YYDEBUG
+extern int ppdebug;
+#endif
+
+/* Token type.  */
+#ifndef YYTOKENTYPE
+# define YYTOKENTYPE
+  enum yytokentype
+  {
+    TOK_CONST_INT = 258,
+    TOK_IDENTIFIER = 259,
+    TOK_OP_OR = 260,
+    TOK_OP_AND = 261,
+    TOK_OP_EQ = 262,
+    TOK_OP_NE = 263,
+    TOK_OP_LE = 264,
+    TOK_OP_GE = 265,
+    TOK_OP_LEFT = 266,
+    TOK_OP_RIGHT = 267,
+    TOK_UNARY = 268
+  };
+#endif
+
+/* Value type.  */
+#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
+typedef int YYSTYPE;
+# define YYSTYPE_IS_TRIVIAL 1
+# define YYSTYPE_IS_DECLARED 1
+#endif
+
+
+
+int ppparse (Context *context);
+
+
+
+
+
+#ifdef short
+# undef short
+#endif
+
+#ifdef YYTYPE_UINT8
+typedef YYTYPE_UINT8 yytype_uint8;
+#else
+typedef unsigned char yytype_uint8;
+#endif
+
+#ifdef YYTYPE_INT8
+typedef YYTYPE_INT8 yytype_int8;
+#else
+typedef signed char yytype_int8;
+#endif
+
+#ifdef YYTYPE_UINT16
+typedef YYTYPE_UINT16 yytype_uint16;
+#else
+typedef unsigned short yytype_uint16;
+#endif
+
+#ifdef YYTYPE_INT16
+typedef YYTYPE_INT16 yytype_int16;
+#else
+typedef short yytype_int16;
+#endif
+
+#ifndef YYSIZE_T
+# ifdef __SIZE_TYPE__
+#  define YYSIZE_T __SIZE_TYPE__
+# elif defined size_t
+#  define YYSIZE_T size_t
+# elif ! defined YYSIZE_T
+#  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
+#  define YYSIZE_T size_t
+# else
+#  define YYSIZE_T unsigned
+# endif
+#endif
+
+#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
+
+#ifndef YY_
+# if defined YYENABLE_NLS && YYENABLE_NLS
+#  if ENABLE_NLS
+#   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
+#   define YY_(Msgid) dgettext ("bison-runtime", Msgid)
+#  endif
+# endif
+# ifndef YY_
+#  define YY_(Msgid) Msgid
+# endif
+#endif
+
+#ifndef YY_ATTRIBUTE
+# if (defined __GNUC__                                               \
+      && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__)))  \
+     || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
+#  define YY_ATTRIBUTE(Spec) __attribute__(Spec)
+# else
+#  define YY_ATTRIBUTE(Spec) /* empty */
+# endif
+#endif
+
+#ifndef YY_ATTRIBUTE_PURE
+# define YY_ATTRIBUTE_PURE   YY_ATTRIBUTE ((__pure__))
+#endif
+
+#ifndef YY_ATTRIBUTE_UNUSED
+# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
+#endif
+
+/* Suppress unused-variable warnings by "using" E.  */
+#if ! defined lint || defined __GNUC__
+# define YYUSE(E) ((void) (E))
+#else
+# define YYUSE(E) /* empty */
+#endif
+
+#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
+/* Suppress an incorrect diagnostic about yylval being uninitialized.  */
+# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
+    _Pragma ("GCC diagnostic push") \
+    _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
+    _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
+# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
+    _Pragma ("GCC diagnostic pop")
+#else
+# define YY_INITIAL_VALUE(Value) Value
+#endif
+#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
+# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
+# define YY_IGNORE_MAYBE_UNINITIALIZED_END
+#endif
+#ifndef YY_INITIAL_VALUE
+# define YY_INITIAL_VALUE(Value) /* Nothing. */
+#endif
+
+
+#if ! defined yyoverflow || YYERROR_VERBOSE
+
+/* The parser invokes alloca or malloc; define the necessary symbols.  */
+
+# ifdef YYSTACK_USE_ALLOCA
+#  if YYSTACK_USE_ALLOCA
+#   ifdef __GNUC__
+#    define YYSTACK_ALLOC __builtin_alloca
+#   elif defined __BUILTIN_VA_ARG_INCR
+#    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
+#   elif defined _AIX
+#    define YYSTACK_ALLOC __alloca
+#   elif defined _MSC_VER
+#    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
+#    define alloca _alloca
+#   else
+#    define YYSTACK_ALLOC alloca
+#    if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
+#     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
+      /* Use EXIT_SUCCESS as a witness for stdlib.h.  */
+#     ifndef EXIT_SUCCESS
+#      define EXIT_SUCCESS 0
+#     endif
+#    endif
+#   endif
+#  endif
+# endif
+
+# ifdef YYSTACK_ALLOC
+   /* Pacify GCC's 'empty if-body' warning.  */
+#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
+#  ifndef YYSTACK_ALLOC_MAXIMUM
+    /* The OS might guarantee only one guard page at the bottom of the stack,
+       and a page size can be as small as 4096 bytes.  So we cannot safely
+       invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
+       to allow for a few compiler-allocated temporary stack slots.  */
+#   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
+#  endif
+# else
+#  define YYSTACK_ALLOC YYMALLOC
+#  define YYSTACK_FREE YYFREE
+#  ifndef YYSTACK_ALLOC_MAXIMUM
+#   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
+#  endif
+#  if (defined __cplusplus && ! defined EXIT_SUCCESS \
+       && ! ((defined YYMALLOC || defined malloc) \
+             && (defined YYFREE || defined free)))
+#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
+#   ifndef EXIT_SUCCESS
+#    define EXIT_SUCCESS 0
+#   endif
+#  endif
+#  ifndef YYMALLOC
+#   define YYMALLOC malloc
+#   if ! defined malloc && ! defined EXIT_SUCCESS
+void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
+#   endif
+#  endif
+#  ifndef YYFREE
+#   define YYFREE free
+#   if ! defined free && ! defined EXIT_SUCCESS
+void free (void *); /* INFRINGES ON USER NAME SPACE */
+#   endif
+#  endif
+# endif
+#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
+
+
+#if (! defined yyoverflow \
+     && (! defined __cplusplus \
+         || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
+
+/* A type that is properly aligned for any stack member.  */
+union yyalloc
+{
+  yytype_int16 yyss_alloc;
+  YYSTYPE yyvs_alloc;
+};
+
+/* The size of the maximum gap between one aligned stack and the next.  */
+# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
+
+/* The size of an array large to enough to hold all stacks, each with
+   N elements.  */
+# define YYSTACK_BYTES(N) \
+     ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
+      + YYSTACK_GAP_MAXIMUM)
+
+# define YYCOPY_NEEDED 1
+
+/* Relocate STACK from its old location to the new one.  The
+   local variables YYSIZE and YYSTACKSIZE give the old and new number of
+   elements in the stack, and YYPTR gives the new location of the
+   stack.  Advance YYPTR to a properly aligned location for the next
+   stack.  */
+# define YYSTACK_RELOCATE(Stack_alloc, Stack)                           \
+    do                                                                  \
+      {                                                                 \
+        YYSIZE_T yynewbytes;                                            \
+        YYCOPY (&yyptr->Stack_alloc, Stack, yysize);                    \
+        Stack = &yyptr->Stack_alloc;                                    \
+        yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
+        yyptr += yynewbytes / sizeof (*yyptr);                          \
+      }                                                                 \
+    while (0)
+
+#endif
+
+#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
+/* Copy COUNT objects from SRC to DST.  The source and destination do
+   not overlap.  */
+# ifndef YYCOPY
+#  if defined __GNUC__ && 1 < __GNUC__
+#   define YYCOPY(Dst, Src, Count) \
+      __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
+#  else
+#   define YYCOPY(Dst, Src, Count)              \
+      do                                        \
+        {                                       \
+          YYSIZE_T yyi;                         \
+          for (yyi = 0; yyi < (Count); yyi++)   \
+            (Dst)[yyi] = (Src)[yyi];            \
+        }                                       \
+      while (0)
+#  endif
+# endif
+#endif /* !YYCOPY_NEEDED */
+
+/* YYFINAL -- State number of the termination state.  */
+#define YYFINAL  15
+/* YYLAST -- Last index in YYTABLE.  */
+#define YYLAST   176
+
+/* YYNTOKENS -- Number of terminals.  */
+#define YYNTOKENS  28
+/* YYNNTS -- Number of nonterminals.  */
+#define YYNNTS  5
+/* YYNRULES -- Number of rules.  */
+#define YYNRULES  29
+/* YYNSTATES -- Number of states.  */
+#define YYNSTATES  55
+
+#define YYUNDEFTOK  2
+#define YYMAXUTOK   268
+
+/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
+   as returned by yylex, with out-of-bounds checking.  */
+#define YYTRANSLATE(YYX)                                                \
+  ((unsigned) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
+
+/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
+   as returned by yylex.  */
+static const yytype_uint8 yytranslate[] =
+{
+       0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,    24,     2,     2,     2,    22,     9,     2,
+      26,    27,    20,    18,     2,    19,     2,    21,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+      12,     2,    13,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     8,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     7,     2,    25,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
+       5,     6,    10,    11,    14,    15,    16,    17,    23
+};
+
+#if YYDEBUG
+  /* YYRLINE[YYN] -- Source line where rule number YYN was defined.  */
+static const yytype_uint16 yyrline[] =
+{
+       0,   115,   115,   122,   123,   134,   134,   155,   155,   176,
+     179,   182,   185,   188,   191,   194,   197,   200,   203,   228,
+     250,   253,   256,   282,   309,   312,   315,   318,   330,   333
+};
+#endif
+
+#if YYDEBUG || YYERROR_VERBOSE || 0
+/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
+   First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
+static const char *const yytname[] =
+{
+  "$end", "error", "$undefined", "TOK_CONST_INT", "TOK_IDENTIFIER",
+  "TOK_OP_OR", "TOK_OP_AND", "'|'", "'^'", "'&'", "TOK_OP_EQ", "TOK_OP_NE",
+  "'<'", "'>'", "TOK_OP_LE", "TOK_OP_GE", "TOK_OP_LEFT", "TOK_OP_RIGHT",
+  "'+'", "'-'", "'*'", "'/'", "'%'", "TOK_UNARY", "'!'", "'~'", "'('",
+  "')'", "$accept", "input", "expression", "$@1", "$@2", YY_NULLPTR
+};
+#endif
+
+# ifdef YYPRINT
+/* YYTOKNUM[NUM] -- (External) token number corresponding to the
+   (internal) symbol number NUM (which must be that of a token).  */
+static const yytype_uint16 yytoknum[] =
+{
+       0,   256,   257,   258,   259,   260,   261,   124,    94,    38,
+     262,   263,    60,    62,   264,   265,   266,   267,    43,    45,
+      42,    47,    37,   268,    33,   126,    40,    41
+};
+# endif
+
+#define YYPACT_NINF -12
+
+#define yypact_value_is_default(Yystate) \
+  (!!((Yystate) == (-12)))
+
+#define YYTABLE_NINF -1
+
+#define yytable_value_is_error(Yytable_value) \
+  0
+
+  /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
+     STATE-NUM.  */
+static const yytype_int16 yypact[] =
+{
+      31,   -12,   -12,    31,    31,    31,    31,    31,    51,    76,
+     -12,   -12,   -12,   -12,    53,   -12,   -12,   -12,    31,    31,
+      31,    31,    31,    31,    31,    31,    31,    31,    31,    31,
+      31,    31,    31,    31,   -12,    31,    31,   124,   138,    26,
+     149,   149,   -11,   -11,   -11,   -11,   154,   154,    -8,    -8,
+     -12,   -12,   -12,    93,   109
+};
+
+  /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
+     Performed when YYTABLE does not specify something else to do.  Zero
+     means the default is an error.  */
+static const yytype_uint8 yydefact[] =
+{
+       0,     3,     4,     0,     0,     0,     0,     0,     0,     2,
+      28,    27,    25,    26,     0,     1,     5,     7,     0,     0,
+       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
+       0,     0,     0,     0,    29,     0,     0,     9,    10,    11,
+      13,    12,    17,    16,    15,    14,    19,    18,    21,    20,
+      24,    23,    22,     6,     8
+};
+
+  /* YYPGOTO[NTERM-NUM].  */
+static const yytype_int8 yypgoto[] =
+{
+     -12,   -12,    -3,   -12,   -12
+};
+
+  /* YYDEFGOTO[NTERM-NUM].  */
+static const yytype_int8 yydefgoto[] =
+{
+      -1,     8,     9,    35,    36
+};
+
+  /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM.  If
+     positive, shift that token.  If negative, reduce the rule whose
+     number is the opposite.  If YYTABLE_NINF, syntax error.  */
+static const yytype_uint8 yytable[] =
+{
+      10,    11,    12,    13,    14,    27,    28,    29,    30,    31,
+      32,    33,    31,    32,    33,    37,    38,    39,    40,    41,
+      42,    43,    44,    45,    46,    47,    48,    49,    50,    51,
+      52,     0,    53,    54,     1,     2,    21,    22,    23,    24,
+      25,    26,    27,    28,    29,    30,    31,    32,    33,     3,
+       4,    15,     0,     0,     0,     5,     6,     7,    16,    17,
+      18,    19,    20,    21,    22,    23,    24,    25,    26,    27,
+      28,    29,    30,    31,    32,    33,     0,     0,     0,     0,
+      34,    16,    17,    18,    19,    20,    21,    22,    23,    24,
+      25,    26,    27,    28,    29,    30,    31,    32,    33,    17,
+      18,    19,    20,    21,    22,    23,    24,    25,    26,    27,
+      28,    29,    30,    31,    32,    33,    18,    19,    20,    21,
+      22,    23,    24,    25,    26,    27,    28,    29,    30,    31,
+      32,    33,    19,    20,    21,    22,    23,    24,    25,    26,
+      27,    28,    29,    30,    31,    32,    33,    20,    21,    22,
+      23,    24,    25,    26,    27,    28,    29,    30,    31,    32,
+      33,    23,    24,    25,    26,    27,    28,    29,    30,    31,
+      32,    33,    29,    30,    31,    32,    33
+};
+
+static const yytype_int8 yycheck[] =
+{
+       3,     4,     5,     6,     7,    16,    17,    18,    19,    20,
+      21,    22,    20,    21,    22,    18,    19,    20,    21,    22,
+      23,    24,    25,    26,    27,    28,    29,    30,    31,    32,
+      33,    -1,    35,    36,     3,     4,    10,    11,    12,    13,
+      14,    15,    16,    17,    18,    19,    20,    21,    22,    18,
+      19,     0,    -1,    -1,    -1,    24,    25,    26,     5,     6,
+       7,     8,     9,    10,    11,    12,    13,    14,    15,    16,
+      17,    18,    19,    20,    21,    22,    -1,    -1,    -1,    -1,
+      27,     5,     6,     7,     8,     9,    10,    11,    12,    13,
+      14,    15,    16,    17,    18,    19,    20,    21,    22,     6,
+       7,     8,     9,    10,    11,    12,    13,    14,    15,    16,
+      17,    18,    19,    20,    21,    22,     7,     8,     9,    10,
+      11,    12,    13,    14,    15,    16,    17,    18,    19,    20,
+      21,    22,     8,     9,    10,    11,    12,    13,    14,    15,
+      16,    17,    18,    19,    20,    21,    22,     9,    10,    11,
+      12,    13,    14,    15,    16,    17,    18,    19,    20,    21,
+      22,    12,    13,    14,    15,    16,    17,    18,    19,    20,
+      21,    22,    18,    19,    20,    21,    22
+};
+
+  /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
+     symbol of state STATE-NUM.  */
+static const yytype_uint8 yystos[] =
+{
+       0,     3,     4,    18,    19,    24,    25,    26,    29,    30,
+      30,    30,    30,    30,    30,     0,     5,     6,     7,     8,
+       9,    10,    11,    12,    13,    14,    15,    16,    17,    18,
+      19,    20,    21,    22,    27,    31,    32,    30,    30,    30,
+      30,    30,    30,    30,    30,    30,    30,    30,    30,    30,
+      30,    30,    30,    30,    30
+};
+
+  /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
+static const yytype_uint8 yyr1[] =
+{
+       0,    28,    29,    30,    30,    31,    30,    32,    30,    30,
+      30,    30,    30,    30,    30,    30,    30,    30,    30,    30,
+      30,    30,    30,    30,    30,    30,    30,    30,    30,    30
+};
+
+  /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN.  */
+static const yytype_uint8 yyr2[] =
+{
+       0,     2,     1,     1,     1,     0,     4,     0,     4,     3,
+       3,     3,     3,     3,     3,     3,     3,     3,     3,     3,
+       3,     3,     3,     3,     3,     2,     2,     2,     2,     3
+};
+
+
+#define yyerrok         (yyerrstatus = 0)
+#define yyclearin       (yychar = YYEMPTY)
+#define YYEMPTY         (-2)
+#define YYEOF           0
+
+#define YYACCEPT        goto yyacceptlab
+#define YYABORT         goto yyabortlab
+#define YYERROR         goto yyerrorlab
+
+
+#define YYRECOVERING()  (!!yyerrstatus)
+
+#define YYBACKUP(Token, Value)                                    \
+  do                                                              \
+    if (yychar == YYEMPTY)                                        \
+      {                                                           \
+        yychar = (Token);                                         \
+        yylval = (Value);                                         \
+        YYPOPSTACK (yylen);                                       \
+        yystate = *yyssp;                                         \
+        goto yybackup;                                            \
+      }                                                           \
+    else                                                          \
+      {                                                           \
+        yyerror (context, YY_("syntax error: cannot back up")); \
+        YYERROR;                                                  \
+      }                                                           \
+  while (0)
+
+/* Error token number */
+#define YYTERROR        1
+#define YYERRCODE       256
+
+
+
+/* Enable debugging if requested.  */
+#if YYDEBUG
+
+# ifndef YYFPRINTF
+#  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
+#  define YYFPRINTF fprintf
+# endif
+
+# define YYDPRINTF(Args)                        \
+do {                                            \
+  if (yydebug)                                  \
+    YYFPRINTF Args;                             \
+} while (0)
+
+/* This macro is provided for backward compatibility. */
+#ifndef YY_LOCATION_PRINT
+# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
+#endif
+
+
+# define YY_SYMBOL_PRINT(Title, Type, Value, Location)                    \
+do {                                                                      \
+  if (yydebug)                                                            \
+    {                                                                     \
+      YYFPRINTF (stderr, "%s ", Title);                                   \
+      yy_symbol_print (stderr,                                            \
+                  Type, Value, context); \
+      YYFPRINTF (stderr, "\n");                                           \
+    }                                                                     \
+} while (0)
+
+
+/*-----------------------------------.
+| Print this symbol's value on YYO.  |
+`-----------------------------------*/
+
+static void
+yy_symbol_value_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep, Context *context)
+{
+  FILE *yyoutput = yyo;
+  YYUSE (yyoutput);
+  YYUSE (context);
+  if (!yyvaluep)
+    return;
+# ifdef YYPRINT
+  if (yytype < YYNTOKENS)
+    YYPRINT (yyo, yytoknum[yytype], *yyvaluep);
+# endif
+  YYUSE (yytype);
+}
+
+
+/*---------------------------.
+| Print this symbol on YYO.  |
+`---------------------------*/
+
+static void
+yy_symbol_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep, Context *context)
+{
+  YYFPRINTF (yyo, "%s %s (",
+             yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
+
+  yy_symbol_value_print (yyo, yytype, yyvaluep, context);
+  YYFPRINTF (yyo, ")");
+}
+
+/*------------------------------------------------------------------.
+| yy_stack_print -- Print the state stack from its BOTTOM up to its |
+| TOP (included).                                                   |
+`------------------------------------------------------------------*/
+
+static void
+yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
+{
+  YYFPRINTF (stderr, "Stack now");
+  for (; yybottom <= yytop; yybottom++)
+    {
+      int yybot = *yybottom;
+      YYFPRINTF (stderr, " %d", yybot);
+    }
+  YYFPRINTF (stderr, "\n");
+}
+
+# define YY_STACK_PRINT(Bottom, Top)                            \
+do {                                                            \
+  if (yydebug)                                                  \
+    yy_stack_print ((Bottom), (Top));                           \
+} while (0)
+
+
+/*------------------------------------------------.
+| Report that the YYRULE is going to be reduced.  |
+`------------------------------------------------*/
+
+static void
+yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule, Context *context)
+{
+  unsigned long yylno = yyrline[yyrule];
+  int yynrhs = yyr2[yyrule];
+  int yyi;
+  YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
+             yyrule - 1, yylno);
+  /* The symbols being reduced.  */
+  for (yyi = 0; yyi < yynrhs; yyi++)
+    {
+      YYFPRINTF (stderr, "   $%d = ", yyi + 1);
+      yy_symbol_print (stderr,
+                       yystos[yyssp[yyi + 1 - yynrhs]],
+                       &yyvsp[(yyi + 1) - (yynrhs)]
+                                              , context);
+      YYFPRINTF (stderr, "\n");
+    }
+}
+
+# define YY_REDUCE_PRINT(Rule)          \
+do {                                    \
+  if (yydebug)                          \
+    yy_reduce_print (yyssp, yyvsp, Rule, context); \
+} while (0)
+
+/* Nonzero means print parse trace.  It is left uninitialized so that
+   multiple parsers can coexist.  */
+int yydebug;
+#else /* !YYDEBUG */
+# define YYDPRINTF(Args)
+# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
+# define YY_STACK_PRINT(Bottom, Top)
+# define YY_REDUCE_PRINT(Rule)
+#endif /* !YYDEBUG */
+
+
+/* YYINITDEPTH -- initial size of the parser's stacks.  */
+#ifndef YYINITDEPTH
+# define YYINITDEPTH 200
+#endif
+
+/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
+   if the built-in stack extension method is used).
+
+   Do not make this value too large; the results are undefined if
+   YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
+   evaluated with infinite-precision integer arithmetic.  */
+
+#ifndef YYMAXDEPTH
+# define YYMAXDEPTH 10000
+#endif
+
+
+#if YYERROR_VERBOSE
+
+# ifndef yystrlen
+#  if defined __GLIBC__ && defined _STRING_H
+#   define yystrlen strlen
+#  else
+/* Return the length of YYSTR.  */
+static YYSIZE_T
+yystrlen (const char *yystr)
+{
+  YYSIZE_T yylen;
+  for (yylen = 0; yystr[yylen]; yylen++)
+    continue;
+  return yylen;
+}
+#  endif
+# endif
+
+# ifndef yystpcpy
+#  if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
+#   define yystpcpy stpcpy
+#  else
+/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
+   YYDEST.  */
+static char *
+yystpcpy (char *yydest, const char *yysrc)
+{
+  char *yyd = yydest;
+  const char *yys = yysrc;
+
+  while ((*yyd++ = *yys++) != '\0')
+    continue;
+
+  return yyd - 1;
+}
+#  endif
+# endif
+
+# ifndef yytnamerr
+/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
+   quotes and backslashes, so that it's suitable for yyerror.  The
+   heuristic is that double-quoting is unnecessary unless the string
+   contains an apostrophe, a comma, or backslash (other than
+   backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
+   null, do not copy; instead, return the length of what the result
+   would have been.  */
+static YYSIZE_T
+yytnamerr (char *yyres, const char *yystr)
+{
+  if (*yystr == '"')
+    {
+      YYSIZE_T yyn = 0;
+      char const *yyp = yystr;
+
+      for (;;)
+        switch (*++yyp)
+          {
+          case '\'':
+          case ',':
+            goto do_not_strip_quotes;
+
+          case '\\':
+            if (*++yyp != '\\')
+              goto do_not_strip_quotes;
+            else
+              goto append;
+
+          append:
+          default:
+            if (yyres)
+              yyres[yyn] = *yyp;
+            yyn++;
+            break;
+
+          case '"':
+            if (yyres)
+              yyres[yyn] = '\0';
+            return yyn;
+          }
+    do_not_strip_quotes: ;
+    }
+
+  if (! yyres)
+    return yystrlen (yystr);
+
+  return (YYSIZE_T) (yystpcpy (yyres, yystr) - yyres);
+}
+# endif
+
+/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
+   about the unexpected token YYTOKEN for the state stack whose top is
+   YYSSP.
+
+   Return 0 if *YYMSG was successfully written.  Return 1 if *YYMSG is
+   not large enough to hold the message.  In that case, also set
+   *YYMSG_ALLOC to the required number of bytes.  Return 2 if the
+   required number of bytes is too large to store.  */
+static int
+yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
+                yytype_int16 *yyssp, int yytoken)
+{
+  YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
+  YYSIZE_T yysize = yysize0;
+  enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
+  /* Internationalized format string. */
+  const char *yyformat = YY_NULLPTR;
+  /* Arguments of yyformat. */
+  char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
+  /* Number of reported tokens (one for the "unexpected", one per
+     "expected"). */
+  int yycount = 0;
+
+  /* There are many possibilities here to consider:
+     - If this state is a consistent state with a default action, then
+       the only way this function was invoked is if the default action
+       is an error action.  In that case, don't check for expected
+       tokens because there are none.
+     - The only way there can be no lookahead present (in yychar) is if
+       this state is a consistent state with a default action.  Thus,
+       detecting the absence of a lookahead is sufficient to determine
+       that there is no unexpected or expected token to report.  In that
+       case, just report a simple "syntax error".
+     - Don't assume there isn't a lookahead just because this state is a
+       consistent state with a default action.  There might have been a
+       previous inconsistent state, consistent state with a non-default
+       action, or user semantic action that manipulated yychar.
+     - Of course, the expected token list depends on states to have
+       correct lookahead information, and it depends on the parser not
+       to perform extra reductions after fetching a lookahead from the
+       scanner and before detecting a syntax error.  Thus, state merging
+       (from LALR or IELR) and default reductions corrupt the expected
+       token list.  However, the list is correct for canonical LR with
+       one exception: it will still contain any token that will not be
+       accepted due to an error action in a later state.
+  */
+  if (yytoken != YYEMPTY)
+    {
+      int yyn = yypact[*yyssp];
+      yyarg[yycount++] = yytname[yytoken];
+      if (!yypact_value_is_default (yyn))
+        {
+          /* Start YYX at -YYN if negative to avoid negative indexes in
+             YYCHECK.  In other words, skip the first -YYN actions for
+             this state because they are default actions.  */
+          int yyxbegin = yyn < 0 ? -yyn : 0;
+          /* Stay within bounds of both yycheck and yytname.  */
+          int yychecklim = YYLAST - yyn + 1;
+          int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
+          int yyx;
+
+          for (yyx = yyxbegin; yyx < yyxend; ++yyx)
+            if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
+                && !yytable_value_is_error (yytable[yyx + yyn]))
+              {
+                if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
+                  {
+                    yycount = 1;
+                    yysize = yysize0;
+                    break;
+                  }
+                yyarg[yycount++] = yytname[yyx];
+                {
+                  YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
+                  if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
+                    yysize = yysize1;
+                  else
+                    return 2;
+                }
+              }
+        }
+    }
+
+  switch (yycount)
+    {
+# define YYCASE_(N, S)                      \
+      case N:                               \
+        yyformat = S;                       \
+      break
+    default: /* Avoid compiler warnings. */
+      YYCASE_(0, YY_("syntax error"));
+      YYCASE_(1, YY_("syntax error, unexpected %s"));
+      YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
+      YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
+      YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
+      YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
+# undef YYCASE_
+    }
+
+  {
+    YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
+    if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
+      yysize = yysize1;
+    else
+      return 2;
+  }
+
+  if (*yymsg_alloc < yysize)
+    {
+      *yymsg_alloc = 2 * yysize;
+      if (! (yysize <= *yymsg_alloc
+             && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
+        *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
+      return 1;
+    }
+
+  /* Avoid sprintf, as that infringes on the user's name space.
+     Don't have undefined behavior even if the translation
+     produced a string with the wrong number of "%s"s.  */
+  {
+    char *yyp = *yymsg;
+    int yyi = 0;
+    while ((*yyp = *yyformat) != '\0')
+      if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
+        {
+          yyp += yytnamerr (yyp, yyarg[yyi++]);
+          yyformat += 2;
+        }
+      else
+        {
+          yyp++;
+          yyformat++;
+        }
+  }
+  return 0;
+}
+#endif /* YYERROR_VERBOSE */
+
+/*-----------------------------------------------.
+| Release the memory associated to this symbol.  |
+`-----------------------------------------------*/
+
+static void
+yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, Context *context)
+{
+  YYUSE (yyvaluep);
+  YYUSE (context);
+  if (!yymsg)
+    yymsg = "Deleting";
+  YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
+
+  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
+  YYUSE (yytype);
+  YY_IGNORE_MAYBE_UNINITIALIZED_END
+}
+
+
+
+
+/*----------.
+| yyparse.  |
+`----------*/
+
+int
+yyparse (Context *context)
+{
+/* The lookahead symbol.  */
+int yychar;
+
+
+/* The semantic value of the lookahead symbol.  */
+/* Default value used for initialization, for pacifying older GCCs
+   or non-GCC compilers.  */
+YY_INITIAL_VALUE (static YYSTYPE yyval_default;)
+YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);
+
+    /* Number of syntax errors so far.  */
+    int yynerrs;
+
+    int yystate;
+    /* Number of tokens to shift before error messages enabled.  */
+    int yyerrstatus;
+
+    /* The stacks and their tools:
+       'yyss': related to states.
+       'yyvs': related to semantic values.
+
+       Refer to the stacks through separate pointers, to allow yyoverflow
+       to reallocate them elsewhere.  */
+
+    /* The state stack.  */
+    yytype_int16 yyssa[YYINITDEPTH];
+    yytype_int16 *yyss;
+    yytype_int16 *yyssp;
+
+    /* The semantic value stack.  */
+    YYSTYPE yyvsa[YYINITDEPTH];
+    YYSTYPE *yyvs;
+    YYSTYPE *yyvsp;
+
+    YYSIZE_T yystacksize;
+
+  int yyn;
+  int yyresult;
+  /* Lookahead token as an internal (translated) token number.  */
+  int yytoken = 0;
+  /* The variables used to return semantic value and location from the
+     action routines.  */
+  YYSTYPE yyval;
+
+#if YYERROR_VERBOSE
+  /* Buffer for error messages, and its allocated size.  */
+  char yymsgbuf[128];
+  char *yymsg = yymsgbuf;
+  YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
+#endif
+
+#define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
+
+  /* The number of symbols on the RHS of the reduced rule.
+     Keep to zero when no symbol should be popped.  */
+  int yylen = 0;
+
+  yyssp = yyss = yyssa;
+  yyvsp = yyvs = yyvsa;
+  yystacksize = YYINITDEPTH;
+
+  YYDPRINTF ((stderr, "Starting parse\n"));
+
+  yystate = 0;
+  yyerrstatus = 0;
+  yynerrs = 0;
+  yychar = YYEMPTY; /* Cause a token to be read.  */
+  goto yysetstate;
+
+
+/*------------------------------------------------------------.
+| yynewstate -- push a new state, which is found in yystate.  |
+`------------------------------------------------------------*/
+yynewstate:
+  /* In all cases, when you get here, the value and location stacks
+     have just been pushed.  So pushing a state here evens the stacks.  */
+  yyssp++;
+
+
+/*--------------------------------------------------------------------.
+| yynewstate -- set current state (the top of the stack) to yystate.  |
+`--------------------------------------------------------------------*/
+yysetstate:
+  *yyssp = (yytype_int16) yystate;
+
+  if (yyss + yystacksize - 1 <= yyssp)
+#if !defined yyoverflow && !defined YYSTACK_RELOCATE
+    goto yyexhaustedlab;
+#else
+    {
+      /* Get the current used size of the three stacks, in elements.  */
+      YYSIZE_T yysize = (YYSIZE_T) (yyssp - yyss + 1);
+
+# if defined yyoverflow
+      {
+        /* Give user a chance to reallocate the stack.  Use copies of
+           these so that the &'s don't force the real ones into
+           memory.  */
+        YYSTYPE *yyvs1 = yyvs;
+        yytype_int16 *yyss1 = yyss;
+
+        /* Each stack pointer address is followed by the size of the
+           data in use in that stack, in bytes.  This used to be a
+           conditional around just the two extra args, but that might
+           be undefined if yyoverflow is a macro.  */
+        yyoverflow (YY_("memory exhausted"),
+                    &yyss1, yysize * sizeof (*yyssp),
+                    &yyvs1, yysize * sizeof (*yyvsp),
+                    &yystacksize);
+        yyss = yyss1;
+        yyvs = yyvs1;
+      }
+# else /* defined YYSTACK_RELOCATE */
+      /* Extend the stack our own way.  */
+      if (YYMAXDEPTH <= yystacksize)
+        goto yyexhaustedlab;
+      yystacksize *= 2;
+      if (YYMAXDEPTH < yystacksize)
+        yystacksize = YYMAXDEPTH;
+
+      {
+        yytype_int16 *yyss1 = yyss;
+        union yyalloc *yyptr =
+          (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
+        if (! yyptr)
+          goto yyexhaustedlab;
+        YYSTACK_RELOCATE (yyss_alloc, yyss);
+        YYSTACK_RELOCATE (yyvs_alloc, yyvs);
+# undef YYSTACK_RELOCATE
+        if (yyss1 != yyssa)
+          YYSTACK_FREE (yyss1);
+      }
+# endif
+
+      yyssp = yyss + yysize - 1;
+      yyvsp = yyvs + yysize - 1;
+
+      YYDPRINTF ((stderr, "Stack size increased to %lu\n",
+                  (unsigned long) yystacksize));
+
+      if (yyss + yystacksize - 1 <= yyssp)
+        YYABORT;
+    }
+#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
+
+  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
+
+  if (yystate == YYFINAL)
+    YYACCEPT;
+
+  goto yybackup;
+
+
+/*-----------.
+| yybackup.  |
+`-----------*/
+yybackup:
+  /* Do appropriate processing given the current state.  Read a
+     lookahead token if we need one and don't already have one.  */
+
+  /* First try to decide what to do without reference to lookahead token.  */
+  yyn = yypact[yystate];
+  if (yypact_value_is_default (yyn))
+    goto yydefault;
+
+  /* Not known => get a lookahead token if don't already have one.  */
+
+  /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
+  if (yychar == YYEMPTY)
+    {
+      YYDPRINTF ((stderr, "Reading a token: "));
+      yychar = yylex (&yylval, context);
+    }
+
+  if (yychar <= YYEOF)
+    {
+      yychar = yytoken = YYEOF;
+      YYDPRINTF ((stderr, "Now at end of input.\n"));
+    }
+  else
+    {
+      yytoken = YYTRANSLATE (yychar);
+      YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
+    }
+
+  /* If the proper action on seeing token YYTOKEN is to reduce or to
+     detect an error, take that action.  */
+  yyn += yytoken;
+  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
+    goto yydefault;
+  yyn = yytable[yyn];
+  if (yyn <= 0)
+    {
+      if (yytable_value_is_error (yyn))
+        goto yyerrlab;
+      yyn = -yyn;
+      goto yyreduce;
+    }
+
+  /* Count tokens shifted since error; after three, turn off error
+     status.  */
+  if (yyerrstatus)
+    yyerrstatus--;
+
+  /* Shift the lookahead token.  */
+  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
+
+  /* Discard the shifted token.  */
+  yychar = YYEMPTY;
+
+  yystate = yyn;
+  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
+  *++yyvsp = yylval;
+  YY_IGNORE_MAYBE_UNINITIALIZED_END
+
+  goto yynewstate;
+
+
+/*-----------------------------------------------------------.
+| yydefault -- do the default action for the current state.  |
+`-----------------------------------------------------------*/
+yydefault:
+  yyn = yydefact[yystate];
+  if (yyn == 0)
+    goto yyerrlab;
+  goto yyreduce;
+
+
+/*-----------------------------.
+| yyreduce -- do a reduction.  |
+`-----------------------------*/
+yyreduce:
+  /* yyn is the number of a rule to reduce with.  */
+  yylen = yyr2[yyn];
+
+  /* If YYLEN is nonzero, implement the default value of the action:
+     '$$ = $1'.
+
+     Otherwise, the following line sets YYVAL to garbage.
+     This behavior is undocumented and Bison
+     users should not rely upon it.  Assigning to YYVAL
+     unconditionally makes the parser a bit smaller, and it avoids a
+     GCC warning that YYVAL may be used uninitialized.  */
+  yyval = yyvsp[1-yylen];
+
+
+  YY_REDUCE_PRINT (yyn);
+  switch (yyn)
+    {
+        case 2:
+
+    {
+        *(context->result) = static_cast<int>(yyvsp[0]);
+        YYACCEPT;
+    }
+
+    break;
+
+  case 4:
+
+    {
+        if (!context->isIgnoringErrors())
+        {
+            // This rule should be applied right after the token is lexed, so we can
+            // refer to context->token in the error message.
+            context->diagnostics->report(context->errorSettings.unexpectedIdentifier,
+                                         context->token->location, context->token->text);
+            *(context->valid) = false;
+        }
+        yyval = yyvsp[0];
+    }
+
+    break;
+
+  case 5:
+
+    {
+        if (yyvsp[-1] != 0)
+        {
+            // Ignore errors in the short-circuited part of the expression.
+            // ESSL3.00 section 3.4:
+            // If an operand is not evaluated, the presence of undefined identifiers
+            // in the operand will not cause an error.
+            // Unevaluated division by zero should not cause an error either.
+            context->startIgnoreErrors();
+        }
+    }
+
+    break;
+
+  case 6:
+
+    {
+        if (yyvsp[-3] != 0)
+        {
+            context->endIgnoreErrors();
+            yyval = static_cast<YYSTYPE>(1);
+        }
+        else
+        {
+            yyval = yyvsp[-3] || yyvsp[0];
+        }
+    }
+
+    break;
+
+  case 7:
+
+    {
+        if (yyvsp[-1] == 0)
+        {
+            // Ignore errors in the short-circuited part of the expression.
+            // ESSL3.00 section 3.4:
+            // If an operand is not evaluated, the presence of undefined identifiers
+            // in the operand will not cause an error.
+            // Unevaluated division by zero should not cause an error either.
+            context->startIgnoreErrors();
+        }
+    }
+
+    break;
+
+  case 8:
+
+    {
+        if (yyvsp[-3] == 0)
+        {
+            context->endIgnoreErrors();
+            yyval = static_cast<YYSTYPE>(0);
+        }
+        else
+        {
+            yyval = yyvsp[-3] && yyvsp[0];
+        }
+    }
+
+    break;
+
+  case 9:
+
+    {
+        yyval = yyvsp[-2] | yyvsp[0];
+    }
+
+    break;
+
+  case 10:
+
+    {
+        yyval = yyvsp[-2] ^ yyvsp[0];
+    }
+
+    break;
+
+  case 11:
+
+    {
+        yyval = yyvsp[-2] & yyvsp[0];
+    }
+
+    break;
+
+  case 12:
+
+    {
+        yyval = yyvsp[-2] != yyvsp[0];
+    }
+
+    break;
+
+  case 13:
+
+    {
+        yyval = yyvsp[-2] == yyvsp[0];
+    }
+
+    break;
+
+  case 14:
+
+    {
+        yyval = yyvsp[-2] >= yyvsp[0];
+    }
+
+    break;
+
+  case 15:
+
+    {
+        yyval = yyvsp[-2] <= yyvsp[0];
+    }
+
+    break;
+
+  case 16:
+
+    {
+        yyval = yyvsp[-2] > yyvsp[0];
+    }
+
+    break;
+
+  case 17:
+
+    {
+        yyval = yyvsp[-2] < yyvsp[0];
+    }
+
+    break;
+
+  case 18:
+
+    {
+        if (yyvsp[0] < 0 || yyvsp[0] > 31)
+        {
+            if (!context->isIgnoringErrors())
+            {
+                std::ostringstream stream;
+                stream << yyvsp[-2] << " >> " << yyvsp[0];
+                std::string text = stream.str();
+                context->diagnostics->report(angle::pp::Diagnostics::PP_UNDEFINED_SHIFT,
+                                             context->token->location,
+                                             text.c_str());
+                *(context->valid) = false;
+            }
+            yyval = static_cast<YYSTYPE>(0);
+        }
+        else if (yyvsp[-2] < 0)
+        {
+            // Logical shift right.
+            yyval = static_cast<YYSTYPE>(static_cast<UNSIGNED_TYPE>(yyvsp[-2]) >> yyvsp[0]);
+        }
+        else
+        {
+            yyval = yyvsp[-2] >> yyvsp[0];
+        }
+    }
+
+    break;
+
+  case 19:
+
+    {
+        if (yyvsp[0] < 0 || yyvsp[0] > 31)
+        {
+            if (!context->isIgnoringErrors())
+            {
+                std::ostringstream stream;
+                stream << yyvsp[-2] << " << " << yyvsp[0];
+                std::string text = stream.str();
+                context->diagnostics->report(angle::pp::Diagnostics::PP_UNDEFINED_SHIFT,
+                                             context->token->location,
+                                             text.c_str());
+                *(context->valid) = false;
+            }
+            yyval = static_cast<YYSTYPE>(0);
+        }
+        else
+        {
+            // Logical shift left. Casting to unsigned is needed to ensure there's no signed integer
+            // overflow, which some tools treat as an error.
+            yyval = static_cast<YYSTYPE>(static_cast<UNSIGNED_TYPE>(yyvsp[-2]) << yyvsp[0]);
+        }
+    }
+
+    break;
+
+  case 20:
+
+    {
+        yyval = gl::WrappingDiff<YYSTYPE>(yyvsp[-2], yyvsp[0]);
+    }
+
+    break;
+
+  case 21:
+
+    {
+        yyval = gl::WrappingSum<YYSTYPE>(yyvsp[-2], yyvsp[0]);
+    }
+
+    break;
+
+  case 22:
+
+    {
+        if (yyvsp[0] == 0)
+        {
+            if (!context->isIgnoringErrors())
+            {
+                std::ostringstream stream;
+                stream << yyvsp[-2] << " % " << yyvsp[0];
+                std::string text = stream.str();
+                context->diagnostics->report(angle::pp::Diagnostics::PP_DIVISION_BY_ZERO,
+                                             context->token->location,
+                                             text.c_str());
+                *(context->valid) = false;
+            }
+            yyval = static_cast<YYSTYPE>(0);
+        }
+        else if ((yyvsp[-2] == std::numeric_limits<YYSTYPE>::min()) && (yyvsp[0] == -1))
+        {
+            // Check for the special case where the minimum representable number is
+            // divided by -1. If left alone this has undefined results.
+            yyval = 0;
+        }
+        else
+        {
+            yyval = yyvsp[-2] % yyvsp[0];
+        }
+    }
+
+    break;
+
+  case 23:
+
+    {
+        if (yyvsp[0] == 0)
+        {
+            if (!context->isIgnoringErrors())
+            {
+                std::ostringstream stream;
+                stream << yyvsp[-2] << " / " << yyvsp[0];
+                std::string text = stream.str();
+                context->diagnostics->report(angle::pp::Diagnostics::PP_DIVISION_BY_ZERO,
+                                            context->token->location,
+                                            text.c_str());
+                *(context->valid) = false;
+            }
+            yyval = static_cast<YYSTYPE>(0);
+        }
+        else if ((yyvsp[-2] == std::numeric_limits<YYSTYPE>::min()) && (yyvsp[0] == -1))
+        {
+            // Check for the special case where the minimum representable number is
+            // divided by -1. If left alone this leads to integer overflow in C++, which
+            // has undefined results.
+            yyval = std::numeric_limits<YYSTYPE>::max();
+        }
+        else
+        {
+            yyval = yyvsp[-2] / yyvsp[0];
+        }
+    }
+
+    break;
+
+  case 24:
+
+    {
+        yyval = gl::WrappingMul(yyvsp[-2], yyvsp[0]);
+    }
+
+    break;
+
+  case 25:
+
+    {
+        yyval = ! yyvsp[0];
+    }
+
+    break;
+
+  case 26:
+
+    {
+        yyval = ~ yyvsp[0];
+    }
+
+    break;
+
+  case 27:
+
+    {
+        // Check for negation of minimum representable integer to prevent undefined signed int
+        // overflow.
+        if (yyvsp[0] == std::numeric_limits<YYSTYPE>::min())
+        {
+            yyval = std::numeric_limits<YYSTYPE>::min();
+        }
+        else
+        {
+            yyval = -yyvsp[0];
+        }
+    }
+
+    break;
+
+  case 28:
+
+    {
+        yyval = + yyvsp[0];
+    }
+
+    break;
+
+  case 29:
+
+    {
+        yyval = yyvsp[-1];
+    }
+
+    break;
+
+
+
+      default: break;
+    }
+  /* User semantic actions sometimes alter yychar, and that requires
+     that yytoken be updated with the new translation.  We take the
+     approach of translating immediately before every use of yytoken.
+     One alternative is translating here after every semantic action,
+     but that translation would be missed if the semantic action invokes
+     YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
+     if it invokes YYBACKUP.  In the case of YYABORT or YYACCEPT, an
+     incorrect destructor might then be invoked immediately.  In the
+     case of YYERROR or YYBACKUP, subsequent parser actions might lead
+     to an incorrect destructor call or verbose syntax error message
+     before the lookahead is translated.  */
+  YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
+
+  YYPOPSTACK (yylen);
+  yylen = 0;
+  YY_STACK_PRINT (yyss, yyssp);
+
+  *++yyvsp = yyval;
+
+  /* Now 'shift' the result of the reduction.  Determine what state
+     that goes to, based on the state we popped back to and the rule
+     number reduced by.  */
+  {
+    const int yylhs = yyr1[yyn] - YYNTOKENS;
+    const int yyi = yypgoto[yylhs] + *yyssp;
+    yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
+               ? yytable[yyi]
+               : yydefgoto[yylhs]);
+  }
+
+  goto yynewstate;
+
+
+/*--------------------------------------.
+| yyerrlab -- here on detecting error.  |
+`--------------------------------------*/
+yyerrlab:
+  /* Make sure we have latest lookahead translation.  See comments at
+     user semantic actions for why this is necessary.  */
+  yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
+
+  /* If not already recovering from an error, report this error.  */
+  if (!yyerrstatus)
+    {
+      ++yynerrs;
+#if ! YYERROR_VERBOSE
+      yyerror (context, YY_("syntax error"));
+#else
+# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
+                                        yyssp, yytoken)
+      {
+        char const *yymsgp = YY_("syntax error");
+        int yysyntax_error_status;
+        yysyntax_error_status = YYSYNTAX_ERROR;
+        if (yysyntax_error_status == 0)
+          yymsgp = yymsg;
+        else if (yysyntax_error_status == 1)
+          {
+            if (yymsg != yymsgbuf)
+              YYSTACK_FREE (yymsg);
+            yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
+            if (!yymsg)
+              {
+                yymsg = yymsgbuf;
+                yymsg_alloc = sizeof yymsgbuf;
+                yysyntax_error_status = 2;
+              }
+            else
+              {
+                yysyntax_error_status = YYSYNTAX_ERROR;
+                yymsgp = yymsg;
+              }
+          }
+        yyerror (context, yymsgp);
+        if (yysyntax_error_status == 2)
+          goto yyexhaustedlab;
+      }
+# undef YYSYNTAX_ERROR
+#endif
+    }
+
+
+
+  if (yyerrstatus == 3)
+    {
+      /* If just tried and failed to reuse lookahead token after an
+         error, discard it.  */
+
+      if (yychar <= YYEOF)
+        {
+          /* Return failure if at end of input.  */
+          if (yychar == YYEOF)
+            YYABORT;
+        }
+      else
+        {
+          yydestruct ("Error: discarding",
+                      yytoken, &yylval, context);
+          yychar = YYEMPTY;
+        }
+    }
+
+  /* Else will try to reuse lookahead token after shifting the error
+     token.  */
+  goto yyerrlab1;
+
+
+/*---------------------------------------------------.
+| yyerrorlab -- error raised explicitly by YYERROR.  |
+`---------------------------------------------------*/
+yyerrorlab:
+  /* Pacify compilers when the user code never invokes YYERROR and the
+     label yyerrorlab therefore never appears in user code.  */
+  if (0)
+    YYERROR;
+
+  /* Do not reclaim the symbols of the rule whose action triggered
+     this YYERROR.  */
+  YYPOPSTACK (yylen);
+  yylen = 0;
+  YY_STACK_PRINT (yyss, yyssp);
+  yystate = *yyssp;
+  goto yyerrlab1;
+
+
+/*-------------------------------------------------------------.
+| yyerrlab1 -- common code for both syntax error and YYERROR.  |
+`-------------------------------------------------------------*/
+yyerrlab1:
+  yyerrstatus = 3;      /* Each real token shifted decrements this.  */
+
+  for (;;)
+    {
+      yyn = yypact[yystate];
+      if (!yypact_value_is_default (yyn))
+        {
+          yyn += YYTERROR;
+          if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
+            {
+              yyn = yytable[yyn];
+              if (0 < yyn)
+                break;
+            }
+        }
+
+      /* Pop the current state because it cannot handle the error token.  */
+      if (yyssp == yyss)
+        YYABORT;
+
+
+      yydestruct ("Error: popping",
+                  yystos[yystate], yyvsp, context);
+      YYPOPSTACK (1);
+      yystate = *yyssp;
+      YY_STACK_PRINT (yyss, yyssp);
+    }
+
+  YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
+  *++yyvsp = yylval;
+  YY_IGNORE_MAYBE_UNINITIALIZED_END
+
+
+  /* Shift the error token.  */
+  YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
+
+  yystate = yyn;
+  goto yynewstate;
+
+
+/*-------------------------------------.
+| yyacceptlab -- YYACCEPT comes here.  |
+`-------------------------------------*/
+yyacceptlab:
+  yyresult = 0;
+  goto yyreturn;
+
+
+/*-----------------------------------.
+| yyabortlab -- YYABORT comes here.  |
+`-----------------------------------*/
+yyabortlab:
+  yyresult = 1;
+  goto yyreturn;
+
+
+#if !defined yyoverflow || YYERROR_VERBOSE
+/*-------------------------------------------------.
+| yyexhaustedlab -- memory exhaustion comes here.  |
+`-------------------------------------------------*/
+yyexhaustedlab:
+  yyerror (context, YY_("memory exhausted"));
+  yyresult = 2;
+  /* Fall through.  */
+#endif
+
+
+/*-----------------------------------------------------.
+| yyreturn -- parsing is finished, return the result.  |
+`-----------------------------------------------------*/
+yyreturn:
+  if (yychar != YYEMPTY)
+    {
+      /* Make sure we have latest lookahead translation.  See comments at
+         user semantic actions for why this is necessary.  */
+      yytoken = YYTRANSLATE (yychar);
+      yydestruct ("Cleanup: discarding lookahead",
+                  yytoken, &yylval, context);
+    }
+  /* Do not reclaim the symbols of the rule whose action triggered
+     this YYABORT or YYACCEPT.  */
+  YYPOPSTACK (yylen);
+  YY_STACK_PRINT (yyss, yyssp);
+  while (yyssp != yyss)
+    {
+      yydestruct ("Cleanup: popping",
+                  yystos[*yyssp], yyvsp, context);
+      YYPOPSTACK (1);
+    }
+#ifndef yyoverflow
+  if (yyss != yyssa)
+    YYSTACK_FREE (yyss);
+#endif
+#if YYERROR_VERBOSE
+  if (yymsg != yymsgbuf)
+    YYSTACK_FREE (yymsg);
+#endif
+  return yyresult;
+}
+
+
+
+int yylex(YYSTYPE *lvalp, Context *context)
+{
+    angle::pp::Token *token = context->token;
+    if (!context->parsePresetToken)
+    {
+        context->lexer->lex(token);
+    }
+    context->parsePresetToken = false;
+
+    int type = 0;
+
+    switch (token->type)
+    {
+      case angle::pp::Token::CONST_INT: {
+        unsigned int val = 0;
+        int testVal = 0;
+        if (!token->uValue(&val) || (!token->iValue(&testVal) &&
+                                     context->errorSettings.integerLiteralsMustFit32BitSignedRange))
+        {
+            context->diagnostics->report(angle::pp::Diagnostics::PP_INTEGER_OVERFLOW,
+                                         token->location, token->text);
+            *(context->valid) = false;
+        }
+        *lvalp = static_cast<YYSTYPE>(val);
+        type = TOK_CONST_INT;
+        break;
+      }
+      case angle::pp::Token::IDENTIFIER:
+        *lvalp = static_cast<YYSTYPE>(-1);
+        type = TOK_IDENTIFIER;
+        break;
+      case angle::pp::Token::OP_OR:
+        type = TOK_OP_OR;
+        break;
+      case angle::pp::Token::OP_AND:
+        type = TOK_OP_AND;
+        break;
+      case angle::pp::Token::OP_NE:
+        type = TOK_OP_NE;
+        break;
+      case angle::pp::Token::OP_EQ:
+        type = TOK_OP_EQ;
+        break;
+      case angle::pp::Token::OP_GE:
+        type = TOK_OP_GE;
+        break;
+      case angle::pp::Token::OP_LE:
+        type = TOK_OP_LE;
+        break;
+      case angle::pp::Token::OP_RIGHT:
+        type = TOK_OP_RIGHT;
+        break;
+      case angle::pp::Token::OP_LEFT:
+        type = TOK_OP_LEFT;
+        break;
+      case '|':
+      case '^':
+      case '&':
+      case '>':
+      case '<':
+      case '-':
+      case '+':
+      case '%':
+      case '/':
+      case '*':
+      case '!':
+      case '~':
+      case '(':
+      case ')':
+        type = token->type;
+        break;
+
+      default:
+        break;
+    }
+
+    return type;
+}
+
+void yyerror(Context *context, const char *reason)
+{
+    context->diagnostics->report(angle::pp::Diagnostics::PP_INVALID_EXPRESSION,
+                                 context->token->location,
+                                 reason);
+}
+
+namespace angle {
+
+namespace pp {
+
+ExpressionParser::ExpressionParser(Lexer *lexer, Diagnostics *diagnostics)
+    : mLexer(lexer),
+      mDiagnostics(diagnostics)
+{
+}
+
+bool ExpressionParser::parse(Token *token,
+                             int *result,
+                             bool parsePresetToken,
+                             const ErrorSettings &errorSettings,
+                             bool *valid)
+{
+    Context context;
+    context.diagnostics = mDiagnostics;
+    context.lexer = mLexer;
+    context.token = token;
+    context.result = result;
+    context.ignoreErrors = 0;
+    context.parsePresetToken = parsePresetToken;
+    context.errorSettings    = errorSettings;
+    context.valid            = valid;
+    int ret = yyparse(&context);
+    switch (ret)
+    {
+      case 0:
+      case 1:
+        break;
+
+      case 2:
+        mDiagnostics->report(Diagnostics::PP_OUT_OF_MEMORY, token->location, "");
+        break;
+
+      default:
+        assert(false);
+        mDiagnostics->report(Diagnostics::PP_INTERNAL_ERROR, token->location, "");
+        break;
+    }
+
+    return ret == 0;
+}
+
+}  // namespace pp
+
+}  // namespace angle
diff --git a/src/compiler/translator/64bit-lexer-safety.patch b/src/compiler/translator/64bit-lexer-safety.patch
deleted file mode 100644
index b632877..0000000
--- a/src/compiler/translator/64bit-lexer-safety.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-diff --git a/src/compiler/translator/glslang_lex.cpp b/src/compiler/translator/glslang_lex.cpp
-index 1ba63df..2a206ab 100644
---- a/src/compiler/translator/glslang_lex.cpp
-+++ b/src/compiler/translator/glslang_lex.cpp
-@@ -2698,8 +2703,10 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
- 			num_to_read = YY_READ_BUF_SIZE;
- 
- 		/* Read in more data. */
-+        size_t result = 0;
- 		YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
--			yyg->yy_n_chars, num_to_read );
-+            result, num_to_read );
-+        yyg->yy_n_chars = static_cast<int>(result);
- 
- 		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
- 		}
diff --git a/src/compiler/translator/generate_parser.py b/src/compiler/translator/generate_parser.py
new file mode 100755
index 0000000..b1a7079
--- /dev/null
+++ b/src/compiler/translator/generate_parser.py
@@ -0,0 +1,22 @@
+#!/usr/bin/python
+# Copyright 2019 The ANGLE Project Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+#
+# generate_parser.py:
+#   Generate lexer and parser for ANGLE's translator.
+
+import sys
+
+sys.path.append('..')
+import generate_parser_tools
+
+basename = 'glslang'
+
+
+def main():
+    return generate_parser_tools.generate_parser(basename, True)
+
+
+if __name__ == '__main__':
+    sys.exit(main())
diff --git a/src/compiler/translator/generate_parser.sh b/src/compiler/translator/generate_parser.sh
deleted file mode 100755
index 54023e2..0000000
--- a/src/compiler/translator/generate_parser.sh
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/bin/bash
-# Copyright 2010 The ANGLE Project Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-# Generates GLSL ES parser - glslang_lex.cpp, glslang_tab.h, and glslang_tab.cpp
-
-run_flex()
-{
-input_file=./$1.l
-output_source=./$1_lex.cpp
-flex --noline --nounistd --outfile=$output_source $input_file
-}
-
-run_bison()
-{
-input_file=./$1.y
-output_header=./$1_tab.h
-output_source=./$1_tab.cpp
-bison --no-lines --skeleton=yacc.c --defines=$output_header --output=$output_source $input_file
-}
-
-script_dir=$(dirname $0)
-
-# Generate Parser
-cd $script_dir
-run_flex glslang
-run_bison glslang
-patch --silent --forward < 64bit-lexer-safety.patch
diff --git a/src/compiler/translator/glslang.l b/src/compiler/translator/glslang.l
index a3e939f..bfe8ea2 100644
--- a/src/compiler/translator/glslang.l
+++ b/src/compiler/translator/glslang.l
@@ -9,20 +9,22 @@
 Based on ANSI C grammar, Lex specification:
 http://www.lysator.liu.se/c/ANSI-C-grammar-l.html
 
-IF YOU MODIFY THIS FILE YOU ALSO NEED TO RUN generate_parser.sh,
-WHICH GENERATES THE GLSL ES LEXER (glslang_lex.cpp).
+IF YOU MODIFY THIS FILE YOU ALSO NEED TO RUN scripts/run_code_generation.py
+WHICH GENERATES THE GLSL ES LEXER (glslang_lex_autogen.cpp).
 */
 
 %top{
+// GENERATED FILE - DO NOT EDIT.
+// Generated by generate_parser.py from glslang.l
 //
-// Copyright 2012 The ANGLE Project Authors. All rights reserved.
+// Copyright 2019 The ANGLE Project Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 //
+// glslang.l:
+//   Lexer for the OpenGL shading language.
 
-// This file is auto-generated by generate_parser.sh. DO NOT EDIT!
-
-/* clang-format off */
+// clang-format off
 
 // Ignore errors in auto-generated code.
 #if defined(__GNUC__)
@@ -60,7 +62,7 @@
 
 using namespace sh;
 
-#include "glslang_tab.h"
+#include "glslang_tab_autogen.h"
 
 /* windows only pragma */
 #ifdef _MSC_VER
diff --git a/src/compiler/translator/glslang.y b/src/compiler/translator/glslang.y
index ad40130..b1dd8a8 100644
--- a/src/compiler/translator/glslang.y
+++ b/src/compiler/translator/glslang.y
@@ -9,18 +9,20 @@
 Based on ANSI C Yacc grammar:
 http://www.lysator.liu.se/c/ANSI-C-grammar-y.html
 
-IF YOU MODIFY THIS FILE YOU ALSO NEED TO RUN generate_parser.sh,
-WHICH GENERATES THE GLSL ES PARSER (glslang_tab.cpp AND glslang_tab.h).
+IF YOU MODIFY THIS FILE YOU ALSO NEED TO RUN scripts/run_code_generation.py
+WHICH GENERATES THE GLSL ES PARSER (glslang_tab_autogen.cpp AND glslang_tab_autogen.h).
 */
 
 %{
+// GENERATED FILE - DO NOT EDIT.
+// Generated by generate_parser.py from glslang.y
 //
-// Copyright 2002 The ANGLE Project Authors. All rights reserved.
+// Copyright 2019 The ANGLE Project Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 //
-
-// This file is auto-generated by generate_parser.sh. DO NOT EDIT!
+// glslang.y:
+//   Parser for the OpenGL shading language.
 
 // clang-format off
 
diff --git a/src/compiler/translator/glslang_lex.cpp b/src/compiler/translator/glslang_lex_autogen.cpp
similarity index 99%
rename from src/compiler/translator/glslang_lex.cpp
rename to src/compiler/translator/glslang_lex_autogen.cpp
index ba04ab9..06bf722 100644
--- a/src/compiler/translator/glslang_lex.cpp
+++ b/src/compiler/translator/glslang_lex_autogen.cpp
@@ -1,13 +1,15 @@
-#line 17 "./glslang.l"
+#line 17 "glslang.l"
+// GENERATED FILE - DO NOT EDIT.
+// Generated by generate_parser.py from glslang.l
 //
-// Copyright 2012 The ANGLE Project Authors. All rights reserved.
+// Copyright 2019 The ANGLE Project Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 //
+// glslang.l:
+//   Lexer for the OpenGL shading language.
 
-// This file is auto-generated by generate_parser.sh. DO NOT EDIT!
-
-/* clang-format off */
+// clang-format off
 
 // Ignore errors in auto-generated code.
 #if defined(__GNUC__)
@@ -118,10 +120,10 @@
 /* First, we deal with  platform-specific or compiler-specific issues. */
 
 /* begin standard C headers. */
-#include <errno.h>
 #include <stdio.h>
-#include <stdlib.h>
 #include <string.h>
+#include <errno.h>
+#include <stdlib.h>
 
 /* end standard C headers. */
 
@@ -1187,19 +1189,19 @@
 Based on ANSI C grammar, Lex specification:
 http://www.lysator.liu.se/c/ANSI-C-grammar-l.html
 
-IF YOU MODIFY THIS FILE YOU ALSO NEED TO RUN generate_parser.sh,
-WHICH GENERATES THE GLSL ES LEXER (glslang_lex.cpp).
+IF YOU MODIFY THIS FILE YOU ALSO NEED TO RUN scripts/run_code_generation.py
+WHICH GENERATES THE GLSL ES LEXER (glslang_lex_autogen.cpp).
 */
 
-#include "compiler/preprocessor/Token.h"
-#include "compiler/translator/ParseContext.h"
 #include "compiler/translator/glslang.h"
-#include "compiler/translator/length_limits.h"
+#include "compiler/translator/ParseContext.h"
+#include "compiler/preprocessor/Token.h"
 #include "compiler/translator/util.h"
+#include "compiler/translator/length_limits.h"
 
 using namespace sh;
 
-#include "glslang_tab.h"
+#include "glslang_tab_autogen.h"
 
 /* windows only pragma */
 #ifdef _MSC_VER
@@ -2749,10 +2751,10 @@
 			num_to_read = YY_READ_BUF_SIZE;
 
 		/* Read in more data. */
-        size_t result = 0;
+		yy_size_t ret = 0;
 		YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
-            result, num_to_read );
-        yyg->yy_n_chars = static_cast<int>(result);
+			ret, num_to_read );
+		yyg->yy_n_chars = static_cast<int>(ret);
 
 		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
 		}
diff --git a/src/compiler/translator/glslang_tab.cpp b/src/compiler/translator/glslang_tab_autogen.cpp
similarity index 95%
rename from src/compiler/translator/glslang_tab.cpp
rename to src/compiler/translator/glslang_tab_autogen.cpp
index e49325c..dacea48 100644
--- a/src/compiler/translator/glslang_tab.cpp
+++ b/src/compiler/translator/glslang_tab_autogen.cpp
@@ -1,8 +1,9 @@
-/* A Bison parser, made by GNU Bison 3.0.4.  */
+/* A Bison parser, made by GNU Bison 3.3.2.  */
 
 /* Bison implementation for Yacc-like parsers in C
 
-   Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
+   Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2019 Free Software Foundation,
+   Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -40,11 +41,14 @@
    define necessary library symbols; they are noted "INFRINGES ON
    USER NAME SPACE" below.  */
 
+/* Undocumented macros, especially those whose name start with YY_,
+   are private implementation details.  Do not rely on them.  */
+
 /* Identify Bison output.  */
 #define YYBISON 1
 
 /* Bison version.  */
-#define YYBISON_VERSION "3.0.4"
+#define YYBISON_VERSION "3.3.2"
 
 /* Skeleton name.  */
 #define YYSKELETON_NAME "yacc.c"
@@ -58,15 +62,17 @@
 /* Pull parsers.  */
 #define YYPULL 1
 
-/* Copy the first part of user declarations.  */
+/* First part of user prologue.  */
 
+// GENERATED FILE - DO NOT EDIT.
+// Generated by generate_parser.py from glslang.y
 //
-// Copyright 2002 The ANGLE Project Authors. All rights reserved.
+// Copyright 2019 The ANGLE Project Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 //
-
-// This file is auto-generated by generate_parser.sh. DO NOT EDIT!
+// glslang.y:
+//   Parser for the OpenGL shading language.
 
 // clang-format off
 
@@ -99,12 +105,15 @@
 
 
 
-
 # ifndef YY_NULLPTR
-#  if defined __cplusplus && 201103L <= __cplusplus
-#   define YY_NULLPTR nullptr
+#  if defined __cplusplus
+#   if 201103L <= __cplusplus
+#    define YY_NULLPTR nullptr
+#   else
+#    define YY_NULLPTR 0
+#   endif
 #  else
-#   define YY_NULLPTR 0
+#   define YY_NULLPTR ((void*)0)
 #  endif
 # endif
 
@@ -117,9 +126,9 @@
 #endif
 
 /* In a future release of Bison, this section will be replaced
-   by #include "glslang_tab.h".  */
-#ifndef YY_YY_GLSLANG_TAB_H_INCLUDED
-# define YY_YY_GLSLANG_TAB_H_INCLUDED
+   by #include "glslang_tab_autogen.h".  */
+#ifndef YY_YY_GLSLANG_TAB_AUTOGEN_H_INCLUDED
+# define YY_YY_GLSLANG_TAB_AUTOGEN_H_INCLUDED
 /* Debug traces.  */
 #ifndef YYDEBUG
 # define YYDEBUG 0
@@ -372,9 +381,9 @@
 
 int yyparse (TParseContext* context, void *scanner);
 
-#endif /* !YY_YY_GLSLANG_TAB_H_INCLUDED  */
+#endif /* !YY_YY_GLSLANG_TAB_AUTOGEN_H_INCLUDED  */
 
-/* Copy the second part of user declarations.  */
+/* Second part of user prologue.  */
 
 
 extern int yylex(YYSTYPE* yylval, YYLTYPE* yylloc, void* yyscanner);
@@ -408,23 +417,20 @@
     }  \
 } while (0)
 
-// TODO(http://anglebug.com/3819): Update for GL version specific validation
 #define ES2_ONLY(S, L) do {  \
-    if (context->getShaderVersion() != 100 && !IsDesktopGLSpec(context->getShaderSpec())) {  \
+    if (context->getShaderVersion() != 100) {  \
         context->error(L, " supported in GLSL ES 1.00 only", S);  \
     }  \
 } while (0)
 
-// TODO(http://anglebug.com/3819): Update for GL version specific validation
 #define ES3_OR_NEWER(TOKEN, LINE, REASON) do {  \
-    if (context->getShaderVersion() < 300 && !IsDesktopGLSpec(context->getShaderSpec())) {  \
+    if (context->getShaderVersion() < 300) {  \
         context->error(LINE, REASON " supported in GLSL ES 3.00 and above only", TOKEN);  \
     }  \
 } while (0)
 
-// TODO(http://anglebug.com/3819): Update for GL version specific validation
 #define ES3_1_ONLY(TOKEN, LINE, REASON) do {  \
-    if (context->getShaderVersion() != 310 && !IsDesktopGLSpec(context->getShaderSpec())) {  \
+    if (context->getShaderVersion() != 310) {  \
         context->error(LINE, REASON " supported in GLSL ES 3.10 only", TOKEN);  \
     }  \
 } while (0)
@@ -450,13 +456,13 @@
 #ifdef YYTYPE_UINT16
 typedef YYTYPE_UINT16 yytype_uint16;
 #else
-typedef unsigned short int yytype_uint16;
+typedef unsigned short yytype_uint16;
 #endif
 
 #ifdef YYTYPE_INT16
 typedef YYTYPE_INT16 yytype_int16;
 #else
-typedef short int yytype_int16;
+typedef short yytype_int16;
 #endif
 
 #ifndef YYSIZE_T
@@ -468,7 +474,7 @@
 #  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
 #  define YYSIZE_T size_t
 # else
-#  define YYSIZE_T unsigned int
+#  define YYSIZE_T unsigned
 # endif
 #endif
 
@@ -504,15 +510,6 @@
 # define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
 #endif
 
-#if !defined _Noreturn \
-     && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
-# if defined _MSC_VER && 1200 <= _MSC_VER
-#  define _Noreturn __declspec (noreturn)
-# else
-#  define _Noreturn YY_ATTRIBUTE ((__noreturn__))
-# endif
-#endif
-
 /* Suppress unused-variable warnings by "using" E.  */
 #if ! defined lint || defined __GNUC__
 # define YYUSE(E) ((void) (E))
@@ -520,7 +517,7 @@
 # define YYUSE(E) /* empty */
 #endif
 
-#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
+#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
 /* Suppress an incorrect diagnostic about yylval being uninitialized.  */
 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
     _Pragma ("GCC diagnostic push") \
@@ -684,16 +681,16 @@
 /* YYNSTATES -- Number of states.  */
 #define YYNSTATES  426
 
-/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
-   by yylex, with out-of-bounds checking.  */
 #define YYUNDEFTOK  2
 #define YYMAXUTOK   411
 
+/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
+   as returned by yylex, with out-of-bounds checking.  */
 #define YYTRANSLATE(YYX)                                                \
-  ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
+  ((unsigned) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
 
 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
-   as returned by yylex, without out-of-bounds checking.  */
+   as returned by yylex.  */
 static const yytype_uint8 yytranslate[] =
 {
        0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
@@ -744,37 +741,37 @@
   /* YYRLINE[YYN] -- Source line where rule number YYN was defined.  */
 static const yytype_uint16 yyrline[] =
 {
-       0,   251,   251,   252,   255,   262,   265,   270,   275,   280,
-     285,   294,   300,   303,   306,   309,   312,   315,   321,   328,
-     334,   337,   345,   348,   354,   357,   363,   367,   374,   382,
-     385,   388,   394,   397,   400,   403,   410,   411,   412,   413,
-     421,   422,   425,   428,   435,   436,   439,   445,   446,   450,
-     457,   458,   461,   464,   467,   473,   474,   477,   483,   484,
-     491,   492,   499,   500,   507,   508,   514,   515,   521,   522,
-     528,   529,   535,   536,   542,   543,   544,   545,   549,   550,
-     551,   555,   559,   563,   567,   574,   577,   583,   590,   597,
-     600,   603,   607,   611,   615,   619,   623,   630,   637,   640,
-     647,   655,   672,   682,   685,   691,   695,   699,   703,   710,
-     717,   720,   724,   728,   733,   740,   744,   748,   752,   757,
-     764,   768,   774,   777,   783,   787,   794,   800,   804,   808,
-     811,   814,   823,   828,   832,   835,   838,   841,   844,   848,
-     851,   855,   858,   861,   864,   867,   870,   877,   884,   887,
-     890,   896,   903,   906,   912,   915,   918,   921,   927,   930,
-     937,   942,   949,   954,   965,   968,   971,   974,   977,   980,
-     984,   988,   992,   996,  1000,  1004,  1008,  1012,  1016,  1020,
-    1024,  1028,  1032,  1036,  1040,  1044,  1048,  1052,  1056,  1060,
-    1064,  1071,  1074,  1077,  1080,  1083,  1086,  1089,  1092,  1095,
-    1098,  1101,  1104,  1107,  1110,  1113,  1116,  1119,  1122,  1125,
-    1128,  1131,  1134,  1144,  1151,  1158,  1161,  1164,  1167,  1170,
-    1173,  1176,  1179,  1182,  1185,  1188,  1191,  1194,  1197,  1200,
-    1208,  1208,  1211,  1211,  1217,  1220,  1226,  1229,  1236,  1240,
-    1246,  1249,  1255,  1259,  1263,  1264,  1270,  1271,  1272,  1273,
-    1274,  1275,  1276,  1280,  1284,  1284,  1284,  1291,  1292,  1296,
-    1296,  1297,  1297,  1302,  1306,  1313,  1317,  1324,  1325,  1329,
-    1335,  1339,  1348,  1348,  1355,  1358,  1364,  1368,  1374,  1374,
-    1379,  1379,  1383,  1383,  1391,  1394,  1400,  1403,  1409,  1413,
-    1420,  1423,  1426,  1429,  1432,  1440,  1446,  1452,  1455,  1461,
-    1461
+       0,   253,   253,   254,   257,   264,   267,   272,   277,   282,
+     287,   296,   302,   305,   308,   311,   314,   317,   323,   330,
+     336,   339,   347,   350,   356,   359,   365,   369,   376,   384,
+     387,   390,   396,   399,   402,   405,   412,   413,   414,   415,
+     423,   424,   427,   430,   437,   438,   441,   447,   448,   452,
+     459,   460,   463,   466,   469,   475,   476,   479,   485,   486,
+     493,   494,   501,   502,   509,   510,   516,   517,   523,   524,
+     530,   531,   537,   538,   544,   545,   546,   547,   551,   552,
+     553,   557,   561,   565,   569,   576,   579,   585,   592,   599,
+     602,   605,   609,   613,   617,   621,   625,   632,   639,   642,
+     649,   657,   674,   684,   687,   693,   697,   701,   705,   712,
+     719,   722,   726,   730,   735,   742,   746,   750,   754,   759,
+     766,   770,   776,   779,   785,   789,   796,   802,   806,   810,
+     813,   816,   825,   830,   834,   837,   840,   843,   846,   850,
+     853,   857,   860,   863,   866,   869,   872,   879,   886,   889,
+     892,   898,   905,   908,   914,   917,   920,   923,   929,   932,
+     939,   944,   951,   956,   967,   970,   973,   976,   979,   982,
+     986,   990,   994,   998,  1002,  1006,  1010,  1014,  1018,  1022,
+    1026,  1030,  1034,  1038,  1042,  1046,  1050,  1054,  1058,  1062,
+    1066,  1073,  1076,  1079,  1082,  1085,  1088,  1091,  1094,  1097,
+    1100,  1103,  1106,  1109,  1112,  1115,  1118,  1121,  1124,  1127,
+    1130,  1133,  1136,  1146,  1153,  1160,  1163,  1166,  1169,  1172,
+    1175,  1178,  1181,  1184,  1187,  1190,  1193,  1196,  1199,  1202,
+    1210,  1210,  1213,  1213,  1219,  1222,  1228,  1231,  1238,  1242,
+    1248,  1251,  1257,  1261,  1265,  1266,  1272,  1273,  1274,  1275,
+    1276,  1277,  1278,  1282,  1286,  1286,  1286,  1293,  1294,  1298,
+    1298,  1299,  1299,  1304,  1308,  1315,  1319,  1326,  1327,  1331,
+    1337,  1341,  1350,  1350,  1357,  1360,  1366,  1370,  1376,  1376,
+    1381,  1381,  1385,  1385,  1393,  1396,  1402,  1405,  1411,  1415,
+    1422,  1425,  1428,  1431,  1434,  1442,  1448,  1454,  1457,  1463,
+    1463
 };
 #endif
 
@@ -1752,22 +1749,22 @@
 
 #define YYRECOVERING()  (!!yyerrstatus)
 
-#define YYBACKUP(Token, Value)                                  \
-do                                                              \
-  if (yychar == YYEMPTY)                                        \
-    {                                                           \
-      yychar = (Token);                                         \
-      yylval = (Value);                                         \
-      YYPOPSTACK (yylen);                                       \
-      yystate = *yyssp;                                         \
-      goto yybackup;                                            \
-    }                                                           \
-  else                                                          \
-    {                                                           \
-      yyerror (&yylloc, context, scanner, YY_("syntax error: cannot back up")); \
-      YYERROR;                                                  \
-    }                                                           \
-while (0)
+#define YYBACKUP(Token, Value)                                    \
+  do                                                              \
+    if (yychar == YYEMPTY)                                        \
+      {                                                           \
+        yychar = (Token);                                         \
+        yylval = (Value);                                         \
+        YYPOPSTACK (yylen);                                       \
+        yystate = *yyssp;                                         \
+        goto yybackup;                                            \
+      }                                                           \
+    else                                                          \
+      {                                                           \
+        yyerror (&yylloc, context, scanner, YY_("syntax error: cannot back up")); \
+        YYERROR;                                                  \
+      }                                                           \
+  while (0)
 
 /* Error token number */
 #define YYTERROR        1
@@ -1826,10 +1823,10 @@
 /* Print *YYLOCP on YYO.  Private, do not rely on its existence. */
 
 YY_ATTRIBUTE_UNUSED
-static unsigned
+static int
 yy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp)
 {
-  unsigned res = 0;
+  int res = 0;
   int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
   if (0 <= yylocp->first_line)
     {
@@ -1872,15 +1869,15 @@
 } while (0)
 
 
-/*----------------------------------------.
-| Print this symbol's value on YYOUTPUT.  |
-`----------------------------------------*/
+/*-----------------------------------.
+| Print this symbol's value on YYO.  |
+`-----------------------------------*/
 
 static void
-yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, TParseContext* context, void *scanner)
+yy_symbol_value_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, TParseContext* context, void *scanner)
 {
-  FILE *yyo = yyoutput;
-  YYUSE (yyo);
+  FILE *yyoutput = yyo;
+  YYUSE (yyoutput);
   YYUSE (yylocationp);
   YYUSE (context);
   YYUSE (scanner);
@@ -1888,26 +1885,26 @@
     return;
 # ifdef YYPRINT
   if (yytype < YYNTOKENS)
-    YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
+    YYPRINT (yyo, yytoknum[yytype], *yyvaluep);
 # endif
   YYUSE (yytype);
 }
 
 
-/*--------------------------------.
-| Print this symbol on YYOUTPUT.  |
-`--------------------------------*/
+/*---------------------------.
+| Print this symbol on YYO.  |
+`---------------------------*/
 
 static void
-yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, TParseContext* context, void *scanner)
+yy_symbol_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, TParseContext* context, void *scanner)
 {
-  YYFPRINTF (yyoutput, "%s %s (",
+  YYFPRINTF (yyo, "%s %s (",
              yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
 
-  YY_LOCATION_PRINT (yyoutput, *yylocationp);
-  YYFPRINTF (yyoutput, ": ");
-  yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp, context, scanner);
-  YYFPRINTF (yyoutput, ")");
+  YY_LOCATION_PRINT (yyo, *yylocationp);
+  YYFPRINTF (yyo, ": ");
+  yy_symbol_value_print (yyo, yytype, yyvaluep, yylocationp, context, scanner);
+  YYFPRINTF (yyo, ")");
 }
 
 /*------------------------------------------------------------------.
@@ -1941,7 +1938,7 @@
 static void
 yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, YYLTYPE *yylsp, int yyrule, TParseContext* context, void *scanner)
 {
-  unsigned long int yylno = yyrline[yyrule];
+  unsigned long yylno = yyrline[yyrule];
   int yynrhs = yyr2[yyrule];
   int yyi;
   YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
@@ -1952,7 +1949,7 @@
       YYFPRINTF (stderr, "   $%d = ", yyi + 1);
       yy_symbol_print (stderr,
                        yystos[yyssp[yyi + 1 - yynrhs]],
-                       &(yyvsp[(yyi + 1) - (yynrhs)])
+                       &yyvsp[(yyi + 1) - (yynrhs)]
                        , &(yylsp[(yyi + 1) - (yynrhs)])                       , context, scanner);
       YYFPRINTF (stderr, "\n");
     }
@@ -2056,7 +2053,10 @@
           case '\\':
             if (*++yyp != '\\')
               goto do_not_strip_quotes;
-            /* Fall through.  */
+            else
+              goto append;
+
+          append:
           default:
             if (yyres)
               yyres[yyn] = *yyp;
@@ -2074,7 +2074,7 @@
   if (! yyres)
     return yystrlen (yystr);
 
-  return yystpcpy (yyres, yystr) - yyres;
+  return (YYSIZE_T) (yystpcpy (yyres, yystr) - yyres);
 }
 # endif
 
@@ -2152,10 +2152,10 @@
                 yyarg[yycount++] = yytname[yyx];
                 {
                   YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
-                  if (! (yysize <= yysize1
-                         && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
+                  if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
+                    yysize = yysize1;
+                  else
                     return 2;
-                  yysize = yysize1;
                 }
               }
         }
@@ -2167,6 +2167,7 @@
       case N:                               \
         yyformat = S;                       \
       break
+    default: /* Avoid compiler warnings. */
       YYCASE_(0, YY_("syntax error"));
       YYCASE_(1, YY_("syntax error, unexpected %s"));
       YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
@@ -2178,9 +2179,10 @@
 
   {
     YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
-    if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
+    if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
+      yysize = yysize1;
+    else
       return 2;
-    yysize = yysize1;
   }
 
   if (*yymsg_alloc < yysize)
@@ -2333,23 +2335,31 @@
   yylsp[0] = yylloc;
   goto yysetstate;
 
+
 /*------------------------------------------------------------.
-| yynewstate -- Push a new state, which is found in yystate.  |
+| yynewstate -- push a new state, which is found in yystate.  |
 `------------------------------------------------------------*/
- yynewstate:
+yynewstate:
   /* In all cases, when you get here, the value and location stacks
      have just been pushed.  So pushing a state here evens the stacks.  */
   yyssp++;
 
- yysetstate:
-  *yyssp = yystate;
+
+/*--------------------------------------------------------------------.
+| yynewstate -- set current state (the top of the stack) to yystate.  |
+`--------------------------------------------------------------------*/
+yysetstate:
+  *yyssp = (yytype_int16) yystate;
 
   if (yyss + yystacksize - 1 <= yyssp)
+#if !defined yyoverflow && !defined YYSTACK_RELOCATE
+    goto yyexhaustedlab;
+#else
     {
       /* Get the current used size of the three stacks, in elements.  */
-      YYSIZE_T yysize = yyssp - yyss + 1;
+      YYSIZE_T yysize = (YYSIZE_T) (yyssp - yyss + 1);
 
-#ifdef yyoverflow
+# if defined yyoverflow
       {
         /* Give user a chance to reallocate the stack.  Use copies of
            these so that the &'s don't force the real ones into
@@ -2367,15 +2377,11 @@
                     &yyvs1, yysize * sizeof (*yyvsp),
                     &yyls1, yysize * sizeof (*yylsp),
                     &yystacksize);
-
-        yyls = yyls1;
         yyss = yyss1;
         yyvs = yyvs1;
+        yyls = yyls1;
       }
-#else /* no yyoverflow */
-# ifndef YYSTACK_RELOCATE
-      goto yyexhaustedlab;
-# else
+# else /* defined YYSTACK_RELOCATE */
       /* Extend the stack our own way.  */
       if (YYMAXDEPTH <= yystacksize)
         goto yyexhaustedlab;
@@ -2392,23 +2398,23 @@
         YYSTACK_RELOCATE (yyss_alloc, yyss);
         YYSTACK_RELOCATE (yyvs_alloc, yyvs);
         YYSTACK_RELOCATE (yyls_alloc, yyls);
-#  undef YYSTACK_RELOCATE
+# undef YYSTACK_RELOCATE
         if (yyss1 != yyssa)
           YYSTACK_FREE (yyss1);
       }
 # endif
-#endif /* no yyoverflow */
 
       yyssp = yyss + yysize - 1;
       yyvsp = yyvs + yysize - 1;
       yylsp = yyls + yysize - 1;
 
       YYDPRINTF ((stderr, "Stack size increased to %lu\n",
-                  (unsigned long int) yystacksize));
+                  (unsigned long) yystacksize));
 
       if (yyss + yystacksize - 1 <= yyssp)
         YYABORT;
     }
+#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
 
   YYDPRINTF ((stderr, "Entering state %d\n", yystate));
 
@@ -2417,11 +2423,11 @@
 
   goto yybackup;
 
+
 /*-----------.
 | yybackup.  |
 `-----------*/
 yybackup:
-
   /* Do appropriate processing given the current state.  Read a
      lookahead token if we need one and don't already have one.  */
 
@@ -2494,7 +2500,7 @@
 
 
 /*-----------------------------.
-| yyreduce -- Do a reduction.  |
+| yyreduce -- do a reduction.  |
 `-----------------------------*/
 yyreduce:
   /* yyn is the number of a rule to reduce with.  */
@@ -2510,8 +2516,9 @@
      GCC warning that YYVAL may be used uninitialized.  */
   yyval = yyvsp[1-yylen];
 
-  /* Default location.  */
+  /* Default location. */
   YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen);
+  yyerror_range[1] = yyloc;
   YY_REDUCE_PRINT (yyn);
   switch (yyn)
     {
@@ -4990,14 +4997,13 @@
   /* Now 'shift' the result of the reduction.  Determine what state
      that goes to, based on the state we popped back to and the rule
      number reduced by.  */
-
-  yyn = yyr1[yyn];
-
-  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
-  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
-    yystate = yytable[yystate];
-  else
-    yystate = yydefgoto[yyn - YYNTOKENS];
+  {
+    const int yylhs = yyr1[yyn] - YYNTOKENS;
+    const int yyi = yypgoto[yylhs] + *yyssp;
+    yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp
+               ? yytable[yyi]
+               : yydefgoto[yylhs]);
+  }
 
   goto yynewstate;
 
@@ -5080,14 +5086,11 @@
 | yyerrorlab -- error raised explicitly by YYERROR.  |
 `---------------------------------------------------*/
 yyerrorlab:
+  /* Pacify compilers when the user code never invokes YYERROR and the
+     label yyerrorlab therefore never appears in user code.  */
+  if (0)
+    YYERROR;
 
-  /* Pacify compilers like GCC when the user code never invokes
-     YYERROR and the label yyerrorlab therefore never appears in user
-     code.  */
-  if (/*CONSTCOND*/ 0)
-     goto yyerrorlab;
-
-  yyerror_range[1] = yylsp[1-yylen];
   /* Do not reclaim the symbols of the rule whose action triggered
      this YYERROR.  */
   YYPOPSTACK (yylen);
@@ -5153,6 +5156,7 @@
   yyresult = 0;
   goto yyreturn;
 
+
 /*-----------------------------------.
 | yyabortlab -- YYABORT comes here.  |
 `-----------------------------------*/
@@ -5160,6 +5164,7 @@
   yyresult = 1;
   goto yyreturn;
 
+
 #if !defined yyoverflow || YYERROR_VERBOSE
 /*-------------------------------------------------.
 | yyexhaustedlab -- memory exhaustion comes here.  |
@@ -5170,6 +5175,10 @@
   /* Fall through.  */
 #endif
 
+
+/*-----------------------------------------------------.
+| yyreturn -- parsing is finished, return the result.  |
+`-----------------------------------------------------*/
 yyreturn:
   if (yychar != YYEMPTY)
     {
diff --git a/src/compiler/translator/glslang_tab.h b/src/compiler/translator/glslang_tab_autogen.h
similarity index 95%
rename from src/compiler/translator/glslang_tab.h
rename to src/compiler/translator/glslang_tab_autogen.h
index 5ffee8a..e9d9de5 100644
--- a/src/compiler/translator/glslang_tab.h
+++ b/src/compiler/translator/glslang_tab_autogen.h
@@ -1,8 +1,9 @@
-/* A Bison parser, made by GNU Bison 3.0.4.  */
+/* A Bison parser, made by GNU Bison 3.3.2.  */
 
 /* Bison interface for Yacc-like parsers in C
 
-   Copyright (C) 1984, 1989-1990, 2000-2015 Free Software Foundation, Inc.
+   Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2019 Free Software Foundation,
+   Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -30,8 +31,11 @@
    This special exception was added by the Free Software Foundation in
    version 2.2 of Bison.  */
 
-#ifndef YY_YY_GLSLANG_TAB_H_INCLUDED
-#define YY_YY_GLSLANG_TAB_H_INCLUDED
+/* Undocumented macros, especially those whose name start with YY_,
+   are private implementation details.  Do not rely on them.  */
+
+#ifndef YY_YY_GLSLANG_TAB_AUTOGEN_H_INCLUDED
+#define YY_YY_GLSLANG_TAB_AUTOGEN_H_INCLUDED
 /* Debug traces.  */
 #ifndef YYDEBUG
 #    define YYDEBUG 0
@@ -281,4 +285,4 @@
 
 int yyparse(TParseContext *context, void *scanner);
 
-#endif /* !YY_YY_GLSLANG_TAB_H_INCLUDED  */
+#endif /* !YY_YY_GLSLANG_TAB_AUTOGEN_H_INCLUDED  */
diff --git a/tools/flex-bison/third_party/.gitattributes b/tools/flex-bison/third_party/.gitattributes
new file mode 100644
index 0000000..0688c8a
--- /dev/null
+++ b/tools/flex-bison/third_party/.gitattributes
@@ -0,0 +1 @@
+*                    eol=lf
diff --git a/tools/flex-bison/third_party/m4sugar/LICENSE b/tools/flex-bison/third_party/m4sugar/LICENSE
new file mode 100644
index 0000000..d511905
--- /dev/null
+++ b/tools/flex-bison/third_party/m4sugar/LICENSE
@@ -0,0 +1,339 @@
+		    GNU GENERAL PUBLIC LICENSE
+		       Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+		    GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+			    NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
+
+	    How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License along
+    with this program; if not, write to the Free Software Foundation, Inc.,
+    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) year name of author
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+  <signature of Ty Coon>, 1 April 1989
+  Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.
diff --git a/tools/flex-bison/third_party/m4sugar/README.chromium b/tools/flex-bison/third_party/m4sugar/README.chromium
new file mode 100644
index 0000000..c60a5fd
--- /dev/null
+++ b/tools/flex-bison/third_party/m4sugar/README.chromium
@@ -0,0 +1,11 @@
+Name: Autoconf M4 macros used by Bison
+Short Name: m4sugar
+URL: https://www.gnu.org/software/autoconf/
+Version: unknown
+License: GPL
+License File: LICENSE
+Security critical: no
+
+Description:
+Bison uses M4 to generate its output, and uses the utility M4 macros in this
+directory.
diff --git a/tools/flex-bison/third_party/m4sugar/foreach.m4 b/tools/flex-bison/third_party/m4sugar/foreach.m4
new file mode 100644
index 0000000..7093d0f
--- /dev/null
+++ b/tools/flex-bison/third_party/m4sugar/foreach.m4
@@ -0,0 +1,362 @@
+#                                                  -*- Autoconf -*-
+# This file is part of Autoconf.
+# foreach-based replacements for recursive functions.
+# Speeds up GNU M4 1.4.x by avoiding quadratic $@ recursion, but penalizes
+# GNU M4 1.6 by requiring more memory and macro expansions.
+#
+# Copyright (C) 2008-2017 Free Software Foundation, Inc.
+
+# This file is part of Autoconf.  This program is free
+# software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the
+# Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# Under Section 7 of GPL version 3, you are granted additional
+# permissions described in the Autoconf Configure Script Exception,
+# version 3.0, as published by the Free Software Foundation.
+#
+# You should have received a copy of the GNU General Public License
+# and a copy of the Autoconf Configure Script Exception along with
+# this program; see the files COPYINGv3 and COPYING.EXCEPTION
+# respectively.  If not, see <https://www.gnu.org/licenses/>.
+
+# Written by Eric Blake.
+
+# In M4 1.4.x, every byte of $@ is rescanned.  This means that an
+# algorithm on n arguments that recurses with one less argument each
+# iteration will scan n * (n + 1) / 2 arguments, for O(n^2) time.  In
+# M4 1.6, this was fixed so that $@ is only scanned once, then
+# back-references are made to information stored about the scan.
+# Thus, n iterations need only scan n arguments, for O(n) time.
+# Additionally, in M4 1.4.x, recursive algorithms did not clean up
+# memory very well, requiring O(n^2) memory rather than O(n) for n
+# iterations.
+#
+# This file is designed to overcome the quadratic nature of $@
+# recursion by writing a variant of m4_foreach that uses m4_for rather
+# than $@ recursion to operate on the list.  This involves more macro
+# expansions, but avoids the need to rescan a quadratic number of
+# arguments, making these replacements very attractive for M4 1.4.x.
+# On the other hand, in any version of M4, expanding additional macros
+# costs additional time; therefore, in M4 1.6, where $@ recursion uses
+# fewer macros, these replacements actually pessimize performance.
+# Additionally, the use of $10 to mean the tenth argument violates
+# POSIX; although all versions of m4 1.4.x support this meaning, a
+# future m4 version may switch to take it as the first argument
+# concatenated with a literal 0, so the implementations in this file
+# are not future-proof.  Thus, this file is conditionally included as
+# part of m4_init(), only when it is detected that M4 probably has
+# quadratic behavior (ie. it lacks the macro __m4_version__).
+#
+# Please keep this file in sync with m4sugar.m4.
+
+# _m4_foreach(PRE, POST, IGNORED, ARG...)
+# ---------------------------------------
+# Form the common basis of the m4_foreach and m4_map macros.  For each
+# ARG, expand PRE[ARG]POST[].  The IGNORED argument makes recursion
+# easier, and must be supplied rather than implicit.
+#
+# This version minimizes the number of times that $@ is evaluated by
+# using m4_for to generate a boilerplate into _m4_f then passing $@ to
+# that temporary macro.  Thus, the recursion is done in m4_for without
+# reparsing any user input, and is not quadratic.  For an idea of how
+# this works, note that m4_foreach(i,[1,2],[i]) calls
+#   _m4_foreach([m4_define([i],],[)i],[],[1],[2])
+# which defines _m4_f:
+#   $1[$4]$2[]$1[$5]$2[]_m4_popdef([_m4_f])
+# then calls _m4_f([m4_define([i],],[)i],[],[1],[2]) for a net result:
+#   m4_define([i],[1])i[]m4_define([i],[2])i[]_m4_popdef([_m4_f]).
+m4_define([_m4_foreach],
+[m4_if([$#], [3], [],
+       [m4_pushdef([_m4_f], _m4_for([4], [$#], [1],
+   [$0_([1], [2],], [)])[_m4_popdef([_m4_f])])_m4_f($@)])])
+
+m4_define([_m4_foreach_],
+[[$$1[$$3]$$2[]]])
+
+# m4_case(SWITCH, VAL1, IF-VAL1, VAL2, IF-VAL2, ..., DEFAULT)
+# -----------------------------------------------------------
+# Find the first VAL that SWITCH matches, and expand the corresponding
+# IF-VAL.  If there are no matches, expand DEFAULT.
+#
+# Use m4_for to create a temporary macro in terms of a boilerplate
+# m4_if with final cleanup.  If $# is even, we have DEFAULT; if it is
+# odd, then rounding the last $# up in the temporary macro is
+# harmless.  For example, both m4_case(1,2,3,4,5) and
+# m4_case(1,2,3,4,5,6) result in the intermediate _m4_case being
+#   m4_if([$1],[$2],[$3],[$1],[$4],[$5],_m4_popdef([_m4_case])[$6])
+m4_define([m4_case],
+[m4_if(m4_eval([$# <= 2]), [1], [$2],
+[m4_pushdef([_$0], [m4_if(]_m4_for([2], m4_eval([($# - 1) / 2 * 2]), [2],
+     [_$0_(], [)])[_m4_popdef(
+	 [_$0])]m4_dquote($m4_eval([($# + 1) & ~1]))[)])_$0($@)])])
+
+m4_define([_m4_case_],
+[$0_([1], [$1], m4_incr([$1]))])
+
+m4_define([_m4_case__],
+[[[$$1],[$$2],[$$3],]])
+
+# m4_bmatch(SWITCH, RE1, VAL1, RE2, VAL2, ..., DEFAULT)
+# -----------------------------------------------------
+# m4 equivalent of
+#
+# if (SWITCH =~ RE1)
+#   VAL1;
+# elif (SWITCH =~ RE2)
+#   VAL2;
+# elif ...
+#   ...
+# else
+#   DEFAULT
+#
+# We build the temporary macro _m4_b:
+#   m4_define([_m4_b], _m4_defn([_m4_bmatch]))_m4_b([$1], [$2], [$3])...
+#   _m4_b([$1], [$m-1], [$m])_m4_b([], [], [$m+1]_m4_popdef([_m4_b]))
+# then invoke m4_unquote(_m4_b($@)), for concatenation with later text.
+m4_define([m4_bmatch],
+[m4_if([$#], 0, [m4_fatal([$0: too few arguments: $#])],
+       [$#], 1, [m4_fatal([$0: too few arguments: $#: $1])],
+       [$#], 2, [$2],
+       [m4_pushdef([_m4_b], [m4_define([_m4_b],
+  _m4_defn([_$0]))]_m4_for([3], m4_eval([($# + 1) / 2 * 2 - 1]),
+  [2], [_$0_(], [)])[_m4_b([], [],]m4_dquote([$]m4_eval(
+  [($# + 1) / 2 * 2]))[_m4_popdef([_m4_b]))])m4_unquote(_m4_b($@))])])
+
+m4_define([_m4_bmatch],
+[m4_if(m4_bregexp([$1], [$2]), [-1], [], [[$3]m4_define([$0])])])
+
+m4_define([_m4_bmatch_],
+[$0_([1], m4_decr([$1]), [$1])])
+
+m4_define([_m4_bmatch__],
+[[_m4_b([$$1], [$$2], [$$3])]])
+
+
+# m4_cond(TEST1, VAL1, IF-VAL1, TEST2, VAL2, IF-VAL2, ..., [DEFAULT])
+# -------------------------------------------------------------------
+# Similar to m4_if, except that each TEST is expanded when encountered.
+# If the expansion of TESTn matches the string VALn, the result is IF-VALn.
+# The result is DEFAULT if no tests passed.  This macro allows
+# short-circuiting of expensive tests, where it pays to arrange quick
+# filter tests to run first.
+#
+# m4_cond already guarantees either 3*n or 3*n + 1 arguments, 1 <= n.
+# We only have to speed up _m4_cond, by building the temporary _m4_c:
+#   m4_define([_m4_c], _m4_defn([m4_unquote]))_m4_c([m4_if(($1), [($2)],
+#   [[$3]m4_define([_m4_c])])])_m4_c([m4_if(($4), [($5)],
+#   [[$6]m4_define([_m4_c])])])..._m4_c([m4_if(($m-2), [($m-1)],
+#   [[$m]m4_define([_m4_c])])])_m4_c([[$m+1]]_m4_popdef([_m4_c]))
+# We invoke m4_unquote(_m4_c($@)), for concatenation with later text.
+m4_define([_m4_cond],
+[m4_pushdef([_m4_c], [m4_define([_m4_c],
+  _m4_defn([m4_unquote]))]_m4_for([2], m4_eval([$# / 3 * 3 - 1]), [3],
+  [$0_(], [)])[_m4_c(]m4_dquote(m4_dquote(
+  [$]m4_eval([$# / 3 * 3 + 1])))[_m4_popdef([_m4_c]))])m4_unquote(_m4_c($@))])
+
+m4_define([_m4_cond_],
+[$0_(m4_decr([$1]), [$1], m4_incr([$1]))])
+
+m4_define([_m4_cond__],
+[[_m4_c([m4_if(($$1), [($$2)], [[$$3]m4_define([_m4_c])])])]])
+
+# m4_bpatsubsts(STRING, RE1, SUBST1, RE2, SUBST2, ...)
+# ----------------------------------------------------
+# m4 equivalent of
+#
+#   $_ = STRING;
+#   s/RE1/SUBST1/g;
+#   s/RE2/SUBST2/g;
+#   ...
+#
+# m4_bpatsubsts already validated an odd number of arguments; we only
+# need to speed up _m4_bpatsubsts.  To avoid nesting, we build the
+# temporary _m4_p:
+#   m4_define([_m4_p], [$1])m4_define([_m4_p],
+#   m4_bpatsubst(m4_dquote(_m4_defn([_m4_p])), [$2], [$3]))m4_define([_m4_p],
+#   m4_bpatsubst(m4_dquote(_m4_defn([_m4_p])), [$4], [$5]))m4_define([_m4_p],...
+#   m4_bpatsubst(m4_dquote(_m4_defn([_m4_p])), [$m-1], [$m]))m4_unquote(
+#   _m4_defn([_m4_p])_m4_popdef([_m4_p]))
+m4_define([_m4_bpatsubsts],
+[m4_pushdef([_m4_p], [m4_define([_m4_p],
+  ]m4_dquote([$]1)[)]_m4_for([3], [$#], [2], [$0_(],
+  [)])[m4_unquote(_m4_defn([_m4_p])_m4_popdef([_m4_p]))])_m4_p($@)])
+
+m4_define([_m4_bpatsubsts_],
+[$0_(m4_decr([$1]), [$1])])
+
+m4_define([_m4_bpatsubsts__],
+[[m4_define([_m4_p],
+m4_bpatsubst(m4_dquote(_m4_defn([_m4_p])), [$$1], [$$2]))]])
+
+# m4_shiftn(N, ...)
+# -----------------
+# Returns ... shifted N times.  Useful for recursive "varargs" constructs.
+#
+# m4_shiftn already validated arguments; we only need to speed up
+# _m4_shiftn.  If N is 3, then we build the temporary _m4_s, defined as
+#   ,[$5],[$6],...,[$m]_m4_popdef([_m4_s])
+# before calling m4_shift(_m4_s($@)).
+m4_define([_m4_shiftn],
+[m4_if(m4_incr([$1]), [$#], [], [m4_pushdef([_m4_s],
+  _m4_for(m4_eval([$1 + 2]), [$#], [1],
+  [[,]m4_dquote($], [)])[_m4_popdef([_m4_s])])m4_shift(_m4_s($@))])])
+
+# m4_do(STRING, ...)
+# ------------------
+# This macro invokes all its arguments (in sequence, of course).  It is
+# useful for making your macros more structured and readable by dropping
+# unnecessary dnl's and have the macros indented properly.
+#
+# Here, we use the temporary macro _m4_do, defined as
+#   $1[]$2[]...[]$n[]_m4_popdef([_m4_do])
+m4_define([m4_do],
+[m4_if([$#], [0], [],
+       [m4_pushdef([_$0], _m4_for([1], [$#], [1],
+		   [$], [[[]]])[_m4_popdef([_$0])])_$0($@)])])
+
+# m4_dquote_elt(ARGS)
+# -------------------
+# Return ARGS as an unquoted list of double-quoted arguments.
+#
+# _m4_foreach to the rescue.
+m4_define([m4_dquote_elt],
+[m4_if([$#], [0], [], [[[$1]]_m4_foreach([,m4_dquote(], [)], $@)])])
+
+# m4_reverse(ARGS)
+# ----------------
+# Output ARGS in reverse order.
+#
+# Invoke _m4_r($@) with the temporary _m4_r built as
+#   [$m], [$m-1], ..., [$2], [$1]_m4_popdef([_m4_r])
+m4_define([m4_reverse],
+[m4_if([$#], [0], [], [$#], [1], [[$1]],
+[m4_pushdef([_m4_r], [[$$#]]_m4_for(m4_decr([$#]), [1], [-1],
+    [[, ]m4_dquote($], [)])[_m4_popdef([_m4_r])])_m4_r($@)])])
+
+
+# m4_map_args_pair(EXPRESSION, [END-EXPR = EXPRESSION], ARG...)
+# -------------------------------------------------------------
+# Perform a pairwise grouping of consecutive ARGs, by expanding
+# EXPRESSION([ARG1], [ARG2]).  If there are an odd number of ARGs, the
+# final argument is expanded with END-EXPR([ARGn]).
+#
+# Build the temporary macro _m4_map_args_pair, with the $2([$m+1])
+# only output if $# is odd:
+#   $1([$3], [$4])[]$1([$5], [$6])[]...$1([$m-1],
+#   [$m])[]m4_default([$2], [$1])([$m+1])[]_m4_popdef([_m4_map_args_pair])
+m4_define([m4_map_args_pair],
+[m4_if([$#], [0], [m4_fatal([$0: too few arguments: $#])],
+       [$#], [1], [m4_fatal([$0: too few arguments: $#: $1])],
+       [$#], [2], [],
+       [$#], [3], [m4_default([$2], [$1])([$3])[]],
+       [m4_pushdef([_$0], _m4_for([3],
+   m4_eval([$# / 2 * 2 - 1]), [2], [_$0_(], [)])_$0_end(
+   [1], [2], [$#])[_m4_popdef([_$0])])_$0($@)])])
+
+m4_define([_m4_map_args_pair_],
+[$0_([1], [$1], m4_incr([$1]))])
+
+m4_define([_m4_map_args_pair__],
+[[$$1([$$2], [$$3])[]]])
+
+m4_define([_m4_map_args_pair_end],
+[m4_if(m4_eval([$3 & 1]), [1], [[m4_default([$$2], [$$1])([$$3])[]]])])
+
+# m4_join(SEP, ARG1, ARG2...)
+# ---------------------------
+# Produce ARG1SEPARG2...SEPARGn.  Avoid back-to-back SEP when a given ARG
+# is the empty string.  No expansion is performed on SEP or ARGs.
+#
+# Use a self-modifying separator, since we don't know how many
+# arguments might be skipped before a separator is first printed, but
+# be careful if the separator contains $.  _m4_foreach to the rescue.
+m4_define([m4_join],
+[m4_pushdef([_m4_sep], [m4_define([_m4_sep], _m4_defn([m4_echo]))])]dnl
+[_m4_foreach([_$0([$1],], [)], $@)_m4_popdef([_m4_sep])])
+
+m4_define([_m4_join],
+[m4_if([$2], [], [], [_m4_sep([$1])[$2]])])
+
+# m4_joinall(SEP, ARG1, ARG2...)
+# ------------------------------
+# Produce ARG1SEPARG2...SEPARGn.  An empty ARG results in back-to-back SEP.
+# No expansion is performed on SEP or ARGs.
+#
+# A bit easier than m4_join.  _m4_foreach to the rescue.
+m4_define([m4_joinall],
+[[$2]m4_if(m4_eval([$# <= 2]), [1], [],
+	   [_m4_foreach([$1], [], m4_shift($@))])])
+
+# m4_list_cmp(A, B)
+# -----------------
+# Compare the two lists of integer expressions A and B.
+#
+# m4_list_cmp takes care of any side effects; we only override
+# _m4_list_cmp_raw, where we can safely expand lists multiple times.
+# First, insert padding so that both lists are the same length; the
+# trailing +0 is necessary to handle a missing list.  Next, create a
+# temporary macro to perform pairwise comparisons until an inequality
+# is found.  For example, m4_list_cmp([1], [1,2]) creates _m4_cmp as
+#   m4_if(m4_eval([($1) != ($3)]), [1], [m4_cmp([$1], [$3])],
+#         m4_eval([($2) != ($4)]), [1], [m4_cmp([$2], [$4])],
+#         [0]_m4_popdef([_m4_cmp]))
+# then calls _m4_cmp([1+0], [0*2], [1], [2+0])
+m4_define([_m4_list_cmp_raw],
+[m4_if([$1], [$2], 0,
+       [_m4_list_cmp($1+0_m4_list_pad(m4_count($1), m4_count($2)),
+		     $2+0_m4_list_pad(m4_count($2), m4_count($1)))])])
+
+m4_define([_m4_list_pad],
+[m4_if(m4_eval($1 < $2), [1],
+       [_m4_for(m4_incr([$1]), [$2], [1], [,0*])])])
+
+m4_define([_m4_list_cmp],
+[m4_pushdef([_m4_cmp], [m4_if(]_m4_for(
+   [1], m4_eval([$# >> 1]), [1], [$0_(], [,]m4_eval([$# >> 1])[)])[
+      [0]_m4_popdef([_m4_cmp]))])_m4_cmp($@)])
+
+m4_define([_m4_list_cmp_],
+[$0_([$1], m4_eval([$1 + $2]))])
+
+m4_define([_m4_list_cmp__],
+[[m4_eval([($$1) != ($$2)]), [1], [m4_cmp([$$1], [$$2])],
+]])
+
+# m4_max(EXPR, ...)
+# m4_min(EXPR, ...)
+# -----------------
+# Return the decimal value of the maximum (or minimum) in a series of
+# integer expressions.
+#
+# _m4_foreach to the rescue; we only need to replace _m4_minmax.  Here,
+# we need a temporary macro to track the best answer so far, so that
+# the foreach expression is tractable.
+m4_define([_m4_minmax],
+[m4_pushdef([_m4_best], m4_eval([$2]))_m4_foreach(
+  [m4_define([_m4_best], $1(_m4_best,], [))], m4_shift($@))]dnl
+[_m4_best[]_m4_popdef([_m4_best])])
+
+# m4_set_add_all(SET, VALUE...)
+# -----------------------------
+# Add each VALUE into SET.  This is O(n) in the number of VALUEs, and
+# can be faster than calling m4_set_add for each VALUE.
+#
+# _m4_foreach to the rescue.  If no deletions have occurred, then
+# avoid the speed penalty of m4_set_add.
+m4_define([m4_set_add_all],
+[m4_if([$#], [0], [], [$#], [1], [],
+       [m4_define([_m4_set_size($1)], m4_eval(m4_set_size([$1])
+	  + m4_len(_m4_foreach(m4_ifdef([_m4_set_cleanup($1)],
+  [[m4_set_add]], [[_$0]])[([$1],], [)], $@))))])])
+
+m4_define([_m4_set_add_all],
+[m4_ifdef([_m4_set([$1],$2)], [],
+	  [m4_define([_m4_set([$1],$2)],
+		     [1])m4_pushdef([_m4_set([$1])], [$2])-])])
diff --git a/tools/flex-bison/third_party/m4sugar/m4sugar.m4 b/tools/flex-bison/third_party/m4sugar/m4sugar.m4
new file mode 100644
index 0000000..bbd6958
--- /dev/null
+++ b/tools/flex-bison/third_party/m4sugar/m4sugar.m4
@@ -0,0 +1,3308 @@
+divert(-1)#                                                  -*- Autoconf -*-
+# This file is part of Autoconf.
+# Base M4 layer.
+# Requires GNU M4.
+#
+# Copyright (C) 1999-2017 Free Software Foundation, Inc.
+
+# This file is part of Autoconf.  This program is free
+# software; you can redistribute it and/or modify it under the
+# terms of the GNU General Public License as published by the
+# Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# Under Section 7 of GPL version 3, you are granted additional
+# permissions described in the Autoconf Configure Script Exception,
+# version 3.0, as published by the Free Software Foundation.
+#
+# You should have received a copy of the GNU General Public License
+# and a copy of the Autoconf Configure Script Exception along with
+# this program; see the files COPYINGv3 and COPYING.EXCEPTION
+# respectively.  If not, see <https://www.gnu.org/licenses/>.
+
+# Written by Akim Demaille.
+
+# Set the quotes, whatever the current quoting system.
+changequote()
+changequote([, ])
+
+# Some old m4's don't support m4exit.  But they provide
+# equivalent functionality by core dumping because of the
+# long macros we define.
+ifdef([__gnu__], ,
+[errprint(M4sugar requires GNU M4. Install it before installing M4sugar or
+set the M4 environment variable to its absolute file name.)
+m4exit(2)])
+
+
+## ------------------------------- ##
+## 1. Simulate --prefix-builtins.  ##
+## ------------------------------- ##
+
+# m4_define
+# m4_defn
+# m4_undefine
+define([m4_define],   defn([define]))
+define([m4_defn],     defn([defn]))
+define([m4_undefine], defn([undefine]))
+
+m4_undefine([define])
+m4_undefine([defn])
+m4_undefine([undefine])
+
+
+# m4_copy(SRC, DST)
+# -----------------
+# Define DST as the definition of SRC.
+# What's the difference between:
+# 1. m4_copy([from], [to])
+# 2. m4_define([to], [from($@)])
+# Well, obviously 1 is more expensive in space.  Maybe 2 is more expensive
+# in time, but because of the space cost of 1, it's not that obvious.
+# Nevertheless, one huge difference is the handling of `$0'.  If `from'
+# uses `$0', then with 1, `to''s `$0' is `to', while it is `from' in 2.
+# The user would certainly prefer to see `to'.
+#
+# This definition is in effect during m4sugar initialization, when
+# there are no pushdef stacks; later on, we redefine it to something
+# more powerful for all other clients to use.
+m4_define([m4_copy],
+[m4_define([$2], m4_defn([$1]))])
+
+
+# m4_rename(SRC, DST)
+# -------------------
+# Rename the macro SRC to DST.
+m4_define([m4_rename],
+[m4_copy([$1], [$2])m4_undefine([$1])])
+
+
+# m4_rename_m4(MACRO-NAME)
+# ------------------------
+# Rename MACRO-NAME to m4_MACRO-NAME.
+m4_define([m4_rename_m4],
+[m4_rename([$1], [m4_$1])])
+
+
+# m4_copy_unm4(m4_MACRO-NAME)
+# ---------------------------
+# Copy m4_MACRO-NAME to MACRO-NAME.
+m4_define([m4_copy_unm4],
+[m4_copy([$1], m4_bpatsubst([$1], [^m4_\(.*\)], [[\1]]))])
+
+
+# Some m4 internals have names colliding with tokens we might use.
+# Rename them a` la `m4 --prefix-builtins'.  Conditionals first, since
+# some subsequent renames are conditional.
+m4_rename_m4([ifdef])
+m4_rename([ifelse], [m4_if])
+
+m4_rename_m4([builtin])
+m4_rename_m4([changecom])
+m4_rename_m4([changequote])
+m4_ifdef([changeword],dnl conditionally available in 1.4.x
+[m4_undefine([changeword])])
+m4_rename_m4([debugfile])
+m4_rename_m4([debugmode])
+m4_rename_m4([decr])
+m4_rename_m4([divnum])
+m4_rename_m4([dumpdef])
+m4_rename_m4([errprint])
+m4_rename_m4([esyscmd])
+m4_rename_m4([eval])
+m4_rename_m4([format])
+m4_undefine([include])
+m4_rename_m4([incr])
+m4_rename_m4([index])
+m4_rename_m4([indir])
+m4_rename_m4([len])
+m4_rename([m4exit], [m4_exit])
+m4_undefine([m4wrap])
+m4_ifdef([mkstemp],dnl added in M4 1.4.8
+[m4_rename_m4([mkstemp])
+m4_copy([m4_mkstemp], [m4_maketemp])
+m4_undefine([maketemp])],
+[m4_rename_m4([maketemp])
+m4_copy([m4_maketemp], [m4_mkstemp])])
+m4_rename([patsubst], [m4_bpatsubst])
+m4_rename_m4([popdef])
+m4_rename_m4([pushdef])
+m4_rename([regexp], [m4_bregexp])
+m4_rename_m4([shift])
+m4_undefine([sinclude])
+m4_rename_m4([substr])
+m4_ifdef([symbols],dnl present only in alpha-quality 1.4o
+[m4_rename_m4([symbols])])
+m4_rename_m4([syscmd])
+m4_rename_m4([sysval])
+m4_rename_m4([traceoff])
+m4_rename_m4([traceon])
+m4_rename_m4([translit])
+
+# _m4_defn(ARG)
+# -------------
+# _m4_defn is for internal use only - it bypasses the wrapper, so it
+# must only be used on one argument at a time, and only on macros
+# known to be defined.  Make sure this still works if the user renames
+# m4_defn but not _m4_defn.
+m4_copy([m4_defn], [_m4_defn])
+
+# _m4_divert_raw(NUM)
+# -------------------
+# _m4_divert_raw is for internal use only.  Use this instead of
+# m4_builtin([divert], NUM), so that tracing diversion flow is easier.
+m4_rename([divert], [_m4_divert_raw])
+
+# _m4_popdef(ARG...)
+# ------------------
+# _m4_popdef is for internal use only - it bypasses the wrapper, so it
+# must only be used on macros known to be defined.  Make sure this
+# still works if the user renames m4_popdef but not _m4_popdef.
+m4_copy([m4_popdef], [_m4_popdef])
+
+# _m4_undefine(ARG...)
+# --------------------
+# _m4_undefine is for internal use only - it bypasses the wrapper, so
+# it must only be used on macros known to be defined.  Make sure this
+# still works if the user renames m4_undefine but not _m4_undefine.
+m4_copy([m4_undefine], [_m4_undefine])
+
+# _m4_undivert(NUM...)
+# --------------------
+# _m4_undivert is for internal use only, and should always be given
+# arguments.  Use this instead of m4_builtin([undivert], NUM...), so
+# that tracing diversion flow is easier.
+m4_rename([undivert], [_m4_undivert])
+
+
+## ------------------- ##
+## 2. Error messages.  ##
+## ------------------- ##
+
+
+# m4_location
+# -----------
+# Output the current file, colon, and the current line number.
+m4_define([m4_location],
+[__file__:__line__])
+
+
+# m4_errprintn(MSG)
+# -----------------
+# Same as `errprint', but with the missing end of line.
+m4_define([m4_errprintn],
+[m4_errprint([$1
+])])
+
+
+# m4_warning(MSG)
+# ---------------
+# Warn the user.
+m4_define([m4_warning],
+[m4_errprintn(m4_location[: warning: $1])])
+
+
+# m4_fatal(MSG, [EXIT-STATUS])
+# ----------------------------
+# Fatal the user.                                                      :)
+m4_define([m4_fatal],
+[m4_errprintn(m4_location[: error: $1]
+m4_expansion_stack)m4_exit(m4_if([$2],, 1, [$2]))])
+
+
+# m4_assert(EXPRESSION, [EXIT-STATUS = 1])
+# ----------------------------------------
+# This macro ensures that EXPRESSION evaluates to true, and exits if
+# EXPRESSION evaluates to false.
+m4_define([m4_assert],
+[m4_if(m4_eval([$1]), 0,
+       [m4_fatal([assert failed: $1], [$2])])])
+
+
+
+## ------------- ##
+## 3. Warnings.  ##
+## ------------- ##
+
+
+# _m4_warn(CATEGORY, MESSAGE, [STACK-TRACE])
+# ------------------------------------------
+# Report a MESSAGE to the user if the CATEGORY of warnings is enabled.
+# This is for traces only.
+# If present, STACK-TRACE is a \n-separated list of "LOCATION: MESSAGE",
+# where the last line (and no other) ends with "the top level".
+#
+# Within m4, the macro is a no-op.  This macro really matters
+# when autom4te post-processes the trace output.
+m4_define([_m4_warn], [])
+
+
+# m4_warn(CATEGORY, MESSAGE)
+# --------------------------
+# Report a MESSAGE to the user if the CATEGORY of warnings is enabled.
+m4_define([m4_warn],
+[_m4_warn([$1], [$2],
+m4_ifdef([_m4_expansion_stack], [m4_expansion_stack]))])
+
+
+
+## ------------------- ##
+## 4. File inclusion.  ##
+## ------------------- ##
+
+
+# We also want to neutralize include (and sinclude for symmetry),
+# but we want to extend them slightly: warn when a file is included
+# several times.  This is, in general, a dangerous operation, because
+# too many people forget to quote the first argument of m4_define.
+#
+# For instance in the following case:
+#   m4_define(foo, [bar])
+# then a second reading will turn into
+#   m4_define(bar, [bar])
+# which is certainly not what was meant.
+
+# m4_include_unique(FILE)
+# -----------------------
+# Declare that the FILE was loading; and warn if it has already
+# been included.
+m4_define([m4_include_unique],
+[m4_ifdef([m4_include($1)],
+	  [m4_warn([syntax], [file `$1' included several times])])dnl
+m4_define([m4_include($1)])])
+
+
+# m4_include(FILE)
+# ----------------
+# Like the builtin include, but warns against multiple inclusions.
+m4_define([m4_include],
+[m4_include_unique([$1])dnl
+m4_builtin([include], [$1])])
+
+
+# m4_sinclude(FILE)
+# -----------------
+# Like the builtin sinclude, but warns against multiple inclusions.
+m4_define([m4_sinclude],
+[m4_include_unique([$1])dnl
+m4_builtin([sinclude], [$1])])
+
+
+
+## ------------------------------------ ##
+## 5. Additional branching constructs.  ##
+## ------------------------------------ ##
+
+# Both `m4_ifval' and `m4_ifset' tests against the empty string.  The
+# difference is that `m4_ifset' is specialized on macros.
+#
+# In case of arguments of macros, eg. $1, it makes little difference.
+# In the case of a macro `FOO', you don't want to check `m4_ifval(FOO,
+# TRUE)', because if `FOO' expands with commas, there is a shifting of
+# the arguments.  So you want to run `m4_ifval([FOO])', but then you just
+# compare the *string* `FOO' against `', which, of course fails.
+#
+# So you want the variation `m4_ifset' that expects a macro name as $1.
+# If this macro is both defined and defined to a non empty value, then
+# it runs TRUE, etc.
+
+
+# m4_ifblank(COND, [IF-BLANK], [IF-TEXT])
+# m4_ifnblank(COND, [IF-TEXT], [IF-BLANK])
+# ----------------------------------------
+# If COND is empty, or consists only of blanks (space, tab, newline),
+# then expand IF-BLANK, otherwise expand IF-TEXT.  This differs from
+# m4_ifval only if COND has just whitespace, but it helps optimize in
+# spite of users who mistakenly leave trailing space after what they
+# thought was an empty argument:
+#   macro(
+#         []
+#        )
+#
+# Writing one macro in terms of the other causes extra overhead, so
+# we inline both definitions.
+m4_define([m4_ifblank],
+[m4_if(m4_translit([[$1]],  [ ][	][
+]), [], [$2], [$3])])
+
+m4_define([m4_ifnblank],
+[m4_if(m4_translit([[$1]],  [ ][	][
+]), [], [$3], [$2])])
+
+
+# m4_ifval(COND, [IF-TRUE], [IF-FALSE])
+# -------------------------------------
+# If COND is not the empty string, expand IF-TRUE, otherwise IF-FALSE.
+# Comparable to m4_ifdef.
+m4_define([m4_ifval],
+[m4_if([$1], [], [$3], [$2])])
+
+
+# m4_n(TEXT)
+# ----------
+# If TEXT is not empty, return TEXT and a new line, otherwise nothing.
+m4_define([m4_n],
+[m4_if([$1],
+       [], [],
+	   [$1
+])])
+
+
+# m4_ifvaln(COND, [IF-TRUE], [IF-FALSE])
+# --------------------------------------
+# Same as `m4_ifval', but add an extra newline to IF-TRUE or IF-FALSE
+# unless that argument is empty.
+m4_define([m4_ifvaln],
+[m4_if([$1],
+       [],   [m4_n([$3])],
+	     [m4_n([$2])])])
+
+
+# m4_ifset(MACRO, [IF-TRUE], [IF-FALSE])
+# --------------------------------------
+# If MACRO has no definition, or of its definition is the empty string,
+# expand IF-FALSE, otherwise IF-TRUE.
+m4_define([m4_ifset],
+[m4_ifdef([$1],
+	  [m4_ifval(_m4_defn([$1]), [$2], [$3])],
+	  [$3])])
+
+
+# m4_ifndef(NAME, [IF-NOT-DEFINED], [IF-DEFINED])
+# -----------------------------------------------
+m4_define([m4_ifndef],
+[m4_ifdef([$1], [$3], [$2])])
+
+
+# m4_case(SWITCH, VAL1, IF-VAL1, VAL2, IF-VAL2, ..., DEFAULT)
+# -----------------------------------------------------------
+# m4 equivalent of
+# switch (SWITCH)
+# {
+#   case VAL1:
+#     IF-VAL1;
+#     break;
+#   case VAL2:
+#     IF-VAL2;
+#     break;
+#   ...
+#   default:
+#     DEFAULT;
+#     break;
+# }.
+# All the values are optional, and the macro is robust to active
+# symbols properly quoted.
+#
+# Please keep foreach.m4 in sync with any adjustments made here.
+m4_define([m4_case],
+[m4_if([$#], 0, [],
+       [$#], 1, [],
+       [$#], 2, [$2],
+       [$1], [$2], [$3],
+       [$0([$1], m4_shift3($@))])])
+
+
+# m4_bmatch(SWITCH, RE1, VAL1, RE2, VAL2, ..., DEFAULT)
+# -----------------------------------------------------
+# m4 equivalent of
+#
+# if (SWITCH =~ RE1)
+#   VAL1;
+# elif (SWITCH =~ RE2)
+#   VAL2;
+# elif ...
+#   ...
+# else
+#   DEFAULT
+#
+# All the values are optional, and the macro is robust to active symbols
+# properly quoted.
+#
+# Please keep foreach.m4 in sync with any adjustments made here.
+m4_define([m4_bmatch],
+[m4_if([$#], 0, [m4_fatal([$0: too few arguments: $#])],
+       [$#], 1, [m4_fatal([$0: too few arguments: $#: $1])],
+       [$#], 2, [$2],
+       [m4_if(m4_bregexp([$1], [$2]), -1, [$0([$1], m4_shift3($@))],
+	      [$3])])])
+
+# m4_argn(N, ARGS...)
+# -------------------
+# Extract argument N (greater than 0) from ARGS.  Example:
+#   m4_define([b], [B])
+#   m4_argn([2], [a], [b], [c]) => b
+#
+# Rather than using m4_car(m4_shiftn([$1], $@)), we exploit the fact that
+# GNU m4 can directly reference any argument, through an indirect macro.
+m4_define([m4_argn],
+[m4_assert([0 < $1])]dnl
+[m4_pushdef([_$0], [_m4_popdef([_$0])]m4_dquote([$]m4_incr([$1])))_$0($@)])
+
+
+# m4_car(ARGS...)
+# m4_cdr(ARGS...)
+# ---------------
+# Manipulate m4 lists.  m4_car returns the first argument.  m4_cdr
+# bundles all but the first argument into a quoted list.  These two
+# macros are generally used with list arguments, with quoting removed
+# to break the list into multiple m4 ARGS.
+m4_define([m4_car], [[$1]])
+m4_define([m4_cdr],
+[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
+       [$#], 1, [],
+       [m4_dquote(m4_shift($@))])])
+
+# _m4_cdr(ARGS...)
+# ----------------
+# Like m4_cdr, except include a leading comma unless only one argument
+# remains.  Why?  Because comparing a large list against [] is more
+# expensive in expansion time than comparing the number of arguments; so
+# _m4_cdr can be used to reduce the number of arguments when it is time
+# to end recursion.
+m4_define([_m4_cdr],
+[m4_if([$#], 1, [],
+       [, m4_dquote(m4_shift($@))])])
+
+
+
+# m4_cond(TEST1, VAL1, IF-VAL1, TEST2, VAL2, IF-VAL2, ..., [DEFAULT])
+# -------------------------------------------------------------------
+# Similar to m4_if, except that each TEST is expanded when encountered.
+# If the expansion of TESTn matches the string VALn, the result is IF-VALn.
+# The result is DEFAULT if no tests passed.  This macro allows
+# short-circuiting of expensive tests, where it pays to arrange quick
+# filter tests to run first.
+#
+# For an example, consider a previous implementation of _AS_QUOTE_IFELSE:
+#
+#    m4_if(m4_index([$1], [\]), [-1], [$2],
+#          m4_eval(m4_index([$1], [\\]) >= 0), [1], [$2],
+#          m4_eval(m4_index([$1], [\$]) >= 0), [1], [$2],
+#          m4_eval(m4_index([$1], [\`]) >= 0), [1], [$3],
+#          m4_eval(m4_index([$1], [\"]) >= 0), [1], [$3],
+#          [$2])
+#
+# Here, m4_index is computed 5 times, and m4_eval 4, even if $1 contains
+# no backslash.  It is more efficient to do:
+#
+#    m4_cond([m4_index([$1], [\])], [-1], [$2],
+#            [m4_eval(m4_index([$1], [\\]) >= 0)], [1], [$2],
+#            [m4_eval(m4_index([$1], [\$]) >= 0)], [1], [$2],
+#            [m4_eval(m4_index([$1], [\`]) >= 0)], [1], [$3],
+#            [m4_eval(m4_index([$1], [\"]) >= 0)], [1], [$3],
+#            [$2])
+#
+# In the common case of $1 with no backslash, only one m4_index expansion
+# occurs, and m4_eval is avoided altogether.
+#
+# Please keep foreach.m4 in sync with any adjustments made here.
+m4_define([m4_cond],
+[m4_if([$#], [0], [m4_fatal([$0: cannot be called without arguments])],
+       [$#], [1], [$1],
+       m4_eval([$# % 3]), [2], [m4_fatal([$0: missing an argument])],
+       [_$0($@)])])
+
+m4_define([_m4_cond],
+[m4_if(($1), [($2)], [$3],
+       [$#], [3], [],
+       [$#], [4], [$4],
+       [$0(m4_shift3($@))])])
+
+
+## ---------------------------------------- ##
+## 6. Enhanced version of some primitives.  ##
+## ---------------------------------------- ##
+
+# m4_bpatsubsts(STRING, RE1, SUBST1, RE2, SUBST2, ...)
+# ----------------------------------------------------
+# m4 equivalent of
+#
+#   $_ = STRING;
+#   s/RE1/SUBST1/g;
+#   s/RE2/SUBST2/g;
+#   ...
+#
+# All the values are optional, and the macro is robust to active symbols
+# properly quoted.
+#
+# I would have liked to name this macro `m4_bpatsubst', unfortunately,
+# due to quotation problems, I need to double quote $1 below, therefore
+# the anchors are broken :(  I can't let users be trapped by that.
+#
+# Recall that m4_shift3 always results in an argument.  Hence, we need
+# to distinguish between a final deletion vs. ending recursion.
+#
+# Please keep foreach.m4 in sync with any adjustments made here.
+m4_define([m4_bpatsubsts],
+[m4_if([$#], 0, [m4_fatal([$0: too few arguments: $#])],
+       [$#], 1, [m4_fatal([$0: too few arguments: $#: $1])],
+       [$#], 2, [m4_unquote(m4_builtin([patsubst], [[$1]], [$2]))],
+       [$#], 3, [m4_unquote(m4_builtin([patsubst], [[$1]], [$2], [$3]))],
+       [_$0($@m4_if(m4_eval($# & 1), 0, [,]))])])
+m4_define([_m4_bpatsubsts],
+[m4_if([$#], 2, [$1],
+       [$0(m4_builtin([patsubst], [[$1]], [$2], [$3]),
+	   m4_shift3($@))])])
+
+
+# m4_copy(SRC, DST)
+# -----------------
+# Define the pushdef stack DST as a copy of the pushdef stack SRC;
+# give an error if DST is already defined.  This is particularly nice
+# for copying self-modifying pushdef stacks, where the top definition
+# includes one-shot initialization that is later popped to the normal
+# definition.  This version intentionally does nothing if SRC is
+# undefined.
+#
+# Some macros simply can't be renamed with this method: namely, anything
+# involved in the implementation of m4_stack_foreach_sep.
+m4_define([m4_copy],
+[m4_ifdef([$2], [m4_fatal([$0: won't overwrite defined macro: $2])],
+	  [m4_stack_foreach_sep([$1], [m4_pushdef([$2],], [)])])]dnl
+[m4_ifdef([m4_location($1)], [m4_define([m4_location($2)], m4_location)])])
+
+
+# m4_copy_force(SRC, DST)
+# m4_rename_force(SRC, DST)
+# -------------------------
+# Like m4_copy/m4_rename, except blindly overwrite any existing DST.
+# Note that m4_copy_force tolerates undefined SRC, while m4_rename_force
+# does not.
+m4_define([m4_copy_force],
+[m4_ifdef([$2], [_m4_undefine([$2])])m4_copy($@)])
+
+m4_define([m4_rename_force],
+[m4_ifdef([$2], [_m4_undefine([$2])])m4_rename($@)])
+
+
+# m4_define_default(MACRO, VALUE)
+# -------------------------------
+# If MACRO is undefined, set it to VALUE.
+m4_define([m4_define_default],
+[m4_ifndef([$1], [m4_define($@)])])
+
+
+# m4_default(EXP1, EXP2)
+# m4_default_nblank(EXP1, EXP2)
+# -----------------------------
+# Returns EXP1 if not empty/blank, otherwise EXP2.  Expand the result.
+#
+# m4_default is called on hot paths, so inline the contents of m4_ifval,
+# for one less round of expansion.
+m4_define([m4_default],
+[m4_if([$1], [], [$2], [$1])])
+
+m4_define([m4_default_nblank],
+[m4_ifblank([$1], [$2], [$1])])
+
+
+# m4_default_quoted(EXP1, EXP2)
+# m4_default_nblank_quoted(EXP1, EXP2)
+# ------------------------------------
+# Returns EXP1 if non empty/blank, otherwise EXP2.  Leave the result quoted.
+#
+# For comparison:
+#   m4_define([active], [ACTIVE])
+#   m4_default([active], [default]) => ACTIVE
+#   m4_default([], [active]) => ACTIVE
+#   -m4_default([ ], [active])- => - -
+#   -m4_default_nblank([ ], [active])- => -ACTIVE-
+#   m4_default_quoted([active], [default]) => active
+#   m4_default_quoted([], [active]) => active
+#   -m4_default_quoted([ ], [active])- => - -
+#   -m4_default_nblank_quoted([ ], [active])- => -active-
+#
+# m4_default macro is called on hot paths, so inline the contents of m4_ifval,
+# for one less round of expansion.
+m4_define([m4_default_quoted],
+[m4_if([$1], [], [[$2]], [[$1]])])
+
+m4_define([m4_default_nblank_quoted],
+[m4_ifblank([$1], [[$2]], [[$1]])])
+
+
+# m4_defn(NAME)
+# -------------
+# Like the original, except guarantee a warning when using something which is
+# undefined (unlike M4 1.4.x).  This replacement is not a full-featured
+# replacement: if any of the defined macros contain unbalanced quoting, but
+# when pasted together result in a well-quoted string, then only native m4
+# support is able to get it correct.  But that's where quadrigraphs come in
+# handy, if you really need unbalanced quotes inside your macros.
+#
+# This macro is called frequently, so minimize the amount of additional
+# expansions by skipping m4_ifndef.  Better yet, if __m4_version__ exists,
+# (added in M4 1.6), then let m4 do the job for us (see m4_init).
+m4_define([m4_defn],
+[m4_if([$#], [0], [[$0]],
+       [$#], [1], [m4_ifdef([$1], [_m4_defn([$1])],
+			    [m4_fatal([$0: undefined macro: $1])])],
+       [m4_map_args([$0], $@)])])
+
+
+# m4_dumpdef(NAME...)
+# -------------------
+# In m4 1.4.x, dumpdef writes to the current debugfile, rather than
+# stderr.  This in turn royally confuses autom4te; so we follow the
+# lead of newer m4 and always dump to stderr.  Unlike the original,
+# this version requires an argument, since there is no convenient way
+# in m4 1.4.x to grab the names of all defined macros.  Newer m4
+# always dumps to stderr, regardless of the current debugfile; it also
+# provides m4symbols as a way to grab all current macro names.  But
+# dumpdefs is not frequently called, so we don't need to worry about
+# conditionally using these newer features.  Also, this version
+# doesn't sort multiple arguments.
+#
+# If we detect m4 1.6 or newer, then provide an alternate definition,
+# installed during m4_init, that allows builtins through.
+# Unfortunately, there is no nice way in m4 1.4.x to dump builtins.
+m4_define([m4_dumpdef],
+[m4_if([$#], [0], [m4_fatal([$0: missing argument])],
+       [$#], [1], [m4_ifdef([$1], [m4_errprintn(
+  [$1:	]m4_dquote(_m4_defn([$1])))], [m4_fatal([$0: undefined macro: $1])])],
+       [m4_map_args([$0], $@)])])
+
+m4_define([_m4_dumpdef],
+[m4_if([$#], [0], [m4_fatal([$0: missing argument])],
+       [$#], [1], [m4_builtin([dumpdef], [$1])],
+       [m4_map_args_sep([m4_builtin([dumpdef],], [)], [], $@)])])
+
+
+# m4_dumpdefs(NAME...)
+# --------------------
+# Similar to `m4_dumpdef(NAME)', but if NAME was m4_pushdef'ed, display its
+# value stack (most recent displayed first).  Also, this version silently
+# ignores undefined macros, rather than erroring out.
+#
+# This macro cheats, because it relies on the current definition of NAME
+# while the second argument of m4_stack_foreach_lifo is evaluated (which
+# would be undefined according to the API).
+m4_define([m4_dumpdefs],
+[m4_if([$#], [0], [m4_fatal([$0: missing argument])],
+       [$#], [1], [m4_stack_foreach_lifo([$1], [m4_dumpdef([$1])m4_ignore])],
+       [m4_map_args([$0], $@)])])
+
+# m4_esyscmd_s(COMMAND)
+# ---------------------
+# Like m4_esyscmd, except strip any trailing newlines, thus behaving
+# more like shell command substitution.
+m4_define([m4_esyscmd_s],
+[m4_chomp_all(m4_esyscmd([$1]))])
+
+
+# m4_popdef(NAME)
+# ---------------
+# Like the original, except guarantee a warning when using something which is
+# undefined (unlike M4 1.4.x).
+#
+# This macro is called frequently, so minimize the amount of additional
+# expansions by skipping m4_ifndef.  Better yet, if __m4_version__ exists,
+# (added in M4 1.6), then let m4 do the job for us (see m4_init).
+m4_define([m4_popdef],
+[m4_if([$#], [0], [[$0]],
+       [$#], [1], [m4_ifdef([$1], [_m4_popdef([$1])],
+			    [m4_fatal([$0: undefined macro: $1])])],
+       [m4_map_args([$0], $@)])])
+
+
+# m4_shiftn(N, ...)
+# -----------------
+# Returns ... shifted N times.  Useful for recursive "varargs" constructs.
+#
+# Autoconf does not use this macro, because it is inherently slower than
+# calling the common cases of m4_shift2 or m4_shift3 directly.  But it
+# might as well be fast for other clients, such as Libtool.  One way to
+# do this is to expand $@ only once in _m4_shiftn (otherwise, for long
+# lists, the expansion of m4_if takes twice as much memory as what the
+# list itself occupies, only to throw away the unused branch).  The end
+# result is strictly equivalent to
+#   m4_if([$1], 1, [m4_shift(,m4_shift(m4_shift($@)))],
+#         [_m4_shiftn(m4_decr([$1]), m4_shift(m4_shift($@)))])
+# but with the final `m4_shift(m4_shift($@)))' shared between the two
+# paths.  The first leg uses a no-op m4_shift(,$@) to balance out the ().
+#
+# Please keep foreach.m4 in sync with any adjustments made here.
+m4_define([m4_shiftn],
+[m4_assert(0 < $1 && $1 < $#)_$0($@)])
+
+m4_define([_m4_shiftn],
+[m4_if([$1], 1, [m4_shift(],
+       [$0(m4_decr([$1])]), m4_shift(m4_shift($@)))])
+
+# m4_shift2(...)
+# m4_shift3(...)
+# --------------
+# Returns ... shifted twice, and three times.  Faster than m4_shiftn.
+m4_define([m4_shift2], [m4_shift(m4_shift($@))])
+m4_define([m4_shift3], [m4_shift(m4_shift(m4_shift($@)))])
+
+# _m4_shift2(...)
+# _m4_shift3(...)
+# ---------------
+# Like m4_shift2 or m4_shift3, except include a leading comma unless shifting
+# consumes all arguments.  Why?  Because in recursion, it is nice to
+# distinguish between 1 element left and 0 elements left, based on how many
+# arguments this shift expands to.
+m4_define([_m4_shift2],
+[m4_if([$#], [2], [],
+       [, m4_shift(m4_shift($@))])])
+m4_define([_m4_shift3],
+[m4_if([$#], [3], [],
+       [, m4_shift(m4_shift(m4_shift($@)))])])
+
+
+# m4_undefine(NAME)
+# -----------------
+# Like the original, except guarantee a warning when using something which is
+# undefined (unlike M4 1.4.x).
+#
+# This macro is called frequently, so minimize the amount of additional
+# expansions by skipping m4_ifndef.  Better yet, if __m4_version__ exists,
+# (added in M4 1.6), then let m4 do the job for us (see m4_init).
+m4_define([m4_undefine],
+[m4_if([$#], [0], [[$0]],
+       [$#], [1], [m4_ifdef([$1], [_m4_undefine([$1])],
+			    [m4_fatal([$0: undefined macro: $1])])],
+       [m4_map_args([$0], $@)])])
+
+# _m4_wrap(PRE, POST)
+# -------------------
+# Helper macro for m4_wrap and m4_wrap_lifo.  Allows nested calls to
+# m4_wrap within wrapped text.  Use _m4_defn and _m4_popdef for speed.
+m4_define([_m4_wrap],
+[m4_ifdef([$0_text],
+	  [m4_define([$0_text], [$1]_m4_defn([$0_text])[$2])],
+	  [m4_builtin([m4wrap], [m4_unquote(
+  _m4_defn([$0_text])_m4_popdef([$0_text]))])m4_define([$0_text], [$1$2])])])
+
+# m4_wrap(TEXT)
+# -------------
+# Append TEXT to the list of hooks to be executed at the end of input.
+# Whereas the order of the original may be LIFO in the underlying m4,
+# this version is always FIFO.
+m4_define([m4_wrap],
+[_m4_wrap([], [$1[]])])
+
+# m4_wrap_lifo(TEXT)
+# ------------------
+# Prepend TEXT to the list of hooks to be executed at the end of input.
+# Whereas the order of m4_wrap may be FIFO in the underlying m4, this
+# version is always LIFO.
+m4_define([m4_wrap_lifo],
+[_m4_wrap([$1[]])])
+
+## ------------------------- ##
+## 7. Quoting manipulation.  ##
+## ------------------------- ##
+
+
+# m4_apply(MACRO, LIST)
+# ---------------------
+# Invoke MACRO, with arguments provided from the quoted list of
+# comma-separated quoted arguments.  If LIST is empty, invoke MACRO
+# without arguments.  The expansion will not be concatenated with
+# subsequent text.
+m4_define([m4_apply],
+[m4_if([$2], [], [$1], [$1($2)])[]])
+
+# _m4_apply(MACRO, LIST)
+# ----------------------
+# Like m4_apply, except do nothing if LIST is empty.
+m4_define([_m4_apply],
+[m4_if([$2], [], [], [$1($2)[]])])
+
+
+# m4_count(ARGS)
+# --------------
+# Return a count of how many ARGS are present.
+m4_define([m4_count], [$#])
+
+
+# m4_curry(MACRO, ARG...)
+# -----------------------
+# Perform argument currying.  The expansion of this macro is another
+# macro that takes exactly one argument, appends it to the end of the
+# original ARG list, then invokes MACRO.  For example:
+#   m4_curry([m4_curry], [m4_reverse], [1])([2])([3]) => 3, 2, 1
+# Not quite as practical as m4_incr, but you could also do:
+#   m4_define([add], [m4_eval(([$1]) + ([$2]))])
+#   m4_define([add_one], [m4_curry([add], [1])])
+#   add_one()([2]) => 3
+m4_define([m4_curry], [$1(m4_shift($@,)_$0])
+m4_define([_m4_curry],               [[$1])])
+
+
+# m4_do(STRING, ...)
+# ------------------
+# This macro invokes all its arguments (in sequence, of course).  It is
+# useful for making your macros more structured and readable by dropping
+# unnecessary dnl's and have the macros indented properly.  No concatenation
+# occurs after a STRING; use m4_unquote(m4_join(,STRING)) for that.
+#
+# Please keep foreach.m4 in sync with any adjustments made here.
+m4_define([m4_do],
+[m4_if([$#], 0, [],
+       [$#], 1, [$1[]],
+       [$1[]$0(m4_shift($@))])])
+
+
+# m4_dquote(ARGS)
+# ---------------
+# Return ARGS as a quoted list of quoted arguments.
+m4_define([m4_dquote],  [[$@]])
+
+
+# m4_dquote_elt(ARGS)
+# -------------------
+# Return ARGS as an unquoted list of double-quoted arguments.
+#
+# Please keep foreach.m4 in sync with any adjustments made here.
+m4_define([m4_dquote_elt],
+[m4_if([$#], [0], [],
+       [$#], [1], [[[$1]]],
+       [[[$1]],$0(m4_shift($@))])])
+
+
+# m4_echo(ARGS)
+# -------------
+# Return the ARGS, with the same level of quoting.  Whitespace after
+# unquoted commas are consumed.
+m4_define([m4_echo], [$@])
+
+
+# m4_expand(ARG)
+# _m4_expand(ARG)
+# ---------------
+# Return the expansion of ARG as a single string.  Unlike
+# m4_quote($1), this preserves whitespace following single-quoted
+# commas that appear within ARG.  It also deals with shell case
+# statements.
+#
+#   m4_define([active], [ACT, IVE])
+#   m4_define([active2], [[ACT, IVE]])
+#   m4_quote(active, active2)
+#   => ACT,IVE,ACT, IVE
+#   m4_expand([active, active2])
+#   => ACT, IVE, ACT, IVE
+#
+# Unfortunately, due to limitations in m4, ARG must expand to
+# something with balanced quotes (use quadrigraphs to get around
+# this), and should not contain the unlikely delimiters -=<{( or
+# )}>=-.  It is possible to have unbalanced quoted `(' or `)', as well
+# as unbalanced unquoted `)'.  m4_expand can handle unterminated
+# comments or dnl on the final line, at the expense of speed; it also
+# aids in detecting attempts to incorrectly change the current
+# diversion inside ARG.  Meanwhile, _m4_expand is faster but must be
+# given a terminated expansion, and has no safety checks for
+# mis-diverted text.
+#
+# Exploit that extra unquoted () will group unquoted commas and the
+# following whitespace.  m4_bpatsubst can't handle newlines inside $1,
+# and m4_substr strips quoting.  So we (ab)use m4_changequote, using
+# temporary quotes to remove the delimiters that conveniently included
+# the unquoted () that were added prior to the changequote.
+#
+# Thanks to shell case statements, too many people are prone to pass
+# underquoted `)', so we try to detect that by passing a marker as a
+# fourth argument; if the marker is not present, then we assume that
+# we encountered an early `)', and re-expand the first argument, but
+# this time with one more `(' in the second argument and in the
+# open-quote delimiter.  We must also ignore the slop from the
+# previous try.  The final macro is thus half line-noise, half art.
+m4_define([m4_expand],
+[m4_pushdef([m4_divert], _m4_defn([_m4_divert_unsafe]))]dnl
+[m4_pushdef([m4_divert_push], _m4_defn([_m4_divert_unsafe]))]dnl
+[m4_chomp(_$0([$1
+]))_m4_popdef([m4_divert], [m4_divert_push])])
+
+m4_define([_m4_expand], [$0_([$1], [(], -=<{($1)}>=-, [}>=-])])
+
+m4_define([_m4_expand_],
+[m4_if([$4], [}>=-],
+       [m4_changequote([-=<{$2], [)}>=-])$3m4_changequote([, ])],
+       [$0([$1], [($2], -=<{($2$1)}>=-, [}>=-])m4_ignore$2])])
+
+
+# m4_ignore(ARGS)
+# ---------------
+# Expands to nothing.  Useful for conditionally ignoring an arbitrary
+# number of arguments (see _m4_list_cmp for an example).
+m4_define([m4_ignore])
+
+
+# m4_make_list(ARGS)
+# ------------------
+# Similar to m4_dquote, this creates a quoted list of quoted ARGS.  This
+# version is less efficient than m4_dquote, but separates each argument
+# with a comma and newline, rather than just comma, for readability.
+# When developing an m4sugar algorithm, you could temporarily use
+#   m4_pushdef([m4_dquote],m4_defn([m4_make_list]))
+# around your code to make debugging easier.
+m4_define([m4_make_list], [m4_join([,
+], m4_dquote_elt($@))])
+
+
+# m4_noquote(STRING)
+# ------------------
+# Return the result of ignoring all quotes in STRING and invoking the
+# macros it contains.  Among other things, this is useful for enabling
+# macro invocations inside strings with [] blocks (for instance regexps
+# and help-strings).  On the other hand, since all quotes are disabled,
+# any macro expanded during this time that relies on nested [] quoting
+# will likely crash and burn.  This macro is seldom useful; consider
+# m4_unquote or m4_expand instead.
+m4_define([m4_noquote],
+[m4_changequote([-=<{(],[)}>=-])$1-=<{()}>=-m4_changequote([,])])
+
+
+# m4_quote(ARGS)
+# --------------
+# Return ARGS as a single argument.  Any whitespace after unquoted commas
+# is stripped.  There is always output, even when there were no arguments.
+#
+# It is important to realize the difference between `m4_quote(exp)' and
+# `[exp]': in the first case you obtain the quoted *result* of the
+# expansion of EXP, while in the latter you just obtain the string
+# `exp'.
+m4_define([m4_quote],  [[$*]])
+
+
+# _m4_quote(ARGS)
+# ---------------
+# Like m4_quote, except that when there are no arguments, there is no
+# output.  For conditional scenarios (such as passing _m4_quote as the
+# macro name in m4_mapall), this feature can be used to distinguish between
+# one argument of the empty string vs. no arguments.  However, in the
+# normal case with arguments present, this is less efficient than m4_quote.
+m4_define([_m4_quote],
+[m4_if([$#], [0], [], [[$*]])])
+
+
+# m4_reverse(ARGS)
+# ----------------
+# Output ARGS in reverse order.
+#
+# Please keep foreach.m4 in sync with any adjustments made here.
+m4_define([m4_reverse],
+[m4_if([$#], [0], [], [$#], [1], [[$1]],
+       [$0(m4_shift($@)), [$1]])])
+
+
+# m4_unquote(ARGS)
+# ----------------
+# Remove one layer of quotes from each ARG, performing one level of
+# expansion.  For one argument, m4_unquote([arg]) is more efficient than
+# m4_do([arg]), but for multiple arguments, the difference is that
+# m4_unquote separates arguments with commas while m4_do concatenates.
+# Follow this macro with [] if concatenation with subsequent text is
+# undesired.
+m4_define([m4_unquote], [$*])
+
+
+## -------------------------- ##
+## 8. Implementing m4 loops.  ##
+## -------------------------- ##
+
+
+# m4_for(VARIABLE, FIRST, LAST, [STEP = +/-1], EXPRESSION)
+# --------------------------------------------------------
+# Expand EXPRESSION defining VARIABLE to FROM, FROM + 1, ..., TO with
+# increments of STEP.  Both limits are included, and bounds are
+# checked for consistency.  The algorithm is robust to indirect
+# VARIABLE names.  Changing VARIABLE inside EXPRESSION will not impact
+# the number of iterations.
+#
+# Uses _m4_defn for speed, and avoid dnl in the macro body.  Factor
+# the _m4_for call so that EXPRESSION is only parsed once.
+m4_define([m4_for],
+[m4_pushdef([$1], m4_eval([$2]))]dnl
+[m4_cond([m4_eval(([$3]) > ([$2]))], 1,
+	   [m4_pushdef([_m4_step], m4_eval(m4_default_quoted([$4],
+	      1)))m4_assert(_m4_step > 0)_$0(_m4_defn([$1]),
+  m4_eval((([$3]) - ([$2])) / _m4_step * _m4_step + ([$2])), _m4_step,],
+	 [m4_eval(([$3]) < ([$2]))], 1,
+	   [m4_pushdef([_m4_step], m4_eval(m4_default_quoted([$4],
+	      -1)))m4_assert(_m4_step < 0)_$0(_m4_defn([$1]),
+  m4_eval((([$2]) - ([$3])) / -(_m4_step) * _m4_step + ([$2])), _m4_step,],
+	 [m4_pushdef([_m4_step])_$0(_m4_defn([$1]), _m4_defn([$1]), 0,])]dnl
+[[m4_define([$1],], [)$5])m4_popdef([_m4_step], [$1])])
+
+# _m4_for(COUNT, LAST, STEP, PRE, POST)
+# -------------------------------------
+# Core of the loop, no consistency checks, all arguments are plain
+# numbers.  Expand PRE[COUNT]POST, then alter COUNT by STEP and
+# iterate if COUNT is not LAST.
+m4_define([_m4_for],
+[$4[$1]$5[]m4_if([$1], [$2], [],
+		 [$0(m4_eval([$1 + $3]), [$2], [$3], [$4], [$5])])])
+
+
+# Implementing `foreach' loops in m4 is much more tricky than it may
+# seem.  For example, the old M4 1.4.4 manual had an incorrect example,
+# which looked like this (when translated to m4sugar):
+#
+# | # foreach(VAR, (LIST), STMT)
+# | m4_define([foreach],
+# |   [m4_pushdef([$1])_foreach([$1], [$2], [$3])m4_popdef([$1])])
+# | m4_define([_arg1], [$1])
+# | m4_define([_foreach],
+# |   [m4_if([$2], [()], ,
+# |     [m4_define([$1], _arg1$2)$3[]_foreach([$1], (m4_shift$2), [$3])])])
+#
+# But then if you run
+#
+# | m4_define(a, 1)
+# | m4_define(b, 2)
+# | m4_define(c, 3)
+# | foreach([f], [([a], [(b], [c)])], [echo f
+# | ])
+#
+# it gives
+#
+#  => echo 1
+#  => echo (2,3)
+#
+# which is not what is expected.
+#
+# Of course the problem is that many quotes are missing.  So you add
+# plenty of quotes at random places, until you reach the expected
+# result.  Alternatively, if you are a quoting wizard, you directly
+# reach the following implementation (but if you really did, then
+# apply to the maintenance of m4sugar!).
+#
+# | # foreach(VAR, (LIST), STMT)
+# | m4_define([foreach], [m4_pushdef([$1])_foreach($@)m4_popdef([$1])])
+# | m4_define([_arg1], [[$1]])
+# | m4_define([_foreach],
+# |  [m4_if($2, [()], ,
+# |    [m4_define([$1], [_arg1$2])$3[]_foreach([$1], [(m4_shift$2)], [$3])])])
+#
+# which this time answers
+#
+#  => echo a
+#  => echo (b
+#  => echo c)
+#
+# Bingo!
+#
+# Well, not quite.
+#
+# With a better look, you realize that the parens are more a pain than
+# a help: since anyway you need to quote properly the list, you end up
+# with always using an outermost pair of parens and an outermost pair
+# of quotes.  Rejecting the parens both eases the implementation, and
+# simplifies the use:
+#
+# | # foreach(VAR, (LIST), STMT)
+# | m4_define([foreach], [m4_pushdef([$1])_foreach($@)m4_popdef([$1])])
+# | m4_define([_arg1], [$1])
+# | m4_define([_foreach],
+# |  [m4_if($2, [], ,
+# |    [m4_define([$1], [_arg1($2)])$3[]_foreach([$1], [m4_shift($2)], [$3])])])
+#
+#
+# Now, just replace the `$2' with `m4_quote($2)' in the outer `m4_if'
+# to improve robustness, and you come up with a nice implementation
+# that doesn't require extra parentheses in the user's LIST.
+#
+# But wait -  now the algorithm is quadratic, because every recursion of
+# the algorithm keeps the entire LIST and merely adds another m4_shift to
+# the quoted text.  If the user has a lot of elements in LIST, you can
+# bring the system to its knees with the memory m4 then requires, or trip
+# the m4 --nesting-limit recursion factor.  The only way to avoid
+# quadratic growth is ensure m4_shift is expanded prior to the recursion.
+# Hence the design below.
+#
+# The M4 manual now includes a chapter devoted to this issue, with
+# the lessons learned from m4sugar.  And still, this design is only
+# optimal for M4 1.6; see foreach.m4 for yet more comments on why
+# M4 1.4.x uses yet another implementation.
+
+
+# m4_foreach(VARIABLE, LIST, EXPRESSION)
+# --------------------------------------
+#
+# Expand EXPRESSION assigning each value of the LIST to VARIABLE.
+# LIST should have the form `item_1, item_2, ..., item_n', i.e. the
+# whole list must *quoted*.  Quote members too if you don't want them
+# to be expanded.
+#
+# This macro is robust to active symbols:
+#      | m4_define(active, [ACT, IVE])
+#      | m4_foreach(Var, [active, active], [-Var-])
+#     => -ACT--IVE--ACT--IVE-
+#
+#      | m4_foreach(Var, [[active], [active]], [-Var-])
+#     => -ACT, IVE--ACT, IVE-
+#
+#      | m4_foreach(Var, [[[active]], [[active]]], [-Var-])
+#     => -active--active-
+#
+# This macro is called frequently, so avoid extra expansions such as
+# m4_ifval and dnl.  Also, since $2 might be quite large, try to use it
+# as little as possible in _m4_foreach; each extra use requires that much
+# more memory for expansion.  So, rather than directly compare $2 against
+# [] and use m4_car/m4_cdr for recursion, we instead unbox the list (which
+# requires swapping the argument order in the helper), insert an ignored
+# third argument, and use m4_shift3 to detect when recursion is complete,
+# at which point this looks very much like m4_map_args.
+m4_define([m4_foreach],
+[m4_if([$2], [], [],
+       [m4_pushdef([$1])_$0([m4_define([$1],], [)$3], [],
+  $2)m4_popdef([$1])])])
+
+# _m4_foreach(PRE, POST, IGNORED, ARG...)
+# ---------------------------------------
+# Form the common basis of the m4_foreach and m4_map macros.  For each
+# ARG, expand PRE[ARG]POST[].  The IGNORED argument makes recursion
+# easier, and must be supplied rather than implicit.
+#
+# Please keep foreach.m4 in sync with any adjustments made here.
+m4_define([_m4_foreach],
+[m4_if([$#], [3], [],
+       [$1[$4]$2[]$0([$1], [$2], m4_shift3($@))])])
+
+
+# m4_foreach_w(VARIABLE, LIST, EXPRESSION)
+# ----------------------------------------
+# Like m4_foreach, but the list is whitespace separated.  Depending on
+# EXPRESSION, it may be more efficient to use m4_map_args_w.
+#
+# This macro is robust to active symbols:
+#    m4_foreach_w([Var], [ active
+#    b	act\
+#    ive  ], [-Var-])end
+#    => -active--b--active-end
+#
+# This used to use a slower implementation based on m4_foreach:
+#   m4_foreach([$1], m4_split(m4_normalize([$2]), [ ]), [$3])
+m4_define([m4_foreach_w],
+[m4_pushdef([$1])m4_map_args_w([$2],
+  [m4_define([$1],], [)$3])m4_popdef([$1])])
+
+
+# m4_map(MACRO, LIST)
+# m4_mapall(MACRO, LIST)
+# ----------------------
+# Invoke MACRO($1), MACRO($2) etc. where $1, $2... are the elements of
+# LIST.  $1, $2... must in turn be lists, appropriate for m4_apply.
+# If LIST contains an empty sublist, m4_map skips the expansion of
+# MACRO, while m4_mapall expands MACRO with no arguments.
+#
+# Since LIST may be quite large, we want to minimize how often it
+# appears in the expansion.  Rather than use m4_car/m4_cdr iteration,
+# we unbox the list, and use _m4_foreach for iteration.  For m4_map,
+# an empty list behaves like an empty sublist and gets ignored; for
+# m4_mapall, we must special-case the empty list.
+m4_define([m4_map],
+[_m4_foreach([_m4_apply([$1],], [)], [], $2)])
+
+m4_define([m4_mapall],
+[m4_if([$2], [], [],
+       [_m4_foreach([m4_apply([$1],], [)], [], $2)])])
+
+
+# m4_map_sep(MACRO, [SEPARATOR], LIST)
+# m4_mapall_sep(MACRO, [SEPARATOR], LIST)
+# ---------------------------------------
+# Invoke MACRO($1), SEPARATOR, MACRO($2), ..., MACRO($N) where $1,
+# $2... $N are the elements of LIST, and are in turn lists appropriate
+# for m4_apply.  SEPARATOR is expanded, in order to allow the creation
+# of a list of arguments by using a single-quoted comma as the
+# separator.  For each empty sublist, m4_map_sep skips the expansion
+# of MACRO and SEPARATOR, while m4_mapall_sep expands MACRO with no
+# arguments.
+#
+# For m4_mapall_sep, merely expand the first iteration without the
+# separator, then include separator as part of subsequent recursion;
+# but avoid extra expansion of LIST's side-effects via a helper macro.
+# For m4_map_sep, things are trickier - we don't know if the first
+# list element is an empty sublist, so we must define a self-modifying
+# helper macro and use that as the separator instead.
+m4_define([m4_map_sep],
+[m4_pushdef([m4_Sep], [m4_define([m4_Sep], _m4_defn([m4_unquote]))])]dnl
+[_m4_foreach([_m4_apply([m4_Sep([$2])[]$1],], [)], [], $3)m4_popdef([m4_Sep])])
+
+m4_define([m4_mapall_sep],
+[m4_if([$3], [], [], [_$0([$1], [$2], $3)])])
+
+m4_define([_m4_mapall_sep],
+[m4_apply([$1], [$3])_m4_foreach([m4_apply([$2[]$1],], [)], m4_shift2($@))])
+
+# m4_map_args(EXPRESSION, ARG...)
+# -------------------------------
+# Expand EXPRESSION([ARG]) for each argument.  More efficient than
+#   m4_foreach([var], [ARG...], [EXPRESSION(m4_defn([var]))])
+# Shorthand for m4_map_args_sep([EXPRESSION(], [)], [], ARG...).
+m4_define([m4_map_args],
+[m4_if([$#], [0], [m4_fatal([$0: too few arguments: $#])],
+       [$#], [1], [],
+       [$#], [2], [$1([$2])[]],
+       [_m4_foreach([$1(], [)], $@)])])
+
+
+# m4_map_args_pair(EXPRESSION, [END-EXPR = EXPRESSION], ARG...)
+# -------------------------------------------------------------
+# Perform a pairwise grouping of consecutive ARGs, by expanding
+# EXPRESSION([ARG1], [ARG2]).  If there are an odd number of ARGs, the
+# final argument is expanded with END-EXPR([ARGn]).
+#
+# For example:
+#   m4_define([show], [($*)m4_newline])dnl
+#   m4_map_args_pair([show], [], [a], [b], [c], [d], [e])dnl
+#   => (a,b)
+#   => (c,d)
+#   => (e)
+#
+# Please keep foreach.m4 in sync with any adjustments made here.
+m4_define([m4_map_args_pair],
+[m4_if([$#], [0], [m4_fatal([$0: too few arguments: $#])],
+       [$#], [1], [m4_fatal([$0: too few arguments: $#: $1])],
+       [$#], [2], [],
+       [$#], [3], [m4_default([$2], [$1])([$3])[]],
+       [$#], [4], [$1([$3], [$4])[]],
+       [$1([$3], [$4])[]$0([$1], [$2], m4_shift(m4_shift3($@)))])])
+
+
+# m4_map_args_sep([PRE], [POST], [SEP], ARG...)
+# ---------------------------------------------
+# Expand PRE[ARG]POST for each argument, with SEP between arguments.
+m4_define([m4_map_args_sep],
+[m4_if([$#], [0], [m4_fatal([$0: too few arguments: $#])],
+       [$#], [1], [],
+       [$#], [2], [],
+       [$#], [3], [],
+       [$#], [4], [$1[$4]$2[]],
+       [$1[$4]$2[]_m4_foreach([$3[]$1], [$2], m4_shift3($@))])])
+
+
+# m4_map_args_w(STRING, [PRE], [POST], [SEP])
+# -------------------------------------------
+# Perform the expansion of PRE[word]POST[] for each word in STRING
+# separated by whitespace.  More efficient than:
+#   m4_foreach_w([var], [STRING], [PRE[]m4_defn([var])POST])
+# Additionally, expand SEP between words.
+#
+# As long as we have to use m4_bpatsubst to split the string, we might
+# as well make it also apply PRE and POST; this avoids iteration
+# altogether.  But we must be careful of any \ in PRE or POST.
+# _m4_strip returns a quoted string, but that's okay, since it also
+# supplies an empty leading and trailing argument due to our
+# intentional whitespace around STRING.  We use m4_substr to strip the
+# empty elements and remove the extra layer of quoting.
+m4_define([m4_map_args_w],
+[_$0(_m4_split([ ]m4_flatten([$1])[ ], [[	 ]+],
+	       m4_if(m4_index([$2$3$4], [\]), [-1], [[$3[]$4[]$2]],
+		     [m4_bpatsubst([[$3[]$4[]$2]], [\\], [\\\\])])),
+     m4_len([[]$3[]$4]), m4_len([$4[]$2[]]))])
+
+m4_define([_m4_map_args_w],
+[m4_substr([$1], [$2], m4_eval(m4_len([$1]) - [$2] - [$3]))])
+
+
+# m4_stack_foreach(MACRO, FUNC)
+# m4_stack_foreach_lifo(MACRO, FUNC)
+# ----------------------------------
+# Pass each stacked definition of MACRO to the one-argument macro FUNC.
+# m4_stack_foreach proceeds in FIFO order, while m4_stack_foreach_lifo
+# processes the topmost definitions first.  In addition, FUNC should
+# not push or pop definitions of MACRO, and should not expect anything about
+# the active definition of MACRO (it will not be the topmost, and may not
+# be the one passed to FUNC either).
+#
+# Some macros simply can't be examined with this method: namely,
+# anything involved in the implementation of _m4_stack_reverse.
+m4_define([m4_stack_foreach],
+[_m4_stack_reverse([$1], [m4_tmp-$1])]dnl
+[_m4_stack_reverse([m4_tmp-$1], [$1], [$2(_m4_defn([m4_tmp-$1]))])])
+
+m4_define([m4_stack_foreach_lifo],
+[_m4_stack_reverse([$1], [m4_tmp-$1], [$2(_m4_defn([m4_tmp-$1]))])]dnl
+[_m4_stack_reverse([m4_tmp-$1], [$1])])
+
+# m4_stack_foreach_sep(MACRO, [PRE], [POST], [SEP])
+# m4_stack_foreach_sep_lifo(MACRO, [PRE], [POST], [SEP])
+# ------------------------------------------------------
+# Similar to m4_stack_foreach and m4_stack_foreach_lifo, in that every
+# definition of a pushdef stack will be visited.  But rather than
+# passing the definition as a single argument to a macro, this variant
+# expands the concatenation of PRE[]definition[]POST, and expands SEP
+# between consecutive expansions.  Note that m4_stack_foreach([a], [b])
+# is equivalent to m4_stack_foreach_sep([a], [b(], [)]).
+m4_define([m4_stack_foreach_sep],
+[_m4_stack_reverse([$1], [m4_tmp-$1])]dnl
+[_m4_stack_reverse([m4_tmp-$1], [$1], [$2[]_m4_defn([m4_tmp-$1])$3], [$4[]])])
+
+m4_define([m4_stack_foreach_sep_lifo],
+[_m4_stack_reverse([$1], [m4_tmp-$1], [$2[]_m4_defn([m4_tmp-$1])$3], [$4[]])]dnl
+[_m4_stack_reverse([m4_tmp-$1], [$1])])
+
+
+# _m4_stack_reverse(OLD, NEW, [ACTION], [SEP])
+# --------------------------------------------
+# A recursive worker for pushdef stack manipulation.  Destructively
+# copy the OLD stack into the NEW, and expanding ACTION for each
+# iteration.  After the first iteration, SEP is promoted to the front
+# of ACTION (note that SEP should include a trailing [] if it is to
+# avoid interfering with ACTION).  The current definition is examined
+# after the NEW has been pushed but before OLD has been popped; this
+# order is important, as ACTION is permitted to operate on either
+# _m4_defn([OLD]) or _m4_defn([NEW]).  Since the operation is
+# destructive, this macro is generally used twice, with a temporary
+# macro name holding the swapped copy.
+m4_define([_m4_stack_reverse],
+[m4_ifdef([$1], [m4_pushdef([$2],
+  _m4_defn([$1]))$3[]_m4_popdef([$1])$0([$1], [$2], [$4$3])])])
+
+
+
+## --------------------------- ##
+## 9. More diversion support.  ##
+## --------------------------- ##
+
+
+# m4_cleardivert(DIVERSION-NAME...)
+# ---------------------------------
+# Discard any text in DIVERSION-NAME.
+#
+# This works even inside m4_expand.
+m4_define([m4_cleardivert],
+[m4_if([$#], [0], [m4_fatal([$0: missing argument])],
+       [_m4_divert_raw([-1])m4_undivert($@)_m4_divert_raw(
+	 _m4_divert(_m4_defn([_m4_divert_diversion]), [-]))])])
+
+
+# _m4_divert(DIVERSION-NAME or NUMBER, [NOWARN])
+# ----------------------------------------------
+# If DIVERSION-NAME is the name of a diversion, return its number,
+# otherwise if it is a NUMBER return it.  Issue a warning about
+# the use of a number instead of a name, unless NOWARN is provided.
+m4_define([_m4_divert],
+[m4_ifdef([_m4_divert($1)],
+	  [m4_indir([_m4_divert($1)])],
+	  [m4_if([$2], [], [m4_warn([syntax],
+	     [prefer named diversions])])$1])])
+
+# KILL is only used to suppress output.
+m4_define([_m4_divert(KILL)],           -1)
+
+# The empty diversion name is a synonym for 0.
+m4_define([_m4_divert()],                0)
+
+
+# m4_divert_stack
+# ---------------
+# Print the diversion stack, if it's nonempty.  The caller is
+# responsible for any leading or trailing newline.
+m4_define([m4_divert_stack],
+[m4_stack_foreach_sep_lifo([_m4_divert_stack], [], [], [
+])])
+
+
+# m4_divert_stack_push(MACRO-NAME, DIVERSION-NAME)
+# ------------------------------------------------
+# Form an entry of the diversion stack from caller MACRO-NAME and
+# entering DIVERSION-NAME and push it.
+m4_define([m4_divert_stack_push],
+[m4_pushdef([_m4_divert_stack], m4_location[: $1: $2])])
+
+
+# m4_divert(DIVERSION-NAME)
+# -------------------------
+# Change the diversion stream to DIVERSION-NAME.
+m4_define([m4_divert],
+[m4_popdef([_m4_divert_stack])]dnl
+[m4_define([_m4_divert_diversion], [$1])]dnl
+[m4_divert_stack_push([$0], [$1])]dnl
+[_m4_divert_raw(_m4_divert([$1]))])
+
+
+# m4_divert_push(DIVERSION-NAME, [NOWARN])
+# ----------------------------------------
+# Change the diversion stream to DIVERSION-NAME, while stacking old values.
+# For internal use only: if NOWARN is not empty, DIVERSION-NAME can be a
+# number instead of a name.
+m4_define([m4_divert_push],
+[m4_divert_stack_push([$0], [$1])]dnl
+[m4_pushdef([_m4_divert_diversion], [$1])]dnl
+[_m4_divert_raw(_m4_divert([$1], [$2]))])
+
+
+# m4_divert_pop([DIVERSION-NAME])
+# -------------------------------
+# Change the diversion stream to its previous value, unstacking it.
+# If specified, verify we left DIVERSION-NAME.
+# When we pop the last value from the stack, we divert to -1.
+m4_define([m4_divert_pop],
+[m4_if([$1], [], [],
+       [$1], _m4_defn([_m4_divert_diversion]), [],
+       [m4_fatal([$0($1): diversion mismatch:
+]m4_divert_stack)])]dnl
+[_m4_popdef([_m4_divert_stack], [_m4_divert_diversion])]dnl
+[m4_ifdef([_m4_divert_diversion], [],
+	   [m4_fatal([too many m4_divert_pop])])]dnl
+[_m4_divert_raw(_m4_divert(_m4_defn([_m4_divert_diversion]), [-]))])
+
+
+# m4_divert_text(DIVERSION-NAME, CONTENT)
+# ---------------------------------------
+# Output CONTENT into DIVERSION-NAME (which may be a number actually).
+# An end of line is appended for free to CONTENT.
+m4_define([m4_divert_text],
+[m4_divert_push([$1])$2
+m4_divert_pop([$1])])
+
+
+# m4_divert_once(DIVERSION-NAME, CONTENT)
+# ---------------------------------------
+# Output CONTENT into DIVERSION-NAME once, if not already there.
+# An end of line is appended for free to CONTENT.
+m4_define([m4_divert_once],
+[m4_expand_once([m4_divert_text([$1], [$2])])])
+
+
+# _m4_divert_unsafe(DIVERSION-NAME)
+# ---------------------------------
+# Issue a warning that the attempt to change the current diversion to
+# DIVERSION-NAME is unsafe, because this macro is being expanded
+# during argument collection of m4_expand.
+m4_define([_m4_divert_unsafe],
+[m4_fatal([$0: cannot change diversion to `$1' inside m4_expand])])
+
+
+# m4_undivert(DIVERSION-NAME...)
+# ------------------------------
+# Undivert DIVERSION-NAME.  Unlike the M4 version, this requires at
+# least one DIVERSION-NAME; also, due to support for named diversions,
+# this should not be used to undivert files.
+m4_define([m4_undivert],
+[m4_if([$#], [0], [m4_fatal([$0: missing argument])],
+       [$#], [1], [_m4_undivert(_m4_divert([$1]))],
+       [m4_map_args([$0], $@)])])
+
+
+## --------------------------------------------- ##
+## 10. Defining macros with bells and whistles.  ##
+## --------------------------------------------- ##
+
+# `m4_defun' is basically `m4_define' but it equips the macro with the
+# needed machinery for `m4_require'.  A macro must be m4_defun'd if
+# either it is m4_require'd, or it m4_require's.
+#
+# Two things deserve attention and are detailed below:
+#  1. Implementation of m4_require
+#  2. Keeping track of the expansion stack
+#
+# 1. Implementation of m4_require
+# ===============================
+#
+# Of course m4_defun calls m4_provide, so that a macro which has
+# been expanded is not expanded again when m4_require'd, but the
+# difficult part is the proper expansion of macros when they are
+# m4_require'd.
+#
+# The implementation is based on three ideas, (i) using diversions to
+# prepare the expansion of the macro and its dependencies (by Franc,ois
+# Pinard), (ii) expand the most recently m4_require'd macros _after_
+# the previous macros (by Axel Thimm), and (iii) track instances of
+# provide before require (by Eric Blake).
+#
+#
+# The first idea: why use diversions?
+# -----------------------------------
+#
+# When a macro requires another, the other macro is expanded in new
+# diversion, GROW.  When the outer macro is fully expanded, we first
+# undivert the most nested diversions (GROW - 1...), and finally
+# undivert GROW.  To understand why we need several diversions,
+# consider the following example:
+#
+# | m4_defun([TEST1], [Test...m4_require([TEST2])1])
+# | m4_defun([TEST2], [Test...m4_require([TEST3])2])
+# | m4_defun([TEST3], [Test...3])
+#
+# Because m4_require is not required to be first in the outer macros, we
+# must keep the expansions of the various levels of m4_require separated.
+# Right before executing the epilogue of TEST1, we have:
+#
+#	   GROW - 2: Test...3
+#	   GROW - 1: Test...2
+#	   GROW:     Test...1
+#	   BODY:
+#
+# Finally the epilogue of TEST1 undiverts GROW - 2, GROW - 1, and
+# GROW into the regular flow, BODY.
+#
+#	   GROW - 2:
+#	   GROW - 1:
+#	   GROW:
+#	   BODY:        Test...3; Test...2; Test...1
+#
+# (The semicolons are here for clarification, but of course are not
+# emitted.)  This is what Autoconf 2.0 (I think) to 2.13 (I'm sure)
+# implement.
+#
+#
+# The second idea: first required first out
+# -----------------------------------------
+#
+# The natural implementation of the idea above is buggy and produces
+# very surprising results in some situations.  Let's consider the
+# following example to explain the bug:
+#
+# | m4_defun([TEST1],  [m4_require([TEST2a])m4_require([TEST2b])])
+# | m4_defun([TEST2a], [])
+# | m4_defun([TEST2b], [m4_require([TEST3])])
+# | m4_defun([TEST3],  [m4_require([TEST2a])])
+# |
+# | AC_INIT
+# | TEST1
+#
+# The dependencies between the macros are:
+#
+#		 3 --- 2b
+#		/        \              is m4_require'd by
+#	       /          \       left -------------------- right
+#	    2a ------------ 1
+#
+# If you strictly apply the rules given in the previous section you get:
+#
+#	   GROW - 2: TEST3
+#	   GROW - 1: TEST2a; TEST2b
+#	   GROW:     TEST1
+#	   BODY:
+#
+# (TEST2a, although required by TEST3 is not expanded in GROW - 3
+# because is has already been expanded before in GROW - 1, so it has
+# been AC_PROVIDE'd, so it is not expanded again) so when you undivert
+# the stack of diversions, you get:
+#
+#	   GROW - 2:
+#	   GROW - 1:
+#	   GROW:
+#	   BODY:        TEST3; TEST2a; TEST2b; TEST1
+#
+# i.e., TEST2a is expanded after TEST3 although the latter required the
+# former.
+#
+# Starting from 2.50, we use an implementation provided by Axel Thimm.
+# The idea is simple: the order in which macros are emitted must be the
+# same as the one in which macros are expanded.  (The bug above can
+# indeed be described as: a macro has been m4_provide'd before its
+# dependent, but it is emitted after: the lack of correlation between
+# emission and expansion order is guilty).
+#
+# How to do that?  You keep the stack of diversions to elaborate the
+# macros, but each time a macro is fully expanded, emit it immediately.
+#
+# In the example above, when TEST2a is expanded, but it's epilogue is
+# not run yet, you have:
+#
+#	   GROW - 2:
+#	   GROW - 1: TEST2a
+#	   GROW:     Elaboration of TEST1
+#	   BODY:
+#
+# The epilogue of TEST2a emits it immediately:
+#
+#	   GROW - 2:
+#	   GROW - 1:
+#	   GROW:     Elaboration of TEST1
+#	   BODY:     TEST2a
+#
+# TEST2b then requires TEST3, so right before the epilogue of TEST3, you
+# have:
+#
+#	   GROW - 2: TEST3
+#	   GROW - 1: Elaboration of TEST2b
+#	   GROW:     Elaboration of TEST1
+#	   BODY:      TEST2a
+#
+# The epilogue of TEST3 emits it:
+#
+#	   GROW - 2:
+#	   GROW - 1: Elaboration of TEST2b
+#	   GROW:     Elaboration of TEST1
+#	   BODY:     TEST2a; TEST3
+#
+# TEST2b is now completely expanded, and emitted:
+#
+#	   GROW - 2:
+#	   GROW - 1:
+#	   GROW:     Elaboration of TEST1
+#	   BODY:     TEST2a; TEST3; TEST2b
+#
+# and finally, TEST1 is finished and emitted:
+#
+#	   GROW - 2:
+#	   GROW - 1:
+#	   GROW:
+#	   BODY:     TEST2a; TEST3; TEST2b: TEST1
+#
+# The idea is simple, but the implementation is a bit involved.  If
+# you are like me, you will want to see the actual functioning of this
+# implementation to be convinced.  The next section gives the full
+# details.
+#
+#
+# The Axel Thimm implementation at work
+# -------------------------------------
+#
+# We consider the macros above, and this configure.ac:
+#
+#	    AC_INIT
+#	    TEST1
+#
+# You should keep the definitions of _m4_defun_pro, _m4_defun_epi, and
+# m4_require at hand to follow the steps.
+#
+# This implementation tries not to assume that the current diversion is
+# BODY, so as soon as a macro (m4_defun'd) is expanded, we first
+# record the current diversion under the name _m4_divert_dump (denoted
+# DUMP below for short).  This introduces an important difference with
+# the previous versions of Autoconf: you cannot use m4_require if you
+# are not inside an m4_defun'd macro, and especially, you cannot
+# m4_require directly from the top level.
+#
+# We have not tried to simulate the old behavior (better yet, we
+# diagnose it), because it is too dangerous: a macro m4_require'd from
+# the top level is expanded before the body of `configure', i.e., before
+# any other test was run.  I let you imagine the result of requiring
+# AC_STDC_HEADERS for instance, before AC_PROG_CC was actually run....
+#
+# After AC_INIT was run, the current diversion is BODY.
+# * AC_INIT was run
+#   DUMP:                undefined
+#   diversion stack:     BODY |-
+#
+# * TEST1 is expanded
+# The prologue of TEST1 sets _m4_divert_dump, which is the diversion
+# where the current elaboration will be dumped, to the current
+# diversion.  It also m4_divert_push to GROW, where the full
+# expansion of TEST1 and its dependencies will be elaborated.
+#   DUMP:        BODY
+#   BODY:        empty
+#   diversions:  GROW, BODY |-
+#
+# * TEST1 requires TEST2a
+# _m4_require_call m4_divert_pushes another temporary diversion,
+# GROW - 1, and expands TEST2a in there.
+#   DUMP:        BODY
+#   BODY:        empty
+#   GROW - 1:    TEST2a
+#   diversions:  GROW - 1, GROW, BODY |-
+# Then the content of the temporary diversion is moved to DUMP and the
+# temporary diversion is popped.
+#   DUMP:        BODY
+#   BODY:        TEST2a
+#   diversions:  GROW, BODY |-
+#
+# * TEST1 requires TEST2b
+# Again, _m4_require_call pushes GROW - 1 and heads to expand TEST2b.
+#   DUMP:        BODY
+#   BODY:        TEST2a
+#   diversions:  GROW - 1, GROW, BODY |-
+#
+# * TEST2b requires TEST3
+# _m4_require_call pushes GROW - 2 and expands TEST3 here.
+# (TEST3 requires TEST2a, but TEST2a has already been m4_provide'd, so
+# nothing happens.)
+#   DUMP:        BODY
+#   BODY:        TEST2a
+#   GROW - 2:    TEST3
+#   diversions:  GROW - 2, GROW - 1, GROW, BODY |-
+# Then the diversion is appended to DUMP, and popped.
+#   DUMP:        BODY
+#   BODY:        TEST2a; TEST3
+#   diversions:  GROW - 1, GROW, BODY |-
+#
+# * TEST1 requires TEST2b (contd.)
+# The content of TEST2b is expanded...
+#   DUMP:        BODY
+#   BODY:        TEST2a; TEST3
+#   GROW - 1:    TEST2b,
+#   diversions:  GROW - 1, GROW, BODY |-
+# ... and moved to DUMP.
+#   DUMP:        BODY
+#   BODY:        TEST2a; TEST3; TEST2b
+#   diversions:  GROW, BODY |-
+#
+# * TEST1 is expanded: epilogue
+# TEST1's own content is in GROW...
+#   DUMP:        BODY
+#   BODY:        TEST2a; TEST3; TEST2b
+#   GROW:        TEST1
+#   diversions:  BODY |-
+# ... and it's epilogue moves it to DUMP and then undefines DUMP.
+#   DUMP:       undefined
+#   BODY:       TEST2a; TEST3; TEST2b; TEST1
+#   diversions: BODY |-
+#
+#
+# The third idea: track macros provided before they were required
+# ---------------------------------------------------------------
+#
+# Using just the first two ideas, Autoconf 2.50 through 2.63 still had
+# a subtle bug for more than seven years.  Let's consider the
+# following example to explain the bug:
+#
+# | m4_defun([TEST1], [1])
+# | m4_defun([TEST2], [2[]m4_require([TEST1])])
+# | m4_defun([TEST3], [3 TEST1 m4_require([TEST2])])
+# | TEST3
+#
+# After the prologue of TEST3, we are collecting text in GROW with the
+# intent of dumping it in BODY during the epilogue.  Next, we
+# encounter the direct invocation of TEST1, which provides the macro
+# in place in GROW.  From there, we encounter a requirement for TEST2,
+# which must be collected in a new diversion.  While expanding TEST2,
+# we encounter a requirement for TEST1, but since it has already been
+# expanded, the Axel Thimm algorithm states that we can treat it as a
+# no-op.  But that would lead to an end result of `2 3 1', meaning
+# that we have once again output a macro (TEST2) prior to its
+# requirements (TEST1).
+#
+# The problem can only occur if a single defun'd macro first provides,
+# then later indirectly requires, the same macro.  Note that directly
+# expanding then requiring a macro is okay: because the dependency was
+# met, the require phase can be a no-op.  For that matter, the outer
+# macro can even require two helpers, where the first helper expands
+# the macro, and the second helper indirectly requires the macro.
+# Out-of-order expansion is only present if the inner macro is
+# required by something that will be hoisted in front of where the
+# direct expansion occurred.  In other words, we must be careful not
+# to warn on:
+#
+# | m4_defun([TEST4], [4])
+# | m4_defun([TEST5], [5 TEST4 m4_require([TEST4])])
+# | TEST5 => 5 4
+#
+# or even the more complex:
+#
+# | m4_defun([TEST6], [6])
+# | m4_defun([TEST7], [7 TEST6])
+# | m4_defun([TEST8], [8 m4_require([TEST6])])
+# | m4_defun([TEST9], [9 m4_require([TEST8])])
+# | m4_defun([TEST10], [10 m4_require([TEST7]) m4_require([TEST9])])
+# | TEST10 => 7 6 8 9 10
+#
+# So, to detect whether a require was direct or indirect, m4_defun and
+# m4_require track the name of the macro that caused a diversion to be
+# created (using the stack _m4_diverting, coupled with an O(1) lookup
+# _m4_diverting([NAME])), and m4_provide stores the name associated
+# with the diversion at which a macro was provided.  A require call is
+# direct if it occurs within the same diversion where the macro was
+# provided, or if the diversion associated with the providing context
+# has been collected.
+#
+# The implementation of the warning involves tracking the set of
+# macros which have been provided since the start of the outermost
+# defun'd macro (the set is named _m4_provide).  When starting an
+# outermost macro, the set is emptied; when a macro is provided, it is
+# added to the set; when require expands the body of a macro, it is
+# removed from the set; and when a macro is indirectly required, the
+# set is checked.  If a macro is in the set, then it has been provided
+# before it was required, and we satisfy dependencies by expanding the
+# macro as if it had never been provided; in the example given above,
+# this means we now output `1 2 3 1'.  Meanwhile, a warning is issued
+# to inform the user that her macros trigger the bug in older autoconf
+# versions, and that her output file now contains redundant contents
+# (and possibly new problems, if the repeated macro was not
+# idempotent).  Meanwhile, macros defined by m4_defun_once instead of
+# m4_defun are idempotent, avoiding any warning or duplicate output.
+#
+#
+# 2. Keeping track of the expansion stack
+# =======================================
+#
+# When M4 expansion goes wrong it is often extremely hard to find the
+# path amongst macros that drove to the failure.  What is needed is
+# the stack of macro `calls'. One could imagine that GNU M4 would
+# maintain a stack of macro expansions, unfortunately it doesn't, so
+# we do it by hand.  This is of course extremely costly, but the help
+# this stack provides is worth it.  Nevertheless to limit the
+# performance penalty this is implemented only for m4_defun'd macros,
+# not for define'd macros.
+#
+# Each time we enter an m4_defun'd macros, we add a definition in
+# _m4_expansion_stack, and when we exit the macro, we remove it (thanks
+# to pushdef/popdef).  m4_stack_foreach is used to print the expansion
+# stack in the rare cases when it's needed.
+#
+# In addition, we want to detect circular m4_require dependencies.
+# Each time we expand a macro FOO we define _m4_expanding(FOO); and
+# m4_require(BAR) simply checks whether _m4_expanding(BAR) is defined.
+
+
+# m4_expansion_stack
+# ------------------
+# Expands to the entire contents of the expansion stack.  The caller
+# must supply a trailing newline.  This macro always prints a
+# location; check whether _m4_expansion_stack is defined to filter out
+# the case when no defun'd macro is in force.
+m4_define([m4_expansion_stack],
+[m4_stack_foreach_sep_lifo([_$0], [_$0_entry(], [)
+])m4_location[: the top level]])
+
+# _m4_expansion_stack_entry(MACRO)
+# --------------------------------
+# Format an entry for MACRO found on the expansion stack.
+m4_define([_m4_expansion_stack_entry],
+[_m4_defn([m4_location($1)])[: $1 is expanded from...]])
+
+# m4_expansion_stack_push(MACRO)
+# ------------------------------
+# Form an entry of the expansion stack on entry to MACRO and push it.
+m4_define([m4_expansion_stack_push],
+[m4_pushdef([_m4_expansion_stack], [$1])])
+
+
+# _m4_divert(GROW)
+# ----------------
+# This diversion is used by the m4_defun/m4_require machinery.  It is
+# important to keep room before GROW because for each nested
+# AC_REQUIRE we use an additional diversion (i.e., two m4_require's
+# will use GROW - 2.  More than 3 levels has never seemed to be
+# needed.)
+#
+# ...
+# - GROW - 2
+#   m4_require'd code, 2 level deep
+# - GROW - 1
+#   m4_require'd code, 1 level deep
+# - GROW
+#   m4_defun'd macros are elaborated here.
+
+m4_define([_m4_divert(GROW)],       10000)
+
+
+# _m4_defun_pro(MACRO-NAME)
+# -------------------------
+# The prologue for Autoconf macros.
+#
+# This is called frequently, so minimize the number of macro invocations
+# by avoiding dnl and m4_defn overhead.
+m4_define([_m4_defun_pro],
+[m4_ifdef([_m4_expansion_stack], [], [_m4_defun_pro_outer([$1])])]dnl
+[m4_expansion_stack_push([$1])m4_pushdef([_m4_expanding($1)])])
+
+m4_define([_m4_defun_pro_outer],
+[m4_set_delete([_m4_provide])]dnl
+[m4_pushdef([_m4_diverting([$1])])m4_pushdef([_m4_diverting], [$1])]dnl
+[m4_pushdef([_m4_divert_dump], m4_divnum)m4_divert_push([GROW])])
+
+# _m4_defun_epi(MACRO-NAME)
+# -------------------------
+# The Epilogue for Autoconf macros.  MACRO-NAME only helps tracing
+# the PRO/EPI pairs.
+#
+# This is called frequently, so minimize the number of macro invocations
+# by avoiding dnl and m4_popdef overhead.
+m4_define([_m4_defun_epi],
+[_m4_popdef([_m4_expanding($1)], [_m4_expansion_stack])]dnl
+[m4_ifdef([_m4_expansion_stack], [], [_m4_defun_epi_outer([$1])])]dnl
+[m4_provide([$1])])
+
+m4_define([_m4_defun_epi_outer],
+[_m4_popdef([_m4_divert_dump], [_m4_diverting([$1])], [_m4_diverting])]dnl
+[m4_divert_pop([GROW])m4_undivert([GROW])])
+
+
+# _m4_divert_dump
+# ---------------
+# If blank, we are outside of any defun'd macro.  Otherwise, expands
+# to the diversion number (not name) where require'd macros should be
+# moved once completed.
+m4_define([_m4_divert_dump])
+
+
+# m4_divert_require(DIVERSION, NAME-TO-CHECK, [BODY-TO-EXPAND])
+# -------------------------------------------------------------
+# Same as m4_require, but BODY-TO-EXPAND goes into the named DIVERSION;
+# requirements still go in the current diversion though.
+#
+m4_define([m4_divert_require],
+[m4_ifdef([_m4_expanding($2)],
+  [m4_fatal([$0: circular dependency of $2])])]dnl
+[m4_if(_m4_divert_dump, [],
+  [m4_fatal([$0($2): cannot be used outside of an m4_defun'd macro])])]dnl
+[m4_provide_if([$2], [],
+  [_m4_require_call([$2], [$3], _m4_divert([$1], [-]))])])
+
+
+# m4_defun(NAME, EXPANSION, [MACRO = m4_define])
+# ----------------------------------------------
+# Define a macro NAME which automatically provides itself.  Add
+# machinery so the macro automatically switches expansion to the
+# diversion stack if it is not already using it, prior to EXPANSION.
+# In this case, once finished, it will bring back all the code
+# accumulated in the diversion stack.  This, combined with m4_require,
+# achieves the topological ordering of macros.  We don't use this
+# macro to define some frequently called macros that are not involved
+# in ordering constraints, to save m4 processing.
+#
+# MACRO is an undocumented argument; when set to m4_pushdef, and NAME
+# is already defined, the new definition is added to the pushdef
+# stack, rather than overwriting the current definition.  It can thus
+# be used to write self-modifying macros, which pop themselves to a
+# previously m4_define'd definition so that subsequent use of the
+# macro is faster.
+m4_define([m4_defun],
+[m4_define([m4_location($1)], m4_location)]dnl
+[m4_default([$3], [m4_define])([$1],
+  [_m4_defun_pro(]m4_dquote($[0])[)$2[]_m4_defun_epi(]m4_dquote($[0])[)])])
+
+
+# m4_defun_init(NAME, INIT, COMMON)
+# ---------------------------------
+# Like m4_defun, but split EXPANSION into two portions: INIT which is
+# done only the first time NAME is invoked, and COMMON which is
+# expanded every time.
+#
+# For now, the COMMON definition is always m4_define'd, giving an even
+# lighter-weight definition.  m4_defun allows self-providing, but once
+# a macro is provided, m4_require no longer cares if it is m4_define'd
+# or m4_defun'd.  m4_defun also provides location tracking to identify
+# dependency bugs, but once the INIT has been expanded, we know there
+# are no dependency bugs.  However, if a future use needs COMMON to be
+# m4_defun'd, we can add a parameter, similar to the third parameter
+# to m4_defun.
+m4_define([m4_defun_init],
+[m4_define([$1], [$3[]])m4_defun([$1],
+   [$2[]_m4_popdef(]m4_dquote($[0])[)m4_indir(]m4_dquote($[0])dnl
+[m4_if(]m4_dquote($[#])[, [0], [], ]m4_dquote([,$]@)[))], [m4_pushdef])])
+
+
+# m4_defun_once(NAME, EXPANSION)
+# ------------------------------
+# Like m4_defun, but guarantee that EXPANSION only happens once
+# (thereafter, using NAME is a no-op).
+#
+# If _m4_divert_dump is empty, we are called at the top level;
+# otherwise, we must ensure that we are required in front of the
+# current defun'd macro.  Use a helper macro so that EXPANSION need
+# only occur once in the definition of NAME, since it might be large.
+m4_define([m4_defun_once],
+[m4_define([m4_location($1)], m4_location)]dnl
+[m4_define([$1], [_m4_defun_once([$1], [$2], m4_if(_m4_divert_dump, [],
+  [[_m4_defun_pro([$1])m4_unquote(], [)_m4_defun_epi([$1])]],
+m4_ifdef([_m4_diverting([$1])], [-]), [-], [[m4_unquote(], [)]],
+  [[_m4_require_call([$1],], [, _m4_divert_dump)]]))])])
+
+m4_define([_m4_defun_once],
+[m4_pushdef([$1])$3[$2[]m4_provide([$1])]$4])
+
+
+# m4_pattern_forbid(ERE, [WHY])
+# -----------------------------
+# Declare that no token matching the forbidden perl extended regular
+# expression ERE should be seen in the output unless...
+m4_define([m4_pattern_forbid], [])
+
+
+# m4_pattern_allow(ERE)
+# ---------------------
+# ... that token also matches the allowed extended regular expression ERE.
+# Both used via traces, by autom4te post-processing.
+m4_define([m4_pattern_allow], [])
+
+
+## --------------------------------- ##
+## 11. Dependencies between macros.  ##
+## --------------------------------- ##
+
+
+# m4_before(THIS-MACRO-NAME, CALLED-MACRO-NAME)
+# ---------------------------------------------
+# Issue a warning if CALLED-MACRO-NAME was called before THIS-MACRO-NAME.
+m4_define([m4_before],
+[m4_provide_if([$2],
+	       [m4_warn([syntax], [$2 was called before $1])])])
+
+
+# m4_require(NAME-TO-CHECK, [BODY-TO-EXPAND = NAME-TO-CHECK])
+# -----------------------------------------------------------
+# If NAME-TO-CHECK has never been expanded (actually, if it is not
+# m4_provide'd), expand BODY-TO-EXPAND *before* the current macro
+# expansion; follow the expansion with a newline.  Once expanded, emit
+# it in _m4_divert_dump.  Keep track of the m4_require chain in
+# _m4_expansion_stack.
+#
+# The normal cases are:
+#
+# - NAME-TO-CHECK == BODY-TO-EXPAND
+#   Which you can use for regular macros with or without arguments, e.g.,
+#     m4_require([AC_PROG_CC], [AC_PROG_CC])
+#     m4_require([AC_CHECK_HEADERS(threads.h)], [AC_CHECK_HEADERS(threads.h)])
+#   which is just the same as
+#     m4_require([AC_PROG_CC])
+#     m4_require([AC_CHECK_HEADERS(threads.h)])
+#
+# - BODY-TO-EXPAND == m4_indir([NAME-TO-CHECK])
+#   In the case of macros with irregular names.  For instance:
+#     m4_require([AC_LANG_COMPILER(C)], [indir([AC_LANG_COMPILER(C)])])
+#   which means `if the macro named `AC_LANG_COMPILER(C)' (the parens are
+#   part of the name, it is not an argument) has not been run, then
+#   call it.'
+#   Had you used
+#     m4_require([AC_LANG_COMPILER(C)], [AC_LANG_COMPILER(C)])
+#   then m4_require would have tried to expand `AC_LANG_COMPILER(C)', i.e.,
+#   call the macro `AC_LANG_COMPILER' with `C' as argument.
+#
+#   You could argue that `AC_LANG_COMPILER', when it receives an argument
+#   such as `C' should dispatch the call to `AC_LANG_COMPILER(C)'.  But this
+#   `extension' prevents `AC_LANG_COMPILER' from having actual arguments that
+#   it passes to `AC_LANG_COMPILER(C)'.
+#
+# This is called frequently, so minimize the number of macro invocations
+# by avoiding dnl and other overhead on the common path.
+m4_define([m4_require],
+[m4_ifdef([_m4_expanding($1)],
+  [m4_fatal([$0: circular dependency of $1])])]dnl
+[m4_if(_m4_divert_dump, [],
+  [m4_fatal([$0($1): cannot be used outside of an ]dnl
+m4_if([$0], [m4_require], [[m4_defun]], [[AC_DEFUN]])['d macro])])]dnl
+[m4_provide_if([$1], [m4_set_contains([_m4_provide], [$1],
+    [_m4_require_check([$1], _m4_defn([m4_provide($1)]), [$0])], [m4_ignore])],
+  [_m4_require_call])([$1], [$2], _m4_divert_dump)])
+
+
+# _m4_require_call(NAME-TO-CHECK, [BODY-TO-EXPAND = NAME-TO-CHECK],
+#                  DIVERSION-NUMBER)
+# -----------------------------------------------------------------
+# If m4_require decides to expand the body, it calls this macro.  The
+# expansion is placed in DIVERSION-NUMBER.
+#
+# This is called frequently, so minimize the number of macro invocations
+# by avoiding dnl and other overhead on the common path.
+# The use of a witness macro protecting the warning allows aclocal
+# to silence any warnings when probing for what macros are required
+# and must therefore be located, when using the Autoconf-without-aclocal-m4
+# autom4te language.  For more background, see:
+# https://lists.gnu.org/archive/html/automake-patches/2012-11/msg00035.html
+m4_define([_m4_require_call],
+[m4_pushdef([_m4_divert_grow], m4_decr(_m4_divert_grow))]dnl
+[m4_pushdef([_m4_diverting([$1])])m4_pushdef([_m4_diverting], [$1])]dnl
+[m4_divert_push(_m4_divert_grow, [-])]dnl
+[m4_if([$2], [], [$1], [$2])
+m4_provide_if([$1], [m4_set_remove([_m4_provide], [$1])],
+  [m4_ifndef([m4_require_silent_probe],
+    [m4_warn([syntax], [$1 is m4_require'd but not m4_defun'd])])])]dnl
+[_m4_divert_raw($3)_m4_undivert(_m4_divert_grow)]dnl
+[m4_divert_pop(_m4_divert_grow)_m4_popdef([_m4_divert_grow],
+[_m4_diverting([$1])], [_m4_diverting])])
+
+
+# _m4_require_check(NAME-TO-CHECK, OWNER, CALLER)
+# -----------------------------------------------
+# NAME-TO-CHECK has been identified as previously expanded in the
+# diversion owned by OWNER.  If this is a problem, warn on behalf of
+# CALLER and return _m4_require_call; otherwise return m4_ignore.
+m4_define([_m4_require_check],
+[m4_if(_m4_defn([_m4_diverting]), [$2], [m4_ignore],
+       m4_ifdef([_m4_diverting([$2])], [-]), [-], [m4_warn([syntax],
+   [$3: `$1' was expanded before it was required
+https://www.gnu.org/software/autoconf/manual/autoconf.html#Expanded-Before-Required])_m4_require_call],
+       [m4_ignore])])
+
+
+# _m4_divert_grow
+# ---------------
+# The counter for _m4_require_call.
+m4_define([_m4_divert_grow], _m4_divert([GROW]))
+
+
+# m4_expand_once(TEXT, [WITNESS = TEXT])
+# --------------------------------------
+# If TEXT has never been expanded, expand it *here*.  Use WITNESS as
+# as a memory that TEXT has already been expanded.
+m4_define([m4_expand_once],
+[m4_provide_if(m4_default_quoted([$2], [$1]),
+	       [],
+	       [m4_provide(m4_default_quoted([$2], [$1]))[]$1])])
+
+
+# m4_provide(MACRO-NAME)
+# ----------------------
+m4_define([m4_provide],
+[m4_ifdef([m4_provide($1)], [],
+[m4_set_add([_m4_provide], [$1], [m4_define([m4_provide($1)],
+  m4_ifdef([_m4_diverting], [_m4_defn([_m4_diverting])]))])])])
+
+
+# m4_provide_if(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
+# -------------------------------------------------------
+# If MACRO-NAME is provided do IF-PROVIDED, else IF-NOT-PROVIDED.
+# The purpose of this macro is to provide the user with a means to
+# check macros which are provided without letting her know how the
+# information is coded.
+m4_define([m4_provide_if],
+[m4_ifdef([m4_provide($1)],
+	  [$2], [$3])])
+
+
+## --------------------- ##
+## 12. Text processing.  ##
+## --------------------- ##
+
+
+# m4_cr_letters
+# m4_cr_LETTERS
+# m4_cr_Letters
+# -------------
+m4_define([m4_cr_letters], [abcdefghijklmnopqrstuvwxyz])
+m4_define([m4_cr_LETTERS], [ABCDEFGHIJKLMNOPQRSTUVWXYZ])
+m4_define([m4_cr_Letters],
+m4_defn([m4_cr_letters])dnl
+m4_defn([m4_cr_LETTERS])dnl
+)
+
+
+# m4_cr_digits
+# ------------
+m4_define([m4_cr_digits], [0123456789])
+
+
+# m4_cr_alnum
+# -----------
+m4_define([m4_cr_alnum],
+m4_defn([m4_cr_Letters])dnl
+m4_defn([m4_cr_digits])dnl
+)
+
+
+# m4_cr_symbols1
+# m4_cr_symbols2
+# --------------
+m4_define([m4_cr_symbols1],
+m4_defn([m4_cr_Letters])dnl
+_)
+
+m4_define([m4_cr_symbols2],
+m4_defn([m4_cr_symbols1])dnl
+m4_defn([m4_cr_digits])dnl
+)
+
+# m4_cr_all
+# ---------
+# The character range representing everything, with `-' as the last
+# character, since it is special to m4_translit.  Use with care, because
+# it contains characters special to M4 (fortunately, both ASCII and EBCDIC
+# have [] in order, so m4_defn([m4_cr_all]) remains a valid string).  It
+# also contains characters special to terminals, so it should never be
+# displayed in an error message.  Also, attempts to map [ and ] to other
+# characters via m4_translit must deal with the fact that m4_translit does
+# not add quotes to the output.
+#
+# In EBCDIC, $ is immediately followed by *, which leads to problems
+# if m4_cr_all is inlined into a macro definition; so swap them.
+#
+# It is mainly useful in generating inverted character range maps, for use
+# in places where m4_translit is faster than an equivalent m4_bpatsubst;
+# the regex `[^a-z]' is equivalent to:
+#  m4_translit(m4_dquote(m4_defn([m4_cr_all])), [a-z])
+m4_define([m4_cr_all],
+m4_translit(m4_dquote(m4_format(m4_dquote(m4_for(
+  ,1,255,,[[%c]]))m4_for([i],1,255,,[,i]))), [$*-], [*$])-)
+
+
+# _m4_define_cr_not(CATEGORY)
+# ---------------------------
+# Define m4_cr_not_CATEGORY as the inverse of m4_cr_CATEGORY.
+m4_define([_m4_define_cr_not],
+[m4_define([m4_cr_not_$1],
+	   m4_translit(m4_dquote(m4_defn([m4_cr_all])),
+		       m4_defn([m4_cr_$1])))])
+
+
+# m4_cr_not_letters
+# m4_cr_not_LETTERS
+# m4_cr_not_Letters
+# m4_cr_not_digits
+# m4_cr_not_alnum
+# m4_cr_not_symbols1
+# m4_cr_not_symbols2
+# ------------------
+# Inverse character sets
+_m4_define_cr_not([letters])
+_m4_define_cr_not([LETTERS])
+_m4_define_cr_not([Letters])
+_m4_define_cr_not([digits])
+_m4_define_cr_not([alnum])
+_m4_define_cr_not([symbols1])
+_m4_define_cr_not([symbols2])
+
+
+# m4_newline([STRING])
+# --------------------
+# Expands to a newline, possibly followed by STRING.  Exists mostly for
+# formatting reasons.
+m4_define([m4_newline], [
+$1])
+
+
+# m4_re_escape(STRING)
+# --------------------
+# Escape RE active characters in STRING.
+m4_define([m4_re_escape],
+[m4_bpatsubst([$1],
+	      [[][*+.?\^$]], [\\\&])])
+
+
+# m4_re_string
+# ------------
+# Regexp for `[a-zA-Z_0-9]*'
+# m4_dquote provides literal [] for the character class.
+m4_define([m4_re_string],
+m4_dquote(m4_defn([m4_cr_symbols2]))dnl
+[*]dnl
+)
+
+
+# m4_re_word
+# ----------
+# Regexp for `[a-zA-Z_][a-zA-Z_0-9]*'
+m4_define([m4_re_word],
+m4_dquote(m4_defn([m4_cr_symbols1]))dnl
+m4_defn([m4_re_string])dnl
+)
+
+
+# m4_tolower(STRING)
+# m4_toupper(STRING)
+# ------------------
+# These macros convert STRING to lowercase or uppercase.
+#
+# Rather than expand the m4_defn each time, we inline them up front.
+m4_define([m4_tolower],
+[m4_translit([[$1]], ]m4_dquote(m4_defn([m4_cr_LETTERS]))[,
+		     ]m4_dquote(m4_defn([m4_cr_letters]))[)])
+m4_define([m4_toupper],
+[m4_translit([[$1]], ]m4_dquote(m4_defn([m4_cr_letters]))[,
+		     ]m4_dquote(m4_defn([m4_cr_LETTERS]))[)])
+
+
+# m4_split(STRING, [REGEXP])
+# --------------------------
+# Split STRING into an m4 list of quoted elements.  The elements are
+# quoted with [ and ].  Beginning spaces and end spaces *are kept*.
+# Use m4_strip to remove them.
+#
+# REGEXP specifies where to split.  Default is [\t ]+.
+#
+# If STRING is empty, the result is an empty list.
+#
+# Pay attention to the m4_changequotes.  When m4 reads the definition of
+# m4_split, it still has quotes set to [ and ].  Luckily, these are matched
+# in the macro body, so the definition is stored correctly.  Use the same
+# alternate quotes as m4_noquote; it must be unlikely to appear in $1.
+#
+# Also, notice that $1 is quoted twice, since we want the result to
+# be quoted.  Then you should understand that the argument of
+# patsubst is -=<{(STRING)}>=- (i.e., with additional -=<{( and )}>=-).
+#
+# This macro is safe on active symbols, i.e.:
+#   m4_define(active, ACTIVE)
+#   m4_split([active active ])end
+#   => [active], [active], []end
+#
+# Optimize on regex of ` ' (space), since m4_foreach_w already guarantees
+# that the list contains single space separators, and a common case is
+# splitting a single-element list.  This macro is called frequently,
+# so avoid unnecessary dnl inside the definition.
+m4_define([m4_split],
+[m4_if([$1], [], [],
+       [$2], [ ], [m4_if(m4_index([$1], [ ]), [-1], [[[$1]]],
+			 [_$0([$1], [$2], [, ])])],
+       [$2], [], [_$0([$1], [[	 ]+], [, ])],
+       [_$0([$1], [$2], [, ])])])
+
+m4_define([_m4_split],
+[m4_changequote([-=<{(],[)}>=-])]dnl
+[[m4_bpatsubst(-=<{(-=<{($1)}>=-)}>=-, -=<{($2)}>=-,
+	       -=<{(]$3[)}>=-)]m4_changequote([, ])])
+
+
+# m4_chomp(STRING)
+# m4_chomp_all(STRING)
+# --------------------
+# Return STRING quoted, but without a trailing newline.  m4_chomp
+# removes at most one newline, while m4_chomp_all removes all
+# consecutive trailing newlines.  Embedded newlines are not touched,
+# and a trailing backslash-newline leaves just a trailing backslash.
+#
+# m4_bregexp is slower than m4_index, and we don't always want to
+# remove all newlines; hence the two variants.  We massage characters
+# to give a nicer pattern to match, particularly since m4_bregexp is
+# line-oriented.  Both versions must guarantee a match, to avoid bugs
+# with precision -1 in m4_format in older m4.
+m4_define([m4_chomp],
+[m4_format([[%.*s]], m4_index(m4_translit([[$1]], [
+/.], [/  ])[./.], [/.]), [$1])])
+
+m4_define([m4_chomp_all],
+[m4_format([[%.*s]], m4_bregexp(m4_translit([[$1]], [
+/], [/ ]), [/*$]), [$1])])
+
+
+# m4_flatten(STRING)
+# ------------------
+# If STRING contains end of lines, replace them with spaces.  If there
+# are backslashed end of lines, remove them.  This macro is safe with
+# active symbols.
+#    m4_define(active, ACTIVE)
+#    m4_flatten([active
+#    act\
+#    ive])end
+#    => active activeend
+#
+# In m4, m4_bpatsubst is expensive, so first check for a newline.
+m4_define([m4_flatten],
+[m4_if(m4_index([$1], [
+]), [-1], [[$1]],
+       [m4_translit(m4_bpatsubst([[[$1]]], [\\
+]), [
+], [ ])])])
+
+
+# m4_strip(STRING)
+# ----------------
+# Expands into STRING with tabs and spaces singled out into a single
+# space, and removing leading and trailing spaces.
+#
+# This macro is robust to active symbols.
+#    m4_define(active, ACTIVE)
+#    m4_strip([  active <tab> <tab>active ])end
+#    => active activeend
+#
+# First, notice that we guarantee trailing space.  Why?  Because regular
+# expressions are greedy, and `.* ?' would always group the space into the
+# .* portion.  The algorithm is simpler by avoiding `?' at the end.  The
+# algorithm correctly strips everything if STRING is just ` '.
+#
+# Then notice the second pattern: it is in charge of removing the
+# leading/trailing spaces.  Why not just `[^ ]'?  Because they are
+# applied to over-quoted strings, i.e. more or less [STRING], due
+# to the limitations of m4_bpatsubsts.  So the leading space in STRING
+# is the *second* character; equally for the trailing space.
+m4_define([m4_strip],
+[m4_bpatsubsts([$1 ],
+	       [[	 ]+], [ ],
+	       [^. ?\(.*\) .$], [[[\1]]])])
+
+
+# m4_normalize(STRING)
+# --------------------
+# Apply m4_flatten and m4_strip to STRING.
+#
+# The argument is quoted, so that the macro is robust to active symbols:
+#
+#    m4_define(active, ACTIVE)
+#    m4_normalize([  act\
+#    ive
+#    active ])end
+#    => active activeend
+
+m4_define([m4_normalize],
+[m4_strip(m4_flatten([$1]))])
+
+
+
+# m4_join(SEP, ARG1, ARG2...)
+# ---------------------------
+# Produce ARG1SEPARG2...SEPARGn.  Avoid back-to-back SEP when a given ARG
+# is the empty string.  No expansion is performed on SEP or ARGs.
+#
+# Since the number of arguments to join can be arbitrarily long, we
+# want to avoid having more than one $@ in the macro definition;
+# otherwise, the expansion would require twice the memory of the already
+# long list.  Hence, m4_join merely looks for the first non-empty element,
+# and outputs just that element; while _m4_join looks for all non-empty
+# elements, and outputs them following a separator.  The final trick to
+# note is that we decide between recursing with $0 or _$0 based on the
+# nested m4_if ending with `_'.
+#
+# Please keep foreach.m4 in sync with any adjustments made here.
+m4_define([m4_join],
+[m4_if([$#], [1], [],
+       [$#], [2], [[$2]],
+       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift2($@))])])
+m4_define([_m4_join],
+[m4_if([$#$2], [2], [],
+       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift2($@))])])
+
+# m4_joinall(SEP, ARG1, ARG2...)
+# ------------------------------
+# Produce ARG1SEPARG2...SEPARGn.  An empty ARG results in back-to-back SEP.
+# No expansion is performed on SEP or ARGs.
+#
+# Please keep foreach.m4 in sync with any adjustments made here.
+m4_define([m4_joinall], [[$2]_$0([$1], m4_shift($@))])
+m4_define([_m4_joinall],
+[m4_if([$#], [2], [], [[$1$3]$0([$1], m4_shift2($@))])])
+
+# m4_combine([SEPARATOR], PREFIX-LIST, [INFIX], SUFFIX...)
+# --------------------------------------------------------
+# Produce the pairwise combination of every element in the quoted,
+# comma-separated PREFIX-LIST with every element from the SUFFIX arguments.
+# Each pair is joined with INFIX, and pairs are separated by SEPARATOR.
+# No expansion occurs on SEPARATOR, INFIX, or elements of either list.
+#
+# For example:
+#   m4_combine([, ], [[a], [b], [c]], [-], [1], [2], [3])
+#   => a-1, a-2, a-3, b-1, b-2, b-3, c-1, c-2, c-3
+#
+# This definition is a bit hairy; the thing to realize is that we want
+# to construct m4_map_args_sep([[prefix$3]], [], [[$1]], m4_shift3($@))
+# as the inner loop, using each prefix generated by the outer loop,
+# and without recalculating m4_shift3 every outer iteration.
+m4_define([m4_combine],
+[m4_if([$2], [], [], m4_eval([$# > 3]), [1],
+[m4_map_args_sep([m4_map_args_sep(m4_dquote(], [)[[$3]], [], [[$1]],]]]dnl
+[m4_dquote(m4_dquote(m4_shift3($@)))[[)], [[$1]], $2)])])
+
+
+# m4_append(MACRO-NAME, STRING, [SEPARATOR])
+# ------------------------------------------
+# Redefine MACRO-NAME to hold its former content plus `SEPARATOR`'STRING'
+# at the end.  It is valid to use this macro with MACRO-NAME undefined,
+# in which case no SEPARATOR is added.  Be aware that the criterion is
+# `not being defined', and not `not being empty'.
+#
+# Note that neither STRING nor SEPARATOR are expanded here; rather, when
+# you expand MACRO-NAME, they will be expanded at that point in time.
+#
+# This macro is robust to active symbols.  It can be used to grow
+# strings.
+#
+#    | m4_define(active, ACTIVE)dnl
+#    | m4_append([sentence], [This is an])dnl
+#    | m4_append([sentence], [ active ])dnl
+#    | m4_append([sentence], [symbol.])dnl
+#    | sentence
+#    | m4_undefine([active])dnl
+#    | sentence
+#    => This is an ACTIVE symbol.
+#    => This is an active symbol.
+#
+# It can be used to define hooks.
+#
+#    | m4_define(active, ACTIVE)dnl
+#    | m4_append([hooks], [m4_define([act1], [act2])])dnl
+#    | m4_append([hooks], [m4_define([act2], [active])])dnl
+#    | m4_undefine([active])dnl
+#    | act1
+#    | hooks
+#    | act1
+#    => act1
+#    =>
+#    => active
+#
+# It can also be used to create lists, although this particular usage was
+# broken prior to autoconf 2.62.
+#    | m4_append([list], [one], [, ])dnl
+#    | m4_append([list], [two], [, ])dnl
+#    | m4_append([list], [three], [, ])dnl
+#    | list
+#    | m4_dquote(list)
+#    => one, two, three
+#    => [one],[two],[three]
+#
+# Note that m4_append can benefit from amortized O(n) m4 behavior, if
+# the underlying m4 implementation is smart enough to avoid copying existing
+# contents when enlarging a macro's definition into any pre-allocated storage
+# (m4 1.4.x unfortunately does not implement this optimization).  We do
+# not implement m4_prepend, since it is inherently O(n^2) (pre-allocated
+# storage only occurs at the end of a macro, so the existing contents must
+# always be moved).
+#
+# Use _m4_defn for speed.
+m4_define([m4_append],
+[m4_define([$1], m4_ifdef([$1], [_m4_defn([$1])[$3]])[$2])])
+
+
+# m4_append_uniq(MACRO-NAME, STRING, [SEPARATOR], [IF-UNIQ], [IF-DUP])
+# --------------------------------------------------------------------
+# Like `m4_append', but append only if not yet present.  Additionally,
+# expand IF-UNIQ if STRING was appended, or IF-DUP if STRING was already
+# present.  Also, warn if SEPARATOR is not empty and occurs within STRING,
+# as the algorithm no longer guarantees uniqueness.
+#
+# Note that while m4_append can be O(n) (depending on the quality of the
+# underlying M4 implementation), m4_append_uniq is inherently O(n^2)
+# because each append operation searches the entire string.
+m4_define([m4_append_uniq],
+[m4_ifval([$3], [m4_if(m4_index([$2], [$3]), [-1], [],
+		       [m4_warn([syntax],
+				[$0: `$2' contains `$3'])])])_$0($@)])
+m4_define([_m4_append_uniq],
+[m4_ifdef([$1],
+	  [m4_if(m4_index([$3]_m4_defn([$1])[$3], [$3$2$3]), [-1],
+		 [m4_append([$1], [$2], [$3])$4], [$5])],
+	  [m4_define([$1], [$2])$4])])
+
+# m4_append_uniq_w(MACRO-NAME, STRINGS)
+# -------------------------------------
+# For each of the words in the whitespace separated list STRINGS, append
+# only the unique strings to the definition of MACRO-NAME.
+#
+# Use _m4_defn for speed.
+m4_define([m4_append_uniq_w],
+[m4_map_args_w([$2], [_m4_append_uniq([$1],], [, [ ])])])
+
+
+# m4_escape(STRING)
+# -----------------
+# Output quoted STRING, but with embedded #, $, [ and ] turned into
+# quadrigraphs.
+#
+# It is faster to check if STRING is already good using m4_translit
+# than to blindly perform four m4_bpatsubst.
+#
+# Because the translit is stripping quotes, it must also neutralize
+# anything that might be in a macro name, as well as comments, commas,
+# and parentheses.  All the problem characters are unified so that a
+# single m4_index can scan the result.
+#
+# Rather than expand m4_defn every time m4_escape is expanded, we
+# inline its expansion up front.
+m4_define([m4_escape],
+[m4_if(m4_index(m4_translit([$1],
+   [[]#,()]]m4_dquote(m4_defn([m4_cr_symbols2]))[, [$$$]), [$]),
+  [-1], [m4_echo], [_$0])([$1])])
+
+m4_define([_m4_escape],
+[m4_changequote([-=<{(],[)}>=-])]dnl
+[m4_bpatsubst(m4_bpatsubst(m4_bpatsubst(m4_bpatsubst(
+	  -=<{(-=<{(-=<{(-=<{(-=<{($1)}>=-)}>=-)}>=-)}>=-)}>=-,
+	-=<{(#)}>=-, -=<{(@%:@)}>=-),
+      -=<{(\[)}>=-, -=<{(@<:@)}>=-),
+    -=<{(\])}>=-, -=<{(@:>@)}>=-),
+  -=<{(\$)}>=-, -=<{(@S|@)}>=-)m4_changequote([,])])
+
+
+# m4_text_wrap(STRING, [PREFIX], [FIRST-PREFIX], [WIDTH])
+# -------------------------------------------------------
+# Expands into STRING wrapped to hold in WIDTH columns (default = 79).
+# If PREFIX is given, each line is prefixed with it.  If FIRST-PREFIX is
+# specified, then the first line is prefixed with it.  As a special case,
+# if the length of FIRST-PREFIX is greater than that of PREFIX, then
+# FIRST-PREFIX will be left alone on the first line.
+#
+# No expansion occurs on the contents STRING, PREFIX, or FIRST-PREFIX,
+# although quadrigraphs are correctly recognized.  More precisely,
+# you may redefine m4_qlen to recognize whatever escape sequences that
+# you will post-process.
+#
+# Typical outputs are:
+#
+# m4_text_wrap([Short string */], [   ], [/* ], 20)
+#  => /* Short string */
+#
+# m4_text_wrap([Much longer string */], [   ], [/* ], 20)
+#  => /* Much longer
+#  =>    string */
+#
+# m4_text_wrap([Short doc.], [          ], [  --short ], 30)
+#  =>   --short Short doc.
+#
+# m4_text_wrap([Short doc.], [          ], [  --too-wide ], 30)
+#  =>   --too-wide
+#  =>           Short doc.
+#
+# m4_text_wrap([Super long documentation.], [          ], [  --too-wide ], 30)
+#  =>   --too-wide
+#  =>      Super long
+#  =>      documentation.
+#
+# FIXME: there is no checking of a longer PREFIX than WIDTH, but do
+# we really want to bother with people trying each single corner
+# of a software?
+#
+# This macro does not leave a trailing space behind the last word of a line,
+# which complicates it a bit.  The algorithm is otherwise stupid and simple:
+# all the words are preceded by m4_Separator which is defined to empty for
+# the first word, and then ` ' (single space) for all the others.
+#
+# The algorithm uses a helper that uses $2 through $4 directly, rather than
+# using local variables, to avoid m4_defn overhead, or expansion swallowing
+# any $.  It also bypasses m4_popdef overhead with _m4_popdef since no user
+# macro expansion occurs in the meantime.  Also, the definition is written
+# with m4_do, to avoid time wasted on dnl during expansion (since this is
+# already a time-consuming macro).
+m4_define([m4_text_wrap],
+[_$0(m4_escape([$1]), [$2], m4_default_quoted([$3], [$2]),
+     m4_default_quoted([$4], [79]))])
+
+m4_define([_m4_text_wrap],
+m4_do(dnl set up local variables, to avoid repeated calculations
+[[m4_pushdef([m4_Indent], m4_qlen([$2]))]],
+[[m4_pushdef([m4_Cursor], m4_qlen([$3]))]],
+[[m4_pushdef([m4_Separator], [m4_define([m4_Separator], [ ])])]],
+dnl expand the first prefix, then check its length vs. regular prefix
+dnl same length: nothing special
+dnl prefix1 longer: output on line by itself, and reset cursor
+dnl prefix1 shorter: pad to length of prefix, and reset cursor
+[[[$3]m4_cond([m4_Cursor], m4_Indent, [],
+	      [m4_eval(m4_Cursor > m4_Indent)], [1], [
+[$2]m4_define([m4_Cursor], m4_Indent)],
+	      [m4_format([%*s], m4_max([0],
+  m4_eval(m4_Indent - m4_Cursor)), [])m4_define([m4_Cursor], m4_Indent)])]],
+dnl now, for each word, compute the cursor after the word is output, then
+dnl check if the cursor would exceed the wrap column
+dnl if so, reset cursor, and insert newline and prefix
+dnl if not, insert the separator (usually a space)
+dnl either way, insert the word
+[[m4_map_args_w([$1], [$0_word(], [, [$2], [$4])])]],
+dnl finally, clean up the local variables
+[[_m4_popdef([m4_Separator], [m4_Cursor], [m4_Indent])]]))
+
+m4_define([_m4_text_wrap_word],
+[m4_define([m4_Cursor], m4_eval(m4_Cursor + m4_qlen([$1]) + 1))]dnl
+[m4_if(m4_eval(m4_Cursor > ([$3])),
+      [1], [m4_define([m4_Cursor], m4_eval(m4_Indent + m4_qlen([$1]) + 1))
+[$2]],
+      [m4_Separator[]])[$1]])
+
+# m4_text_box(MESSAGE, [FRAME-CHARACTER = `-'])
+# ---------------------------------------------
+# Turn MESSAGE into:
+#  ## ------- ##
+#  ## MESSAGE ##
+#  ## ------- ##
+# using FRAME-CHARACTER in the border.
+#
+# Quadrigraphs are correctly recognized.  More precisely, you may
+# redefine m4_qlen to recognize whatever escape sequences that you
+# will post-process.
+m4_define([m4_text_box],
+[m4_pushdef([m4_Border],
+	    m4_translit(m4_format([[[%*s]]], m4_decr(m4_qlen(_m4_expand([$1
+]))), []), [ ], m4_default_quoted([$2], [-])))]dnl
+[[##] _m4_defn([m4_Border]) [##]
+[##] $1 [##]
+[##] _m4_defn([m4_Border]) [##]_m4_popdef([m4_Border])])
+
+
+# m4_qlen(STRING)
+# ---------------
+# Expands to the length of STRING after autom4te converts all quadrigraphs.
+#
+# If you use some other means of post-processing m4 output rather than
+# autom4te, then you may redefine this macro to recognize whatever
+# escape sequences your post-processor will handle.  For that matter,
+# m4_define([m4_qlen], m4_defn([m4_len])) is sufficient if you don't
+# do any post-processing.
+#
+# Avoid bpatsubsts for the common case of no quadrigraphs.  Cache
+# results, as configure scripts tend to ask about lengths of common
+# strings like `/*' and `*/' rather frequently.  Minimize the number
+# of times that $1 occurs in m4_qlen, so there is less text to parse
+# on a cache hit.
+m4_define([m4_qlen],
+[m4_ifdef([$0-$1], [_m4_defn([$0-]], [_$0(])[$1])])
+m4_define([_m4_qlen],
+[m4_define([m4_qlen-$1],
+m4_if(m4_index([$1], [@]), [-1], [m4_len([$1])],
+      [m4_len(m4_bpatsubst([[$1]],
+			   [@\(\(<:\|:>\|S|\|%:\|\{:\|:\}\)\(@\)\|&t@\)],
+			   [\3]))]))_m4_defn([m4_qlen-$1])])
+
+# m4_copyright_condense(TEXT)
+# ---------------------------
+# Condense the copyright notice in TEXT to only display the final
+# year, wrapping the results to fit in 80 columns.
+m4_define([m4_copyright_condense],
+[m4_text_wrap(m4_bpatsubst(m4_flatten([[$1]]),
+[(C)[-	 ,0-9]*\([1-9][0-9][0-9][0-9]\)], [(C) \1]))])
+
+## ----------------------- ##
+## 13. Number processing.  ##
+## ----------------------- ##
+
+# m4_cmp(A, B)
+# ------------
+# Compare two integer expressions.
+# A < B -> -1
+# A = B ->  0
+# A > B ->  1
+m4_define([m4_cmp],
+[m4_eval((([$1]) > ([$2])) - (([$1]) < ([$2])))])
+
+
+# m4_list_cmp(A, B)
+# -----------------
+#
+# Compare the two lists of integer expressions A and B.  For instance:
+#   m4_list_cmp([1, 0],     [1])    ->  0
+#   m4_list_cmp([1, 0],     [1, 0]) ->  0
+#   m4_list_cmp([1, 2],     [1, 0]) ->  1
+#   m4_list_cmp([1, 2, 3],  [1, 2]) ->  1
+#   m4_list_cmp([1, 2, -3], [1, 2]) -> -1
+#   m4_list_cmp([1, 0],     [1, 2]) -> -1
+#   m4_list_cmp([1],        [1, 2]) -> -1
+#   m4_define([xa], [oops])dnl
+#   m4_list_cmp([[0xa]],    [5+5])  -> 0
+#
+# Rather than face the overhead of m4_case, we use a helper function whose
+# expansion includes the name of the macro to invoke on the tail, either
+# m4_ignore or m4_unquote.  This is particularly useful when comparing
+# long lists, since less text is being expanded for deciding when to end
+# recursion.  The recursion is between a pair of macros that alternate
+# which list is trimmed by one element; this is more efficient than
+# calling m4_cdr on both lists from a single macro.  Guarantee exactly
+# one expansion of both lists' side effects.
+#
+# Please keep foreach.m4 in sync with any adjustments made here.
+m4_define([m4_list_cmp],
+[_$0_raw(m4_dquote($1), m4_dquote($2))])
+
+m4_define([_m4_list_cmp_raw],
+[m4_if([$1], [$2], [0], [_m4_list_cmp_1([$1], $2)])])
+
+m4_define([_m4_list_cmp],
+[m4_if([$1], [], [0m4_ignore], [$2], [0], [m4_unquote], [$2m4_ignore])])
+
+m4_define([_m4_list_cmp_1],
+[_m4_list_cmp_2([$2], [m4_shift2($@)], $1)])
+
+m4_define([_m4_list_cmp_2],
+[_m4_list_cmp([$1$3], m4_cmp([$3+0], [$1+0]))(
+  [_m4_list_cmp_1(m4_dquote(m4_shift3($@)), $2)])])
+
+# m4_max(EXPR, ...)
+# m4_min(EXPR, ...)
+# -----------------
+# Return the decimal value of the maximum (or minimum) in a series of
+# integer expressions.
+#
+# M4 1.4.x doesn't provide ?:.  Hence this huge m4_eval.  Avoid m4_eval
+# if both arguments are identical, but be aware of m4_max(0xa, 10) (hence
+# the use of <=, not just <, in the second multiply).
+#
+# Please keep foreach.m4 in sync with any adjustments made here.
+m4_define([m4_max],
+[m4_if([$#], [0], [m4_fatal([too few arguments to $0])],
+       [$#], [1], [m4_eval([$1])],
+       [$#$1], [2$2], [m4_eval([$1])],
+       [$#], [2], [_$0($@)],
+       [_m4_minmax([_$0], $@)])])
+
+m4_define([_m4_max],
+[m4_eval((([$1]) > ([$2])) * ([$1]) + (([$1]) <= ([$2])) * ([$2]))])
+
+m4_define([m4_min],
+[m4_if([$#], [0], [m4_fatal([too few arguments to $0])],
+       [$#], [1], [m4_eval([$1])],
+       [$#$1], [2$2], [m4_eval([$1])],
+       [$#], [2], [_$0($@)],
+       [_m4_minmax([_$0], $@)])])
+
+m4_define([_m4_min],
+[m4_eval((([$1]) < ([$2])) * ([$1]) + (([$1]) >= ([$2])) * ([$2]))])
+
+# _m4_minmax(METHOD, ARG1, ARG2...)
+# ---------------------------------
+# Common recursion code for m4_max and m4_min.  METHOD must be _m4_max
+# or _m4_min, and there must be at least two arguments to combine.
+#
+# Please keep foreach.m4 in sync with any adjustments made here.
+m4_define([_m4_minmax],
+[m4_if([$#], [3], [$1([$2], [$3])],
+       [$0([$1], $1([$2], [$3]), m4_shift3($@))])])
+
+
+# m4_sign(A)
+# ----------
+# The sign of the integer expression A.
+m4_define([m4_sign],
+[m4_eval((([$1]) > 0) - (([$1]) < 0))])
+
+
+
+## ------------------------ ##
+## 14. Version processing.  ##
+## ------------------------ ##
+
+
+# m4_version_unletter(VERSION)
+# ----------------------------
+# Normalize beta version numbers with letters to numeric expressions, which
+# can then be handed to m4_eval for the purpose of comparison.
+#
+#   Nl -> (N+1).-1.(l#)
+#
+# for example:
+#   [2.14a] -> [0,2,14+1,-1,[0r36:a]] -> 2.15.-1.10
+#   [2.14b] -> [0,2,15+1,-1,[0r36:b]] -> 2.15.-1.11
+#   [2.61aa.b] -> [0,2.61,1,-1,[0r36:aa],+1,-1,[0r36:b]] -> 2.62.-1.370.1.-1.11
+#   [08] -> [0,[0r10:0]8] -> 8
+#
+# This macro expects reasonable version numbers, but can handle double
+# letters and does not expand any macros.  Original version strings can
+# use both `.' and `-' separators.
+#
+# Inline constant expansions, to avoid m4_defn overhead.
+# _m4_version_unletter is the real workhorse used by m4_version_compare,
+# but since [0r36:a] and commas are less readable than 10 and dots, we
+# provide a wrapper for human use.
+m4_define([m4_version_unletter],
+[m4_substr(m4_map_args([.m4_eval], m4_unquote(_$0([$1]))), [3])])
+m4_define([_m4_version_unletter],
+[m4_bpatsubst(m4_bpatsubst(m4_translit([[[[0,$1]]]], [.-], [,,]),]dnl
+m4_dquote(m4_dquote(m4_defn([m4_cr_Letters])))[[+],
+	      [+1,-1,[0r36:\&]]), [,0], [,[0r10:0]])])
+
+
+# m4_version_compare(VERSION-1, VERSION-2)
+# ----------------------------------------
+# Compare the two version numbers and expand into
+#  -1 if VERSION-1 < VERSION-2
+#   0 if           =
+#   1 if           >
+#
+# Since _m4_version_unletter does not output side effects, we can
+# safely bypass the overhead of m4_version_cmp.
+m4_define([m4_version_compare],
+[_m4_list_cmp_raw(_m4_version_unletter([$1]), _m4_version_unletter([$2]))])
+
+
+# m4_PACKAGE_NAME
+# m4_PACKAGE_TARNAME
+# m4_PACKAGE_VERSION
+# m4_PACKAGE_STRING
+# m4_PACKAGE_BUGREPORT
+# --------------------
+# If m4sugar/version.m4 is present, then define version strings.  This
+# file is optional, provided by Autoconf but absent in Bison.
+m4_sinclude([m4sugar/version.m4])
+
+
+# m4_version_prereq(VERSION, [IF-OK], [IF-NOT = FAIL])
+# ----------------------------------------------------
+# Check this Autoconf version against VERSION.
+m4_define([m4_version_prereq],
+m4_ifdef([m4_PACKAGE_VERSION],
+[[m4_if(m4_version_compare(]m4_dquote(m4_defn([m4_PACKAGE_VERSION]))[, [$1]),
+	[-1],
+	[m4_default([$3],
+		    [m4_fatal([Autoconf version $1 or higher is required],
+			      [63])])],
+	[$2])]],
+[[m4_fatal([m4sugar/version.m4 not found])]]))
+
+
+## ------------------ ##
+## 15. Set handling.  ##
+## ------------------ ##
+
+# Autoconf likes to create arbitrarily large sets; for example, as of
+# this writing, the configure.ac for coreutils tracks a set of more
+# than 400 AC_SUBST.  How do we track all of these set members,
+# without introducing duplicates?  We could use m4_append_uniq, with
+# the set NAME residing in the contents of the macro NAME.
+# Unfortunately, m4_append_uniq is quadratic for set creation, because
+# it costs O(n) to search the string for each of O(n) insertions; not
+# to mention that with m4 1.4.x, even using m4_append is slow, costing
+# O(n) rather than O(1) per insertion.  Other set operations, not used
+# by Autoconf but still possible by manipulation of the definition
+# tracked in macro NAME, include O(n) deletion of one element and O(n)
+# computation of set size.  Because the set is exposed to the user via
+# the definition of a single macro, we cannot cache any data about the
+# set without risking the cache being invalidated by the user
+# redefining NAME.
+#
+# Can we do better?  Yes, because m4 gives us an O(1) search function
+# for free: ifdef.  Additionally, even m4 1.4.x gives us an O(1)
+# insert operation for free: pushdef.  But to use these, we must
+# represent the set via a group of macros; to keep the set consistent,
+# we must hide the set so that the user can only manipulate it through
+# accessor macros.  The contents of the set are maintained through two
+# access points; _m4_set([name]) is a pushdef stack of values in the
+# set, useful for O(n) traversal of the set contents; while the
+# existence of _m4_set([name],value) with no particular value is
+# useful for O(1) querying of set membership.  And since the user
+# cannot externally manipulate the set, we are free to add additional
+# caching macros for other performance improvements.  Deletion can be
+# O(1) per element rather than O(n), by reworking the definition of
+# _m4_set([name],value) to be 0 or 1 based on current membership, and
+# adding _m4_set_cleanup(name) to defer the O(n) cleanup of
+# _m4_set([name]) until we have another reason to do an O(n)
+# traversal.  The existence of _m4_set_cleanup(name) can then be used
+# elsewhere to determine if we must dereference _m4_set([name],value),
+# or assume that definition implies set membership.  Finally, size can
+# be tracked in an O(1) fashion with _m4_set_size(name).
+#
+# The quoting in _m4_set([name],value) is chosen so that there is no
+# ambiguity with a set whose name contains a comma, and so that we can
+# supply the value via _m4_defn([_m4_set([name])]) without needing any
+# quote manipulation.
+
+# m4_set_add(SET, VALUE, [IF-UNIQ], [IF-DUP])
+# -------------------------------------------
+# Add VALUE as an element of SET.  Expand IF-UNIQ on the first
+# addition, and IF-DUP if it is already in the set.  Addition of one
+# element is O(1), such that overall set creation is O(n).
+#
+# We do not want to add a duplicate for a previously deleted but
+# unpruned element, but it is just as easy to check existence directly
+# as it is to query _m4_set_cleanup($1).
+m4_define([m4_set_add],
+[m4_ifdef([_m4_set([$1],$2)],
+	  [m4_if(m4_indir([_m4_set([$1],$2)]), [0],
+		 [m4_define([_m4_set([$1],$2)],
+			    [1])_m4_set_size([$1], [m4_incr])$3], [$4])],
+	  [m4_define([_m4_set([$1],$2)],
+		     [1])m4_pushdef([_m4_set([$1])],
+				    [$2])_m4_set_size([$1], [m4_incr])$3])])
+
+# m4_set_add_all(SET, VALUE...)
+# -----------------------------
+# Add each VALUE into SET.  This is O(n) in the number of VALUEs, and
+# can be faster than calling m4_set_add for each VALUE.
+#
+# Implement two recursion helpers; the check variant is slower but
+# handles the case where an element has previously been removed but
+# not pruned.  The recursion helpers ignore their second argument, so
+# that we can use the faster m4_shift2 and 2 arguments, rather than
+# _m4_shift2 and one argument, as the signal to end recursion.
+#
+# Please keep foreach.m4 in sync with any adjustments made here.
+m4_define([m4_set_add_all],
+[m4_define([_m4_set_size($1)], m4_eval(m4_set_size([$1])
+  + m4_len(m4_ifdef([_m4_set_cleanup($1)], [_$0_check], [_$0])([$1], $@))))])
+
+m4_define([_m4_set_add_all],
+[m4_if([$#], [2], [],
+       [m4_ifdef([_m4_set([$1],$3)], [],
+		 [m4_define([_m4_set([$1],$3)], [1])m4_pushdef([_m4_set([$1])],
+	   [$3])-])$0([$1], m4_shift2($@))])])
+
+m4_define([_m4_set_add_all_check],
+[m4_if([$#], [2], [],
+       [m4_set_add([$1], [$3])$0([$1], m4_shift2($@))])])
+
+# m4_set_contains(SET, VALUE, [IF-PRESENT], [IF-ABSENT])
+# ------------------------------------------------------
+# Expand IF-PRESENT if SET contains VALUE, otherwise expand IF-ABSENT.
+# This is always O(1).
+m4_define([m4_set_contains],
+[m4_ifdef([_m4_set_cleanup($1)],
+	  [m4_if(m4_ifdef([_m4_set([$1],$2)],
+		    [m4_indir([_m4_set([$1],$2)])], [0]), [1], [$3], [$4])],
+	  [m4_ifdef([_m4_set([$1],$2)], [$3], [$4])])])
+
+# m4_set_contents(SET, [SEP])
+# ---------------------------
+# Expand to a single string containing all the elements in SET,
+# separated by SEP, without modifying SET.  No provision is made for
+# disambiguating set elements that contain non-empty SEP as a
+# sub-string, or for recognizing a set that contains only the empty
+# string.  Order of the output is not guaranteed.  If any elements
+# have been previously removed from the set, this action will prune
+# the unused memory.  This is O(n) in the size of the set before
+# pruning.
+#
+# Use _m4_popdef for speed.  The existence of _m4_set_cleanup($1)
+# determines which version of _1 helper we use.
+m4_define([m4_set_contents],
+[m4_set_map_sep([$1], [], [], [[$2]])])
+
+# _m4_set_contents_1(SET)
+# _m4_set_contents_1c(SET)
+# _m4_set_contents_2(SET, [PRE], [POST], [SEP])
+# ---------------------------------------------
+# Expand to a list of quoted elements currently in the set, each
+# surrounded by PRE and POST, and moving SEP in front of PRE on
+# recursion.  To avoid nesting limit restrictions, the algorithm must
+# be broken into two parts; _1 destructively copies the stack in
+# reverse into _m4_set_($1), producing no output; then _2
+# destructively copies _m4_set_($1) back into the stack in reverse.
+# If no elements were deleted, then this visits the set in the order
+# that elements were inserted.  Behavior is undefined if PRE/POST/SEP
+# tries to recursively list or modify SET in any way other than
+# calling m4_set_remove on the current element.  Use _1 if all entries
+# in the stack are guaranteed to be in the set, and _1c to prune
+# removed entries.  Uses _m4_defn and _m4_popdef for speed.
+m4_define([_m4_set_contents_1],
+[_m4_stack_reverse([_m4_set([$1])], [_m4_set_($1)])])
+
+m4_define([_m4_set_contents_1c],
+[m4_ifdef([_m4_set([$1])],
+	  [m4_set_contains([$1], _m4_defn([_m4_set([$1])]),
+		   [m4_pushdef([_m4_set_($1)], _m4_defn([_m4_set([$1])]))],
+		   [_m4_popdef([_m4_set([$1],]_m4_defn(
+      [_m4_set([$1])])[)])])_m4_popdef([_m4_set([$1])])$0([$1])],
+	  [_m4_popdef([_m4_set_cleanup($1)])])])
+
+m4_define([_m4_set_contents_2],
+[_m4_stack_reverse([_m4_set_($1)], [_m4_set([$1])],
+  [$2[]_m4_defn([_m4_set_($1)])$3], [$4[]])])
+
+# m4_set_delete(SET)
+# ------------------
+# Delete all elements in SET, and reclaim any memory occupied by the
+# set.  This is O(n) in the set size.
+#
+# Use _m4_defn and _m4_popdef for speed.
+m4_define([m4_set_delete],
+[m4_ifdef([_m4_set([$1])],
+	  [_m4_popdef([_m4_set([$1],]_m4_defn([_m4_set([$1])])[)],
+		      [_m4_set([$1])])$0([$1])],
+	  [m4_ifdef([_m4_set_cleanup($1)],
+		    [_m4_popdef([_m4_set_cleanup($1)])])m4_ifdef(
+		    [_m4_set_size($1)],
+		    [_m4_popdef([_m4_set_size($1)])])])])
+
+# m4_set_difference(SET1, SET2)
+# -----------------------------
+# Produce a LIST of quoted elements that occur in SET1 but not SET2.
+# Output a comma prior to any elements, to distinguish the empty
+# string from no elements.  This can be directly used as a series of
+# arguments, such as for m4_join, or wrapped inside quotes for use in
+# m4_foreach.  Order of the output is not guaranteed.
+#
+# Short-circuit the idempotence relation.
+m4_define([m4_set_difference],
+[m4_if([$1], [$2], [], [m4_set_map_sep([$1], [_$0([$2],], [)])])])
+
+m4_define([_m4_set_difference],
+[m4_set_contains([$1], [$2], [], [,[$2]])])
+
+# m4_set_dump(SET, [SEP])
+# -----------------------
+# Expand to a single string containing all the elements in SET,
+# separated by SEP, then delete SET.  In general, if you only need to
+# list the contents once, this is faster than m4_set_contents.  No
+# provision is made for disambiguating set elements that contain
+# non-empty SEP as a sub-string.  Order of the output is not
+# guaranteed.  This is O(n) in the size of the set before pruning.
+#
+# Use _m4_popdef for speed.  Use existence of _m4_set_cleanup($1) to
+# decide if more expensive recursion is needed.
+m4_define([m4_set_dump],
+[m4_ifdef([_m4_set_size($1)],
+	  [_m4_popdef([_m4_set_size($1)])])m4_ifdef([_m4_set_cleanup($1)],
+    [_$0_check], [_$0])([$1], [], [$2])])
+
+# _m4_set_dump(SET, [SEP], [PREP])
+# _m4_set_dump_check(SET, [SEP], [PREP])
+# --------------------------------------
+# Print SEP and the current element, then delete the element and
+# recurse with empty SEP changed to PREP.  The check variant checks
+# whether the element has been previously removed.  Use _m4_defn and
+# _m4_popdef for speed.
+m4_define([_m4_set_dump],
+[m4_ifdef([_m4_set([$1])],
+	  [[$2]_m4_defn([_m4_set([$1])])_m4_popdef([_m4_set([$1],]_m4_defn(
+		[_m4_set([$1])])[)], [_m4_set([$1])])$0([$1], [$2$3])])])
+
+m4_define([_m4_set_dump_check],
+[m4_ifdef([_m4_set([$1])],
+	  [m4_set_contains([$1], _m4_defn([_m4_set([$1])]),
+			   [[$2]_m4_defn([_m4_set([$1])])])_m4_popdef(
+    [_m4_set([$1],]_m4_defn([_m4_set([$1])])[)],
+    [_m4_set([$1])])$0([$1], [$2$3])],
+	  [_m4_popdef([_m4_set_cleanup($1)])])])
+
+# m4_set_empty(SET, [IF-EMPTY], [IF-ELEMENTS])
+# --------------------------------------------
+# Expand IF-EMPTY if SET has no elements, otherwise IF-ELEMENTS.
+m4_define([m4_set_empty],
+[m4_ifdef([_m4_set_size($1)],
+	  [m4_if(m4_indir([_m4_set_size($1)]), [0], [$2], [$3])], [$2])])
+
+# m4_set_foreach(SET, VAR, ACTION)
+# --------------------------------
+# For each element of SET, define VAR to the element and expand
+# ACTION.  ACTION should not recursively list SET's contents, add
+# elements to SET, nor delete any element from SET except the one
+# currently in VAR.  The order that the elements are visited in is not
+# guaranteed.  This is faster than the corresponding m4_foreach([VAR],
+#   m4_indir([m4_dquote]m4_set_listc([SET])), [ACTION])
+m4_define([m4_set_foreach],
+[m4_pushdef([$2])m4_set_map_sep([$1],
+[m4_define([$2],], [)$3])m4_popdef([$2])])
+
+# m4_set_intersection(SET1, SET2)
+# -------------------------------
+# Produce a LIST of quoted elements that occur in both SET1 or SET2.
+# Output a comma prior to any elements, to distinguish the empty
+# string from no elements.  This can be directly used as a series of
+# arguments, such as for m4_join, or wrapped inside quotes for use in
+# m4_foreach.  Order of the output is not guaranteed.
+#
+# Iterate over the smaller set, and short-circuit the idempotence
+# relation.
+m4_define([m4_set_intersection],
+[m4_if([$1], [$2], [m4_set_listc([$1])],
+       m4_eval(m4_set_size([$2]) < m4_set_size([$1])), [1], [$0([$2], [$1])],
+       [m4_set_map_sep([$1], [_$0([$2],], [)])])])
+
+m4_define([_m4_set_intersection],
+[m4_set_contains([$1], [$2], [,[$2]])])
+
+# m4_set_list(SET)
+# m4_set_listc(SET)
+# -----------------
+# Produce a LIST of quoted elements of SET.  This can be directly used
+# as a series of arguments, such as for m4_join or m4_set_add_all, or
+# wrapped inside quotes for use in m4_foreach or m4_map.  With
+# m4_set_list, there is no way to distinguish an empty set from a set
+# containing only the empty string; with m4_set_listc, a leading comma
+# is output if there are any elements.
+m4_define([m4_set_list],
+[m4_set_map_sep([$1], [], [], [,])])
+
+m4_define([m4_set_listc],
+[m4_set_map_sep([$1], [,])])
+
+# m4_set_map(SET, ACTION)
+# -----------------------
+# For each element of SET, expand ACTION with a single argument of the
+# current element.  ACTION should not recursively list SET's contents,
+# add elements to SET, nor delete any element from SET except the one
+# passed as an argument.  The order that the elements are visited in
+# is not guaranteed.  This is faster than either of the corresponding
+#   m4_map_args([ACTION]m4_set_listc([SET]))
+#   m4_set_foreach([SET], [VAR], [ACTION(m4_defn([VAR]))])
+m4_define([m4_set_map],
+[m4_set_map_sep([$1], [$2(], [)])])
+
+# m4_set_map_sep(SET, [PRE], [POST], [SEP])
+# -----------------------------------------
+# For each element of SET, expand PRE[value]POST[], and expand SEP
+# between elements.
+m4_define([m4_set_map_sep],
+[m4_ifdef([_m4_set_cleanup($1)], [_m4_set_contents_1c],
+	  [_m4_set_contents_1])([$1])_m4_set_contents_2($@)])
+
+# m4_set_remove(SET, VALUE, [IF-PRESENT], [IF-ABSENT])
+# ----------------------------------------------------
+# If VALUE is an element of SET, delete it and expand IF-PRESENT.
+# Otherwise expand IF-ABSENT.  Deleting a single value is O(1),
+# although it leaves memory occupied until the next O(n) traversal of
+# the set which will compact the set.
+#
+# Optimize if the element being removed is the most recently added,
+# since defining _m4_set_cleanup($1) slows down so many other macros.
+# In particular, this plays well with m4_set_foreach and m4_set_map.
+m4_define([m4_set_remove],
+[m4_set_contains([$1], [$2], [_m4_set_size([$1],
+    [m4_decr])m4_if(_m4_defn([_m4_set([$1])]), [$2],
+		    [_m4_popdef([_m4_set([$1],$2)], [_m4_set([$1])])],
+		    [m4_define([_m4_set_cleanup($1)])m4_define(
+		      [_m4_set([$1],$2)], [0])])$3], [$4])])
+
+# m4_set_size(SET)
+# ----------------
+# Expand to the number of elements currently in SET.  This operation
+# is O(1), and thus more efficient than m4_count(m4_set_list([SET])).
+m4_define([m4_set_size],
+[m4_ifdef([_m4_set_size($1)], [m4_indir([_m4_set_size($1)])], [0])])
+
+# _m4_set_size(SET, ACTION)
+# -------------------------
+# ACTION must be either m4_incr or m4_decr, and the size of SET is
+# changed accordingly.  If the set is empty, ACTION must not be
+# m4_decr.
+m4_define([_m4_set_size],
+[m4_define([_m4_set_size($1)],
+	   m4_ifdef([_m4_set_size($1)], [$2(m4_indir([_m4_set_size($1)]))],
+		    [1]))])
+
+# m4_set_union(SET1, SET2)
+# ------------------------
+# Produce a LIST of double quoted elements that occur in either SET1
+# or SET2, without duplicates.  Output a comma prior to any elements,
+# to distinguish the empty string from no elements.  This can be
+# directly used as a series of arguments, such as for m4_join, or
+# wrapped inside quotes for use in m4_foreach.  Order of the output is
+# not guaranteed.
+#
+# We can rely on the fact that m4_set_listc prunes SET1, so we don't
+# need to check _m4_set([$1],element) for 0.  Short-circuit the
+# idempotence relation.
+m4_define([m4_set_union],
+[m4_set_listc([$1])m4_if([$1], [$2], [],
+  [m4_set_map_sep([$2], [_$0([$1],], [)])])])
+
+m4_define([_m4_set_union],
+[m4_ifdef([_m4_set([$1],$2)], [], [,[$2]])])
+
+
+