167 Commits
Author SHA1 Message Date
dependabot[bot] a8a44278b8 chore(deps): bump actions/checkout in the github-actions group
Bumps the github-actions group with 1 update: [actions/checkout](https://github.com/actions/checkout).


Updates `actions/checkout` from 6.0.3 to 7.0.0
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/df4cb1c069e1874edd31b4311f1884172cec0e10...9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 7.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-24 07:14:55 -04:00
dependabot[bot] 94a5995c68 chore(deps): bump github/codeql-action in the github-actions group
Bumps the github-actions group with 1 update: [github/codeql-action](https://github.com/github/codeql-action).


Updates `github/codeql-action` from 4.36.1 to 4.36.2
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/87557b9c84dde89fdd9b10e88954ac2f4248e463...8aad20d150bbac5944a9f9d289da16a4b0d87c1e)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.36.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-08 10:49:26 -04:00
dependabot[bot] 20beab090c chore(deps): bump the github-actions group with 2 updates
Bumps the github-actions group with 2 updates: [actions/checkout](https://github.com/actions/checkout) and [github/codeql-action](https://github.com/github/codeql-action).


Updates `actions/checkout` from 6.0.2 to 6.0.3
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/de0fac2e4500dabe0009e67214ff5f5447ce83dd...df4cb1c069e1874edd31b4311f1884172cec0e10)

Updates `github/codeql-action` from 4.36.0 to 4.36.1
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/7211b7c8077ea37d8641b6271f6a365a22a5fbfa...87557b9c84dde89fdd9b10e88954ac2f4248e463)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 6.0.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: github/codeql-action
  dependency-version: 4.36.1
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-02 16:05:26 -04:00
Tuukka Pasanen 4c7405e3b4 refactor: Add SPDX-License-Identifiers for files
Add SPDX-License-Identifiers with value BSD-3-CLause-flex to source
files in project.
2026-05-26 03:01:21 -07:00
dependabot[bot] 65dce1b907 chore(deps): bump github/codeql-action in the github-actions group
Bumps the github-actions group with 1 update: [github/codeql-action](https://github.com/github/codeql-action).


Updates `github/codeql-action` from 4.35.5 to 4.36.0
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/9e0d7b8d25671d64c341c19c0152d693099fb5ba...7211b7c8077ea37d8641b6271f6a365a22a5fbfa)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.36.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-05-26 02:27:17 -07:00
dependabot[bot] a5b010582c chore(deps): bump github/codeql-action
Bumps the github-actions group with 1 update in the / directory: [github/codeql-action](https://github.com/github/codeql-action).


Updates `github/codeql-action` from 4.35.3 to 4.35.5
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/e46ed2cbd01164d986452f91f178727624ae40d7...9e0d7b8d25671d64c341c19c0152d693099fb5ba)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.35.4
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-05-19 05:40:49 -07:00
Will Estes c2edac78db chore: add sponsorship 2026-05-12 20:31:56 -04:00
David Pokora of Trail of Bits, in collaboration with Anthropic 257c3f083e fix: reset _sf_top_ix when scan-flags stack is re-initialized
In sf_init(), the global stack index _sf_top_ix is not reset when the
scan-flags stack is re-initialized. When flex_main() is called more
than once in the same process, sf_init() allocates a fresh 32-entry
buffer but writes at the stale index from the previous invocation,
causing a 4-byte heap-buffer-overflow write past the end of the
allocation. An attacker who controls the flex input grammar can
influence the overflow offset (proportional to the number of '('
characters in the rules section), though the written value is always
zero. This results in an out-of-bounds heap write that could corrupt
adjacent heap metadata or object fields.
2026-05-08 14:50:35 -04:00
dependabot[bot] 0725218038 chore(deps): bump github/codeql-action in the github-actions group
Bumps the github-actions group with 1 update: [github/codeql-action](https://github.com/github/codeql-action).


Updates `github/codeql-action` from 4.35.2 to 4.35.3
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/95e58e9a2cdfd71adc6e0353d5c52f41a045d225...e46ed2cbd01164d986452f91f178727624ae40d7)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.35.3
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-05-04 14:48:14 -04:00
dependabot[bot] bdb5a14b57 chore(deps): bump github/codeql-action in the github-actions group
Bumps the github-actions group with 1 update: [github/codeql-action](https://github.com/github/codeql-action).


Updates `github/codeql-action` from 4.35.1 to 4.35.2
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/c10b8064de6f491fea524254123dbe5e09572f13...95e58e9a2cdfd71adc6e0353d5c52f41a045d225)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.35.2
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-30 08:22:46 -04:00
dependabot[bot] 13c8018e38 chore(deps): bump github/codeql-action in the github-actions group
Bumps the github-actions group with 1 update: [github/codeql-action](https://github.com/github/codeql-action).


Updates `github/codeql-action` from 4.32.5 to 4.35.1
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/c793b717bc78562f491db7b0e93a3a178b099162...c10b8064de6f491fea524254123dbe5e09572f13)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.35.1
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-13 13:37:38 -04:00
Mightyjo 38e2465035 chore: fix CPAREN typo in YY_G macro call 2026-04-08 14:12:59 -04:00
dependabot[bot] 3241307056 chore(deps): bump github/codeql-action in the github-actions group
Bumps the github-actions group with 1 update: [github/codeql-action](https://github.com/github/codeql-action).


Updates `github/codeql-action` from 4.32.4 to 4.32.5
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/89a39a4e59826350b863aa6b6252a07ad50cf83e...c793b717bc78562f491db7b0e93a3a178b099162)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 4.32.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-04-08 14:08:24 -04:00
dependabot[bot] 9fcb2a4d09 chore(deps): bump the github-actions group with 2 updates
Bumps the github-actions group with 2 updates: [actions/checkout](https://github.com/actions/checkout) and [github/codeql-action](https://github.com/github/codeql-action).


Updates `actions/checkout` from 5.0.0 to 6.0.2
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/08c6903cd8c0fde910a37f88322edcfb5dd907a8...de0fac2e4500dabe0009e67214ff5f5447ce83dd)

Updates `github/codeql-action` from 3.29.10 to 4.32.4
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/96f518a34f7a870018057716cc4d7a5c014bd61c...89a39a4e59826350b863aa6b6252a07ad50cf83e)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 6.0.2
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
- dependency-name: github/codeql-action
  dependency-version: 4.32.4
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-24 11:52:41 -05:00
Mightyjo 575e0f42dd test\!: UNDO Turn off tests for fake Go backend
This prevents the mock Go skeleton currently on the mainline from causing test errors.
It should be reverted when a real Go skeleton and backend are implmemented.
2026-02-22 15:51:00 -05:00
Mightyjo c749bd29a7 test: Rename alloc_extra_r.l to match its reentrant behavior 2026-02-20 09:01:31 -05:00
Mightyjo a75d893a68 tests: fix warnings about suffix rule prerequisites 2026-02-20 06:35:56 -05:00
dependabot[bot] 790dccd637 chore(deps): bump the github-actions group across 1 directory with 2 updates
Bumps the github-actions group with 2 updates in the / directory: [actions/checkout](https://github.com/actions/checkout) and [github/codeql-action](https://github.com/github/codeql-action).


Updates `actions/checkout` from 4.2.2 to 5.0.0
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/11bd71901bbe5b1630ceea73d27597364c9af683...08c6903cd8c0fde910a37f88322edcfb5dd907a8)

Updates `github/codeql-action` from 3.28.18 to 3.29.10
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/ff0a06e83cb2de871e5a09832bc6a81e7276941f...96f518a34f7a870018057716cc4d7a5c014bd61c)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: 5.0.0
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
- dependency-name: github/codeql-action
  dependency-version: 3.29.10
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-02-20 06:25:21 -05:00
Richard Barnes bf254c75b1 Match malloc signature to its use 2025-05-26 12:08:09 -04:00
dependabot[bot] 8a59edae27 chore(deps): bump github/codeql-action in the github-actions group
Bumps the github-actions group with 1 update: [github/codeql-action](https://github.com/github/codeql-action).


Updates `github/codeql-action` from 3.28.13 to 3.28.18
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/1b549b9259bda1cb5ddde3b41741a82a2d15a841...ff0a06e83cb2de871e5a09832bc6a81e7276941f)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-version: 3.28.18
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-22 13:59:08 -04:00
Javier Maestro cff048484c fix: noline for %top directives
Fixes #463 and #268

When using the --noline flag or the %option noline, flex was failing to
suppress the %top line directives.

There was an if-guard missing in the code that adds the line directives
to the top_buf. This commit fixes it.
2025-05-17 11:01:09 -04:00
dependabot[bot] 1eb2280120 chore(deps): bump github/codeql-action in the github-actions group
Bumps the github-actions group with 1 update: [github/codeql-action](https://github.com/github/codeql-action).


Updates `github/codeql-action` from 3.28.11 to 3.28.13
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/6bb031afdd8eb862ea3fc1848194185e076637e5...1b549b9259bda1cb5ddde3b41741a82a2d15a841)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-17 10:54:47 -04:00
Ross Burton dff2e1b19f build(tests): add missing parser->scanner dependencies
With sufficient parallelism and `make --shuffle` to reorder builds the
test suite occasionally fails to build with errors like this:

 tests/bison_yylval_parser.y:36:10: fatal error: bison_yylval_scanner.h: No such file or directory
    36 | #include "bison_yylval_scanner.h"

Solve this by adding the missing dependencies to the *_parser.o targets
on the _scanner.h files.
2025-03-27 16:43:30 -04:00
dependabot[bot] 7b5b6690da chore(deps): bump github/codeql-action
Bumps the github-actions group with 1 update in the / directory: [github/codeql-action](https://github.com/github/codeql-action).


Updates `github/codeql-action` from 3.28.1 to 3.28.11
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/b6a472f63d85b9c78a3ac5e89422239fc15e9b3c...6bb031afdd8eb862ea3fc1848194185e076637e5)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-03-27 16:41:35 -04:00
dependabot[bot] 051ab9ed8c chore(deps): bump github/codeql-action in the github-actions group
Bumps the github-actions group with 1 update: [github/codeql-action](https://github.com/github/codeql-action).


Updates `github/codeql-action` from 3.28.0 to 3.28.1
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/48ab28a6f5dbc2a99bf1e0131198dd8f1df78169...b6a472f63d85b9c78a3ac5e89422239fc15e9b3c)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-01-14 16:17:39 -05:00
Mightyjo c0c89c1265 build(ci): Build nightly distribution tarballs. 2025-01-08 13:35:46 -05:00
Mightyjo 25a5ade6cd build: Remove slugs from mkskel.sh version numbers 2025-01-06 16:23:27 -05:00
dependabot[bot] a79d85283b chore(deps): bump github/codeql-action
Bumps the github-actions group with 1 update in the / directory: [github/codeql-action](https://github.com/github/codeql-action).


Updates `github/codeql-action` from 3.27.5 to 3.28.0
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/f09c1c0a94de965c15400f5634aa42fac8fb8f88...48ab28a6f5dbc2a99bf1e0131198dd8f1df78169)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-23 11:57:13 -05:00
dependabot[bot] 6fc88bc133 chore(deps): bump github/codeql-action
Bumps the github-actions group with 1 update in the / directory: [github/codeql-action](https://github.com/github/codeql-action).


Updates `github/codeql-action` from 3.27.1 to 3.27.5
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/4f3212b61783c3c68e8309a0f18a699764811cda...f09c1c0a94de965c15400f5634aa42fac8fb8f88)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-12-03 15:02:17 -05:00
dependabot[bot] d29a6c02d4 chore(deps): bump the github-actions group across 1 directory with 2 updates
Bumps the github-actions group with 2 updates in the / directory: [actions/checkout](https://github.com/actions/checkout) and [github/codeql-action](https://github.com/github/codeql-action).


Updates `actions/checkout` from 4.2.1 to 4.2.2
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871...11bd71901bbe5b1630ceea73d27597364c9af683)

Updates `github/codeql-action` from 3.26.13 to 3.27.1
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/f779452ac5af1c261dce0346a8f964149f49322b...4f3212b61783c3c68e8309a0f18a699764811cda)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-11-11 15:53:12 -05:00
Explorer09 7191257ddc build: Update ax_prog_cc_for_build.m4 with upstream
The ax_prog_cc_for_build.m4 module from upstream contains a typo fix.
Beyond that, there are no code changes.
2024-11-03 07:14:29 -05:00
dependabot[bot] 21eee2c2c1 chore(deps): bump the github-actions group with 2 updates
Bumps the github-actions group with 2 updates: [actions/checkout](https://github.com/actions/checkout) and [github/codeql-action](https://github.com/github/codeql-action).


Updates `actions/checkout` from 4.2.0 to 4.2.1
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/d632683dd7b4114ad314bca15554477dd762a938...eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871)

Updates `github/codeql-action` from 3.26.11 to 3.26.13
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/6db8d6351fd0be61f9ed8ebd12ccd35dcec51fea...f779452ac5af1c261dce0346a8f964149f49322b)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-14 10:58:56 -04:00
dependabot[bot] 91eb0d0d84 chore(deps): bump github/codeql-action in the github-actions group
Bumps the github-actions group with 1 update: [github/codeql-action](https://github.com/github/codeql-action).


Updates `github/codeql-action` from 3.26.10 to 3.26.11
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/e2b3eafc8d227b0241d48be5f425d47c2d750a13...6db8d6351fd0be61f9ed8ebd12ccd35dcec51fea)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-07 10:37:07 -04:00
dependabot[bot] 4cadf6d6e7 chore(deps): bump the github-actions group with 2 updates
Bumps the github-actions group with 2 updates: [actions/checkout](https://github.com/actions/checkout) and [github/codeql-action](https://github.com/github/codeql-action).


Updates `actions/checkout` from 4.1.7 to 4.2.0
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/692973e3d937129bcbf40652eb9f2f61becf3332...d632683dd7b4114ad314bca15554477dd762a938)

Updates `github/codeql-action` from 3.26.8 to 3.26.10
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/294a9d92911152fe08befb9ec03e240add280cb3...e2b3eafc8d227b0241d48be5f425d47c2d750a13)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-10-01 13:29:59 -04:00
dependabot[bot] 1cd24f8a47 chore(deps): bump github/codeql-action in the github-actions group
Bumps the github-actions group with 1 update: [github/codeql-action](https://github.com/github/codeql-action).


Updates `github/codeql-action` from 3.26.7 to 3.26.8
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/8214744c546c1e5c8f03dde8fab3a7353211988d...294a9d92911152fe08befb9ec03e240add280cb3)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-24 16:48:57 -04:00
dependabot[bot] 396a2bfb37 chore(deps): bump github/codeql-action
Bumps the github-actions group with 1 update in the / directory: [github/codeql-action](https://github.com/github/codeql-action).


Updates `github/codeql-action` from 3.26.5 to 3.26.7
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/2c779ab0d087cd7fe7b826087247c2c81f27bfa6...8214744c546c1e5c8f03dde8fab3a7353211988d)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-16 12:54:01 -04:00
dependabot[bot] 9433e4f65f chore(deps): bump github/codeql-action in the github-actions group
Bumps the github-actions group with 1 update: [github/codeql-action](https://github.com/github/codeql-action).


Updates `github/codeql-action` from 3.26.2 to 3.26.5
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/429e1977040da7a23b6822b13c129cd1ba93dbb2...2c779ab0d087cd7fe7b826087247c2c81f27bfa6)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-27 18:33:23 -04:00
dependabot[bot] 48371b32a9 chore(deps): bump github/codeql-action in the github-actions group
Bumps the github-actions group with 1 update: [github/codeql-action](https://github.com/github/codeql-action).


Updates `github/codeql-action` from 3.26.0 to 3.26.2
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/eb055d739abdc2e8de2e5f4ba1a8b246daa779aa...429e1977040da7a23b6822b13c129cd1ba93dbb2)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-19 18:21:41 -04:00
dependabot[bot] 719a1cafc6 chore(deps): bump github/codeql-action in the github-actions group
Bumps the github-actions group with 1 update: [github/codeql-action](https://github.com/github/codeql-action).


Updates `github/codeql-action` from 3.25.15 to 3.26.0
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/afb54ba388a7dca6ecae48f608c4ff05ff4cc77a...eb055d739abdc2e8de2e5f4ba1a8b246daa779aa)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-08-13 06:55:08 -04:00
Nikolaos Chatzikonstantinou 546d905feb Update flex.texi 2024-08-10 11:18:39 -04:00
dependabot[bot] 06f1ee7ee8 chore(deps): bump github/codeql-action
Bumps the github-actions group with 1 update in the / directory: [github/codeql-action](https://github.com/github/codeql-action).


Updates `github/codeql-action` from 3.25.11 to 3.25.15
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/b611370bb5703a7efb587f9d136a52ea24c5c38c...afb54ba388a7dca6ecae48f608c4ff05ff4cc77a)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-31 16:09:09 -04:00
dependabot[bot] 18fe45eaa4 chore(deps): bump github/codeql-action in the github-actions group
Bumps the github-actions group with 1 update: [github/codeql-action](https://github.com/github/codeql-action).


Updates `github/codeql-action` from 3.25.10 to 3.25.11
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/23acc5c183826b7a8a97bce3cecc52db901f8251...b611370bb5703a7efb587f9d136a52ea24c5c38c)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-04 09:15:54 -04:00
dependabot[bot] ae83246128 chore(deps): bump the github-actions group with 2 updates
Bumps the github-actions group with 2 updates: [actions/checkout](https://github.com/actions/checkout) and [github/codeql-action](https://github.com/github/codeql-action).


Updates `actions/checkout` from 4.1.6 to 4.1.7
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/a5ac7e51b41094c92402da3b24376905380afc29...692973e3d937129bcbf40652eb9f2f61becf3332)

Updates `github/codeql-action` from 3.25.8 to 3.25.10
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/2e230e8fe0ad3a14a340ad0815ddb96d599d2aff...23acc5c183826b7a8a97bce3cecc52db901f8251)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-17 19:45:30 -04:00
dependabot[bot] 203af5cfe5 chore(deps): bump github/codeql-action in the github-actions group
Bumps the github-actions group with 1 update: [github/codeql-action](https://github.com/github/codeql-action).


Updates `github/codeql-action` from 3.25.7 to 3.25.8
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/f079b8493333aace61c81488f8bd40919487bd9f...2e230e8fe0ad3a14a340ad0815ddb96d599d2aff)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-10 10:51:52 -04:00
dependabot[bot] c6114324f9 chore(deps): bump github/codeql-action in the github-actions group
Bumps the github-actions group with 1 update: [github/codeql-action](https://github.com/github/codeql-action).


Updates `github/codeql-action` from 3.25.6 to 3.25.7
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/9fdb3e49720b44c48891d036bb502feb25684276...f079b8493333aace61c81488f8bd40919487bd9f)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-03 16:18:48 -04:00
dependabot[bot] 05909f20c5 chore(deps): bump the github-actions group with 2 updates
Bumps the github-actions group with 2 updates: [actions/checkout](https://github.com/actions/checkout) and [github/codeql-action](https://github.com/github/codeql-action).


Updates `actions/checkout` from 4.1.5 to 4.1.6
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/44c2b7a8a4ea60a981eaca3cf939b5f4305c123b...a5ac7e51b41094c92402da3b24376905380afc29)

Updates `github/codeql-action` from 3.25.5 to 3.25.6
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/b7cec7526559c32f1616476ff32d17ba4c59b2d6...9fdb3e49720b44c48891d036bb502feb25684276)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-20 13:15:19 -04:00
dependabot[bot] ea5a7719ba chore(deps): bump the github-actions group with 2 updates
Bumps the github-actions group with 2 updates: [actions/checkout](https://github.com/actions/checkout) and [github/codeql-action](https://github.com/github/codeql-action).


Updates `actions/checkout` from 4.1.4 to 4.1.5
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/0ad4b8fadaa221de15dcec353f45205ec38ea70b...44c2b7a8a4ea60a981eaca3cf939b5f4305c123b)

Updates `github/codeql-action` from 3.25.3 to 3.25.5
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/d39d31e687223d841ef683f52467bd88e9b21c14...b7cec7526559c32f1616476ff32d17ba4c59b2d6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-05-13 13:21:24 -04:00
Explorer09 74a132156c fix(build): Replace obsolete Autoconf macros
Replace two obsolete Autoconf macro uses that would trigger warnings in
Autoconf 2.70.

The minimum required versions of the Autotools remain the same.
2024-05-10 16:59:02 -04:00
Explorer09 bbe2a15e2d build: Add BUILD_OBJEXT sanity check 2024-05-10 12:52:44 -04:00
Explorer09 787edd4183 build: Update AX_PROG_CC_FOR_BUILD to fix BUILD_EXEEXT problems 2024-05-10 12:52:44 -04:00
Explorer09 2d08e2f469 build: Correct program path in doc/Makefile.am
Prevent help2man from invoking the flex program installed on the
builder's system to generate the man page.
2024-05-09 15:03:16 -04:00
Will Estes 3c70fb6932 fix(build): build man page, even when cross compiling, even on MSWindows 2024-05-09 10:02:08 -04:00
Explorer09 1a7a3e0885 build(tests): Fix ruleset.am regeneration in VPATH build 2024-05-01 12:40:16 -04:00
Explorer09 7e53fea7dc build(doc): Generate man page with fixed program name
When generating the flex man page, fix the program name in the SYNOPSIS
section to 'flex' and not 'stage1flex' or 'flex.exe'. This make it
possible to generate the man page deterministically with a recent enough
'help2man' tool (1.47.1 or later, which supports SOURCE_DATE_EPOCH that
eliminated the last nondeterministic information).

Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
2024-04-30 16:55:57 -04:00
Explorer09 03b5af1572 build(doc): Portable 'flex.1' dependency expression
Avoid the GNU Make specific "| order-only-prerequisite" syntax and use a
portable alternative of having doc/Makefile invoke src/Makefile before
generating the man page.

Note that 'flex.1' man page target does not depend on '$(FLEX)' program
directly - the direct dependency would confuse 'make' and it is a
limitation of the current "recursive makefile" structure.

Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
2024-04-30 16:55:57 -04:00
Explorer09 1ac30394ec build: Append $(WARNINGFLAGS) to AM_CFLAGS
In src/Makefile.am, remove flex_CFLAGS variable, and append
$(WARNINGFLAGS) to AM_CFLAGS. The use of flex_CFLAGS has forced
Automake to rename flex's object files (.o) to have a 'flex-' prefix.
By preventing the rename, the generated src/Makefile.in can be about
37 kB smaller.

Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
2024-04-30 13:55:53 -04:00
Explorer09 025095c847 refactor: Unify boolean arrays into 'char[]' type
They were either 'int[]' or 'bool[]'. In C, it is suboptimal to use
'bool' types in arrays as the arrays would not be optimized for size or
speed.

Redefine the boolean array variables to use 'char' array instead. As we
are allocating them in 'char' array type, the macros
reallocate_bool_array() and allocate_bool_array() would draw confusion.
Replace the use of reallocate_bool_array() to reallocate_array().
2024-04-30 18:51:26 +08:00
Explorer09 3c97166fbd refactor: Rename scinstal() 'xcluflg' parameter
It meant "exclusive flag" but was abbreviated poorly.
We don't have tight constraints on variable naming now, so rename it to
'sc_is_exclusive'.
Also use 'bool' type for the parameter.
2024-04-30 18:51:26 +08:00
Explorer09 b7d76db200 refactor: Use 'bool' type for many internal flags
They were 'int' type variables that should be modernized to use 'bool'.
Also limit variable scope if they are used in only one file.
2024-04-29 17:50:37 -04:00
Explorer09 dca87d9b1f refactor: Merge allocate_array() and reallocate_array() into one.
Will reduce code size, since both function would call reallocarray()
anyway.
2024-04-29 17:42:23 -04:00
Wiktor Garbacz cab0bbc85c scanner: fix buffer stack popping in yylex_destroy 2024-04-29 17:00:56 -04:00
dependabot[bot] f99d327117 chore(deps): bump the github-actions group with 2 updates
Bumps the github-actions group with 2 updates: [actions/checkout](https://github.com/actions/checkout) and [github/codeql-action](https://github.com/github/codeql-action).


Updates `actions/checkout` from 4.1.3 to 4.1.4
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/1d96c772d19495a3b5c517cd2bc0cb401ea0529f...0ad4b8fadaa221de15dcec353f45205ec38ea70b)

Updates `github/codeql-action` from 3.25.1 to 3.25.3
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/c7f9125735019aa87cfc361530512d50ea439c71...d39d31e687223d841ef683f52467bd88e9b21c14)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-29 14:56:50 -04:00
Explorer09 e241be63dd refactor: Expand and remove {re,}allocate_dfaacc_union() macros
The macros are only used once.
2024-04-27 09:58:29 -04:00
Explorer09 3adb336992 refactor: Make functions in gen.c static...
... except make_tables() which is called from outside gen.c.
2024-04-27 09:51:13 -04:00
Explorer09 1f27fff775 refactor: Make functions in dfa.c static. 2024-04-27 09:41:38 -04:00
Explorer09 518108ed39 refactor: dataflush() no longer checks 'gentables' flag within function 2024-04-27 09:28:38 -04:00
John Lindal b012df90bb optimize yy_get_next_buffer by switching to memmove
based on https://lists.defectivebydesign.org/archive/html/help-flex/2013-01/msg00000.html
2024-04-27 09:11:58 -04:00
Will Estes 68eb57857f Merge pull request #380 from eqvinox/realloc_size
scanner: consistently +2 to realloc size for EOB
2024-04-25 16:55:04 -04:00
David Lamparter dae428c836 scanner: consistently +2 to realloc size for EOB
We expect to have room for 2 EOB chars, but in this particular realloc
path this only works because yy_n_chars tends to be large enough for
1.5x its value to have room for our 2 EOB chars.

That said, clang-6's static analyzer does produce a warning about this
("Use of zero-allocated memory", meaning realloc with size=0) because it
goes by the assumption that yy_n_chars and number_to_move could be 0.

While this is somewhat bogus, it does make sense to just put the "+ 2"
here and be done with it.  AFAICS, this is the correct thing to do here
after all.

Signed-off-by: David Lamparter <equinox@diac24.net>
2024-04-25 22:31:13 +02:00
Alex Richardson bf23944911 Fix -Wundef warnings by using #ifdef instead of #if
This also brings back the check for __func__ that was deleted in commit
9b41a091bc
2024-04-25 14:56:00 -04:00
Ryan McCullagh a4abd73431 add strerror to error message 2024-04-25 14:40:44 -04:00
ggujjula 80d756484c Add error messages to unreachable ends of switch statements 2024-04-25 14:30:59 -04:00
Explorer09 ccbd9f698b Remove unused "prev" member from struct hash_entry.
Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
2024-04-25 14:25:37 -04:00
Explorer09 08ce73bb6f Use size_t for addsym(), findsym() and hashfunct().
Because int is not a proper type for table_size parameter.

Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
2024-04-25 14:25:37 -04:00
Explorer09 601cef4b28 Explicitly initialize ndtbl[], sctbl[] and ccltab[] to {NULL}.
Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
2024-04-25 14:25:37 -04:00
Explorer09 26673bdce1 Fix cclinstal(), ndinstal() and scinstal() memory leak.
Move the job of strdup() from cclinstal(), ndinstal() and scinstal() to
addsym(). This means ccltab[], sctbl[] and ndtbl[], respectively, will
assume ownership of the duplicated string buffers, and no more garbage
will be left in cclinstal(), ndinstal() or scinstal().

Because of the ownership assumption of sctbl[], strings in scname[] are
now READ-ONLY as they point to the "name" members within sctbl[].

Fixes: #340

Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
2024-04-25 14:25:37 -04:00
Mightyjo 1a44eb990c refactor(skeleton): Use M4_YY_HOOK_EOF_STATE_CASE_ARM in parse.y.
Add informative comments to gen.c.

Regularize whitespace I recently messed up.

Remove dead code.
2024-04-25 08:52:55 -04:00
Bill Currie d5770a0acd Allow white space in yymore and yyreject checks
AC_PROG_LEX puts a space between yymore and its ()s causing the yymore
check to fail and thus break configure.
2024-04-23 19:09:15 -04:00
dependabot[bot] b577780992 chore(deps): bump the github-actions group with 2 updates
Bumps the github-actions group with 2 updates: [actions/checkout](https://github.com/actions/checkout) and [github/codeql-action](https://github.com/github/codeql-action).


Updates `actions/checkout` from 4.1.2 to 4.1.3
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/9bb56186c3b09b4f86b1c65136769dd318469633...1d96c772d19495a3b5c517cd2bc0cb401ea0529f)

Updates `github/codeql-action` from 3.24.10 to 3.25.1
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/4355270be187e1b672a7a1c7c7bae5afdc1ab94a...c7f9125735019aa87cfc361530512d50ea439c71)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-22 12:34:52 -04:00
dependabot[bot] 5676be36e4 chore(deps): bump github/codeql-action in the github-actions group
Bumps the github-actions group with 1 update: [github/codeql-action](https://github.com/github/codeql-action).


Updates `github/codeql-action` from 3.24.9 to 3.24.10
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/1b1aada464948af03b950897e5eb522f92603cc2...4355270be187e1b672a7a1c7c7bae5afdc1ab94a)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-08 11:04:49 -04:00
Explorer09 4f7f19e6bc build: Add stage2scan.c and byte comparison check for bootstrap.
With stage1scan.c being deterministic, it's possible to add a bootstrap
check that ensures the generated flex program can build the scanner of
itself flawlessly. The check is performed on native build only.

Code is partly inspired from GCC's makefile.

Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
2024-04-02 07:01:20 -04:00
Explorer09 2e5f4bc9d8 build: Generate deterministic scan.c and stage1scan.c.
Change the generating rules of scan.c (in dist-hook) and stage1scan.c
so that the source and output file names in #line directives are fixed.
This would allow the scanner results be comparable to each other.

Also in --disable-bootstrap build, the flex binary will now be built
with scan.c directly - no more sedding.

Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
2024-04-02 07:01:20 -04:00
Explorer09 bab5ce6457 build: let "make mostlyclean" delete "*-flex.h".
These skeleton header files can be easily regenerated.

(The things that "mostlyclean" shouldn't delete are files that are more
expensive to rebuild, e.g. library archives and linked executables.)

Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
2024-04-01 16:11:48 -04:00
Explorer09 a8b07bac95 build: Don't use BUILT_SOURCES for skeleton files
State the dependencies of '*-flex.h' skeleton files properly and avoid
the 'BUILT_SOURCES' Automake variable, which often does more harm than
good (building files that are not needed for a particular target).

(Regression from commit e6472493e2)

Also remove a GNU make wildcard function call as it's no longer needed.

Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
2024-04-01 16:11:48 -04:00
Explorer09 289796314f build: Makefile style changes to prevent merge conflicts
Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
2024-04-01 16:11:48 -04:00
Explorer09 3726c1a88d build: Correct skeleton headers dependencies
The '*-flex.h' files are included by skeletons.c and not by other source
files. Correct the dependencies in the makefile.

(The error was introduced by 3603f03350)

Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
2024-04-01 16:11:48 -04:00
Explorer09 b162ab50f4 build: config_for_build.h for cross, bootstrap config.
This should be enough to fix the main bug as reported in #314.
Other cross-compile limitations may still exist.

Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
2024-03-30 10:15:55 -04:00
Explorer09 19491a012a build: Re-add and update 'bool' fallback definition
Re-add the fallback definition of 'bool', which was deleted in commit
3efb40df0e. Also amend the preprocessor
conditionals to turn off the fallback in C++ mode or C23 or later
standard.

This is for backward compatibility to compilers that do not yet support
C99 stdbool.h.

Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
2024-03-30 10:15:55 -04:00
Explorer09 978faf231d build: Use portable alternative to $'\r' in mkskel.sh
Replace the $'\r' quoting in commit
c674b5faa3 with a portable alternative
`` cr=`printf '\r'` ``

Although $' ' (dollar-single-quote) quoting is proposed for inclusion in
POSIX, we have not seen it in a published standard yet, so it is best to
avoid it for now.

Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
2024-03-30 07:22:34 -04:00
Akim Demaille ba1efdfa39 doc: modernize Bison snippets (#420)
The proper way to use a pure parser since 2.7 (2012-12-12) is "%define
api.pure full".  The proper way to pass params since 3.0 (2013-07-25)
is "%param".
2024-03-29 10:54:03 -04:00
Explorer09 d009124da5 build: let "make mostlyclean" delete stage1scan.c.
The argument is that it's easy to regenerate stage1scan.c comparing to
the stage 1 flex program, which takes time to rebuild.

Signed-off-by: Kang-Che Sung <explorer09@gmail.com>
2024-03-29 10:30:34 -04:00
Will Estes 05f4e0c505 Merge pull request #637 from Mightyjo/issue_632_b
docs: Clarify GNU tool dependencies.
2024-03-26 12:05:32 -04:00
Will Estes ba197cc47a Merge pull request #638 from westes/dependabot/github_actions/github-actions-7fdc7770a1
chore(deps): bump the github-actions group with 1 update
2024-03-26 11:55:20 -04:00
dependabot[bot] 363a534309 chore(deps): bump the github-actions group with 1 update
Bumps the github-actions group with 1 update: [github/codeql-action](https://github.com/github/codeql-action).


Updates `github/codeql-action` from 3.24.8 to 3.24.9
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/05963f47d870e2cb19a537396c1f668a348c7d8f...1b1aada464948af03b950897e5eb522f92603cc2)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-25 14:20:21 +00:00
Mightyjo ff7ac43be2 docs: Clarify GNU tool dependencies.
Clarify and expand tool dependency info in INSTALL.md, particularly with respect to GNU tool variants.
Describe minimal troubleshooting steps for failed builds on non-Debian systems.

Refs: #632
2024-03-20 22:07:51 -04:00
Will Estes 52c3d81c24 Merge pull request #635 from westes/dependabot/github_actions/github-actions-c7658c26b4
chore(deps): bump the github-actions group with 2 updates
2024-03-19 09:15:13 -04:00
dependabot[bot] 221bee4fa7 chore(deps): bump the github-actions group with 2 updates
Bumps the github-actions group with 2 updates: [actions/checkout](https://github.com/actions/checkout) and [github/codeql-action](https://github.com/github/codeql-action).


Updates `actions/checkout` from 4.1.1 to 4.1.2
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/b4ffde65f46336ab88eb53be808477a3936bae11...9bb56186c3b09b4f86b1c65136769dd318469633)

Updates `github/codeql-action` from 3.24.6 to 3.24.8
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/8a470fddafa5cbb6266ee11b37ef4d8aae19c571...05963f47d870e2cb19a537396c1f668a348c7d8f)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-18 14:10:01 +00:00
Mightyjo 3d2cc12a8b fix(build): Comment out impl func dec in prefix_c99 test.
tests/prefix_c99.l calls a function before its definition from within
a dead code block. This is treated as an error in newer compilers. The
test isn't needed as the scanner's main() repeats the call.

Refs: #632
2024-03-15 00:04:55 -04:00
Mightyjo ba051d52d4 fix(build): Make typenames in C99 and Go skeletons portable. 2024-03-14 22:13:30 -04:00
Mightyjo 002cea24e6 fix(build): Scrub dead code from scan.l.
Refs: #632
2024-03-13 22:03:27 -04:00
Mightyjo c674b5faa3 fix(build): Fix sed error in mkskel.sh on macos.
Comment out dead code in scan.l

Refs: #632
2024-03-13 21:41:10 -04:00
Will Estes d86f102dc1 Merge pull request #631 from westes/dependabot/github_actions/github-actions-1b5558a478
chore(deps): bump the github-actions group with 1 update
2024-03-12 13:31:52 -04:00
dependabot[bot] 61fd9e0403 chore(deps): bump the github-actions group with 1 update
Bumps the github-actions group with 1 update: [github/codeql-action](https://github.com/github/codeql-action).


Updates `github/codeql-action` from 3.24.5 to 3.24.6
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/47b3d888fe66b639e431abf22ebca059152f1eea...8a470fddafa5cbb6266ee11b37ef4d8aae19c571)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-03-04 14:20:03 +00:00
Will Estes 9a8e61ce31 Merge pull request #630 from Mightyjo/issue_628
fix: Correct fullspeed table size.
2024-03-03 20:47:53 -05:00
Mightyjo e09102edc4 fix: Correct fullspeed table size.
Correct fullspeed table size computation from 'tblend + numecs + 1' to
'tblend + 2 + 1' to avoid allocating extra space that is never initialized.

Refs: #628
2024-03-03 20:34:32 -05:00
Will Estes cf9c659c54 Merge pull request #629 from westes/dependabot/github_actions/github-actions-b81d1c2178
chore(deps): bump the github-actions group with 1 update
2024-02-26 11:39:01 -05:00
dependabot[bot] 1cd660e4d6 chore(deps): bump the github-actions group with 1 update
Bumps the github-actions group with 1 update: [github/codeql-action](https://github.com/github/codeql-action).


Updates `github/codeql-action` from 3.24.3 to 3.24.5
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/379614612a29c9e28f31f39a59013eb8012a51f0...47b3d888fe66b639e431abf22ebca059152f1eea)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-26 14:34:49 +00:00
Will Estes ec6bdb287e Merge pull request #626 from westes/dependabot/github_actions/github-actions-636086e5fd
chore(deps): bump the github-actions group with 1 update
2024-02-23 10:47:38 -05:00
dependabot[bot] a997ad61b7 chore(deps): bump the github-actions group with 1 update
Bumps the github-actions group with 1 update: [github/codeql-action](https://github.com/github/codeql-action).


Updates `github/codeql-action` from 3.24.0 to 3.24.3
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/e8893c57a1f3a2b659b6b55564fdfdbbd2982911...379614612a29c9e28f31f39a59013eb8012a51f0)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-19 14:35:38 +00:00
Will Estes 2285b0d5b8 Merge pull request #623 from westes/dependabot/github_actions/github-actions-58291bdd1e
chore(deps): bump the github-actions group with 1 update
2024-02-06 21:06:33 -05:00
dependabot[bot] 5b5ec2420f chore(deps): bump the github-actions group with 1 update
Bumps the github-actions group with 1 update: [github/codeql-action](https://github.com/github/codeql-action).


Updates `github/codeql-action` from 3.23.2 to 3.24.0
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/b7bf0a3ed3ecfa44160715d7c442788f65f0f923...e8893c57a1f3a2b659b6b55564fdfdbbd2982911)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-02-05 14:13:46 +00:00
Will Estes e64e7e248f Merge pull request #621 from westes/dependabot/github_actions/github-actions-4439fa794e
chore(deps): bump the github-actions group with 1 update
2024-02-03 09:47:39 -05:00
dependabot[bot] 0874fccc85 chore(deps): bump the github-actions group with 1 update
Bumps the github-actions group with 1 update: [github/codeql-action](https://github.com/github/codeql-action).


Updates `github/codeql-action` from 3.23.0 to 3.23.2
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/e5f05b81d5b6ff8cfa111c80c22c5fd02a384118...b7bf0a3ed3ecfa44160715d7c442788f65f0f923)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-29 14:31:18 +00:00
Will Estes 65f8308496 Merge pull request #614 from zmajeedforks/zmajeed_flex_doc_c_comment_regex
Issue 609: Fix wrong example regex for C- and C++-style comments
2024-01-08 20:31:41 -05:00
Will Estes 7f062cf1ae Merge pull request #618 from westes/dependabot/github_actions/github-actions-f70ee59181
chore(deps): bump the github-actions group with 1 update
2024-01-08 20:29:27 -05:00
dependabot[bot] f1eabccbef chore(deps): bump the github-actions group with 1 update
Bumps the github-actions group with 1 update: [github/codeql-action](https://github.com/github/codeql-action).


Updates `github/codeql-action` from 3.22.12 to 3.23.0
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/012739e5082ff0c22ca6d6ab32e07c36df03c4a4...e5f05b81d5b6ff8cfa111c80c22c5fd02a384118)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-08 14:39:35 +00:00
Will Estes e4ccec1f49 Merge pull request #616 from westes/dependabot/github_actions/github-actions-dd63810dd4
chore(deps): bump the github-actions group with 1 update
2024-01-03 11:29:23 -05:00
dependabot[bot] fd91e0b78e chore(deps): bump the github-actions group with 1 update
Bumps the github-actions group with 1 update: [github/codeql-action](https://github.com/github/codeql-action).


Updates `github/codeql-action` from 2.22.9 to 3.22.12
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/c0d1daa7f7e14667747d73a7dbbe8c074bc8bfe2...012739e5082ff0c22ca6d6ab32e07c36df03c4a4)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-25 14:51:05 +00:00
zmajeed 7c053dac96 typo 2023-12-16 09:36:31 -06:00
zmajeed 52eb5570b9 Fix wrong example regexes for C and C++ comments 2023-12-16 09:34:21 -06:00
zmajeed 1a313b3fb8 Fix wrong example regexes for C and C++ comments 2023-12-16 09:29:05 -06:00
Bill Currie 1370faa58c Add lineno_generated.l.in to EXTRA_DIST
I had forgotten about distcheck
2023-12-11 10:46:20 -05:00
Bill Currie a46776704b Extract correct line numbers to use in line number test
This makes the test much less fragile as now all that is need is for
@LINE@ and __LINE__ to be on the same line (the comment gets substituted
too, but it's a comment...)
2023-12-11 10:46:20 -05:00
Bill Currie 0591dc12ba Add a test for checking the generated line numbers
This checks the line numbers in multiple places, so it should help keep
line numbers working in general.
2023-12-11 10:46:20 -05:00
Bill Currie 97b8fa9c6f Skip linenum increment for indented code blocks
An indented code block would cause the subsequent all subsequent code
block line numbers (including its own) to be out by one.

For example, the following would cause the line number for the `BEGIN`
code block to have the line number for the `warning` code block. This
would also affect the code in the final section after the second `%%`.

    %%
                yyflexdebug = 0;
                grab_frame = GRAB_FRAME;
                grab_other = GRAB_OTHER;
                grab_write = GRAB_WRITE;
                yylval->pointer = 0;// ensure pointer vals are null

    "/*"        { BEGIN (COMMENT); }
    <COMMENT>"/*" { warning (0, "nested /* in comment"); }
2023-12-11 10:46:20 -05:00
dependabot[bot] 20bd1cd233 chore(deps): bump the github-actions group with 1 update
Bumps the github-actions group with 1 update: [github/codeql-action](https://github.com/github/codeql-action).

- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/407ffafae6a767df3e0230c3df91b6443ae8df75...c0d1daa7f7e14667747d73a7dbbe8c074bc8bfe2)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-11 10:34:47 -05:00
dependabot[bot] 8453b08d82 chore(deps): bump the github-actions group with 1 update
Bumps the github-actions group with 1 update: [github/codeql-action](https://github.com/github/codeql-action).

- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/74483a38d39275f33fcff5f35b679b5ca4a26a99...407ffafae6a767df3e0230c3df91b6443ae8df75)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-08 11:00:17 -05:00
dependabot[bot] 9457969786 chore(deps): bump the github-actions group with 2 updates
Bumps the github-actions group with 2 updates: [actions/checkout](https://github.com/actions/checkout) and [github/codeql-action](https://github.com/github/codeql-action).


Updates `actions/checkout` from 4.1.0 to 4.1.1
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/8ade135a41bc03ea155e62e844d188df1ea18608...b4ffde65f46336ab88eb53be808477a3936bae11)

Updates `github/codeql-action` from 2.22.3 to 2.22.5
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/0116bc2df50751f9724a2e35ef1f24d22f90e4e1...74483a38d39275f33fcff5f35b679b5ca4a26a99)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-11-02 11:25:54 -04:00
zmajeed c47ca061c6 C++ lexer header file is FlexLexer.h not yyFlexLexer.h 2023-11-02 11:25:13 -04:00
Bill Currie ee2d527aa0 Correct guarding of GUTS declaration
It turns out I had missed some tests for recursive scanners.
2023-10-19 13:44:54 -04:00
Bill Currie 7efebe2a17 Guard yyunput_r definition with YY_NO_YYUNPUT
The declaration had the ifdef, but the defintion was missing it, thus
lexers that don't use yyunput would generate an unused static function
warning.
2023-10-19 13:44:54 -04:00
Bill Currie 63665f4c72 Remove unused M4_YY_DECL_GUTS_VAR
yy_create_buffer makes no use of YY_G and thus does not require its
declaration. Removes another unused variable warning.
2023-10-19 13:44:54 -04:00
Bill Currie f7ea805ae1 Guard local vars with M4_MODE_USES_REJECT
This prevents unused variable warnings in lexers that don't use reject.
2023-10-19 13:44:54 -04:00
Bill Currie c27726d60b Avoid unsigned warnings in comparisons with sizes
yy_state_buf_max and yyread's max_size are both (yy_)size_t so ensure
the comparison is against (yy_)size_t for the other expression.
2023-10-19 13:44:54 -04:00
dependabot[bot] 3cb02c7555 chore(deps): bump the github-actions group with 1 update
Bumps the github-actions group with 1 update: [github/codeql-action](https://github.com/github/codeql-action).

- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/ddccb873888234080b77e9bc2d4764d5ccaaccf9...0116bc2df50751f9724a2e35ef1f24d22f90e4e1)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-19 13:22:50 -04:00
dependabot[bot] fe90aa6ebe chore(deps): bump the github-actions group with 2 updates
Bumps the github-actions group with 2 updates: [actions/checkout](https://github.com/actions/checkout) and [github/codeql-action](https://github.com/github/codeql-action).


Updates `actions/checkout` from 4.0.0 to 4.1.0
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/3df4ab11eba7bda6032a0b82a6bb43b11571feac...8ade135a41bc03ea155e62e844d188df1ea18608)

Updates `github/codeql-action` from 2.21.7 to 2.21.9
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/04daf014b50eaf774287bf3f0f1869d4b4c4b913...ddccb873888234080b77e9bc2d4764d5ccaaccf9)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: github-actions
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-10-02 11:10:06 -04:00
dependabot[bot] f2567970b0 chore(deps): bump the github-actions group with 1 update
Bumps the github-actions group with 1 update: [github/codeql-action](https://github.com/github/codeql-action).

- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/github/codeql-action/compare/00e563ead9f72a8461b24876bee2d0c2e8bd2ee8...04daf014b50eaf774287bf3f0f1869d4b4c4b913)

---
updated-dependencies:
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: github-actions
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-18 11:12:07 -04:00
Sean McBride 2c0b6c791b Fixed issue #416: Made YY_DO_BEFORE_ACTION a do-while loop to fix -Wextra-semi-stmt warnings 2023-09-06 10:49:51 -04:00
Pedro Kaj Kjellerup Nacht 6db99ccd7a Add dependabot to keep Actions updated
Signed-off-by: Pedro Kaj Kjellerup Nacht <pnacht@google.com>
2023-09-06 10:44:07 -04:00
Pedro Kaj Kjellerup Nacht ac962cd512 Hash-pin GitHub Actions
Signed-off-by: Pedro Kaj Kjellerup Nacht <pnacht@google.com>
2023-09-06 10:44:07 -04:00
musvaage d7d1c54362 typos 2023-08-22 11:35:15 -04:00
polluks c2fae24fa3 Fixed typos 2023-08-22 11:23:54 -04:00
winter.loo 541645a888 doc: fix typo 2023-07-11 16:40:23 -04:00
Martin Joerg a97872a311 Fix pattern documentation for case-insensitive ranges 2023-06-05 10:29:18 -04:00
Pedro Kaj Kjellerup Nacht 1b38ae28e7 ci: Add read-only permissions to workflows
Signed-off-by: Pedro Kaj Kjellerup Nacht <pnacht@google.com>
2023-06-05 07:04:59 -04:00
6NoFantasy9 a3022d064a Fix README typos
* Update README

* patch 1.5
2023-06-05 07:02:59 -04:00
Will Estes d30bdf45a8 fix(build): build man page when cross compiling
fixes #560
2023-04-07 10:05:10 -04:00
Joseph Langley 4a4bac0b29 doc(contrib): Alphabetize commit types
Thanks to @Explorer09 for the suggestion!
2023-03-30 15:40:11 -04:00
Mightyjo 2bb3bfd64f docs(contrib): Add CONTRIBUTING.md to EXTRA_DIST. 2023-03-30 15:40:11 -04:00
Mightyjo b822e533e1 docs: Add CONTRIBUTING manual. 2023-03-30 15:40:11 -04:00
Simon Sobisch 3aedd28670 remove unused DO_COMPARISON 2023-03-15 13:36:52 -04:00
Burke Libbey 3352d7f1c9 Correctly refer to ctrl.traceline_template:
This was refactored in 0e32cd, but left a dangling reference to the
previous location here.
2023-03-13 11:49:21 -04:00
Yifeng Li a57e165cc5 Fix #539 crash on Apple M1 by casting 0 to (char *) explicitly
Currently, when the NULL-terminated variadic function
filter_create_ext() is invoked, the value "0" is passed as
the last argument to act as a terminator. However, this is
an integer value, which is incompatible with the pointer
data type expected by filter_create_ext().

This is undefined behavior in C, correct operation is not
guaranteed. In fact, it causes flex to crash on Apple M1
when GCC is used - the loop is not terminated when it should,
instead, it keeps running, corrupting the argument list for
invoking m4. As a result, it creates the following error:

> flex: fatal internal error, exec of gm4 failed

This commit fixes the problem by explicitly casting the value 0 to
the correct pointer type (char *).

Signed-off-by: Yifeng Li <tomli@tomli.me>
2023-03-09 14:45:08 -05:00
Mightyjo 74e8c880fc test(quotes): Add after action comment tests for m4quotes. 2023-03-09 14:41:26 -05:00
Simon Sobisch f1c2570502 removed output-beautification of YACC and INDENT
per request from @Explorer09
saving one code line and its comment two times
2023-03-01 20:52:25 -05:00
Simon Sobisch bf59176220 remove hard-wired bison lookup, check for "GNU Bison" in $YACC's version output instead
additional:
* don't check for GNU indent if indent-check already found no indent
* use common wording to check "*whether* $BINARY is GNU stuff"
2023-03-01 20:52:25 -05:00
musvaage e34253f1ca typo 2023-03-01 20:47:23 -05:00
Simon Sobisch 9e69eff334 .gitignore adjustments for WIN32 2023-03-01 09:46:26 -05:00
Will Estes cf66c9e5f1 doc(NEWS): mentioned new ka translation 2023-01-15 09:46:49 -05:00
Translation Project Robot 06adbc6f0f doc(gettext): added new ka translation from translation project 2023-01-15 09:46:49 -05:00
Translation Project Robot ac1dc0d757 doc(gettext): updated eo translation from Translation Project 2023-01-15 09:40:44 -05:00
Will Estes b746b2c3f6 doc(gettext): added new eo translation to NEWS 2023-01-15 09:40:44 -05:00
Will Estes 3a24fa0366 Merge pull request #399 from Explorer09/autotools-version
build: correct and document minimum Autotools reqirement in configure.ac
2023-01-15 09:27:49 -05:00
Will Estes 4ec57cf108 tighten up markdown in INSTALL.md 2022-09-28 07:06:59 -04:00
Will Estes 853c232b7e rename INSTALL to INSTALL.md 2022-09-28 07:00:11 -04:00
Will Estes 13a2f02b80 update and reformat installation instructions 2022-09-28 06:57:11 -04:00
Explorer09 0954f389d3 build: correct and document minimum Autotools reqirement in configure.ac
A build test is done to determine the minimum versions of the configure
tools (Autoconf, Automake, Libtool & gettext) that can successfully
build flex in the current state of the code. This commit would help
builders to figure out whether their build tools are still compatible
for building flex, or they need tools upgrade, especially when they
patch flex and need to regenerate configure script for any reason.

This commit resolves version requirement debates as in #374.

A summary of version requirements: Autoconf 2.62, Libtool 2.2,
Automake 1.11.3 and gettext 0.19.6.

Signed-off-by: Kang-che Sung <explorer09@gmail.com>
2018-10-25 06:44:30 +08:00
71 changed files with 2573 additions and 1125 deletions
+15
View File
@@ -0,0 +1,15 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
groups:
github-actions:
patterns:
- "*"
+1
View File
@@ -0,0 +1 @@
github: westes
+5 -3
View File
@@ -8,15 +8,17 @@ on:
pull_request:
branches: [ master ]
permissions: read-all
jobs:
build:
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: apt
run: sudo apt-get install gcc autoconf bison gettext autopoint help2man lzip texinfo texlive
run: sudo apt-get update && sudo apt-get install -y gcc autoconf automake libtool gettext autopoint bison help2man lzip texinfo texlive
- name: autogen
run: ./autogen.sh
- name: configure
+44 -40
View File
@@ -13,67 +13,71 @@ name: "CodeQL"
on:
push:
branches: [ master ]
branches: [ "master" ]
pull_request:
# The branches below must be a subset of the branches above
branches: [ master ]
branches: [ "master" ]
schedule:
- cron: '31 22 * * 4'
- cron: '39 5 * * 5'
permissions: {}
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
name: Analyze (${{ matrix.language }})
# Runner size impacts CodeQL analysis time. To learn more, please see:
# - https://gh.io/recommended-hardware-resources-for-running-codeql
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners (GitHub.com only)
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
runs-on: ubuntu-22.04
timeout-minutes: 240
permissions:
# required for all workflows
security-events: write
# required to fetch internal or private CodeQL packs
packages: read
# only required for workflows in private repositories
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: [ 'cpp' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
include:
- language: c-cpp
build-mode: autobuild
# CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
# Use `c-cpp` to analyze code written in C, C++ or both
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
steps:
- name: Apt
run: sudo apt-get install gcc autoconf bison gettext autopoint help2man lzip texinfo texlive
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
# Ensure autopoint is installed. CodeQL misses it sometimes.
- name: apt
run: sudo apt-get update && sudo apt-get install -y gcc autoconf automake libtool gettext autopoint bison help2man lzip texinfo texlive
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4.36.2
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main
# Autobuild expects to start by running configure.
# Run autogen.sh to ensure configure exists.
- name: Autogen
run: |
./autogen.sh
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2
# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
# ✏️ If the Autobuild fails above, remove it and uncomment the following four lines
# and modify them (or add more) to build your code if your project
# uses a compiled language
#- name: Build
# run: |
# ./configure
# make
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@8aad20d150bbac5944a9f9d289da16a4b0d87c1e # v4.36.2
with:
category: "/language:${{matrix.language}}"
+90
View File
@@ -0,0 +1,90 @@
name: Nightly
on:
schedule:
- cron: '04 00 * * *'
workflow_dispatch:
permissions: {}
jobs:
nightly:
name: Run a Nightly Build and Save the Artifacts
runs-on: ubuntu-22.04
outputs:
update_needed: ${{ steps.update.outputs.needed }}
version_slug: ${{ steps.update.outputs.slug }}
version: ${{ steps.version.outputs.version }}
permissions:
actions: read
contents: write
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- name: Check time since last commit
id: update
run: |
slug=$(git log -n 1 --pretty='format:%h-%as')
echo "slug=$slug" >> $GITHUB_OUTPUT
authorDate=$(echo $slug | cut -d '-' -f 2-4)
update=1
[ $(( $(date +%s) - $(date --date=$authorDate +%s) )) -ge 172800 ] && echo "::notice title=No Changes::No changes within the last two days. Skipping nightly build." && update=0
echo "needed=$update" >> $GITHUB_OUTPUT
- name: Change version number
id: version
env:
slug: ${{ steps.update.outputs.slug }}
update_needed: ${{ steps.update.outputs.needed }}
if: ${{ env.update_needed == 1 }}
run: |
ver=$(sed -n "s/^\(AC_INIT.*generator\],\)\[\(.*\)\]\(,\[flex-help.*\)$/\2/p" $GITHUB_WORKSPACE/configure.ac)
ver=${ver#v}
ver=${ver%-*}
ver=$ver-$slug
echo "version=$ver" >> $GITHUB_OUTPUT
sed -i "s/^\(AC_INIT.*generator\],\)\(.*\)\(,\[flex-help.*\)$/\1[$ver]\3/" $GITHUB_WORKSPACE/configure.ac
- name: apt
env:
update_needed: ${{ steps.update.outputs.needed }}
if: ${{ env.update_needed == 1 }}
run: sudo apt-get update && sudo apt-get install -y gcc autoconf automake libtool gettext autopoint bison help2man lzip texinfo texlive
- name: Update CHANGE_LOG
env:
update_needed: ${{ steps.update.outputs.needed }}
if: ${{ env.update_needed == 1 }}
run: |
./tools/git2cl > $GITHUB_WORKSPACE/ChangeLog
- name: build
env:
update_needed: ${{ steps.update.outputs.needed }}
if: ${{ env.update_needed == 1 }}
run: |
./autogen.sh
./configure
make
make distcheck
- name: Make Git archives
env:
ver: ${{ steps.version.outputs.version }}
update_needed: ${{ steps.update.outputs.needed }}
if: ${{ env.update_needed == 1 }}
run: |
git archive -o $ver.src.tar.gz --prefix=flex-$ver/ HEAD
TZ=America/Los_Angeles git archive -o $ver.src.zip --prefix=flex-$ver/ HEAD
echo "SOURCE_GZ=$(echo $ver.src.tar.gz)" >> $GITHUB_ENV
echo "SOURCE_ZIP=$(echo $ver.src.zip)" >> $GITHUB_ENV
- name: Get artifact names
env:
ver: ${{ steps.version.outputs.version }}
update_needed: ${{ steps.update.outputs.needed }}
if: ${{ env.update_needed == 1 }}
run: |
echo "ARTIFACT_GZ=$(echo flex-$ver.tar.gz)" >> $GITHUB_ENV
echo "ARTIFACT_LZ=$(echo flex-$ver.tar.lz)" >> $GITHUB_ENV
- name: Upload Artifacts to Nightlies Release
id: upload-nightly-artifacts
env:
update_needed: ${{ steps.update.outputs.needed }}
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: ${{ env.update_needed == 1 }}
run: |
gh release upload nightlies ${{ env.ARTIFACT_GZ }} ${{ env.ARTIFACT_LZ }} ${{ env.SOURCE_GZ }} ${{ env.SOURCE_ZIP }} --clobber
+199
View File
@@ -0,0 +1,199 @@
# CONTRIBUTING to Flex
## Introduction
Thank you for your interest in contributing to Flex! Flex's [issue
tracker](https://github.com/westes/flex/issues) is on GitHub. That's
the best place to find a task that needs attention. It's also the best
place to check whether a problem you've found is known to the
community.
## Baseline Build Environment
The maintenance baseline build environment is Ubuntu 20.04 LTS.
Flex needs a previous version of itself in order to build a new
version of itself. You can either install an operating system package
of flex, or you can build flex from one of the release tar balls.
Configuring your Flex development environment to match the maintenance
baseline will help you collaborate and review contributions with the
other developers working on Flex. See the
[INSTALL](https://github.com/westes/flex/blob/master/INSTALL.md) for
programs required to build flex from scratch.
## Branching Convention
Flex source code is maintained in Git at GitHub. Each Flex developer
forks their own copy of the main repository at
[westes/flex](https://github.com/westes/flex). Flex development occurs
in feature branches of the forks. PRs will eventually be submitted
from the feature branches of the forks to westes/flex.
Flex development forks are not required to reside on GitHub. However:
- GitHub's pull request (PR) process only works with repositories
hosted on GitHub;
- Flex's automated testing pipeline depends on GitHub's Actions
infrastructure and may not function on other Git servers.
Therefore, if your fork of flex resides outside of github, you may
wish to submit your patches via email, using standard git mechanisms.
## Preparing Your Commits
Small PRs are easier to review and merge. Minimize the scope of the
changes in a single PR within reason. Changes that touch one or two
files are likely to be reviewed and accepted more quickly than changes
that touch every file in Flex. Your pull request should do one atomic
thing unless there is a really good reason for your pull request to do
more than one thing.
Format your commit messages following [Conventional Commits
1.0.0](https://www.conventionalcommits.org/en/v1.0.0/) (CC BY 3.0
netlify.com). Briefly:
```
<type>[(optional scope)][!]: <description>
[BLANK LINE]
[optional body]
[BLANK LINE]
[optional footer(s)]
```
A typical commit message might look like:
```
docs: Add CONTRIBUTING manual
Refs: #1234
```
The description should summarize the changes in a single, short
sentence. The description should be written in the imperative mood,
like the descriptions of the types below.
The primary types are:
- build: Change the build system, including tracking external dependencies
- ci: Change the CI/CD system
- docs: Update the package documentation
- feat: Add a new feature
- fix: Fix a bug or incorrect behavior
- perf: Improve performance of a feature
- refactor: Simplify maintainability without affecting performance or behavior
- revert: Revert a previous commit
- style: Correct a style mismatch (indentation, etc.)
- test: Change or add to the test suite
The optional scope must appear in parentheses and must consist of a
noun describing the section of the code base that was changed.
```
docs(contrib): Update URLs in CONTRIBUTING manual
```
The optional `!` must appear before the description whenever the
commit introduces a breaking change - one that breaks compatibility
with previous versions of the code base. Whenever the `!` marker
appears, a BREAKING-CHANGE footer should also be included.
The optional body may be included to provid additional information
or context about the change. If it appears, it must be preceded by a
blank line.
The optional footers may be included to provide additional referential
information and links to tracked issues, PRs, etc. Each footer must be
preceded by a blank line. Footers must be formatted as `<footer-type>:
<description>`, similar to the first line of commit messages. The
description's format depends upon the footer-type. Known footer-types
include:
- Refs: A comma-separated list of commit hashes and/or issue and PR numbers. Issue and PR numbers must be prefixed with a `#`.
- BREAKING-CHANGE: A description of the change that breaks compatibility with previous versions of the code, including the version number at which compatibility is broken.
A breaking change commit message might look like:
```
feat!: Switch to quantum scanner
BREAKING-CHANGE: New scanner runs in constant time but doesn't support any existing hardware.
Breaks compatibility with 1.0.0.
```
Squash your commits so that each commit is an atomic change. This aids
discussion and revision during the review process. In particular,
there should be no commits that fixup prior commits.
## Submitting PRs
Before submitting a PR to flex, test your changes either locally or
using the GitHub Actions pipeline.
### Testing locally
1. Commit and/or stash your changes.
1. Clean your working copy using
```
git clean -xdf
```
1. Build flex following the directions in [INSTALL](https://www.github.com/westes/flex/blob/master/INSTALL.md).
1. Run both the `make check` and `make distcheck` targets.
### Testing with GitHub Actions
If you created a fork of Flex on GitHub, any PR you make to your own
main branch will trigger the build and test pipeline.
1. Commit your changes.
1. Push your local branch to your remote at GitHub. Assuming your GitHub remote is called origin:
```
git push origin feature_branch
```
To submit a pull request through GitHub's web interface:
1. Open your GitHub Flex repository in your web browser.
1. Click the 'Pull requests' link.
1. Click the 'New pull request' button.
1. Change the 'base repository' from 'westes/flex' to your fork.
1. Change the 'base' branch to 'master' if it isn't already set.
1. Change the 'compare' branch to your feature branch.
1. Click the 'Create pull request' button.
1. Click the 'Actions' link to monitor the progress of your build and test job.
### Submitting PRs to westes/flex
Sending a PR to westes/flex follows nearly the same process as sending one to your own main branch.
1. Commit your changes.
1. Push your local branch to your remote at GitHub. Assuming your GitHub remote is called origin:
```
git push origin feature_branch
```
To use GitHub's web interface:
1. Open your GitHub Flex repository in your web browser.
1. Click the 'Pull requests' link.
1. Click the 'New pull request' button.
1. Change the 'base repository' to 'westes/flex'.
1. Change the 'base' branch to 'master' if it isn't already set.
1. Change the 'compare' branch to your feature branch.
1. Click the 'Create pull request' button.
1. Add notes to your PR including
- A title or commit-like message
- A summary of the commits in your pull request
- Issue numbers your PR covers
- Links to your GitHub Actions test results or a copy of the last few lines of output from your local test results.
If this is your first contribution to Flex, execution of the Actions
pipeline will have to be manually approved by the maintainer. If you
are a returning contributor, you can click the Actions link to watch
your job run.
Keep an eye on your PR's discussion page and your email for review
notes and questions from other developers.
Thanks for contributing!
-67
View File
@@ -1,67 +0,0 @@
# INSTALLING Flex
## Should you be here at all?
If building, developing or compiling C programs is new to you, you probably want to use your operating system's standard means of installing software to install flex. If you do not need the latest features of flex, you probably just want to use your operating system's standard means of installing software to obtain flex.
## Now that you know you should be here ...
If you are not familiar with bootstrapping C code from a git repository or if GNU autotools seems like a jumble of tenuous incantationery to you, then make sure that you downloaded one of the release tar archives of flex. You can verify this by checking the filename of what you downloaded. If it is something like "flex-<version>.tar.<compressiontype>" then you have a release tar archives. If you have a filename like "flex.tar.gz" or "flex.zip", you have a copy of the git repository and you didn't download the thing you wanted to.
## Building from a release archive
To build flex from a release archive:
$ ./configure <any configure options you need>
$ make
To see what options are available from the configure script:
$ ./configure --help
Optionally run the test suite:
$ make check
To install the flex you just built:
$ make install
Note that you may want to make use of the DESTDIR argument on the "make install" command line or that you may want to have used the "--prefix" argument with configure (or mostly equivalently the "prefix" argument on the make command line).
## Building from the git repository
To build from the git repository:
First, make sure you have a copy of flex installed somewhere on your path so that configure can find it. You can usually do this with your operating system's standard means of installing software. Sometimes, you have to build from a recent release of flex, however.
You will also need all the programs that flex needs in order to be built from scratch --
* compiler suite - flex is built with gcc
* bash, or a good Bourne-style shell
* m4 - `m4 -P` needs to work; GNU m4 and a few others are suitable
* GNU bison; to generate parse.c from parse.y
* autoconf; for handling the build system
* automake; for Makefile generation
* gettext; for i18n support
* help2man; to generate the flex man page
* tar, gzip, lzip, etc.; for packaging of the source distribution
* GNU texinfo; to build and test the flex manual. Note that if you want
to build the dvi/ps/pdf versions of the documentation you will need
texi2dvi and related programs, along with a sufficiently powerful
implementation of TeX to process them. See your operating system
documentation for how to achieve this. The printable versions of the
manual are not built unless specifically requested, but the targets
are included by automake.
* GNU indent; for indenting the flex source the way we want it done
In cases where the versions of the above tools matter, the file
configure.ac will specify the minimum required versions.
Then:
$ ./autogen.sh
After autogen.sh finishes successfully, building flex follows the same steps as building flex from a release archive.
Note that, in addition to "make check", "make distcheck" builds a release archive and builds and tests flex from inside a directory containing only known distributed files.
+110
View File
@@ -0,0 +1,110 @@
# INSTALLING Flex
## Should you be here at all?
If building, developing or compiling C programs is new to you, you
probably want to use your operating system's standard means of
installing software to install flex. If you do not need the latest
features of flex, you probably just want to use your operating
system's standard means of installing software to obtain flex.
## Now that you know you should be here ...
If you are not familiar with bootstrapping C code from a git
repository or if GNU autotools seems like a jumble of tenuous
incantationery to you, then make sure that you downloaded one of the
release tar archives of flex. You can verify this by checking the
filename of what you downloaded. If it is something like
`flex-<version>.tar.<compressiontype>` then you have a release tar
archive. If you have a filename like `flex.tar.gz` or `flex.zip`, you
have a copy of the git repository and you didn't download the thing
you wanted to.
## Building from a release archive
To build flex from a release archive:
```bash
$ ./configure <any configure options you need>
$ make
```
To see what options are available from the configure script:
```bash
$ ./configure --help
```
Optionally run the test suite:
```bash
$ make check
```
To install the flex you just built:
```bash
$ make install
```
Note that you may want to make use of the DESTDIR argument on the
`make install` command line or that you may want to have used the
`--prefix` argument with configure (or mostly equivalently the
`prefix` argument on the make command line).
## Building from the git repository
To build from the git repository:
First, make sure you have a copy of flex installed somewhere on your
path so that configure can find it. You can usually do this with your
operating system's standard means of installing software. Sometimes,
you have to build from a recent release of flex, however. Using a
version of flex built from the flex codebase is always acceptable if
you have already bootstrapped doing so.
You will also need all the programs that flex needs in order to be
built from scratch:
* compiler suite - flex is built with gcc
* bash, or a good Bourne-style shell
* m4 - `m4 -P` needs to work; GNU m4 and a few others are suitable
* GNU bison; to generate parse.c from parse.y
* autoconf; for handling the build system
* automake; for Makefile generation
* libtool; often packaged with automake, but not always
* make; for running the generated Makefiles
* gettext; for i18n support
* help2man; to generate the flex man page
* tar, gzip, lzip, etc.; for packaging of the source distribution
* GNU texinfo; to build and test the flex manual. Note that if you want
to build the dvi/ps/pdf versions of the documentation you will need
texi2dvi and related programs, along with a sufficiently powerful
implementation of TeX to process them. See your operating system
documentation for how to achieve this. The printable versions of the
manual are not built unless specifically requested, but the targets
are included by automake.
* GNU indent; for indenting the flex source the way we want it done
* GNU sed; GNU extensions are used so other sed versions will not work
In cases where the versions of the above tools matter, the file
configure.ac will specify the minimum required versions.
Then:
```bash
$ ./autogen.sh
```
After autogen.sh finishes successfully, building flex follows the same
steps as building flex from a release archive.
Note that, in addition to `make check`, `make distcheck` builds a
release archive and builds and tests flex from inside a directory
containing only known distributed files.
If you have trouble building flex from git sources on non-Debian systems,
(e.g. MacOS) make sure that any required GNU tools have been added to
your PATH before your system defaults. Also check that required GNU tools
are aliased to their typical names - some package systems prefix them with
"gnu-" which make them hard for configure to find.
+2 -1
View File
@@ -39,7 +39,8 @@ dist_doc_DATA = \
EXTRA_DIST = \
.indent.pro \
INSTALL
INSTALL.md \
CONTRIBUTING.md
dist_noinst_SCRIPTS = \
autogen.sh \
+9 -9
View File
@@ -26,7 +26,7 @@ flex NEWS
** documentation
*** new bg, pt, uk translations from the translation project
*** new bg, eo, ka, pt, uk translations from the translation project
** scanner
@@ -110,7 +110,7 @@ flex NEWS
when those platforms are not present.
*** When running "make check", you can now pas V=0 to silence more of
the build. This is useful when you're less connncerned about the
the build. This is useful when you're less concerned about the
details of building and linking the test programs themselves.
* Noteworthy changes in release 2.6.3 (2016-12-30) [stable]
@@ -158,7 +158,7 @@ flex NEWS
** flex internals
*** a segfalt involving yyrestart(NULL) has been fixed
*** a segfault involving yyrestart(NULL) has been fixed
*** flex should now handle quoting when mixed with m4 processing correctly
@@ -245,7 +245,7 @@ flex NEWS
*** Removed deprecated 'register' storage class specifier
*** Changeed output formats from octal to hexadecimal
*** Changed output formats from octal to hexadecimal
*** check limits before using array index cclp; resolves sf-166
@@ -402,7 +402,7 @@ distribution
* version 2.5.31 released 2003-4-1
** remove --enable-maintainer-mode configure option; none of the
Makefiles were using it and it can be unduely confusing
Makefiles were using it and it can be unduly confusing
* version 2.5.30 released 2003-4-1
@@ -451,7 +451,7 @@ distribution
** new es translation from the translation project
** slight tweeks to the flex_int*_t types
** slight tweaks to the flex_int*_t types
** flex now warns about pattern ranges that might be ambiguous when
generating a case-insensitive scanner
@@ -605,7 +605,7 @@ formatting the manual in postscript and pdf in the distributed
** the test suite now respects the usual CFLAGS, etc. variables
** removed some warnings which some tests trigggered with the -s option
** removed some warnings which some tests triggered with the -s option
** the flex-generated header file now tries to be smarter about
conditionally including start conditions
@@ -741,7 +741,7 @@ options, see accompanying documentation
*** Updated the manual with the new reentrant API
*** Two new options %option reentrant (-R) and
*** Two new options %option reentrant (-R) and
%option reentrant-bison (-Rb)
*** All globals optionally placed into struct yyglobals_t
@@ -771,7 +771,7 @@ But the inverse is still true
** Developer test suite added
*** TESTS/ directory has been added. Users can
*** TESTS/ directory has been added. Users can
'make test' in the TESTS directory to execute the test suite
** Support for bison variables yylval and yylloc added
+2 -2
View File
@@ -929,7 +929,7 @@ Changes between 2.3 Patch #2 (02Aug90) and original 2.3 release:
Reordered #ifdef maze in the scanner skeleton in the hope of
getting the declarations right for cfront and g++, too.
- Note that this patch supercedes patch #1 for release 2.3,
- Note that this patch supersedes patch #1 for release 2.3,
which was never announced but was available briefly for
anonymous ftp.
@@ -987,7 +987,7 @@ Things which didn't used to be documented but now are:
- yy_switch_to_buffer() can be used in the yywrap() macro/routine.
- flex scanners do not use stdio for their input, and hence when
writing an interactive scanner one must explictly call fflush()
writing an interactive scanner one must explicitly call fflush()
after writing out a prompt.
- flex scanner can be made reentrant (after a fashion) by using
+3 -3
View File
@@ -30,16 +30,16 @@ the lists.
The flex distribution contains the following files which may be of
interest:
* README - This file.
* README.md - This file.
* NEWS - current version number and list of user-visible changes.
* INSTALL - basic installation information.
* INSTALL.md - basic installation information.
* ABOUT-NLS - description of internationalization support in flex.
* COPYING - flex's copyright and license.
* doc/ - user documentation.
* examples/ - containing examples of some possible flex scanners and a
few other things. See the file examples/README for more
details.
* tests/ - regression tests. See TESTS/README for details.
* tests/ - regression tests. See tests/README for details.
* po/ - internationalization support files.
---
+1 -1
View File
@@ -22,7 +22,7 @@
# PURPOSE.
# If you see no configure script, then run ./autogen.sh to create it
# and procede with the "normal" build procedures.
# and proceed with the "normal" build procedures.
# use LIBTOOLIZE, if set
if test "x$LIBTOOLIZE" = "x"; then
+56 -15
View File
@@ -24,14 +24,23 @@
# autoconf requirements and initialization
dnl We recommend builders to regenerate configure and auxiliary scripts with
dnl exact versions of tools that generate flex release tarball, or latest
dnl versions of tools for flex development. The minimum feature and version
dnl requirements are provided for information only (no guarantee that the tools
dnl will work and we may bump requirements with future code changes).
dnl Uses AC_PATH_PROGS_FEATURE_CHECK. Requires autoconf-2.62 as minimum.
AC_PREREQ([2.62])
AC_INIT([the fast lexical analyser generator],[2.6.4],[flex-help@lists.sourceforge.net],[flex])
AC_PREREQ([2.60])
AC_CONFIG_SRCDIR([src/scan.l])
AC_CONFIG_AUX_DIR([build-aux])
AC_USE_SYSTEM_EXTENSIONS
dnl "LT_*" macros and "libtoolize --install" require libtool-2.2 as minimum.
LT_PREREQ([2.2])
LT_INIT
AM_INIT_AUTOMAKE([1.15 -Wno-portability foreign std-options dist-lzip parallel-tests subdir-objects])
AC_CONFIG_HEADER([src/config.h])
dnl Uses dist-lzip. Requires automake-1.11.3 as minimum.
AM_INIT_AUTOMAKE([1.11.3 -Wno-portability foreign std-options dist-lzip parallel-tests subdir-objects])
AC_CONFIG_HEADERS([src/config.h])
AC_CONFIG_LIBOBJ_DIR([lib])
AC_CONFIG_MACRO_DIR([m4])
SHARED_VERSION_INFO="2:0:0"
@@ -40,13 +49,29 @@ AC_SUBST(SHARED_VERSION_INFO)
# checks for programs
AM_GNU_GETTEXT([external])
AM_GNU_GETTEXT_VERSION([0.19.7])
dnl Try to pull in latest gettext infrastructure ("po" and "m4") files.
dnl Unfortunately autoreconf as of 2.69 doesn't recognize
dnl AM[_]GNU[_]GETTEXT_REQUIRE_VERSION so we provide AM[_]GNU[_]GETTEXT_VERSION
dnl as fallback. (autopoint will ignore latter if former is specified.)
dnl
dnl Bugs in gettext before 0.14 prevent building flex with it.
dnl FLEX_GNU_GETTEXT_REAL_REQUIRE_VERSION=0.14
AM_GNU_GETTEXT_REQUIRE_VERSION([0.19.6])
AM_GNU_GETTEXT_VERSION([0.19.6])
AC_PROG_YACC
AS_IF([test "$YACC" != 'bison -y'], [
YACC="\${top_srcdir}/build-aux/missing bison -y"
AC_MSG_NOTICE(no bison program found: only required for maintainers)
])
AM_CONDITIONAL([HAVE_BISON], [test "$YACC" = 'bison -y'])
AC_MSG_CHECKING(whether $YACC is GNU Bison)
AS_IF([test -n "$YACC" && $YACC --version 2>&1 | $GREP "GNU Bison" >/dev/null],
[AC_MSG_RESULT(yes)
use_gnu_bison=1],
[AC_MSG_RESULT(no)
AC_MSG_WARN($YACC does not appear to be GNU Bison; required for maintainers)
use_gnu_bison=0
YACC="\${top_srcdir}/build-aux/missing bison"
])
AM_CONDITIONAL([HAVE_BISON], [test $use_gnu_bison -eq 1])
dnl AC_PROG_LEX requires an argument in autoconf 2.70, but we cannot
dnl specify it through AM_PROG_LEX until automake 1.17.
AC_PROG_LEX([noyywrap])
AM_PROG_LEX
AC_PROG_CC
AX_PROG_CC_FOR_BUILD
@@ -56,6 +81,15 @@ AC_PROG_LN_S
AC_PROG_AWK
AC_PROG_INSTALL
AS_IF([test "x${BUILD_OBJEXT-}" = x],
[AS_IF([test "$cross_compiling" = no],
[BUILD_EXEEXT="$EXEEXT"
BUILD_OBJEXT="$OBJEXT"],
[BUILD_EXEEXT="${ac_cv_build_exeext-}"
BUILD_OBJEXT="${ac_cv_build_objext-}"])])
AS_IF([test "x${BUILD_OBJEXT-}" = x && test "x${enable_bootstrap-yes}" = xyes],
[AC_MSG_ERROR([BUILD_OBJEXT is invalid; please regenerate 'configure' with a newer ax_prog_cc_for_build.m4 (serial 23 or later) or configure with '--disable-bootstrap'])])
pkgconfigdir=${libdir}/pkgconfig
AC_SUBST(pkgconfigdir)
@@ -109,12 +143,15 @@ AC_CACHE_CHECK([for m4 that supports -P], [ac_cv_path_M4],
AC_SUBST([M4], [$ac_cv_path_M4])
AC_DEFINE_UNQUOTED([M4], ["$M4"], [Define to the m4 executable name.])
AC_PATH_PROG([INDENT], indent, [\${top_srcdir}/build-aux/missing indent])
AC_MSG_CHECKING(if $INDENT is GNU indent)
AS_IF([$INDENT --version 2>/dev/null | head -n 1 | grep "GNU indent" >/dev/null],
[AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no)
AC_MSG_WARN($INDENT does not appear to be GNU indent; 'make indent' may not function properly)
AC_PATH_PROG([INDENT], indent)
AS_IF([test -n "$INDENT"], [
AC_MSG_CHECKING(whether $INDENT is GNU indent)
AS_IF([$INDENT --version 2>/dev/null | $GREP "GNU indent" >/dev/null],
[AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no)
AC_MSG_WARN($INDENT does not appear to be GNU indent; 'make indent' may not function properly)
INDENT="\${top_srcdir}/build-aux/missing indent"
])
])
# checks for headers
@@ -171,6 +208,10 @@ AC_CHECK_FUNCS([dup2 memset regcomp strcasecmp strchr strdup strtol], [],
# reallocarr - NetBSD function. Use reallocarray if not available.
# reallocarray - OpenBSD function. We have replacement if not available.
AC_CHECK_FUNCS([pow setlocale reallocarr reallocarray])
AC_CHECK_DECLS(__func__)
AS_IF([test "$cross_compiling" = yes],
[AC_CONFIG_FILES([src/config_for_build.h])])
AC_CONFIG_FILES(
Makefile
+3
View File
@@ -25,3 +25,6 @@ flex.ps
version.texi
flex.html
flex.t2p
flex
flex.exe
+41 -7
View File
@@ -1,4 +1,9 @@
if CROSS
FLEX = $(top_builddir)/src/stage1flex
else
FLEX = $(top_builddir)/src/flex$(EXEEXT)
endif
TEXI2DVI = @TEXI2DVI@ -I $(srcdir)/../examples/manual/
TEXI2PDF = @TEXI2PDF@ -I $(srcdir)/../examples/manual/
@@ -7,11 +12,40 @@ AM_MAKEINFOFLAGS = -I $(srcdir)/../examples/manual/
dist_man_MANS = flex.1
MAINTAINERCLEANFILES = flex.1
CLEANFILES = *.aux *.cp *.cps *.fn *.fns *.hk *.hks *.ky *.log \
*.op *.ops *.pg *.toc *.tp *.tps *.vr *.vrs
CLEANFILES = \
*.aux \
*.cp \
*.cps \
*.fn \
*.fns \
*.hk \
*.hks \
*.ky \
*.log \
*.op \
*.ops\
*.pg \
*.toc \
*.tp \
*.tps \
*.vr \
*.vrs \
flex
flex.1: $(top_srcdir)/configure.ac $(top_srcdir)/src/cpp-flex.skl $(top_srcdir)/src/options.c $(top_srcdir)/src/options.h | $(FLEX)
$(HELP2MAN) --name='$(PACKAGE_NAME)' --section=1 \
--source='The Flex Project' --manual='Programming' \
--output=$@ $(FLEX) \
|| rm -f $@
# Use a fixed program name, without extension (such as ".exe"), for man
# page generation. 'help2man' strips directory prefix ("./") from the
# usage string, but not file extensions.
flex.1: $(top_srcdir)/configure.ac $(top_srcdir)/src/cpp-flex.skl $(top_srcdir)/src/options.c $(top_srcdir)/src/options.h
( cd $(top_builddir)/src && \
prog_name=`echo '$(FLEX)' | sed 's|^$(top_builddir)/src/||'` && \
$(MAKE) $(AM_MAKEFLAGS) $$prog_name \
)
$(INSTALL) -m 700 $(FLEX) flex$(EXEEXT)
$(HELP2MAN) \
--name='$(PACKAGE_NAME)' \
--section=1 \
--source='The Flex Project' \
--manual='Programming' \
--output=$@ \
./flex
+35 -36
View File
@@ -998,13 +998,13 @@ character range such as @samp{[a-z]} or @samp{[S-W]} where it is obvious that yo
want case-folding to occur. Here are some examples with the @samp{-i} flag
enabled:
@multitable {@samp{[a-zA-Z]}} {ambiguous} {@samp{[A-Z\[\\\]_`a-t]}} {@samp{[@@A-Z\[\\\]_`abc]}}
@multitable {@samp{[a-zA-Z]}} {ambiguous} {@samp{[A-Z\[\\\]^_`a-t]}} {@samp{[@@A-Z\[\\\]^_`abc]}}
@item Range @tab Result @tab Literal Range @tab Alternate Range
@item @samp{[a-t]} @tab ok @tab @samp{[a-tA-T]} @tab
@item @samp{[A-T]} @tab ok @tab @samp{[a-tA-T]} @tab
@item @samp{[A-t]} @tab ambiguous @tab @samp{[A-Z\[\\\]_`a-t]} @tab @samp{[a-tA-T]}
@item @samp{[A-t]} @tab ambiguous @tab @samp{[A-Z\[\\\]^_`a-t]} @tab @samp{[a-tA-T]}
@item @samp{[_-@{]} @tab ambiguous @tab @samp{[_`a-z@{]} @tab @samp{[_`a-zA-Z@{]}
@item @samp{[@@-C]} @tab ambiguous @tab @samp{[@@ABC]} @tab @samp{[@@A-Z\[\\\]_`abc]}
@item @samp{[@@-C]} @tab ambiguous @tab @samp{[@@ABC]} @tab @samp{[@@A-Z\[\\\]^_`abc]}
@end multitable
@cindex end of line, in negated character classes
@@ -1199,7 +1199,7 @@ run-time error results.
Also note that you cannot use @code{%array} with C++ scanner classes
(@pxref{Cxx}).
In target langages with automatic memory allocation and arrays, none
In target languages with automatic memory allocation and arrays, none
of this applies; you can expect @code{yytext} to dynamically resize
itself, calls to the @code{yyunput()} will not destroy the present
contents of @code{yytext}, and you will never get a run-time error
@@ -2481,7 +2481,7 @@ holds the length of the current token.
@item FILE *yyin
is the file which by default @code{flex} reads from.
In target languages other than C/C++, expect it to have
whatever natine type is associated with I/O streams. It may be
whatever native type is associated with I/O streams. It may be
redefined but doing so only makes sense before scanning begins or after
an EOF has been encountered. Changing it in the midst of scanning will
have unexpected results since @code{flex} buffers its input; use
@@ -2547,7 +2547,7 @@ is @code{TOK_NUMBER}, part of the scanner might look like:
@end verbatim
@end example
Bison is also retargetable to langages other than C. Outside the
Bison is also retargetable to languages other than C. Outside the
C/C++ back end, it is likely that your Bison module will simply export
module-level constants that will be made visible to your scanner by
linkage or by explicit import statements.
@@ -2649,7 +2649,7 @@ While in the header, the macro @code{yyIN_HEADER} is defined, where @samp{yy}
is substituted with the appropriate prefix.
The @samp{--header-file} option is not compatible with the @samp{--c++} option,
since the C++ scanner provides its own header in @file{yyFlexLexer.h}.
since the C++ scanner provides its own header in @file{FlexLexer.h}.
This option will generally be a no-op under target languages other
than C.
@@ -2727,9 +2727,9 @@ Python, etc.
Back ends other than the default C generator can't assume they have
the C preprocessor available. Therefore, Flex recognizes the
following function calls - yyecho(), yyless(), yymore(), yyinput(),
yystart(), yybegin(), yyunput(), yypanic() - and rewreites them adding a
yystart(), yybegin(), yyunput(), yypanic() - and rewrites them adding a
yyscanner final argument as though they were C macros. This optiion
is set to false whrn you select or default to the C back end, and to
is set to false when you select or default to the C back end, and to
true otherwise. You can turn it off (or on) explicitly after your
emit option.
@@ -2755,7 +2755,7 @@ implementation. Note that this does not mean @emph{full} compatibility.
Use of this option costs a considerable amount of performance, and it
cannot be used with the @samp{--c++}, @samp{--full}, @samp{--fast}, @samp{-Cf}, or
@samp{-CF} options. For details on the compatibilities it provides, see
@ref{Lex and Posix}. It will usuually be a no-op on back ends other
@ref{Lex and Posix}. It will usually be a no-op on back ends other
than C/C++.
This option also results in the name
@code{YY_FLEX_LEX_COMPAT} being @code{#define}'d in the generated scanner.
@@ -3138,8 +3138,8 @@ scanner, which simply calls @code{yylex()}. This option implies
@opindex yyterminate
@hkindex yyterminate
@item @code{%option yyterminate}
This is a string-valuued option with which you can specify an expansion
of the yyterminate() hook. whuch normally causes the generated
This is a string-valued option with which you can specify an expansion
of the yyterminate() hook. which normally causes the generated
scanner to return 0 as an end-of-input indication.
@anchor{option-nounistd}
@@ -3155,7 +3155,7 @@ to find them.
This option is obsolete, as after Flex was originally written
@file{unistd.h} became part of the Single Unix Specification and is
consequently everywhere; thuas there is no reason to use this option
consequently everywhere; thus there is no reason to use this option
on modern systems. It is included so as not to break compatibility
with old build scripts, and will have no effect on backends other than
the default C one.
@@ -4368,7 +4368,7 @@ to accomplish this. (See below).
In the default C/C++ back end @code{yylex_init} and
@code{yylex_destroy} must be called before and after @code{yylex},
respectively. This may not be true in other target langages,
respectively. This may not be true in other target languages,
especially those with automatic memory management.
@example
@@ -4533,7 +4533,7 @@ the scanner itself.
In the default C/C++ back end, the extra field in your scanner state
structure is defined as type @code{void *}; in other target languages
it might be a generic type, or no such field might be genetated at
it might be a generic type, or no such field might be generated at
all. In back ends which support this extra field, you may redefine
the type using @code{%option extra-type="your_type"} in the scanner:
@@ -4561,7 +4561,7 @@ void scan_file( char* filename )
in = fopen( filename, "r" );
stat( filename, &buf );
yylex_init_extra( buf, &scanner );
yylex_init_extra( &buf, &scanner );
yyset_in( in, scanner );
yylex( scanner );
yylex_destroy( scanner );
@@ -4672,7 +4672,7 @@ when @code{%option bison-locations} (@samp{--bison-locations}) is specified:
@end example
Support for yylval assumes that @code{YYSTYPE} is a valid type. Support for
yylloc assumes that @code{YYSLYPE} is a valid type. Typically, these types are
yylloc assumes that @code{YYLTYPE} is a valid type. Typically, these types are
generated by @code{bison}, and are included in section 1 of the @code{flex}
input.
@@ -8512,10 +8512,10 @@ is compatible with @code{bison}.
%option bison-bridge bison-locations
%
[[:digit:]]+ { yylval->num = atoi(yytext); return NUMBER;}
[[:alnum:]]+ { yylval->str = strdup(yytext); return STRING;}
"="|";" { return yytext[0];}
. {}
[[:digit:]]+ { yylval->num = atoi(yytext); return NUMBER; }
[[:alnum:]]+ { yylval->str = strdup(yytext); return STRING; }
"="|";" { return yytext[0]; }
. { continue; }
%
@end verbatim
@end example
@@ -8529,13 +8529,12 @@ As you can see, there really is no magic here. We just use
@example
@verbatim
/* Parser to convert "C" assignments to lisp. */
%{
%require "3.0"
/* Pass the argument to yyparse through to yylex. */
#define YYPARSE_PARAM scanner
#define YYLEX_PARAM scanner
%}
%param {yyscan_t scanner}
%locations
%pure_parser
%define api.pure full
%union {
int num;
char* str;
@@ -8545,7 +8544,7 @@ As you can see, there really is no magic here. We just use
%%
assignment:
STRING '=' NUMBER ';' {
printf( "(setf %s %d)", $1, $3 );
printf("(setf %s %d)", $1, $3);
}
;
@end verbatim
@@ -8666,7 +8665,7 @@ addition of the @samp{$} character.
@code{L?\"([^\"\\\n]|(\\['\"?\\abfnrtv])|(\\([0123456]@{1,3@}))|(\\x[[:xdigit:]]+)|(\\u([[:xdigit:]]@{4@}))|(\\U([[:xdigit:]]@{8@})))*\"}
@item C99 Comment
@code{("/*"([^*]|"*"[^/])*"*/")|("/"(\\\n)*"/"[^\n]*)}
@code{("/*"([^*]|"*"+[^*/])*"*"+"/")|("/"(\\\n)*"/"((\\\n)|[^\n])*)}
Note that in C99, a @samp{//}-style comment may be split across lines, and, contrary to popular belief,
does not include the trailing @samp{\n} character.
@@ -8761,7 +8760,7 @@ definitions Flex ships is that the bodies of initializers for arrays
of integers consist of decimal numeric literals separated by commas
(and optional whitespace).
Otherwise, knowledge of each target langage's syntax lives in a
Otherwise, knowledge of each target language's syntax lives in a
language-specific skeleton file that is digested into a data structure
inside Flex when Flex is compiled. The skeleton files are part of the
Flex source distribution; they are not required by the Flex
@@ -8792,7 +8791,7 @@ This file you are looking at is processed through GNU m4 during the
pre-compilation stage of Flex. At this time only macros starting with
`m4preproc_' are processed, and quoting is normal (that is, the quote
opener is a back-tick (ASCII 96) and the quote closer is a tick or
single quote (ASCII 39) @footnote{See chapter 3.2 of the m4 mamual,
single quote (ASCII 39) @footnote{See chapter 3.2 of the m4 manual,
``Quoting input to m4'', for more information.}. The main purpose of
this expansion phase is to set Flex version symbols.
@@ -8861,14 +8860,14 @@ is pointed at by the skel nember of your language back end.
@item
The interesting part: mutate your new back end and skeleton so they
produce code in your desired target langage.
produce code in your desired target language.
@item
Add a test suite for your back end. You should be able to clone
one of the existing sets of test loads to get good coverage. Note
that is highly unlikely your back end will be accepted into the
flex distribution without a test suite. Fortunately, adapting
the existing tests should not be difficult. There is some guisdance
the existing tests should not be difficult. There is some guidance
in the @file{tests/README} file of the source distrbution.
@end enumerate
@@ -9031,7 +9030,7 @@ call the special action @code{YY_NEW_FILE}. This is no longer
necessary.
@item
FLEX_SCANNER: Not neaningful outside of the C back end, and not defined.
FLEX_SCANNER: Not meaningful outside of the C back end, and not defined.
@item
FLEX_DEBUG: Outside the default C back end, this is a constant of type
@@ -9046,7 +9045,7 @@ YY_BUF_SIZE: replaced by @code{%option bufsize}.
@item:
yyterminate(): Backends that don't use the C preprocessor cannot
support redefinining this hook with #define. Instead, set it with
support redefining this hook with #define. Instead, set it with
the @code{yyterminate} option.
@end itemize
@@ -9062,7 +9061,7 @@ This is also why the functions @code{yy_current_buffer()},
@code{yy_flush_current_buffer()}, and @code{yy_set_interactive()}
do not have rewrite rules (see @xref{option-rewrite}); simply
removing the underscores would have produced names that are
unncomfortably long and hard on the eyeballs. We leave
uncomfortably long and hard on the eyeballs. We leave
it to the API binding for each individual target language to
choose whether they should be left as is, camel-cased, or
otherwise adapted to local conventions.
@@ -9127,7 +9126,7 @@ to specific locations in the generated scanner, and may be used to insert arbitr
@c endf
@c nnoremap <F5> 1G/@node\s\+unnamed-faq-\d\+<cr>mfww"wy5ezt:call Faq2()<cr>
@c Remaining problem points for the multilangage interface
@c Remaining problem points for the multilanguage interface
@c YY_NUM_RULES
@c YY_FLEX_MAJOR_VERSION
@c YY_FLEX_MINOR_VERSION
+1 -1
View File
@@ -2,7 +2,7 @@ This directory contains some examples of what you can do with
flex. These files are not tested regularly so you might have to tinker
a bit before they work for you. Updates, new files and patches are welcome.
- debflex.awk, an awk script for anotating flex debug output.
- debflex.awk, an awk script for annotating flex debug output.
It presently only works with gawk and mawk, not with "old"
or "new" awk.
+1 -1
View File
@@ -11,7 +11,7 @@ For example:
make -f Makefile.examples expr
If you ad an eample to this directory, don't frget these steps:
If you add an example to this directory, don't forget these steps:
* Add it to the EXTRA_DIST list in Makefile.am
+2 -2
View File
@@ -149,7 +149,7 @@ void write_block_header(char *type)
*/
^[^\n:]+\n[*]+\n write_block_header(CHAPTER);
^"= "[A-Z]" ="\n"="* { /* we create a seciton for each category */
^"= "[A-Z]" ="\n"="* { /* we create a section for each category */
if(need_closing == TRUE){
printf("@end table\n\n\n");
}
@@ -214,7 +214,7 @@ void write_block_header(char *type)
}
/*
* repoduce @enumerate lists
* reproduce @enumerate lists
*/
":"\n+[ \t]*[0-9]+"." {
+1
View File
@@ -1,3 +1,4 @@
*.la
*.lo
*.o
*.obj
+1 -1
View File
@@ -3,7 +3,7 @@
#include <sys/types.h>
void *malloc ();
void *malloc (size_t n);
/* Allocate an N-byte block of memory from the heap.
If N is zero, allocate a 1-byte block. */
+75 -25
View File
@@ -1,5 +1,5 @@
# ===========================================================================
# http://www.gnu.org/software/autoconf-archive/ax_prog_cc_for_build.html
# https://www.gnu.org/software/autoconf-archive/ax_prog_cc_for_build.html
# ===========================================================================
#
# SYNOPSIS
@@ -32,28 +32,32 @@
# and this notice are preserved. This file is offered as-is, without any
# warranty.
#serial 8
#serial 26
AU_ALIAS([AC_PROG_CC_FOR_BUILD], [AX_PROG_CC_FOR_BUILD])
AC_DEFUN([AX_PROG_CC_FOR_BUILD], [dnl
AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AC_PROG_CPP])dnl
AC_REQUIRE([AC_EXEEXT])dnl
AC_REQUIRE([AC_CANONICAL_HOST])dnl
AC_REQUIRE([AC_CANONICAL_BUILD])dnl
dnl Use the standard macros, but make them use other variable names
dnl
pushdef([ac_cv_prog_CPP], ac_cv_build_prog_CPP)dnl
pushdef([ac_cv_prog_gcc], ac_cv_build_prog_gcc)dnl
pushdef([ac_cv_prog_cc_c89], ac_cv_build_prog_cc_c89)dnl
pushdef([ac_cv_prog_cc_c99], ac_cv_build_prog_cc_c99)dnl
pushdef([ac_cv_prog_cc_c11], ac_cv_build_prog_cc_c11)dnl
pushdef([ac_cv_prog_cc_c23], ac_cv_build_prog_cc_c23)dnl
pushdef([ac_cv_prog_cc_stdc], ac_cv_build_prog_cc_stdc)dnl
pushdef([ac_cv_prog_cc_works], ac_cv_build_prog_cc_works)dnl
pushdef([ac_cv_prog_cc_cross], ac_cv_build_prog_cc_cross)dnl
pushdef([ac_cv_prog_cc_g], ac_cv_build_prog_cc_g)dnl
pushdef([ac_cv_exeext], ac_cv_build_exeext)dnl
pushdef([ac_cv_objext], ac_cv_build_objext)dnl
pushdef([ac_prog_cc_stdc], ac_build_prog_cc_stdc)dnl
pushdef([ac_exeext], ac_build_exeext)dnl
pushdef([ac_objext], ac_build_objext)dnl
pushdef([CC], CC_FOR_BUILD)dnl
pushdef([CPP], CPP_FOR_BUILD)dnl
pushdef([GCC], GCC_FOR_BUILD)dnl
pushdef([CFLAGS], CFLAGS_FOR_BUILD)dnl
pushdef([CPPFLAGS], CPPFLAGS_FOR_BUILD)dnl
pushdef([LDFLAGS], LDFLAGS_FOR_BUILD)dnl
@@ -67,27 +71,58 @@ pushdef([ac_cv_host_alias], ac_cv_build_alias)dnl
pushdef([ac_cv_host_cpu], ac_cv_build_cpu)dnl
pushdef([ac_cv_host_vendor], ac_cv_build_vendor)dnl
pushdef([ac_cv_host_os], ac_cv_build_os)dnl
pushdef([ac_cpp], ac_build_cpp)dnl
pushdef([ac_compile], ac_build_compile)dnl
pushdef([ac_link], ac_build_link)dnl
pushdef([ac_tool_prefix], ac_build_tool_prefix)dnl
pushdef([am_cv_CC_dependencies_compiler_type], am_cv_build_CC_dependencies_compiler_type)dnl
pushdef([am_cv_prog_cc_c_o], am_cv_build_prog_cc_c_o)dnl
pushdef([cross_compiling], cross_compiling_build)dnl
dnl
dnl These variables are problematic to rename by M4 macros, so we save
dnl their values in alternative names, and restore the values later.
dnl
dnl _AC_COMPILER_EXEEXT and _AC_COMPILER_OBJEXT internally call
dnl AC_SUBST which prevents the renaming of EXEEXT and OBJEXT
dnl variables. It's not a good idea to rename ac_cv_exeext and
dnl ac_cv_objext either as they're related.
dnl Renaming ac_exeext and ac_objext is safe though.
dnl
ac_cv_host_exeext=$ac_cv_exeext
AS_VAR_SET_IF([ac_cv_build_exeext],
[ac_cv_exeext=$ac_cv_build_exeext],
[AS_UNSET([ac_cv_exeext])])
ac_cv_host_objext=$ac_cv_objext
AS_VAR_SET_IF([ac_cv_build_objext],
[ac_cv_objext=$ac_cv_build_objext],
[AS_UNSET([ac_cv_objext])])
dnl
dnl ac_cv_c_compiler_gnu is used in _AC_LANG_COMPILER_GNU (called by
dnl AC_PROG_CC) indirectly.
dnl
ac_cv_host_c_compiler_gnu=$ac_cv_c_compiler_gnu
AS_VAR_SET_IF([ac_cv_build_c_compiler_gnu],
[ac_cv_c_compiler_gnu=$ac_cv_build_c_compiler_gnu],
[AS_UNSET([ac_cv_c_compiler_gnu])])
save_cross_compiling=$cross_compiling
save_ac_tool_prefix=$ac_tool_prefix
cross_compiling=no
ac_tool_prefix=
cross_compiling_build=no
ac_build_tool_prefix=
AS_IF([test -n "$build"], [ac_build_tool_prefix="$build-"],
[test -n "$build_alias"],[ac_build_tool_prefix="$build_alias-"])
AC_LANG_PUSH([C])
AC_PROG_CC
_AC_COMPILER_EXEEXT
_AC_COMPILER_OBJEXT
AC_PROG_CPP
AC_EXEEXT
ac_tool_prefix=$save_ac_tool_prefix
cross_compiling=$save_cross_compiling
BUILD_EXEEXT=$ac_cv_exeext
BUILD_OBJEXT=$ac_cv_objext
dnl Restore the old definitions
dnl
popdef([ac_link])dnl
popdef([ac_compile])dnl
popdef([ac_cpp])dnl
popdef([cross_compiling])dnl
popdef([am_cv_prog_cc_c_o])dnl
popdef([am_cv_CC_dependencies_compiler_type])dnl
popdef([ac_tool_prefix])dnl
popdef([ac_cv_host_os])dnl
popdef([ac_cv_host_vendor])dnl
popdef([ac_cv_host_cpu])dnl
@@ -101,24 +136,39 @@ popdef([host])dnl
popdef([LDFLAGS])dnl
popdef([CPPFLAGS])dnl
popdef([CFLAGS])dnl
popdef([GCC])dnl
popdef([CPP])dnl
popdef([CC])dnl
popdef([ac_objext])dnl
popdef([ac_exeext])dnl
popdef([ac_cv_objext])dnl
popdef([ac_cv_exeext])dnl
popdef([ac_prog_cc_stdc])dnl
popdef([ac_cv_prog_cc_g])dnl
popdef([ac_cv_prog_cc_cross])dnl
popdef([ac_cv_prog_cc_works])dnl
popdef([ac_cv_prog_cc_stdc])dnl
popdef([ac_cv_prog_cc_c23])dnl
popdef([ac_cv_prog_cc_c11])dnl
popdef([ac_cv_prog_cc_c99])dnl
popdef([ac_cv_prog_cc_c89])dnl
popdef([ac_cv_prog_gcc])dnl
popdef([ac_cv_prog_CPP])dnl
dnl
ac_cv_exeext=$ac_cv_host_exeext
EXEEXT=$ac_cv_host_exeext
ac_cv_objext=$ac_cv_host_objext
OBJEXT=$ac_cv_host_objext
ac_cv_c_compiler_gnu=$ac_cv_host_c_compiler_gnu
ac_compiler_gnu=$ac_cv_host_c_compiler_gnu
dnl restore global variables ac_ext, ac_cpp, ac_compile,
dnl ac_link, ac_compiler_gnu (dependent on the current
dnl language after popping):
AC_LANG_POP([C])
dnl Finally, set Makefile variables
dnl
BUILD_EXEEXT=$ac_build_exeext
BUILD_OBJEXT=$ac_build_objext
AC_SUBST(BUILD_EXEEXT)dnl
AC_SUBST(BUILD_OBJEXT)dnl
AC_SUBST([BUILD_EXEEXT])dnl
AC_SUBST([BUILD_OBJEXT])dnl
AC_SUBST([CFLAGS_FOR_BUILD])dnl
AC_SUBST([CPPFLAGS_FOR_BUILD])dnl
AC_SUBST([LDFLAGS_FOR_BUILD])dnl
+375 -386
View File
File diff suppressed because it is too large Load Diff
+876
View File
@@ -0,0 +1,876 @@
# Georgian translation for flex.
# Copyright (C) 2022 The Flex Project (msgids)
# This file is distributed under the same license as the flex package.
# Temuri Doghonadze <temuri.doghonadze@gmail.com>, 2022.
#
msgid ""
msgstr ""
"Project-Id-Version: flex 2.6.4\n"
"Report-Msgid-Bugs-To: flex-devel@lists.sourceforge.net\n"
"POT-Creation-Date: 2017-05-06 10:49-0400\n"
"PO-Revision-Date: 2022-12-24 07:51+0100\n"
"Last-Translator: Temuri Doghonadze <temuri.doghonadze@gmail.com>\n"
"Language-Team: Georgian <(nothing)>\n"
"Language: ka\n"
"X-Bugs: Report translation errors to the Language-Team address.\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 3.2.2\n"
#: src/buf.c:79
msgid "Allocation of buffer to print string failed"
msgstr ""
#: src/buf.c:107
msgid "Allocation of buffer for line directive failed"
msgstr ""
#: src/buf.c:177
msgid "Allocation of buffer for m4 def failed"
msgstr ""
#: src/buf.c:198
msgid "Allocation of buffer for m4 undef failed"
msgstr ""
#: src/dfa.c:59
#, c-format
msgid "State #%d is non-accepting -\n"
msgstr ""
#: src/dfa.c:119
msgid "dangerous trailing context"
msgstr ""
#: src/dfa.c:159
#, c-format
msgid " associated rule line numbers:"
msgstr ""
#: src/dfa.c:193
#, c-format
msgid " out-transitions: "
msgstr " out-გადასვლები: "
#: src/dfa.c:201
#, c-format
msgid ""
"\n"
" jam-transitions: EOF "
msgstr ""
"\n"
" jam-გადასვლები: EOF "
#: src/dfa.c:331
msgid "consistency check failed in epsclosure()"
msgstr ""
#: src/dfa.c:419
msgid ""
"\n"
"\n"
"DFA Dump:\n"
"\n"
msgstr ""
"\n"
"\n"
"DFA-ის დამპი:\n"
"\n"
#: src/dfa.c:587
msgid "could not create unique end-of-buffer state"
msgstr ""
#: src/dfa.c:608
#, c-format
msgid "state # %d:\n"
msgstr "მდგომარეობა # %d:\n"
#: src/dfa.c:768
msgid "Could not write yynxt_tbl[][]"
msgstr ""
#: src/dfa.c:1028
msgid "bad transition character detected in sympartition()"
msgstr ""
#: src/gen.c:480
msgid ""
"\n"
"\n"
"Equivalence Classes:\n"
"\n"
msgstr ""
"\n"
"ეკვივალენტობის კლასები:\n"
"\n"
#: src/gen.c:669 src/gen.c:698 src/gen.c:1218
#, c-format
msgid "state # %d accepts: [%d]\n"
msgstr ""
#: src/gen.c:1115
#, c-format
msgid "state # %d accepts: "
msgstr ""
#: src/gen.c:1162
msgid "Could not write yyacclist_tbl"
msgstr "ჩაწერის შეცდომა: yyacclist_tbl"
#: src/gen.c:1236
msgid "Could not write yyacc_tbl"
msgstr "ჩაწერის შეცდომა: yyacc_tbl"
#: src/gen.c:1251 src/gen.c:1623 src/gen.c:1646
msgid "Could not write ecstbl"
msgstr "ჩაწერის შეცდომა: ecstbl"
#: src/gen.c:1271
msgid ""
"\n"
"\n"
"Meta-Equivalence Classes:\n"
msgstr ""
"\n"
"\n"
"მეტა-ექვივალენტობის კლასები:\n"
#: src/gen.c:1293
msgid "Could not write yymeta_tbl"
msgstr "ჩაწერის შეცდომა: yymeta_tbl"
#: src/gen.c:1352
msgid "Could not write yybase_tbl"
msgstr "ჩაწერის შეცდომა: yybase_tbl"
#: src/gen.c:1384
msgid "Could not write yydef_tbl"
msgstr "ჩაწერის შეცდომა: yydef_tbl"
#: src/gen.c:1422
msgid "Could not write yynxt_tbl"
msgstr "ჩაწერის შეცდომა: yynxt_tbl"
#: src/gen.c:1456
msgid "Could not write yychk_tbl"
msgstr "ჩაწერის შეცდომა: yychk_tbl"
#: src/gen.c:1608 src/gen.c:1637
msgid "Could not write ftbl"
msgstr "ჩაწერის შეცდომა: ftbl"
#: src/gen.c:1614
msgid "Could not write ssltbl"
msgstr "ჩაწერის შეცდომა: ssltbl"
#: src/gen.c:1665
msgid "Could not write eoltbl"
msgstr "ჩაწერის შეცდომა: eoltbl"
#: src/gen.c:1722
msgid "Could not write yynultrans_tbl"
msgstr "ჩაწერის შეცდომა: yynultrans_tbl"
#: src/main.c:178
msgid "rule cannot be matched"
msgstr ""
#: src/main.c:183
msgid "-s option given but default rule can be matched"
msgstr ""
#: src/main.c:221
msgid "Can't use -+ with -l option"
msgstr ""
#: src/main.c:224
msgid "Can't use -f or -F with -l option"
msgstr ""
#: src/main.c:228
msgid "Can't use --reentrant or --bison-bridge with -l option"
msgstr ""
#: src/main.c:260
msgid "-Cf/-CF and -Cm don't make sense together"
msgstr ""
#: src/main.c:263
msgid "-Cf/-CF and -I are incompatible"
msgstr "-Cf /-CF და - მე შეუთავსებელია"
#: src/main.c:267
msgid "-Cf/-CF are incompatible with lex-compatibility mode"
msgstr ""
#: src/main.c:272
msgid "-Cf and -CF are mutually exclusive"
msgstr "-Cf და -CF ურთიერთგამომრიცხავია"
#: src/main.c:276
msgid "Can't use -+ with -CF option"
msgstr ""
#: src/main.c:279
#, c-format
msgid "%array incompatible with -+ option"
msgstr ""
#: src/main.c:284
msgid "Options -+ and --reentrant are mutually exclusive."
msgstr ""
#: src/main.c:287
msgid "bison bridge not supported for the C++ scanner."
msgstr ""
#: src/main.c:336 src/main.c:419
#, c-format
msgid "could not create %s"
msgstr "%s-ის შექმნის შეცდომა"
#: src/main.c:431
msgid "could not write tables header"
msgstr "ცხრილების თავსართის ჩაწერის შეცდომა"
#: src/main.c:435
#, c-format
msgid "can't open skeleton file %s"
msgstr "ჩონჩხის ფაილის %s გახსნის შეცდომა"
#: src/main.c:450
msgid "Prefix cannot include '[' or ']'"
msgstr ""
#: src/main.c:474
msgid "allocation of macro definition failed"
msgstr ""
#: src/main.c:521
#, c-format
msgid "input error reading skeleton file %s"
msgstr ""
#: src/main.c:525
#, c-format
msgid "error closing skeleton file %s"
msgstr ""
#: src/main.c:709
#, c-format
msgid "error creating header file %s"
msgstr ""
#: src/main.c:717
#, c-format
msgid "error writing output file %s"
msgstr ""
#: src/main.c:721
#, c-format
msgid "error closing output file %s"
msgstr ""
#: src/main.c:725
#, c-format
msgid "error deleting output file %s"
msgstr ""
#: src/main.c:732
#, c-format
msgid "No backing up.\n"
msgstr "მარქაფი გამორთულია.\n"
#: src/main.c:736
#, c-format
msgid "%d backing up (non-accepting) states.\n"
msgstr ""
#: src/main.c:740
#, c-format
msgid "Compressed tables always back up.\n"
msgstr ""
#: src/main.c:743
#, c-format
msgid "error writing backup file %s"
msgstr ""
#: src/main.c:747
#, c-format
msgid "error closing backup file %s"
msgstr ""
#: src/main.c:752
#, c-format
msgid "%s version %s usage statistics:\n"
msgstr ""
#: src/main.c:755
#, c-format
msgid " scanner options: -"
msgstr " სკანერის პარამეტრების ჩვენება: -"
#: src/main.c:834
#, c-format
msgid " %d/%d NFA states\n"
msgstr " %d/%d NFA მდგომარეობები\n"
#: src/main.c:836
#, c-format
msgid " %d/%d DFA states (%d words)\n"
msgstr " %d/%d DFA მდგომარეობები (%d სიტყვა)\n"
#: src/main.c:838
#, c-format
msgid " %d rules\n"
msgstr " %d წესი\n"
#: src/main.c:843
#, c-format
msgid " No backing up\n"
msgstr " მარქაფის გარეშე\n"
#: src/main.c:847
#, c-format
msgid " %d backing-up (non-accepting) states\n"
msgstr ""
#: src/main.c:852
#, c-format
msgid " Compressed tables always back-up\n"
msgstr ""
#: src/main.c:856
#, c-format
msgid " Beginning-of-line patterns used\n"
msgstr ""
#: src/main.c:858
#, c-format
msgid " %d/%d start conditions\n"
msgstr " %d/%d გაშვების პირობები\n"
#: src/main.c:862
#, c-format
msgid " %d epsilon states, %d double epsilon states\n"
msgstr ""
#: src/main.c:866
#, c-format
msgid " no character classes\n"
msgstr " სიმბოლოს კლასების გარეშე\n"
#: src/main.c:870
#, c-format
msgid " %d/%d character classes needed %d/%d words of storage, %d reused\n"
msgstr ""
#: src/main.c:875
#, c-format
msgid " %d state/nextstate pairs created\n"
msgstr ""
#: src/main.c:878
#, c-format
msgid " %d/%d unique/duplicate transitions\n"
msgstr ""
#: src/main.c:883
#, c-format
msgid " %d table entries\n"
msgstr " %d ცხრილის ჩანაწერი\n"
#: src/main.c:891
#, c-format
msgid " %d/%d base-def entries created\n"
msgstr ""
#: src/main.c:895
#, c-format
msgid " %d/%d (peak %d) nxt-chk entries created\n"
msgstr ""
#: src/main.c:899
#, c-format
msgid " %d/%d (peak %d) template nxt-chk entries created\n"
msgstr ""
#: src/main.c:903
#, c-format
msgid " %d empty table entries\n"
msgstr " %d ცხრილის ცარიელი ჩანაწერი\n"
#: src/main.c:905
#, c-format
msgid " %d protos created\n"
msgstr " %d პროტოტიპი შექმნილია\n"
#: src/main.c:908
#, c-format
msgid " %d templates created, %d uses\n"
msgstr ""
#: src/main.c:916
#, c-format
msgid " %d/%d equivalence classes created\n"
msgstr ""
#: src/main.c:924
#, c-format
msgid " %d/%d meta-equivalence classes created\n"
msgstr ""
#: src/main.c:930
#, c-format
msgid " %d (%d saved) hash collisions, %d DFAs equal\n"
msgstr ""
#: src/main.c:932
#, c-format
msgid " %d sets of reallocations needed\n"
msgstr ""
#: src/main.c:934
#, c-format
msgid " %d total table entries needed\n"
msgstr ""
#: src/main.c:1008
#, c-format
msgid "Internal error. flexopts are malformed.\n"
msgstr "შიდა შეცდომა. flexopts არასწორია.\n"
#: src/main.c:1018
#, c-format
msgid "Try `%s --help' for more information.\n"
msgstr "მეტი ინფორმაციისთვის სცადეთ '%s --help'\n"
#: src/main.c:1075
#, c-format
msgid "unknown -C option '%c'"
msgstr "უცნობი -C -ის პარამეტრი '%c'"
#: src/main.c:1204
#, c-format
msgid "%s %s\n"
msgstr "%s %s\n"
#: src/main.c:1476
msgid "fatal parse error"
msgstr "ფატალური შეცდომა დამუშავებისას"
#: src/main.c:1508
#, c-format
msgid "could not create backing-up info file %s"
msgstr ""
#: src/main.c:1529
#, c-format
msgid "-l AT&T lex compatibility option entails a large performance penalty\n"
msgstr ""
#: src/main.c:1532
#, c-format
msgid " and may be the actual source of other reported performance penalties\n"
msgstr ""
#: src/main.c:1538
#, c-format
msgid "%%option yylineno entails a performance penalty ONLY on rules that can match newline characters\n"
msgstr ""
#: src/main.c:1545
#, c-format
msgid "-I (interactive) entails a minor performance penalty\n"
msgstr ""
#: src/main.c:1550
#, c-format
msgid "yymore() entails a minor performance penalty\n"
msgstr "yymore() მცირე წარმადობის ხინჯს შეიცავს\n"
#: src/main.c:1556
#, c-format
msgid "REJECT entails a large performance penalty\n"
msgstr "REJECT წარმადობის დიდ ხინჯს შეიცავს\n"
#: src/main.c:1561
#, c-format
msgid "Variable trailing context rules entail a large performance penalty\n"
msgstr ""
#: src/main.c:1573
msgid "REJECT cannot be used with -f or -F"
msgstr ""
#: src/main.c:1576
#, c-format
msgid "%option yylineno cannot be used with REJECT"
msgstr ""
#: src/main.c:1579
msgid "variable trailing context rules cannot be used with -f or -F"
msgstr ""
#: src/main.c:1704
#, c-format
msgid "%option yyclass only meaningful for C++ scanners"
msgstr ""
#: src/main.c:1791
#, c-format
msgid "Usage: %s [OPTIONS] [FILE]...\n"
msgstr ""
#: src/main.c:1794
#, c-format
msgid ""
"Generates programs that perform pattern-matching on text.\n"
"\n"
"Table Compression:\n"
" -Ca, --align trade off larger tables for better memory alignment\n"
" -Ce, --ecs construct equivalence classes\n"
" -Cf do not compress tables; use -f representation\n"
" -CF do not compress tables; use -F representation\n"
" -Cm, --meta-ecs construct meta-equivalence classes\n"
" -Cr, --read use read() instead of stdio for scanner input\n"
" -f, --full generate fast, large scanner. Same as -Cfr\n"
" -F, --fast use alternate table representation. Same as -CFr\n"
" -Cem default compression (same as --ecs --meta-ecs)\n"
"\n"
"Debugging:\n"
" -d, --debug enable debug mode in scanner\n"
" -b, --backup write backing-up information to %s\n"
" -p, --perf-report write performance report to stderr\n"
" -s, --nodefault suppress default rule to ECHO unmatched text\n"
" -T, --trace %s should run in trace mode\n"
" -w, --nowarn do not generate warnings\n"
" -v, --verbose write summary of scanner statistics to stdout\n"
" --hex use hexadecimal numbers instead of octal in debug outputs\n"
"\n"
"Files:\n"
" -o, --outfile=FILE specify output filename\n"
" -S, --skel=FILE specify skeleton file\n"
" -t, --stdout write scanner on stdout instead of %s\n"
" --yyclass=NAME name of C++ class\n"
" --header-file=FILE create a C header file in addition to the scanner\n"
" --tables-file[=FILE] write tables to FILE\n"
"\n"
"Scanner behavior:\n"
" -7, --7bit generate 7-bit scanner\n"
" -8, --8bit generate 8-bit scanner\n"
" -B, --batch generate batch scanner (opposite of -I)\n"
" -i, --case-insensitive ignore case in patterns\n"
" -l, --lex-compat maximal compatibility with original lex\n"
" -X, --posix-compat maximal compatibility with POSIX lex\n"
" -I, --interactive generate interactive scanner (opposite of -B)\n"
" --yylineno track line count in yylineno\n"
"\n"
"Generated code:\n"
" -+, --c++ generate C++ scanner class\n"
" -Dmacro[=defn] #define macro defn (default defn is '1')\n"
" -L, --noline suppress #line directives in scanner\n"
" -P, --prefix=STRING use STRING as prefix instead of \"yy\"\n"
" -R, --reentrant generate a reentrant C scanner\n"
" --bison-bridge scanner for bison pure parser.\n"
" --bison-locations include yylloc support.\n"
" --stdinit initialize yyin/yyout to stdin/stdout\n"
" --nounistd do not include <unistd.h>\n"
" --noFUNCTION do not generate a particular FUNCTION\n"
"\n"
"Miscellaneous:\n"
" -c do-nothing POSIX option\n"
" -n do-nothing POSIX option\n"
" -?\n"
" -h, --help produce this help message\n"
" -V, --version report %s version\n"
msgstr ""
#: src/misc.c:64
msgid "allocation of sko_stack failed"
msgstr ""
#: src/misc.c:100
#, c-format
msgid "name \"%s\" ridiculously long"
msgstr ""
#: src/misc.c:155
msgid "memory allocation failed in allocate_array()"
msgstr ""
#: src/misc.c:205
#, c-format
msgid "bad character '%s' detected in check_char()"
msgstr ""
#: src/misc.c:210
#, c-format
msgid "scanner requires -8 flag to use the character %s"
msgstr ""
#: src/misc.c:229
msgid "memory allocation failure in xstrdup()"
msgstr ""
#: src/misc.c:303
#, c-format
msgid "%s: fatal internal error, %s\n"
msgstr ""
#: src/misc.c:671
msgid "attempt to increase array size failed"
msgstr ""
#: src/misc.c:795
msgid "bad line in skeleton file"
msgstr ""
#: src/misc.c:845
msgid "memory allocation failed in yy_flex_xmalloc()"
msgstr ""
#: src/nfa.c:100
#, c-format
msgid ""
"\n"
"\n"
"********** beginning dump of nfa with start state %d\n"
msgstr ""
#: src/nfa.c:111
#, c-format
msgid "state # %4d\t"
msgstr ""
#: src/nfa.c:126
#, c-format
msgid "********** end of dump\n"
msgstr ""
#: src/nfa.c:169
msgid "empty machine in dupmachine()"
msgstr ""
#: src/nfa.c:234
#, c-format
msgid "Variable trailing context rule at line %d\n"
msgstr ""
#: src/nfa.c:357
msgid "bad state type in mark_beginning_as_normal()"
msgstr ""
#: src/nfa.c:595
#, c-format
msgid "input rules are too complicated (>= %d NFA states)"
msgstr ""
#: src/nfa.c:673
msgid "found too many transitions in mkxtion()"
msgstr ""
#: src/nfa.c:699
#, c-format
msgid "too many rules (> %d)!"
msgstr ""
#: src/parse.y:159
msgid "unknown error processing section 1"
msgstr ""
#: src/parse.y:184 src/parse.y:353
msgid "bad start condition list"
msgstr ""
#: src/parse.y:204
msgid "Prefix must not contain [ or ]"
msgstr ""
#: src/parse.y:317
msgid "unrecognized rule"
msgstr ""
#: src/parse.y:436 src/parse.y:449 src/parse.y:518
msgid "trailing context used twice"
msgstr ""
#: src/parse.y:554 src/parse.y:564 src/parse.y:637 src/parse.y:647
msgid "bad iteration values"
msgstr ""
#: src/parse.y:582 src/parse.y:600 src/parse.y:665 src/parse.y:683
msgid "iteration value must be positive"
msgstr ""
#: src/parse.y:806 src/parse.y:816
#, c-format
msgid "the character range [%c-%c] is ambiguous in a case-insensitive scanner"
msgstr ""
#: src/parse.y:821
msgid "negative range in character class"
msgstr ""
#: src/parse.y:918
msgid "[:^lower:] is ambiguous in case insensitive scanner"
msgstr ""
#: src/parse.y:924
msgid "[:^upper:] ambiguous in case insensitive scanner"
msgstr ""
#: src/scan.l:82 src/scan.l:644 src/scan.l:702
msgid "Input line too long\n"
msgstr ""
#: src/scan.l:183
#, c-format
msgid "malformed '%top' directive"
msgstr ""
#: src/scan.l:205
#, no-c-format
msgid "unrecognized '%' directive"
msgstr ""
#: src/scan.l:214
msgid "Definition name too long\n"
msgstr ""
#: src/scan.l:309
msgid "Unmatched '{'"
msgstr ""
#: src/scan.l:325
#, c-format
msgid "Definition value for {%s} too long\n"
msgstr ""
#: src/scan.l:342
msgid "incomplete name definition"
msgstr ""
#: src/scan.l:467
msgid "Option line too long\n"
msgstr ""
#: src/scan.l:475
#, c-format
msgid "unrecognized %%option: %s"
msgstr ""
#: src/scan.l:659 src/scan.l:832
msgid "bad character class"
msgstr ""
#: src/scan.l:709
#, c-format
msgid "undefined definition {%s}"
msgstr ""
#: src/scan.l:772
msgid "unbalanced parenthesis"
msgstr ""
#: src/scan.l:787
#, c-format
msgid "bad <start condition>: %s"
msgstr ""
#: src/scan.l:800
msgid "missing quote"
msgstr ""
#: src/scan.l:866
#, c-format
msgid "bad character class expression: %s"
msgstr ""
#: src/scan.l:888
msgid "bad character inside {}'s"
msgstr ""
#: src/scan.l:894
msgid "missing }"
msgstr ""
#: src/scan.l:972
msgid "EOF encountered inside an action"
msgstr ""
#: src/scan.l:977
msgid "EOF encountered inside pattern"
msgstr ""
#: src/scan.l:1010
#, c-format
msgid "bad character: %s"
msgstr ""
#: src/scan.l:1038
#, c-format
msgid "can't open %s"
msgstr "'%s'-ის გახსნის შეცდომა"
#: src/scanopt.c:259
#, c-format
msgid "Usage: %s [OPTIONS]...\n"
msgstr ""
#: src/scanopt.c:524
#, c-format
msgid "option `%s' doesn't allow an argument\n"
msgstr ""
#: src/scanopt.c:529
#, c-format
msgid "option `%s' requires an argument\n"
msgstr ""
#: src/scanopt.c:533
#, c-format
msgid "option `%s' is ambiguous\n"
msgstr ""
#: src/scanopt.c:537
#, c-format
msgid "Unrecognized option `%s'\n"
msgstr ""
#: src/scanopt.c:541
#, c-format
msgid "Unknown error=(%d)\n"
msgstr ""
#: src/sym.c:92
msgid "symbol table memory allocation failed"
msgstr ""
#: src/sym.c:183
msgid "name defined twice"
msgstr ""
#: src/sym.c:231
#, c-format
msgid "start condition %s declared twice"
msgstr ""
#: src/yylex.c:57
msgid "premature EOF"
msgstr ""
#: src/yylex.c:200
#, c-format
msgid "End Marker\n"
msgstr ""
#: src/yylex.c:206
#, c-format
msgid "*Something Weird* - tok: %d val: %d\n"
msgstr ""
+9 -1
View File
@@ -4,10 +4,18 @@
*-flex.h
config.h
config.h.in
config_for_build.h
flex
libfl.pc
parse.c
parse.h
scan.c
stage1scan.[cl]
stage1scan.c
stage1flex
stage2compare
stage2scan.c
# for MSWindows
*.obj
*.exe
+57 -22
View File
@@ -1,5 +1,6 @@
AM_YFLAGS = -d
AM_CPPFLAGS = -DLOCALEDIR=\"$(localedir)\"
AM_CFLAGS = $(WARNINGFLAGS)
LIBS = @LIBS@
pkgconfigdir = @pkgconfigdir@
@@ -8,6 +9,9 @@ m4 = @M4@
bin_PROGRAMS = flex
if ENABLE_BOOTSTRAP
noinst_PROGRAMS = stage1flex
if !CROSS
noinst_DATA = stage2compare
endif
endif
if ENABLE_LIBFL
@@ -23,6 +27,9 @@ stage1flex_SOURCES = \
scan.l \
$(COMMON_SOURCES)
nodist_stage1flex_SOURCES = \
$(SKELINCLUDES)
if CROSS
stage1flex_LDADD =
stage1flex_SOURCES += \
@@ -32,7 +39,7 @@ stage1flex_LINK = $(LIBTOOL) --tag=CC --mode=link $(CC_FOR_BUILD) \
$(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) -o $@
$(stage1flex_OBJECTS): CC=$(CC_FOR_BUILD)
$(stage1flex_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD)
$(stage1flex_OBJECTS): CFLAGS=$(CFLAGS_FOR_BUILD) -DUSE_CONFIG_FOR_BUILD
$(stage1flex_OBJECTS): CPP=$(CPP_FOR_BUILD)
$(stage1flex_OBJECTS): CPPFLAGS=$(CPPFLAGS_FOR_BUILD)
$(stage1flex_OBJECTS): LDFLAGS=$(LDFLAGS_FOR_BUILD)
@@ -46,9 +53,13 @@ flex_SOURCES = \
$(COMMON_SOURCES)
nodist_flex_SOURCES = \
stage1scan.c
$(SKELINCLUDES)
flex_CFLAGS = $(AM_CFLAGS) $(WARNINGFLAGS)
if ENABLE_BOOTSTRAP
nodist_flex_SOURCES += stage1scan.c
else
flex_SOURCES += scan.l
endif
COMMON_SOURCES = \
buf.c \
@@ -95,16 +106,19 @@ EXTRA_DIST = \
gettext.h \
chkskel.sh
CLEANFILES = stage1scan.c stage1flex$(EXEEXT)
MOSTLYCLEANFILES = \
$(SKELINCLUDES) \
stage1scan.c \
stage2scan.c \
stage2compare
BUILT_SOURCES = \
CLEANFILES = stage1flex$(EXEEXT)
SKELINCLUDES = \
cpp-flex.h \
c99-flex.h \
go-flex.h
clean-local:
rm -f $(BUILT_SOURCES)
cpp-flex.h: cpp-flex.skl mkskel.sh flexint_shared.h tables_shared.h tables_shared.c
$(SHELL) $(srcdir)/mkskel.sh cpp $(srcdir) $(m4) $(VERSION) > $@.tmp
$(SHELL) $(srcdir)/chkskel.sh $@.tmp
@@ -120,33 +134,54 @@ go-flex.h: go-flex.skl mkskel.sh
$(SHELL) $(srcdir)/chkskel.sh $@.tmp
mv -f $@.tmp $@
if ENABLE_BOOTSTRAP
# The input and output file names are fixed for deterministic scanner
# generation. If scan.l is not modified by builders, stage1scan.c should
# be bit-identical to the scan.c pregenerated on release.
stage1scan.c: scan.l stage1flex$(EXEEXT)
./stage1flex$(EXEEXT) $(AM_LFLAGS) $(LFLAGS) -o $@ $(srcdir)/scan.l
else
stage1scan.c: scan.c
sed 's|^\(#line .*\)"'`printf %s $< | sed 's|[][\\\\.*]|\\\\&|g'`'"|\1"$@"|g' $< > $@
endif
( cd $(srcdir) && $(abs_builddir)/stage1flex$(EXEEXT) \
$(AM_LFLAGS) $(LFLAGS) -o scan.c -t scan.l ) >$@ || \
{ s=$$?; rm -f $@; exit $$s; }
# Unlike stage1scan.c, we leave stage2scan.c intact when the generation
# fails. This allow users to examine generation errors.
stage2scan.c: scan.l flex$(EXEEXT) stage1scan.c
( cd $(srcdir) && $(abs_builddir)/flex$(EXEEXT) \
$(AM_LFLAGS) $(LFLAGS) -o scan.c -t scan.l ) >$@
stage2compare: stage1scan.c
@rm -f stage2scan.c; \
$(MAKE) $(AM_MAKEFLAGS) stage2scan.c; \
echo Comparing stage1scan.c and stage2scan.c; \
cmp stage1scan.c stage2scan.c || { \
s=$$?; \
echo "Bootstrap comparison failure!"; \
exit $$s; \
}; \
echo Comparison successful.; \
echo success >$@
dist-hook: scan.l flex$(EXEEXT)
chmod u+w $(distdir) && \
chmod u+w $(distdir)/scan.c && \
./flex$(EXEEXT) -o scan.c $< && \
( cd $(srcdir) && $(abs_builddir)/flex$(EXEEXT) \
-o scan.c -t scan.l ) >scan.c && \
mv -f scan.c $(distdir)
# make needs to be told to make inclusions so that parallelized runs will
# not fail.
SKELINCLUDES := $(subst skl,h,$(wildcard *.skl))
stage1flex-skeletons.$(OBJEXT): $(SKELINCLUDES)
skeletons.$(OBJEXT): $(SKELINCLUDES)
stage1flex-main.$(OBJEXT): parse.h $(SKELINCLUDES)
flex-main.$(OBJEXT): parse.h $(SKELINCLUDES)
stage1flex-main.$(OBJEXT): parse.h
main.$(OBJEXT): parse.h
stage1flex-yylex.$(OBJEXT): parse.h $(SKELINCLUDES)
flex-yylex.$(OBJEXT): parse.h $(SKELINCLUDES)
stage1flex-yylex.$(OBJEXT): parse.h
yylex.$(OBJEXT): parse.h
stage1flex-scan.$(OBJEXT): parse.h $(SKELINCLUDES)
flex-stage1scan.$(OBJEXT): parse.h $(SKELINCLUDES)
stage1flex-scan.$(OBJEXT): parse.h
stage1scan.$(OBJEXT): parse.h
scan.$(OBJEXT): parse.h
# Run GNU indent on sources. Don't run this unless all the sources compile cleanly.
#
+3 -1
View File
@@ -1,5 +1,7 @@
/* flex - tool to generate fast lexical analyzers */
/* SPDX-License-Identifier: BSD-3-Clause-flex */
/* Copyright (c) 1990 The Regents of the University of California. */
/* All rights reserved. */
@@ -53,7 +55,7 @@ struct Buf top_buf; /**< contains %top code. String buffer. */
struct Buf *buf_prints (struct Buf *buf, const char *fmt, const char *s)
{
char *t;
size_t tsz;
size_t tsz;
tsz = strlen(fmt) + strlen(s) + 1;
t = malloc(tsz);
+20 -14
View File
@@ -65,7 +65,7 @@ m4_define([[M4_HOOK_CONST_DEFINE_BYTE]], [[const char $1 = $2;
]])
m4_define([[M4_HOOK_CONST_DEFINE_STATE]], [[#define $1 $2
]])
m4_define([[M4_HOOK_CONST_DEFINE_UINT]], [[const uint $1 = $2;
m4_define([[M4_HOOK_CONST_DEFINE_UINT]], [[const unsigned int $1 = $2;
]])
m4_define([[M4_HOOK_CONST_DEFINE_BOOL]], [[const bool $1 = $2;
]])
@@ -221,7 +221,7 @@ m4_ifdef( [[M4_YY_ALWAYS_INTERACTIVE]], ,
#include <stdlib.h>
#include <stdbool.h>
#include <stdint.h>
#include <unistd.h> /* requred for isatty() */
#include <unistd.h> /* required for isatty() */
#if defined(__GNUC__) && __GNUC__ >= 3
#define yynoreturn __attribute__((__noreturn__))
@@ -259,9 +259,9 @@ const int YY_NULL = 0;
*/
m4_define([[YY_SC_TO_UI]], [[((YY_CHAR)($1))]])
/* In the ancestal C back end this was a void pointer, meant to be
/* In the ancestral C back end this was a void pointer, meant to be
* opaque pointer. That indirection has been removed here as it
* wouldn't easily port to other langages.
* wouldn't easily port to other languages.
*/
typedef struct yyguts_t *yyscan_t;
@@ -854,8 +854,10 @@ void yypop_buffer_state (yyscan_t yyscanner)
*/
void yyrestart(FILE * input_file, yyscan_t yyscanner)
{
m4_ifdef( [[M4_MODE_USES_REJECT]], [[
size_t new_size = 0;
yy_state_type *new_state_buf = 0;
]] )
if ( yy_current_buffer(yyscanner) == NULL ) {
yyensure_buffer_stack (yyscanner);
@@ -869,7 +871,7 @@ void yyrestart(FILE * input_file, yyscan_t yyscanner)
m4_ifdef( [[M4_MODE_USES_REJECT]], [[
/* Ensure the reject state buffer is large enough.
*/
if ( yyscanner->yy_state_buf_max < (yy_current_buffer(yyscanner)->yy_buf_size + YY_STATE_BUF_EXTRA_SPACE) ) {
if ( yyscanner->yy_state_buf_max < (size_t) (yy_current_buffer(yyscanner)->yy_buf_size + YY_STATE_BUF_EXTRA_SPACE) ) {
new_size = yy_current_buffer(yyscanner)->yy_buf_size + YY_STATE_BUF_EXTRA_SPACE;
new_state_buf = (yy_state_type*) yyrealloc( yyscanner->yy_state_buf, (new_size * sizeof(yy_state_type)), yyscanner );
@@ -968,7 +970,7 @@ m4_ifdef( [[M4_MODE_YYLINENO]],
}
]])
%# yymore has a magic rewute rule. It's declared here, rather than with the other
%# yymore has a magic rewrite rule. It's declared here, rather than with the other
%# magic functions, so yy_get_next_buffer() won't need a forward declaration.
m4_ifdef([[M4_MODE_YYMORE_USED]], [[
m4_ifdef( [[M4_MODE_YYTEXT_IS_ARRAY]], [[
@@ -1012,7 +1014,7 @@ m4_ifdef( [[M4_MODE_CPP_USE_READ]], [[
m4_ifdef( [[M4_MODE_NO_CPP_USE_READ]], [[
if ( yyscanner->yy_buffer_stack[yyscanner->yy_buffer_stack_top]->yy_is_interactive ) {
int c = '*';
int n;
size_t n;
for ( n = 0; n < max_size &&
(c = getc( yyscanner->yyin_r )) != EOF && c != '\n'; ++n ) {
buf[n] = (char) c;
@@ -1077,9 +1079,9 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
/* First move last chars to start of buffer. */
number_to_move = (int) (yyscanner->yy_c_buf_p - yyscanner->yytext_ptr - 1);
for ( i = 0; i < number_to_move; ++i ) {
*(dest++) = *(source++);
}
if (number_to_move > 0)
memmove(dest, source, number_to_move * sizeof(*source));
if ( yyscanner->yy_buffer_stack[yyscanner->yy_buffer_stack_top]->yy_buffer_status == YY_BUFFER_EOF_PENDING ) {
/* don't do the read, it's not guaranteed to return an EOF,
* just force an EOF
@@ -1151,7 +1153,7 @@ m4_ifdef( [[M4_MODE_USES_REJECT]],
}
if ((yyscanner->yy_n_chars + number_to_move) > yyscanner->yy_buffer_stack[yyscanner->yy_buffer_stack_top]->yy_buf_size) {
/* Extend the array by 50%, plus the number we really need. */
int new_size = yyscanner->yy_n_chars + number_to_move + (yyscanner->yy_n_chars >> 1);
int new_size = yyscanner->yy_n_chars + number_to_move + (yyscanner->yy_n_chars >> 1) + 2;
yyscanner->yy_buffer_stack[yyscanner->yy_buffer_stack_top]->yy_ch_buf = (char *) yyrealloc(
(void *) yyscanner->yy_buffer_stack[yyscanner->yy_buffer_stack_top]->yy_ch_buf, (size_t) new_size, yyscanner );
if ( yyscanner->yy_buffer_stack[yyscanner->yy_buffer_stack_top]->yy_ch_buf == NULL ) {
@@ -1218,6 +1220,8 @@ int yyinput (yyscan_t yyscanner)
case EOB_ACT_CONTINUE_SCAN:
yyscanner->yy_c_buf_p = yyscanner->yytext_ptr + offset;
break;
default:
yypanic("unexpected return value from yy_get_next_buffer()", yyscanner);
}
}
}
@@ -1600,8 +1604,10 @@ bool yyatbol(yyscan_t yyscanner) {
*/
void yy_switch_to_buffer(yybuffer new_buffer, yyscan_t yyscanner)
{
m4_ifdef( [[M4_MODE_USES_REJECT]], [[
size_t new_size = 0;
yy_state_type *new_state_buf = 0;
]] )
/* TODO. We should be able to replace this entire function body
* with
@@ -2056,7 +2062,7 @@ m4_ifdef( [[M4_MODE_USES_REJECT]],
yy_load_buffer_state( yyscanner );
}
/* open scope of user declarationns */
/* open scope of user declarations */
{
%% [4.0] user's declarations go here
@@ -2367,6 +2373,8 @@ m4_ifdef([[M4_MODE_FIND_ACTION_REJECT_OR_INTERACTIVE]], [[
yy_cp = yyscanner->yy_c_buf_p;
yy_bp = yyscanner->yytext_ptr + YY_MORE_ADJ;
goto yy_find_action;
default:
yypanic("unexpected return value from yy_get_next_buffer()", yyscanner);
} /* end EOB inner switch */
} /* end if */
break;
@@ -2496,8 +2504,6 @@ int yylex_destroy (yyscan_t yyscanner) {
/* Pop the buffer stack, destroying each element. */
while(yy_current_buffer(yyscanner)) {
yy_delete_buffer( yy_current_buffer(yyscanner), yyscanner );
yyscanner->yy_buffer_stack[yyscanner->yy_buffer_stack_top] = NULL;
yypop_buffer_state(yyscanner);
}
+4 -4
View File
@@ -1,5 +1,7 @@
/* ccl - routines for character classes */
/* SPDX-License-Identifier: BSD-3-Clause-flex */
/* Copyright (c) 1990 The Regents of the University of California. */
/* All rights reserved. */
@@ -135,7 +137,7 @@ ccl_set_diff (int a, int b)
d = cclinit();
/* In order to handle negation, we spin through all possible chars,
* addding each char in a that is not in b.
* adding each char in a that is not in b.
* (This could be O(n^2), but n is small and bounded.)
*/
for ( ch = 0; ch < ctrl.csize; ++ch )
@@ -202,9 +204,7 @@ int cclinit (void)
ccllen =
reallocate_integer_array (ccllen, current_maxccls);
cclng = reallocate_integer_array (cclng, current_maxccls);
ccl_has_nl =
reallocate_bool_array (ccl_has_nl,
current_maxccls);
ccl_has_nl = reallocate_array(ccl_has_nl, current_maxccls, sizeof(char));
}
if (lastccl == 1)
+81
View File
@@ -0,0 +1,81 @@
/* config_for_build - minimal config header for bootstrapping flex */
/* This file is part of flex. */
/* Redistribution and use in source and binary forms, with or without */
/* modification, are permitted provided that the following conditions */
/* are met: */
/* 1. Redistributions of source code must retain the above copyright */
/* notice, this list of conditions and the following disclaimer. */
/* 2. Redistributions in binary form must reproduce the above copyright */
/* notice, this list of conditions and the following disclaimer in the */
/* documentation and/or other materials provided with the distribution. */
/* Neither the name of the University nor the names of its contributors */
/* may be used to endorse or promote products derived from this software */
/* without specific prior written permission. */
/* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR */
/* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED */
/* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR */
/* PURPOSE. */
/* The "config_for_build.h.in" file is intended to be processed by "configure"
* in order to produce working PACKAGE, VERSION and M4 definitions.
* Add "config_for_build.h.in" to AC_CONFIG_FILES. Do not add it to
* AC_CONFIG_HEADERS as it would break our intentional #undef's and mess up
* with the #define statements.
*/
#define PACKAGE "@PACKAGE@"
#define VERSION "@VERSION@"
#define M4 "@M4@"
#undef ENABLE_NLS
/* Flex includes <locale.h> only if NLS is enabled, but we undef it anyway. */
#undef HAVE_LOCALE_H
#undef HAVE_NETINET_IN_H
#ifdef __has_include
# if __has_include(<netinet/in.h>)
# define HAVE_NETINET_IN_H 1
# endif
#endif
#undef HAVE_REALLOCARRAY
#undef HAVE_REALLOCARR
/* Always use malloc/realloc wrappers. */
#undef malloc
#define malloc rpl_malloc
#undef realloc
#define realloc rpl_realloc
/* The Bison-generated parser in flex code controls the use of alloca() through
* its own macro (YYSTACK_USE_ALLOCA) and not defines from Autoconf.
* alloca() is not used in other parts of flex code.
*/
#undef HAVE_ALLOCA_H
#undef HAVE_ALLOCA
#undef C_ALLOCA
/* HAVE_INTTYPES_H is defined by Autoconf but not used in flex code. Flex has
* flexint.h that provides fallback definitions.
*/
/*
#if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901L
# undef HAVE_INTTYPES_H
#endif
*/
#undef HAVE_STDBOOL_H
#if !defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901L
# undef HAVE__BOOL
#endif
/* Standard C89 stuff which "configure" provides fallback #define's for. */
#ifndef __STDC__
# undef HAVE_LIMITS_H
# define const /* const */
# define size_t unsigned int
#endif
+21 -10
View File
@@ -853,6 +853,7 @@ m4_ifdef( [[M4_YY_NOT_IN_HEADER]],
* corresponding action - sets up yytext.
*/
#define YY_DO_BEFORE_ACTION \
do { \
YY_G(yytext_ptr) = yy_bp; \
m4_ifdef([[M4_MODE_YYMORE_USED]], [[m4_ifdef([[M4_MODE_NO_YYTEXT_IS_ARRAY]], [[YY_G(yytext_ptr) -= YY_G(yy_more_len); \
yyleng = (int) (yy_cp - YY_G(yytext_ptr));]])]]) \
@@ -871,7 +872,8 @@ m4_ifdef([[M4_MODE_YYTEXT_IS_ARRAY]], [[ \
m4_ifdef([[M4_MODE_YYMORE_USED]], [[YY_G(yy_more_offset) = 0;]]) \
m4_ifdef([[M4_MODE_NO_YYMORE_USED]], [[yy_flex_strncpy( yytext, YY_G(yytext_ptr), yyleng + 1 M4_YY_CALL_LAST_ARG);]]) \
]]) \
YY_G(yy_c_buf_p) = yy_cp;
YY_G(yy_c_buf_p) = yy_cp; \
} while(0)
m4_ifdef([[M4_YY_NOT_REENTRANT]], [[
m4_ifdef( [[M4_MODE_C_ONLY]],
@@ -1583,7 +1585,7 @@ m4_ifdef( [[M4_MODE_CPP_USE_READ]], [[
m4_ifdef( [[M4_MODE_NO_CPP_USE_READ]], [[
if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) {
int c = '*';
int n;
yy_size_t n;
for ( n = 0; n < max_size &&
(c = getc( yyin )) != EOF && c != '\n'; ++n ) {
buf[n] = (char) c;
@@ -2269,6 +2271,8 @@ m4_ifdef([[M4_MODE_FIND_ACTION_REJECT_OR_INTERACTIVE]], [[
yy_cp = YY_G(yy_c_buf_p);
yy_bp = YY_G(yytext_ptr) + YY_MORE_ADJ;
goto yy_find_action;
default:
YY_FATAL_ERROR("unexpected return value from yy_get_next_buffer()");
} /* end EOB inner switch */
} /* end if */
break;
@@ -2530,7 +2534,7 @@ m4_ifdef( [[M4_MODE_USES_REJECT]],
}
if ((YY_G(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 = YY_G(yy_n_chars) + number_to_move + (YY_G(yy_n_chars) >> 1);
int new_size = YY_G(yy_n_chars) + number_to_move + (YY_G(yy_n_chars) >> 1) + 2;
YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc(
(void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf, (yy_size_t) new_size M4_YY_CALL_LAST_ARG );
if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) {
@@ -2683,6 +2687,7 @@ m4_ifdef([[M4_MODE_NULTRANS_WRAP]], [[
m4_ifdef([[M4_MODE_CXX_ONLY]], [[m4_undefine([[M4_YY_NO_YYUNPUT]])]])
m4_ifdef( [[M4_YY_NO_YYUNPUT]], , [[
m4_ifdef([[M4_MODE_C_ONLY]], [[
#ifndef YY_NO_YYUNPUT
static void yyunput_r YYFARGS2( int,c, char *,yy_bp)
]])
m4_ifdef([[M4_MODE_CXX_ONLY]], [[
@@ -2732,6 +2737,9 @@ m4_ifdef( [[M4_MODE_YYLINENO]],
YY_G(yy_hold_char) = *yy_cp;
YY_G(yy_c_buf_p) = yy_cp;
}
m4_ifdef([[M4_MODE_C_ONLY]], [[
#endif /* ifndef YY_NO_YYINPUT */
]])
]])
m4_ifdef([[M4_MODE_C_ONLY]], [[
@@ -2789,6 +2797,8 @@ int yyFlexLexer::yyinput()
case EOB_ACT_CONTINUE_SCAN:
YY_G(yy_c_buf_p) = YY_G(yytext_ptr) + offset;
break;
default:
YY_FATAL_ERROR("unexpected return value from yy_get_next_buffer()");
}
}
}
@@ -2832,8 +2842,10 @@ void yyFlexLexer::yyrestart( std::istream& input_file )
]])
{
M4_YY_DECL_GUTS_VAR();
m4_ifdef( [[M4_MODE_USES_REJECT]], [[
size_t new_size = 0;
yy_state_type *new_state_buf = 0;
]] )
if ( yy_current_buffer() == NULL ) {
yyensure_buffer_stack (M4_YY_CALL_ONLY_ARG);
@@ -2847,7 +2859,7 @@ void yyFlexLexer::yyrestart( std::istream& input_file )
m4_ifdef( [[M4_MODE_USES_REJECT]], [[
/* Ensure the reject state buffer is large enough.
*/
if ( YY_G(yy_state_buf_max) < (yy_current_buffer()->yy_buf_size + YY_STATE_BUF_EXTRA_SPACE) ) {
if ( YY_G(yy_state_buf_max) < (yy_size_t) (yy_current_buffer()->yy_buf_size + YY_STATE_BUF_EXTRA_SPACE) ) {
new_size = yy_current_buffer()->yy_buf_size + YY_STATE_BUF_EXTRA_SPACE;
new_state_buf = (yy_state_type *)yyrealloc( YY_G(yy_state_buf), (new_size * sizeof(yy_state_type)) M4_YY_CALL_LAST_ARG );
@@ -2896,8 +2908,10 @@ void yyFlexLexer::yy_switch_to_buffer( yybuffer new_buffer )
]])
{
M4_YY_DECL_GUTS_VAR();
m4_ifdef( [[M4_MODE_USES_REJECT]], [[
size_t new_size = 0;
yy_state_type *new_state_buf = 0;
]] )
/* TODO. We should be able to replace this entire function body
* with
@@ -2921,7 +2935,7 @@ void yyFlexLexer::yy_switch_to_buffer( yybuffer new_buffer )
m4_ifdef( [[M4_MODE_USES_REJECT]], [[
/* Ensure the reject state buffer is large enough.
*/
if ( YY_G(yy_state_buf_max) < (YY_CURRENT_BUFFER_LVALUE->yy_buf_size + YY_STATE_BUF_EXTRA_SPACE) ) {
if ( YY_G(yy_state_buf_max) < (yy_size_t) (YY_CURRENT_BUFFER_LVALUE->yy_buf_size + YY_STATE_BUF_EXTRA_SPACE) ) {
new_size = YY_CURRENT_BUFFER_LVALUE->yy_buf_size + YY_STATE_BUF_EXTRA_SPACE;
new_state_buf = (yy_state_type *)yyrealloc( YY_G(yy_state_buf), (new_size * sizeof(yy_state_type)) M4_YY_CALL_LAST_ARG );
@@ -2977,7 +2991,6 @@ yybuffer yyFlexLexer::yy_create_buffer( std::istream& file, int size )
]])
{
yybuffer b;
M4_YY_DECL_GUTS_VAR();
b = (yybuffer) yyalloc( sizeof( struct yy_buffer_state ) M4_YY_CALL_LAST_ARG );
if ( b == NULL ) {
@@ -3224,7 +3237,7 @@ void yyFlexLexer::yyensure_buffer_stack(void)
YY_G(yy_buffer_stack) = (struct yy_buffer_state**)yyalloc
(num_to_alloc * sizeof(struct yy_buffer_state*)
M4_YY_CALL_LAST_ARG);
if ( YY_G(yy_buffer_stack == NULL) ) {
if ( YY_G(yy_buffer_stack) == NULL ) {
YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
}
@@ -3814,8 +3827,6 @@ int yylex_destroy (M4_YY_DEF_ONLY_ARG) {
/* Pop the buffer stack, destroying each element. */
while(yy_current_buffer()) {
yy_delete_buffer( yy_current_buffer() M4_YY_CALL_LAST_ARG );
YY_CURRENT_BUFFER_LVALUE = NULL;
yypop_buffer_state(M4_YY_CALL_ONLY_ARG);
}
@@ -4186,7 +4197,7 @@ static int yytbl_data_load YYFARGS2(struct yytbl_dmap *, dmap, struct yytbl_read
p = (struct yy_trans_info **) p + 1;
}
else {
/* t32 is a plain int. copy data, then incrememnt p. */
/* t32 is a plain int. copy data, then increment p. */
switch (dmap->dm_sz) {
case sizeof (flex_int32_t):
if(M4_YY_TABLES_VERIFY ) {
+23 -17
View File
@@ -1,5 +1,7 @@
/* dfa - DFA construction routines */
/* SPDX-License-Identifier: BSD-3-Clause-flex */
/* Copyright (c) 1990 The Regents of the University of California. */
/* All rights reserved. */
@@ -34,10 +36,11 @@
/* declare functions that have forward references */
void dump_associated_rules(FILE *, int);
void dump_transitions(FILE *, int[]);
void sympartition(int[], int, int[], int[]);
int symfollowset(int[], int, int, int[]);
static void dump_associated_rules(FILE *, int);
static void dump_transitions(FILE *, int[]);
static int snstods(int[], int, int[], int, int, int *);
static void sympartition(int[], int, int[], int[]);
static int symfollowset(int[], int, int, int[]);
/* check_for_backing_up - check a DFA state for backing up
@@ -49,7 +52,7 @@ int symfollowset(int[], int, int, int[]);
* indexed by equivalence class.
*/
void check_for_backing_up (int ds, int state[])
static void check_for_backing_up(int ds, int state[])
{
if ((reject && !dfaacc[ds].dfaacc_set) || (!reject && !dfaacc[ds].dfaacc_state)) { /* state is non-accepting */
++num_backing_up;
@@ -94,7 +97,7 @@ void check_for_backing_up (int ds, int state[])
* accset[1 .. nacc] is the list of accepting numbers for the DFA state.
*/
void check_trailing_context (int *nfa_states, int num_states, int *accset, int nacc)
static void check_trailing_context(int *nfa_states, int num_states, int *accset, int nacc)
{
int i, j;
@@ -132,7 +135,7 @@ void check_trailing_context (int *nfa_states, int num_states, int *accset, int n
* and writes a report to the given file.
*/
void dump_associated_rules (FILE *file, int ds)
static void dump_associated_rules(FILE *file, int ds)
{
int i, j;
int num_associated_rules = 0;
@@ -180,7 +183,7 @@ void dump_associated_rules (FILE *file, int ds)
* is done to the given file.
*/
void dump_transitions (FILE *file, int state[])
static void dump_transitions(FILE *file, int state[])
{
int i, ec;
int out_char_set[CSIZE];
@@ -226,7 +229,7 @@ void dump_transitions (FILE *file, int state[])
* hashval is the hash value for the dfa corresponding to the state set.
*/
int *epsclosure (int *t, int *ns_addr, int accset[], int *nacc_addr, int *hv_addr)
static int *epsclosure(int *t, int *ns_addr, int accset[], int *nacc_addr, int *hv_addr)
{
int stkpos, ns, tsp;
int numstates = *ns_addr, nacc, hashval, transsym, nfaccnum;
@@ -353,7 +356,8 @@ void increase_max_dfas (void)
accsiz = reallocate_integer_array (accsiz, current_max_dfas);
dhash = reallocate_integer_array (dhash, current_max_dfas);
dss = reallocate_int_ptr_array (dss, current_max_dfas);
dfaacc = reallocate_dfaacc_union (dfaacc, current_max_dfas);
dfaacc = reallocate_array(dfaacc, current_max_dfas,
sizeof(union dfaacc_union));
if (nultrans)
nultrans =
@@ -516,9 +520,10 @@ size_t ntod (void)
yynxt_data[yynxt_curr++] = 0;
}
dataflush ();
if (gentables)
if (gentables) {
dataflush ();
outn ("M4_HOOK_TABLE_CONTINUE");
}
}
/* Create the first states. */
@@ -695,9 +700,10 @@ size_t ntod (void)
state[i] ? state[i] : -ds;
}
dataflush ();
if (gentables)
if (gentables) {
dataflush ();
outn ("M4_HOOK_TABLE_CONTINUE");
}
}
else if (ctrl.fullspd)
@@ -776,7 +782,7 @@ size_t ntod (void)
* On return, the dfa state number is in newds.
*/
int snstods (int sns[], int numstates, int accset[], int nacc, int hashval, int *newds_addr)
static int snstods(int sns[], int numstates, int accset[], int nacc, int hashval, int *newds_addr)
{
int didsort = 0;
int i, j;
@@ -897,7 +903,7 @@ int snstods (int sns[], int numstates, int accset[], int nacc, int hashval, int
* int transsym, int nset[current_max_dfa_size] );
*/
int symfollowset (int ds[], int dsize, int transsym, int nset[])
static int symfollowset(int ds[], int dsize, int transsym, int nset[])
{
int ns, tsp, sym, i, j, lenccl, ch, numstates, ccllist;
@@ -974,7 +980,7 @@ int symfollowset (int ds[], int dsize, int transsym, int nset[])
* int symlist[numecs], int duplist[numecs] );
*/
void sympartition (int ds[], int numstates, int symlist[], int duplist[])
static void sympartition(int ds[], int numstates, int symlist[], int duplist[])
{
int tch, i, j, k, ns, dupfwd[CSIZE + 1], lenccl, cclp, ich;
+2
View File
@@ -1,5 +1,7 @@
/* ecs - equivalence class routines */
/* SPDX-License-Identifier: BSD-3-Clause-flex */
/* Copyright (c) 1990 The Regents of the University of California. */
/* All rights reserved. */
+4 -2
View File
@@ -1,5 +1,7 @@
/* filter - postprocessing of flex output through filters */
/* SPDX-License-Identifier: BSD-3-Clause-flex */
/* This file is part of flex. */
/* Redistribution and use in source and binary forms, with or without */
@@ -328,7 +330,7 @@ static bool is_blank_line (const char *str)
int filter_fix_linedirs (struct filter *chain)
{
char buf[4096];
const char *traceline_template, *cp;
const char *cp;
const size_t readsz = sizeof buf;
int lineno = 1;
bool in_gen = true; /* in generated code */
@@ -381,7 +383,7 @@ int filter_fix_linedirs (struct filter *chain)
/* Adjust the line directives. */
in_gen = true;
snprintf (buf, readsz, traceline_template,
snprintf (buf, readsz, ctrl.traceline_template,
lineno + 1, filename);
strncat(buf, "\n", sizeof(buf)-1);
}
+35 -55
View File
@@ -35,8 +35,12 @@
#ifndef FLEXDEF_H
#define FLEXDEF_H 1
#ifdef HAVE_CONFIG_H
#ifndef USE_CONFIG_FOR_BUILD
# ifdef HAVE_CONFIG_H
#include <config.h>
# endif
#else
#include <config_for_build.h>
#endif
#include <stdio.h>
@@ -66,7 +70,18 @@
#endif
/* Required: wait() in <sys/wait.h> */
#include <sys/wait.h>
#ifdef HAVE_STDBOOL_H
#include <stdbool.h>
#elif !defined(__cplusplus) && (!defined(__STDC_VERSION__) || \
__STDC_VERSION__ < 202311L)
# ifdef HAVE__BOOL
# define bool _Bool
# else
# define bool int
# endif
# define false 0
# define true 1
#endif
#include <stdarg.h>
/* Required: regcomp(), regexec() and regerror() in <regex.h> */
#include <regex.h>
@@ -305,7 +320,7 @@ typedef enum trit_t {
* If it's in this structure, it has a corresponding m4 symbol.
*/
struct ctrl_bundle_t {
bool always_interactive;// always use cheacter-by-character input
bool always_interactive;// always use character-by-character input
FILE *backing_up_file; // file to summarize backing-up states to
bool bison_bridge_lval; // (--bison-bridge), bison pure calling convention.
bool bison_bridge_lloc; // (--bison-locations), bison yylloc.
@@ -341,7 +356,7 @@ struct ctrl_bundle_t {
bool use_read; // (-f, -F, or -Cr) use read() for scanner input
// otherwise, use fread().
char *yyclass; // yyFlexLexer subclass to use for YY_DECL
char *yydecl; // user-specfied prototype for yylex.
char *yydecl; // user-specified prototype for yylex.
int yylmax; // Maximum buffer length if %array
trit yymore_really_used;// Force geberation of support code for yymore
bool yytext_is_array; // if true (i.e., %array directive), then declare
@@ -440,7 +455,7 @@ extern struct env_bundle_t env;
* reject_really_used - same for REJECT
*/
extern int syntaxerror, eofseen;
extern bool syntaxerror, eofseen;
extern int yymore_used, reject, real_reject, continued_action, in_rule;
/* Variables used in the flex input routines:
@@ -464,6 +479,7 @@ extern int yymore_used, reject, real_reject, continued_action, in_rule;
* action_offset - index where the non-prolog starts in action_array
* action_index - index where the next action should go, with respect
* to "action_array"
* always_interactive - if true, generate an interactive scanner
*/
extern int datapos, dataline, linenum;
@@ -529,8 +545,10 @@ extern int maximum_mns, current_mns, current_max_rules;
extern int num_rules, num_eof_rules, default_rule, lastnfa;
extern int *firstst, *lastst, *finalst, *transchar, *trans1, *trans2;
extern int *accptnum, *assoc_rule, *state_type;
extern int *rule_type, *rule_linenum, *rule_useful;
extern bool *rule_has_nl, *ccl_has_nl;
extern int *rule_type, *rule_linenum;
/* rule_useful[], rule_has_nl[] and ccl_has_nl[] are boolean arrays,
* but allocated as char arrays for size. */
extern char *rule_useful, *rule_has_nl, *ccl_has_nl;
extern int nlch;
extern size_t footprint;
@@ -552,7 +570,7 @@ extern int current_state_type;
/* True if the input rules include a rule with both variable-length head
* and trailing context, false otherwise.
*/
extern int variable_trailing_context_rules;
extern bool variable_trailing_context_rules;
/* Variables for protos:
@@ -606,9 +624,12 @@ extern int tecfwd[CSIZE + 1], tecbck[CSIZE + 1];
* scname - start condition name
*/
extern int lastsc, *scset, *scbol, *scxclu, *sceof;
extern int lastsc, *scset, *scbol;
/* scxclu[] and sceof[] are boolean arrays, but allocated as char
* arrays for size. */
extern char *scxclu, *sceof;
extern int current_max_scs;
extern char **scname;
extern const char **scname;
/* Variables for dfa machine data:
@@ -706,30 +727,18 @@ void *reallocate_array(void *, int, size_t);
#define reallocate_integer_array(array,size) \
reallocate_array((void *) array, size, sizeof(int))
#define allocate_bool_array(size) \
allocate_array(size, sizeof(bool))
#define reallocate_bool_array(array,size) \
reallocate_array((void *) array, size, sizeof(bool))
#define allocate_int_ptr_array(size) \
allocate_array(size, sizeof(int *))
#define allocate_char_ptr_array(size) \
allocate_array(size, sizeof(char *))
#define allocate_dfaacc_union(size) \
allocate_array(size, sizeof(union dfaacc_union))
#define reallocate_int_ptr_array(array,size) \
reallocate_array((void *) array, size, sizeof(int *))
#define reallocate_char_ptr_array(array,size) \
reallocate_array((void *) array, size, sizeof(char *))
#define reallocate_dfaacc_union(array, size) \
reallocate_array((void *) array, size, sizeof(union dfaacc_union))
#define allocate_character_array(size) \
allocate_array( size, sizeof(char))
@@ -760,23 +769,11 @@ extern void list_character_set(FILE *, int[]);
/* from file dfa.c */
/* Check a DFA state for backing up. */
extern void check_for_backing_up(int, int[]);
/* Check to see if NFA state set constitutes "dangerous" trailing context. */
extern void check_trailing_context(int *, int, int *, int);
/* Construct the epsilon closure of a set of ndfa states. */
extern int *epsclosure(int *, int *, int[], int *, int *);
/* Increase the maximum number of dfas. */
extern void increase_max_dfas(void);
extern size_t ntod(void); /* convert a ndfa to a dfa */
/* Converts a set of ndfa states into a dfa state. */
extern int snstods(int[], int, int[], int, int, int *);
/* from file ecs.c */
@@ -795,8 +792,6 @@ extern void mkechar(int, int[], int[]);
/* from file gen.c */
extern void do_indent(void); /* indent to the current level */
/* Set a conditional amd make it visible in generated code */
extern void visible_define (const char *);
@@ -806,21 +801,6 @@ extern void visible_define_str (const char *, const char *);
/* This time the value part is an int */
extern void visible_define_int (const char *, const int);
/* Generate full speed compressed transition table. */
extern void genctbl(void);
/* generate full transition table */
extern void genftbl(void);
/* Generate data statements for the transition tables. */
extern void gentabs(void);
/* Write out a formatted string at the current indentation level. */
extern void indent_put2s(const char *, const char *);
/* Write out a string + newline at the current indentation level. */
extern void indent_puts(const char *);
/* generate transition tables */
extern void make_tables(void);
@@ -873,7 +853,7 @@ extern void flexerror(const char *);
extern void flexfatal(const char *);
/* Report a fatal error with a pinpoint, and terminate */
#if HAVE_DECL___FUNC__
#ifdef HAVE_DECL___FUNC__
#define flex_die(msg) \
do{ \
fprintf (stderr,\
@@ -918,7 +898,7 @@ extern void mark_defs1(void);
/* Mark the current position in the action array as the end of the prolog. */
extern void mark_prolog(void);
/* Generate a data statment for a two-dimensional array. */
/* Generate a data statement for a two-dimensional array. */
extern void mk2data(int);
extern void mkdata(int); /* generate a data statement */
@@ -964,7 +944,7 @@ extern int copysingl(int, int);
extern void dumpnfa(int);
/* Finish up the processing for a rule. */
extern void finish_rule(int, int, int, int, int);
extern void finish_rule(int, bool, int, int, int);
/* Connect two machines together. */
extern int link_machines(int, int);
@@ -1032,7 +1012,7 @@ extern void set_input_file(char *);
/* from file skeletons.c */
/* return the correct file suffix for the selrcted back end */
/* return the correct file suffix for the selected back end */
const char *suffix (void);
/* Mine a text-valued property out of the skeleton file */
@@ -1060,7 +1040,7 @@ extern char *ndlookup(const char *); /* lookup a name definition */
/* Increase maximum number of SC's. */
extern void scextend(void);
extern void scinstal(const char *, int); /* make a start condition */
extern void scinstal(const char *, bool); /* make a start condition */
/* Lookup the number associated with a start condition. */
extern int sclookup(const char *);
+28 -12
View File
@@ -1,5 +1,7 @@
/* gen - actual generation (writing) of flex scanners */
/* SPDX-License-Identifier: BSD-3-Clause-flex */
/* Copyright (c) 1990 The Regents of the University of California. */
/* All rights reserved. */
@@ -43,7 +45,7 @@ struct yy_trans_info {int32_t yy_verify; int32_t yy_nxt;};
/* declare functions that have forward references */
void genecs(void);
static void genecs(void);
struct packtype_t *optimize_pack(size_t sz)
{
@@ -59,6 +61,12 @@ struct packtype_t *optimize_pack(size_t sz)
return &out;
}
/* Almost everything is done in terms of arrays starting at 1, so provide
* a null entry for the zero element of all C arrays. (The exception
* to this is that the fast table representation generally uses the
* 0 elements of its arrays, too.)
*/
/** Make the table for possible eol matches.
* @return the newly allocated rule_can_match_eol table
*/
@@ -120,14 +128,14 @@ static struct yytbl_data *mkctbl (void)
flex_int32_t *tdata = 0, curr = 0;
int end_of_buffer_action = num_rules + 1;
struct packtype_t *ptype = optimize_pack(tblend + numecs + 1);
struct packtype_t *ptype = optimize_pack(tblend + 2 + 1);
out_str ("m4_define([[M4_HOOK_MKCTBL_TYPE]], [[%s]])", ptype->name);
tbl = calloc(1, sizeof (struct yytbl_data));
yytbl_data_init (tbl, YYTD_ID_TRANSITION);
tbl->td_flags = YYTD_DATA32 | YYTD_STRUCT;
tbl->td_hilen = 0;
tbl->td_lolen = (flex_uint32_t) (tblend + numecs + 1); /* number of structs */
tbl->td_lolen = (flex_uint32_t) (tblend + 2 + 1); /* number of structs */
tbl->td_data = tdata =
calloc(tbl->td_lolen * 2, sizeof (flex_int32_t));
@@ -237,13 +245,13 @@ static struct yytbl_data *mkssltbl (void)
/* genctbl - generates full speed compressed transition table */
void genctbl (void)
static void genctbl(void)
{
int i;
int end_of_buffer_action = num_rules + 1;
/* Table of verify for transition and offset to next state. */
out_dec ("m4_define([[M4_HOOK_TRANSTABLE_SIZE]], [[%d]])", tblend + numecs + 1);
out_dec ("m4_define([[M4_HOOK_TRANSTABLE_SIZE]], [[%d]])", tblend + 2 + 1);
outn ("m4_define([[M4_HOOK_TRANSTABLE_BODY]], [[m4_dnl");
/* We want the transition to be represented as the offset to the
@@ -312,10 +320,9 @@ void genctbl (void)
transition_struct_out (chk[tblend + 2], nxt[tblend + 2]);
outn ("]])");
footprint += sizeof(struct yy_trans_info) * (tblend + numecs + 1);
footprint += sizeof(struct yy_trans_info) * (tblend + 2 + 1);
out_dec ("m4_define([[M4_HOOK_STARTTABLE_SIZE]], [[%d]])", lastsc * 2 + 1);
if (gentables) {
outn ("m4_define([[M4_HOOK_STARTTABLE_BODY]], [[m4_dnl");
for (i = 0; i <= lastsc * 2; ++i)
@@ -358,7 +365,7 @@ static struct yytbl_data *mkecstbl (void)
/* Generate equivalence-class tables. */
void genecs (void)
static void genecs(void)
{
int ch, row;
int numrows;
@@ -398,7 +405,7 @@ void genecs (void)
* you should call mkecstbl() after this.
*/
struct yytbl_data *mkftbl (void)
static struct yytbl_data *mkftbl(void)
{
int i;
int end_of_buffer_action = num_rules + 1;
@@ -432,7 +439,7 @@ struct yytbl_data *mkftbl (void)
/* genftbl - generate full transition table */
void genftbl (void)
static void genftbl(void)
{
int i;
int end_of_buffer_action = num_rules + 1;
@@ -469,7 +476,7 @@ void genftbl (void)
/* gentabs - generate data statements for the transition tables */
void gentabs (void)
static void gentabs(void)
{
int sz, i, j, k, *accset, nacc, *acc_array, total_states;
int end_of_buffer_action = num_rules + 1;
@@ -977,11 +984,20 @@ void make_tables (void)
}
}
}
else
else {
gentabs ();
}
snprintf(buf, sizeof(buf), "footprint: %ld bytes\n", footprint);
comment(buf);
snprintf(buf, sizeof(buf), "tblend: %d\n", tblend);
comment(buf);
snprintf(buf, sizeof(buf), "numecs: %d\n", numecs);
comment(buf);
snprintf(buf, sizeof(buf), "num_rules: %d\n", num_rules);
comment(buf);
snprintf(buf, sizeof(buf), "lastdfa: %d\n", lastdfa);
comment(buf);
outc ('\n');
// Only at this point do we know if the automaton has backups.
+8 -6
View File
@@ -71,7 +71,7 @@ m4_define([[M4_HOOK_CONST_DEFINE_BYTE]], [[const char $1 = $2;
]])
m4_define([[M4_HOOK_CONST_DEFINE_STATE]], [[#define $1 $2
]])
m4_define([[M4_HOOK_CONST_DEFINE_UINT]], [[const uint $1 = $2;
m4_define([[M4_HOOK_CONST_DEFINE_UINT]], [[const unsigned int $1 = $2;
]])
m4_define([[M4_HOOK_CONST_DEFINE_BOOL]], [[const bool $1 = $2;
]])
@@ -153,7 +153,7 @@ m4_ifdef([[M4_YY_ALWAYS_INTERACTIVE]], ,
#include <stdlib.h>
#include <stdbool.h>
#include <stdint.h>
#include <unistd.h> /* requred for isatty() */
#include <unistd.h> /* required for isatty() */
#if defined(__GNUC__) && __GNUC__ >= 3
#define yynoreturn __attribute__((__noreturn__))
@@ -925,7 +925,7 @@ m4_ifdef([[M4_MODE_NO_CPP_USE_READ]], [[
}
]])
%# yymore has a magic rewute rule. It's declared here, rather than with the other
%# yymore has a magic rewrite rule. It's declared here, rather than with the other
%# magic functions, so yy_get_next_buffer() won't need a forward declaration.
m4_ifdef([[M4_MODE_YYMORE_USED]], [[
m4_ifdef([[M4_MODE_YYTEXT_IS_ARRAY]], [[
@@ -1060,7 +1060,7 @@ m4_ifdef([[M4_MODE_USES_REJECT]],
}
if ((yyscanner->yyNChars + numberToMove) > yyscanner->yyBufferStack[yyscanner->yyBufferStackTop]->yyInputBufSize) {
/* Extend the array by 50%, plus the number we really need. */
int newSize = yyscanner->yyNChars + numberToMove + (yyscanner->yyNChars >> 1);
int newSize = yyscanner->yyNChars + numberToMove + (yyscanner->yyNChars >> 1) + 2;
yyscanner->yyBufferStack[yyscanner->yyBufferStackTop]->yyChBuf = (char *) yyrealloc(
(void *) yyscanner->yyBufferStack[yyscanner->yyBufferStackTop]->yyChBuf, (size_t) newSize, yyscanner);
if (yyscanner->yyBufferStack[yyscanner->yyBufferStackTop]->yyChBuf == NULL) {
@@ -1127,6 +1127,8 @@ int yyinput(FlexLexer *yyscanner)
case EOB_ACT_CONTINUE_SCAN:
yyscanner->yyCBufP = yyscanner->yytext_ptr + offset;
break;
default:
yypanic("unexpected return value from yy_get_next_buffer()", yyscanner);
}
}
}
@@ -2217,6 +2219,8 @@ m4_ifdef([[M4_MODE_FIND_ACTION_REJECT_OR_INTERACTIVE]], [[
yyCp = yyscanner->yyCBufP;
yyBp = yyscanner->yytext_ptr + YY_MORE_ADJ;
goto yyFindActionLabel;
default:
yypanic("unexpected return value from yy_get_next_buffer()", yyscanner);
} /* end EOB inner switch */
} /* end if */
break;
@@ -2343,8 +2347,6 @@ int yylex_destroy(FlexLexer *yyscanner) {
/* Pop the buffer stack, destroying each element. */
while(yy_current_buffer(yyscanner)) {
yy_delete_buffer(yy_current_buffer(yyscanner), yyscanner);
yyscanner->yyBufferStack[yyscanner->yyBufferStackTop] = NULL;
yypop_buffer_state(yyscanner);
}
+2
View File
@@ -1,5 +1,7 @@
/* libmain - flex run-time support library "main" function */
/* SPDX-License-Identifier: BSD-3-Clause-flex */
/* This file is part of flex. */
/* Redistribution and use in source and binary forms, with or without */
+2
View File
@@ -1,5 +1,7 @@
/* libyywrap - flex run-time support library "yywrap" function */
/* SPDX-License-Identifier: BSD-3-Clause-flex */
/* This file is part of flex. */
/* Redistribution and use in source and binary forms, with or without */
+25 -17
View File
@@ -1,5 +1,7 @@
/* flex - tool to generate fast lexical analyzers */
/* SPDX-License-Identifier: BSD-3-Clause-flex */
/* Copyright (c) 1990 The Regents of the University of California. */
/* All rights reserved. */
@@ -47,7 +49,7 @@ void readin(void);
void set_up_initial_allocations(void);
/* these globals are all defined and commented in flexdef.h */
int syntaxerror, eofseen;
bool syntaxerror, eofseen;
int yymore_used, reject, real_reject, continued_action, in_rule;
int datapos, dataline, linenum;
FILE *skelfile = NULL;
@@ -63,17 +65,20 @@ int maximum_mns, current_mns, current_max_rules;
int num_rules, num_eof_rules, default_rule, lastnfa;
int *firstst, *lastst, *finalst, *transchar, *trans1, *trans2;
int *accptnum, *assoc_rule, *state_type;
int *rule_type, *rule_linenum, *rule_useful;
int *rule_type, *rule_linenum;
int current_state_type;
int variable_trailing_context_rules;
bool variable_trailing_context_rules;
int numtemps, numprots, protprev[MSP], protnext[MSP], prottbl[MSP];
int protcomst[MSP], firstprot, lastprot, protsave[PROT_SAVE_SIZE];
int numecs, nextecm[CSIZE + 1], ecgroup[CSIZE + 1], nummecs,
tecfwd[CSIZE + 1];
int tecbck[CSIZE + 1];
int lastsc, *scset, *scbol, *scxclu, *sceof;
int lastsc, *scset, *scbol;
/* scxclu[] and sceof[] are boolean arrays, but allocated as char
* arrays for size. */
char *scxclu, *sceof;
int current_max_scs;
char **scname;
const char **scname;
int current_max_dfa_size, current_max_xpairs;
int current_max_template_xpairs, current_max_dfas;
int lastdfa, *nxt, *chk, *tnxt;
@@ -92,7 +97,9 @@ int end_of_buffer_state;
char **input_files;
int num_input_files;
jmp_buf flex_main_jmp_buf;
bool *rule_has_nl, *ccl_has_nl;
/* rule_useful[], rule_has_nl[] and ccl_has_nl[] are boolean arrays,
* but allocated as char arrays for size. */
char *rule_useful, *rule_has_nl, *ccl_has_nl;
int nlch = '\n';
bool tablesext, tablesverify, gentables;
@@ -160,7 +167,6 @@ int flex_main (int argc, char *argv[])
flexinit (argc, argv);
readin ();
skelout (true); /* %% [1.0] DFA */
footprint += ntod ();
@@ -295,7 +301,7 @@ void initialize_output_filters(void)
if ( !(m4 = getenv("M4"))) {
m4 = M4;
}
filter_create_ext(output_chain, m4, "-P", 0);
filter_create_ext(output_chain, m4, "-P", (char *) 0);
filter_create_int(output_chain, filter_fix_linedirs, NULL);
/* For debugging, only run the requested number of filters. */
@@ -1167,7 +1173,8 @@ void flexinit (int argc, char **argv)
numas = numsnpairs = tmpuses = 0;
numecs = numeps = eps2 = num_reallocs = hshcol = dfaeql = totnst =
0;
numuniq = numdup = hshsave = eofseen = datapos = dataline = 0;
numuniq = numdup = hshsave = datapos = dataline = 0;
eofseen = false;
num_backing_up = onesp = numprots = 0;
variable_trailing_context_rules = bol_needed = false;
@@ -1284,7 +1291,7 @@ void readin (void)
out_str ("M4_HOOK_SET_POSTACTION(%s)\n", ctrl.postaction);
}
/* This has to be a stright textual substitution rather
/* This has to be a straight textual substitution rather
* than a constant declaration because in C a const is
* not const enough to be a static array bound.
*/
@@ -1294,7 +1301,7 @@ void readin (void)
if (userdef_buf.elts)
outn ((char *) (userdef_buf.elts));
/* If the user explicitly requested posix compatibility by specifing the
/* If the user explicitly requested posix compatibility by specifying the
* posix-compat option, then we check for conflicting options. However, if
* the POSIXLY_CORRECT variable is set, then we quietly make flex as
* posix-compatible as possible. This is the recommended behavior
@@ -1691,21 +1698,21 @@ void set_up_initial_allocations (void)
current_max_rules = INITIAL_MAX_RULES;
rule_type = allocate_integer_array (current_max_rules);
rule_linenum = allocate_integer_array (current_max_rules);
rule_useful = allocate_integer_array (current_max_rules);
rule_has_nl = allocate_bool_array (current_max_rules);
rule_useful = allocate_array(current_max_rules, sizeof(char));
rule_has_nl = allocate_array(current_max_rules, sizeof(char));
current_max_scs = INITIAL_MAX_SCS;
scset = allocate_integer_array (current_max_scs);
scbol = allocate_integer_array (current_max_scs);
scxclu = allocate_integer_array (current_max_scs);
sceof = allocate_integer_array (current_max_scs);
scxclu = allocate_array(current_max_scs, sizeof(char));
sceof = allocate_array(current_max_scs, sizeof(char));
scname = allocate_char_ptr_array (current_max_scs);
current_maxccls = INITIAL_MAX_CCLS;
cclmap = allocate_integer_array (current_maxccls);
ccllen = allocate_integer_array (current_maxccls);
cclng = allocate_integer_array (current_maxccls);
ccl_has_nl = allocate_bool_array (current_maxccls);
ccl_has_nl = allocate_array(current_maxccls, sizeof(char));
current_max_ccl_tbl_size = INITIAL_MAX_CCL_TBL_SIZE;
ccltbl = allocate_Character_array (current_max_ccl_tbl_size);
@@ -1726,7 +1733,8 @@ void set_up_initial_allocations (void)
accsiz = allocate_integer_array (current_max_dfas);
dhash = allocate_integer_array (current_max_dfas);
dss = allocate_int_ptr_array (current_max_dfas);
dfaacc = allocate_dfaacc_union (current_max_dfas);
dfaacc = allocate_array(current_max_dfas,
sizeof(union dfaacc_union));
nultrans = NULL;
}
+24 -32
View File
@@ -1,5 +1,7 @@
/* misc - miscellaneous flex routines */
/* SPDX-License-Identifier: BSD-3-Clause-flex */
/* Copyright (c) 1990 The Regents of the University of California. */
/* All rights reserved. */
@@ -63,24 +65,7 @@ void add_action (const char *new_text)
void *allocate_array (int size, size_t element_size)
{
void *new_array;
#if HAVE_REALLOCARR
new_array = NULL;
if (reallocarr(&new_array, (size_t) size, element_size))
flexfatal (_("memory allocation failed in allocate_array()"));
#else
# if HAVE_REALLOCARRAY
new_array = reallocarray(NULL, (size_t) size, element_size);
# else
/* Do manual overflow detection */
size_t num_bytes = (size_t) size * element_size;
new_array = (size && SIZE_MAX / (size_t) size < element_size) ? NULL :
malloc(num_bytes);
# endif
if (!new_array)
flexfatal (_("memory allocation failed in allocate_array()"));
#endif
return new_array;
return reallocate_array(NULL, size, element_size);
}
@@ -184,7 +169,7 @@ void dataend (const char *endit)
/* add terminator for initialization; { for vi */
if (endit)
outn (endit);
outn (endit);
}
dataline = 0;
datapos = 0;
@@ -195,9 +180,7 @@ void dataend (const char *endit)
void dataflush (void)
{
/* short circuit any output */
if (!gentables)
return;
assert (gentables);
if (datapos > 0)
outc ('\n');
@@ -351,7 +334,7 @@ void mk2data (int value)
out (" ");
else
outc (',');
outc (',');
++datapos;
@@ -377,10 +360,9 @@ void mkdata (int value)
if (datapos == 0)
/* Indent. */
out (" ");
out (" ");
else
outc (',');
++datapos;
out_dec ("%5d", value);
@@ -474,7 +456,7 @@ unsigned char myesc (unsigned char array[])
}
/* out - various flavors of outputing a (possibly formatted) string for the
/* out - various flavors of outputting a (possibly formatted) string for the
* generated scanner, keeping track of the line count.
*/
@@ -581,12 +563,17 @@ char *readable_form (int c)
void *reallocate_array (void *array, int size, size_t element_size)
{
void *new_array;
#if HAVE_REALLOCARR
#ifdef HAVE_REALLOCARR
new_array = array;
if (reallocarr(&new_array, (size_t) size, element_size))
flexfatal (_("attempt to increase array size failed"));
if (reallocarr(&new_array, (size_t) size, element_size)) {
flexfatal ((array) ?
_("attempt to increase array size failed") :
/* Function name is allocate_array() because of
* compatibility (for translations): */
_("memory allocation failed in allocate_array()"));
}
#else
# if HAVE_REALLOCARRAY
# ifdef HAVE_REALLOCARRAY
new_array = reallocarray(array, (size_t) size, element_size);
# else
/* Do manual overflow detection */
@@ -594,8 +581,13 @@ void *reallocate_array (void *array, int size, size_t element_size)
new_array = (size && SIZE_MAX / (size_t) size < element_size) ? NULL :
realloc(array, num_bytes);
# endif
if (!new_array)
flexfatal (_("attempt to increase array size failed"));
if (!new_array) {
flexfatal ((array) ?
_("attempt to increase array size failed") :
/* Function name is allocate_array() because of
* compatibility (for translations): */
_("memory allocation failed in allocate_array()"));
}
#endif
return new_array;
}
+5 -2
View File
@@ -28,10 +28,13 @@ fi
lang=$1
srcdir=$2
m4=$3
VERSION=$4
VERSION=$(echo $4 | cut -d '-' -f 1)
case $VERSION in
*[!0-9.]*) echo 'Invalid version number' >&2; exit 1;;
esac
cr=`printf '\r'`
IFS=.
# we do want word splitting, so we won't put double quotes around it (see IFS above)
# shellcheck disable=2086
@@ -46,4 +49,4 @@ sed '/^%#/d
s/m4_/m4preproc_/g
s/a4_/4_/g
s/[\\"]/\\&/g
s/[^\r]*/ "&",/'
s/[^'"$cr"']*/ "&",/'
+7 -5
View File
@@ -1,5 +1,7 @@
/* nfa - NFA construction routines */
/* SPDX-License-Identifier: BSD-3-Clause-flex */
/* Copyright (c) 1990 The Regents of the University of California. */
/* All rights reserved. */
@@ -191,7 +193,7 @@ int dupmachine (int mach)
* context has variable length.
*/
void finish_rule (int mach, int variable_trail_rule, int headcnt, int trailcnt,
void finish_rule (int mach, bool variable_trail_rule, int headcnt, int trailcnt,
int pcont_act)
{
char action_text[MAXLINE];
@@ -687,10 +689,10 @@ void new_rule (void)
current_max_rules);
rule_linenum = reallocate_integer_array (rule_linenum,
current_max_rules);
rule_useful = reallocate_integer_array (rule_useful,
current_max_rules);
rule_has_nl = reallocate_bool_array (rule_has_nl,
current_max_rules);
rule_useful = reallocate_array(rule_useful,
current_max_rules, sizeof(char));
rule_has_nl = reallocate_array(rule_has_nl,
current_max_rules, sizeof(char));
}
if (num_rules > MAX_RULE)
+2
View File
@@ -1,5 +1,7 @@
/* flex - tool to generate fast lexical analyzers */
/* SPDX-License-Identifier: BSD-3-Clause-flex */
/* Copyright (c) 1990 The Regents of the University of California. */
/* All rights reserved. */
+8 -6
View File
@@ -68,7 +68,9 @@
#include "tables.h"
int pat, scnum, eps, headcnt, trailcnt, lastchar, i, rulelen;
int trlcontxt, xcluflg, currccl, cclsorted, varlength, variable_trail_rule;
static int currccl;
bool trlcontxt;
static bool sc_is_exclusive, cclsorted, varlength, variable_trail_rule;
int *scon_stk;
int scon_stk_ptr;
@@ -172,17 +174,17 @@ sect1end : SECTEND
;
startconddecl : SCDECL
{ xcluflg = false; }
{ sc_is_exclusive = false; }
| XSCDECL
{ xcluflg = true; }
{ sc_is_exclusive = true; }
;
namelist1 : namelist1 NAME
{ scinstal( nmstr, xcluflg ); }
{ scinstal( nmstr, sc_is_exclusive ); }
| NAME
{ scinstal( nmstr, xcluflg ); }
{ scinstal( nmstr, sc_is_exclusive ); }
| error
{ synerr( _("bad start condition list") ); }
@@ -992,7 +994,7 @@ void build_eof_action(void)
if (previous_continued_action /* && previous action was regular */)
add_action("YY_RULE_SETUP\n");
snprintf( action_text, sizeof(action_text), "case YY_STATE_EOF(%s):\n",
snprintf( action_text, sizeof(action_text), "M4_HOOK_EOF_STATE_CASE_ARM(%s)\n",
scname[scon_stk[i]] );
add_action( action_text );
}
+2
View File
@@ -1,5 +1,7 @@
/** regex - regular expression functions related to POSIX regex lib. */
/* SPDX-License-Identifier: BSD-3-Clause-flex */
/* This file is part of flex. */
/* Redistribution and use in source and binary forms, with or without */
+13 -17
View File
@@ -40,7 +40,7 @@
#include "parse.h"
extern bool tablesverify, tablesext;
extern int trlcontxt; /* Set in parse.y for each rule. */
extern bool trlcontxt; /* Set in parse.y for each rule. */
extern const char *escaped_qstart, *escaped_qend;
#define M4QSTART "[""["
@@ -95,7 +95,7 @@ extern const char *escaped_qstart, *escaped_qend;
#define START_CODEBLOCK(x) do { \
/* Emit the needed line directive... */\
if (indented_code == false) { \
linenum++; \
if (!x) linenum++; \
line_directive_out(NULL, infilename, linenum); \
} \
add_action(M4QSTART); \
@@ -155,10 +155,10 @@ void context_member(char *, const char *);
%}
%%
static int bracelevel, didadef, indented_code;
static int doing_rule_action = false;
static int option_sense;
static bool doing_rule_action = false;
static bool option_sense;
int doing_codeblock = false;
static bool doing_codeblock = false;
int brace_depth=0, brace_start_line=0;
char nmdef[MAXLINE];
@@ -177,7 +177,8 @@ void context_member(char *, const char *);
snprintf(trampoline, sizeof(trampoline),
"M4_HOOK_TRACE_LINE_FORMAT(%d, [[%s]])",
linenum, infilename?infilename:"<stdin>");
buf_strappend(&top_buf, trampoline);
if (ctrl.gen_line_dirs)
buf_strappend(&top_buf, trampoline);
brace_depth = 1;
yy_push_state(CODEBLOCK_MATCH_BRACE);
}
@@ -395,7 +396,7 @@ void context_member(char *, const char *);
main {
ctrl.do_main = option_sense;
/* Override yywrap */
if( option_sense == true )
if (option_sense)
ctrl.do_yywrap = false;
}
meta-ecs ctrl.usemecs = option_sense;
@@ -471,7 +472,7 @@ void context_member(char *, const char *);
tables-file return TOK_TABLES_FILE;
tables-verify {
tablesverify = option_sense;
if(!tablesext && option_sense)
if (!tablesext && option_sense)
tablesext = true;
}
@@ -673,12 +674,7 @@ void context_member(char *, const char *);
*/
&& (cclval = ccllookup( nmstr )) != 0 )
{
if ( yyinput() != ']' )
synerr( _( "bad character class" ) );
yylval = cclval;
++cclreuse;
return PREVCCL;
/* Dead code removed */
}
else
{
@@ -927,11 +923,11 @@ nmstr[yyleng - 2 - end_is_ws] = '\0'; /* chop trailing brace */
ACTION_ECHO;
CHECK_REJECT(yytext);
}
"yyreject()" {
"yyreject"{OPTWS}"("{OPTWS}")" {
add_action("]""]M4_HOOK_REJECT[""[");
CHECK_YYREJECT(yytext);
}
"yymore()" {
"yymore"{OPTWS}"("{OPTWS}")" {
yymore_used = true;
if (ctrl.rewrite)
context_call(yytext);
@@ -1083,7 +1079,7 @@ void set_input_file( char *file )
yyin = fopen( infilename, "r" );
if ( yyin == NULL )
lerr( _( "can't open %s" ), file );
lerr( _( "can't open %s: %s" ), file, strerror(errno));
}
else
+3
View File
@@ -1,5 +1,7 @@
/* scanflags - flags used by scanning. */
/* SPDX-License-Identifier: BSD-3-Clause-flex */
/* Copyright (c) 1990 The Regents of the University of California. */
/* All rights reserved. */
@@ -62,6 +64,7 @@ sf_init (void)
{
assert(_sf_stk == NULL);
_sf_max = 32;
_sf_top_ix = 0;
_sf_stk = malloc(sizeof(scanflags_t) * _sf_max);
if (!_sf_stk)
lerr_fatal(_("Unable to allocate %zu of stack"), sizeof(scanflags_t));
+2
View File
@@ -1,5 +1,7 @@
/* flex - tool to generate fast lexical analyzers */
/* SPDX-License-Identifier: BSD-3-Clause-flex */
/* Copyright (c) 1990 The Regents of the University of California. */
/* All rights reserved. */
+2
View File
@@ -1,5 +1,7 @@
/* flex - tool to generate fast lexical analyzers */
/* SPDX-License-Identifier: BSD-3-Clause-flex */
/* Copyright (c) 1990 The Regents of the University of California. */
/* All rights reserved. */
+38 -48
View File
@@ -1,5 +1,7 @@
/* sym - symbol table routines */
/* SPDX-License-Identifier: BSD-3-Clause-flex */
/* Copyright (c) 1990 The Regents of the University of California. */
/* All rights reserved. */
@@ -40,7 +42,7 @@
*/
struct hash_entry {
struct hash_entry *prev, *next;
struct hash_entry *next;
char *name;
char *str_val;
int int_val;
@@ -52,17 +54,17 @@ typedef struct hash_entry **hash_table;
#define START_COND_HASH_SIZE 101
#define CCL_HASH_SIZE 101
static struct hash_entry *ndtbl[NAME_TABLE_HASH_SIZE];
static struct hash_entry *sctbl[START_COND_HASH_SIZE];
static struct hash_entry *ccltab[CCL_HASH_SIZE];
static struct hash_entry *ndtbl[NAME_TABLE_HASH_SIZE] = {NULL};
static struct hash_entry *sctbl[START_COND_HASH_SIZE] = {NULL};
static struct hash_entry *ccltab[CCL_HASH_SIZE] = {NULL};
/* declare functions that have forward references */
static int addsym(char[], char *, int, hash_table, int);
static int addsym(const char *, const char *, int, hash_table, size_t);
static struct hash_entry *findsym (const char *sym, hash_table table,
int table_size);
static int hashfunct(const char *, int);
size_t table_size);
static size_t hashfunct(const char *, size_t);
/* addsym - add symbol and definitions to symbol table
@@ -70,12 +72,11 @@ static int hashfunct(const char *, int);
* -1 is returned if the symbol already exists, and the change not made.
*/
static int addsym (char sym[], char *str_def, int int_def, hash_table table, int table_size)
static int addsym (const char *sym, const char *str_def, int int_def, hash_table table, size_t table_size)
{
int hash_val = hashfunct (sym, table_size);
size_t hash_val = hashfunct (sym, table_size);
struct hash_entry *sym_entry = table[hash_val];
struct hash_entry *new_entry;
struct hash_entry *successor;
while (sym_entry) {
if (!strcmp (sym, sym_entry->name)) { /* entry already exists */
@@ -91,16 +92,13 @@ static int addsym (char sym[], char *str_def, int int_def, hash_table table, int
if (new_entry == NULL)
flexfatal (_("symbol table memory allocation failed"));
if ((successor = table[hash_val]) != 0) {
new_entry->next = successor;
successor->prev = new_entry;
new_entry->next = table[hash_val];
new_entry->name = xstrdup(sym);
if (str_def == NULL) {
new_entry->str_val = NULL;
} else {
new_entry->str_val = xstrdup(str_def);
}
else
new_entry->next = NULL;
new_entry->prev = NULL;
new_entry->name = sym;
new_entry->str_val = str_def;
new_entry->int_val = int_def;
table[hash_val] = new_entry;
@@ -117,8 +115,7 @@ void cclinstal (char ccltxt[], int cclnum)
* called unless the symbol is new.
*/
(void) addsym (xstrdup(ccltxt),
(char *) 0, cclnum, ccltab, CCL_HASH_SIZE);
(void) addsym(ccltxt, NULL, cclnum, ccltab, CCL_HASH_SIZE);
}
@@ -135,10 +132,10 @@ int ccllookup (char ccltxt[])
/* findsym - find symbol in symbol table */
static struct hash_entry *findsym (const char *sym, hash_table table, int table_size)
static struct hash_entry *findsym (const char *sym, hash_table table, size_t table_size)
{
static struct hash_entry empty_entry = {
NULL, NULL, NULL, NULL, 0,
NULL, NULL, NULL, 0,
};
struct hash_entry *sym_entry =
@@ -155,15 +152,15 @@ static struct hash_entry *findsym (const char *sym, hash_table table, int table_
/* hashfunct - compute the hash value for "str" and hash size "hash_size" */
static int hashfunct (const char *str, int hash_size)
static size_t hashfunct (const char *str, size_t hash_size)
{
int hashval;
int locstr;
size_t hashval;
size_t locstr;
hashval = 0;
locstr = 0;
while (str[locstr]) {
while (str[locstr] != '\0') {
hashval = (hashval << 1) + (unsigned char) str[locstr++];
hashval %= hash_size;
}
@@ -176,11 +173,9 @@ static int hashfunct (const char *str, int hash_size)
void ndinstal (const char *name, char definition[])
{
if (addsym (xstrdup(name),
xstrdup(definition), 0,
ndtbl, NAME_TABLE_HASH_SIZE))
synerr (_("name defined twice"));
if (addsym(name, definition, 0, ndtbl, NAME_TABLE_HASH_SIZE)) {
synerr (_("name defined twice"));
}
}
@@ -205,35 +200,30 @@ void scextend (void)
scset = reallocate_integer_array (scset, current_max_scs);
scbol = reallocate_integer_array (scbol, current_max_scs);
scxclu = reallocate_integer_array (scxclu, current_max_scs);
sceof = reallocate_integer_array (sceof, current_max_scs);
scxclu = reallocate_array(scxclu, current_max_scs,
sizeof(char));
sceof = reallocate_array(sceof, current_max_scs, sizeof(char));
scname = reallocate_char_ptr_array (scname, current_max_scs);
}
/* scinstal - make a start condition
*
* NOTE
* The start condition is "exclusive" if xcluflg is true.
*/
/* scinstal - make a start condition */
void scinstal (const char *str, int xcluflg)
void scinstal (const char *str, bool sc_is_exclusive)
{
if (++lastsc >= current_max_scs)
scextend ();
scname[lastsc] = xstrdup(str);
if (addsym(scname[lastsc], NULL, lastsc,
sctbl, START_COND_HASH_SIZE))
format_pinpoint_message (_
("start condition %s declared twice"),
str);
if (addsym(str, NULL, lastsc, sctbl, START_COND_HASH_SIZE)) {
format_pinpoint_message (
_("start condition %s declared twice"), str);
}
scname[lastsc] = sctbl[hashfunct(str, START_COND_HASH_SIZE)]->name;
scset[lastsc] = mkstate (SYM_EPSILON);
scbol[lastsc] = mkstate (SYM_EPSILON);
scxclu[lastsc] = xcluflg;
scxclu[lastsc] = sc_is_exclusive ? 1 : 0;
sceof[lastsc] = false;
}
+4 -2
View File
@@ -1,4 +1,6 @@
/* tables.c - tables serialization code
*
* SPDX-License-Identifier: BSD-3-Clause-flex
*
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
@@ -160,12 +162,12 @@ int yytbl_hdr_fwrite (struct yytbl_writer *wr, const struct yytbl_hdr *th)
sz = (int) strlen (th->th_version) + 1;
if ((rv = yytbl_writen (wr, th->th_version, sz)) != sz)
flex_die (_("th_version writen failed"));
flex_die (_("th_version written failed"));
bwritten += rv;
sz = (int) strlen (th->th_name) + 1;
if ((rv = yytbl_writen (wr, th->th_name, sz)) != sz)
flex_die (_("th_name writen failed"));
flex_die (_("th_name written failed"));
bwritten += rv;
/* add padding */
-1
View File
@@ -72,7 +72,6 @@ int yytbl_hdr_fwrite (struct yytbl_writer *wr,
const struct yytbl_hdr *th);
int yytbl_data_fwrite (struct yytbl_writer *wr, struct yytbl_data *td);
void yytbl_data_compress (struct yytbl_data *tbl);
struct yytbl_data *mkftbl (void);
#ifdef __cplusplus
+3 -1
View File
@@ -1,7 +1,9 @@
#ifdef FLEX_SCANNER
/*
dnl tables_shared.c - tables serialization code
dnl
dnl
dnl SPDX-License-Identifier: BSD-3-Clause-flex
dnl
dnl Copyright (c) 1990 The Regents of the University of California.
dnl All rights reserved.
dnl
+3 -1
View File
@@ -1,5 +1,7 @@
/* tblcmp - table compression routines */
/* SPDX-License-Identifier: BSD-3-Clause-flex */
/* Copyright (c) 1990 The Regents of the University of California. */
/* All rights reserved. */
@@ -489,7 +491,7 @@ void mkdeftbl (void)
* (i.e., jam entries) into the table. It is assumed that by linking to
* "JAMSTATE" they will be taken care of. In any case, entries in "state"
* marking transitions to "SAME_TRANS" are treated as though they will be
* taken care of by whereever "deflink" points. "totaltrans" is the total
* taken care of by wherever "deflink" points. "totaltrans" is the total
* number of transitions out of the state. If it is below a certain threshold,
* the tables are searched for an interior spot that will accommodate the
* state array.
+3 -1
View File
@@ -1,5 +1,7 @@
/* yylex - scanner front-end for flex */
/* SPDX-License-Identifier: BSD-3-Clause-flex */
/* Copyright (c) 1990 The Regents of the University of California. */
/* All rights reserved. */
@@ -51,7 +53,7 @@ int yylex (void)
toktype = flexscan ();
}
if (toktype == EOF || toktype == 0) {
eofseen = 1;
eofseen = true;
if (sectnum == 1) {
synerr (_("premature EOF"));
+22 -1
View File
@@ -1,7 +1,12 @@
# common files generated by the test suite as it runs
*.log
*.trs
*.o
*.tables
*.o
# test specific files
alloc_extra_nr
alloc_extra_nr.c
alloc_extra_c99
@@ -12,6 +17,16 @@ array*
basic*
!basic.rules
!basic.txt
alloc_extra
alloc_extra.c
array_nr
array_nr.c
array_r
array_r.c
basic_nr
basic_nr.c
basic_r
basic_r.c
bison_nr
bison_nr_scanner.[ch]
bison_nr_parser.[ch]
@@ -65,6 +80,7 @@ lexcompat*
!lexcompat.rules
!lexcompat.txt
lineno*
!lineno_generated.l.in
!lineno.rules
!lineno.txt
mem_nr
@@ -142,3 +158,8 @@ test-yydecl-*
*.opt
*.ser
*.ver
# for MSWindows
*.obj
*.exe
+43 -14
View File
@@ -61,7 +61,7 @@ AM_CPPFLAGS = -I$(top_builddir)/src -I$(top_srcdir)/src
check_PROGRAMS = $(RULESET_TESTS) $(SPORADIC_TESTS) $(DIRECT_TESTS) $(I3_TESTS) $(PTHREAD_TESTS)
SPORADIC_TESTS = \
alloc_extra_nr \
alloc_extra_r \
alloc_extra_c99 \
bison_nr \
bison_yylloc \
@@ -73,6 +73,7 @@ SPORADIC_TESTS = \
cxx_restart \
header_nr \
header_r \
lineno_generated \
mem_nr \
mem_r \
mem_c99 \
@@ -106,7 +107,7 @@ I3_TESTS = \
PTHREAD_TESTS = \
pthread.pthread
alloc_extra_nr_SOURCES = alloc_extra_nr.l
alloc_extra_r_SOURCES = alloc_extra_r.l
alloc_extra_c99_SOURCES = alloc_extra_c99.l
if HAVE_BISON
bison_nr_SOURCES = bison_nr_scanner.l bison_nr_parser.y bison_nr_main.c
@@ -133,6 +134,9 @@ nodist_header_r_SOURCES = header_r_scanner.h
include_by_buffer_direct_SOURCES = include_by_buffer.direct.l
include_by_push_direct_SOURCES = include_by_push.direct.l
include_by_reentrant_direct_SOURCES = include_by_reentrant.direct.l
lineno_generated_SOURCES = lineno_generated.l
lineno_generated.l: lineno_generated.l.in
grep -n '@LINE@' $^ | sed -e 's%^\([0-9]\+\):.*%\1s/@LINE@/\1/%' | sed -f - $^ > $@.t && mv $@.t $@
mem_nr_SOURCES = mem_nr.l
mem_r_SOURCES = mem_r.l
mem_c99_SOURCES = mem_c99.l
@@ -168,7 +172,7 @@ state_buf_multiple_direct_SOURCES = state_buf_multiple.direct.lll
# it.
CLEANFILES = \
alloc_extra_nr.c \
alloc_extra_r.c \
alloc_extra_c99.c \
bison_nr_parser.c \
bison_nr_parser.h \
@@ -196,6 +200,8 @@ CLEANFILES = \
include_by_buffer.direct.c \
include_by_push.direct.c \
include_by_reentrant.direct.c \
lineno_generated.c \
lineno_generated.l \
mem_nr.c \
mem_r.c \
mem_c99.c \
@@ -281,6 +287,7 @@ EXTRA_DIST = \
flexname.txt \
lexcompat.txt \
lineno.txt \
lineno_generated.l.in \
posix.txt \
posixlycorrect.txt \
preposix.txt \
@@ -315,14 +322,23 @@ TESTOPTS = -L
FLEX = $(top_builddir)/src/flex
.l.c: $(FLEX)
.l.c:
%.c: %.l $(FLEX)
$(AM_V_LEX)$(FLEX) $(TESTOPTS) -o $@ $<
.ll.cc: $(FLEX)
.ll.cc:
%.cc: %.ll $(FLEX)
$(AM_V_LEX)$(FLEX) $(TESTOPTS) -+ -o $@ $<
#want line numbers, so override the default rule
lineno_generated.c: lineno_generated.l
$(AM_V_LEX)$(FLEX) -o $@ $<
bison_nr_main.$(OBJEXT): bison_nr_parser.h bison_nr_scanner.h
bison_nr_scanner.$(OBJEXT): bison_nr_parser.h
bison_nr_parser.$(OBJEXT): bison_nr_scanner.h
bison_nr_scanner.h: bison_nr_scanner.c
@if test ! -f $@; then rm -f $<; else :; fi
@@ -330,6 +346,7 @@ bison_nr_scanner.h: bison_nr_scanner.c
bison_yylloc_main.$(OBJEXT): bison_yylloc_parser.h bison_yylloc_scanner.h
bison_yylloc_scanner.$(OBJEXT): bison_yylloc_parser.h
bison_yylloc_parser.$(OBJEXT): bison_yylloc_scanner.h
bison_yylloc_scanner.h: bison_yylloc_scanner.c
@if test ! -f $@; then rm -f $<; else :; fi
@@ -337,6 +354,7 @@ bison_yylloc_scanner.h: bison_yylloc_scanner.c
bison_yylval_main.$(OBJEXT): bison_yylval_parser.h bison_yylval_scanner.h
bison_yylval_scanner.$(OBJEXT): bison_yylval_parser.h
bison_yylval_parser.$(OBJEXT): bison_yylval_scanner.h
bison_yylval_scanner.h: bison_yylval_scanner.c
@if test ! -f $@; then rm -f $<; else :; fi
@@ -345,7 +363,9 @@ bison_yylval_scanner.h: bison_yylval_scanner.c
# automake does not support compiling flex scanners output in C as C++
# so we explicitly sayhow, using the .lll suffix for the lex input file
.lll.cc: $(FLEX)
.lll.cc:
%.cc: %.lll $(FLEX)
$(AM_V_LEX)$(FLEX) $(TESTOPTS) -o $@ $<
header_nr_main.$(OBJEXT): header_nr_scanner.h
@@ -385,13 +405,21 @@ top.h: top.c
# Build rules for non-C back ends
.l.go:
$(AM_V_LEX)$(FLEX) $(TESTOPTS) -o $@ $<
# This is a temporary fake rule for use while the Go back end still
# actually generates C.
.go:
$(CC) $< -o $*_go
## A Go backend would be built like this
# .l.go:
#
# %.go: %.l $(FLEX)
# $(AM_V_LEX)$(FLEX) $(TESTOPTS) -o $@ $<
#
# .go:
#
# # This is a temporary fake rule for use while the Go back end still
# # actually generates C.
# # We'll replace the CC comand with a golang command if Make still
# # doesn't have a builtin rule when the backend is ready.
#
# %.o: %.go
# $(CC) $< -o $*_go
# Most test productions can be autogenerated from ruleset files, but
# automake has no way to specify such things with a loop in a variable
@@ -424,7 +452,8 @@ RULESETS = \
$(srcdir)/yyunput.rules
$(srcdir)/ruleset.am: $(srcdir)/ruleset.sh $(RULESETS)
$(SHELL) $(srcdir)/ruleset.sh nr r c99 go > $(srcdir)/ruleset.am
( cd $(srcdir) && $(SHELL) ruleset.sh nr r c99 >ruleset.am )
# ( cd $(srcdir) && $(SHELL) ruleset.sh nr r c99 go >ruleset.am )
include $(srcdir)/ruleset.am
+4 -4
View File
@@ -87,17 +87,17 @@ rules file. The assumption is that the test binary should consume the
data following ### in the rules file, exercising some set of Flex
features and not returning a nonzero status.
If you can express your test as a ruleset within in this orotocol,
If you can express your test as a ruleset within in this protocol,
please do so. Those tests are easy to port to new back ends, as that
whole job can be done by enhabcing testmaker.m4.
whole job can be done by enhancing testmaker.m4.
* WHY SOME TESTS ARE MISSING
The "top" test is backend-independent; what it's really testing
is Flex's ability to accumulate and ship preamble code sections.
The "quotes" test is also backend-indepedent; it's testing that
m4 expansion doesn't leak through the genertated scanner.
The "quotes" test is also backend-independent; it's testing that
m4 expansion doesn't leak through the generated scanner.
The C99 backend is missing tests for the Bison bridge, header
generation, and loadable tables because it omits those features in
+1 -1
View File
@@ -24,7 +24,7 @@
/*
* Test Lex incompatibility. This is the compatibility exanmple from
* the documentation; with !lex-compat it *should* match the string "foo".
* For the complementery test, see lexcompat.rules.
* For the complementary test, see lexcompat.rules.
*/
%option nounput nomain noyywrap noinput
%option warn nolex-compat
+1 -1
View File
@@ -30,7 +30,7 @@
* If "--yylineno" in the action is "yylineno--", the pattern
* is not recognized and the magic rewrite rule for yylineo
* does not fire. Only an issue for non-default back ends that
* do magic rewrites rather than rtelying on the C preprocessor.
* do magic rewrites rather than relying on the C preprocessor.
*/
%option 8bit
%option nounput nomain noyywrap noinput yylineno
+73
View File
@@ -0,0 +1,73 @@
/*
* This file is part of flex.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE.
*/
%{
/* Test generated line numbers. Be careful editing this file
as it's all about ensuring flex generates correct line
directives, so the @LINE@ markers must be on the same line as a
their corresponding __LINE__ macros.
*/
#include <stdio.h>
#include "config.h"
static int defs_percent_expect = @LINE@, defs_percent_got = __LINE__;
static int error_count = 0;
static void test_line (const char *desc, int expect, int got);
%}
static int defs_indent_expect = @LINE@, defs_indent_got = __LINE__;
%option nounput noyywrap noinput
%option warn
%%
test_line ("prolog indent", @LINE@, __LINE__);
%{
test_line ("prolog percent", @LINE@, __LINE__);
%}
\n { test_line ("rules braced", @LINE@, __LINE__); }
. test_line ("rules bare", @LINE@, __LINE__);
%%
static void
test_line (const char *desc, int expect, int got)
{
printf ("%s: expect: %d got: %d\n", desc, expect, got);
error_count += expect != got;
}
int
main (void)
{
yybuffer buffer = yy_scan_string ("a\na\n");
yylex ();
yy_delete_buffer (buffer);
test_line ("defs percent", defs_percent_expect, defs_percent_got);
test_line ("defs indent", defs_indent_expect, defs_indent_got);
test_line ("user code", @LINE@, __LINE__);
return error_count != 0;
}
+1 -1
View File
@@ -64,7 +64,7 @@
FOOget_text( (yyscan_t )0 );
FOOlex( (yyscan_t )0 );
//FOOlex_destroy( (yyscan_t )0 );
FOOlex_init( (yyscan_t *)0 );
//FOOlex_init( (yyscan_t *)0 );
//FOOset_extra( (void *)0, (yyscan_t )0 );
FOOset_in( (FILE*)0, (yyscan_t )0 );
FOOset_out( (FILE*)0, (yyscan_t )0 );
+32
View File
@@ -32,6 +32,9 @@
/* sect 1 [[[ 3 ]]] TEST_XXX */
/* sect 1 [[[[ 4 ]]]] TEST_XXX */
/* sect 1 ]] unmatched [[ TEST_XXX */
/* sect 1 ]]
* multiline unmatched [[ TEST_XXX
*/
%{
/* A template scanner file to build "scanner.c". */
@@ -46,6 +49,9 @@
/* sect 1 block [[[ 3 ]]] TEST_XXX */
/* sect 1 block [[[[ 4 ]]]] TEST_XXX */
/* sect 1 block ]] unmatched [[ TEST_XXX */
/* sect 1 block ]]
* multiline unmatched [[ TEST_XXX
*/
static int a[1] = {0};
static int b[1] = {0};
@@ -67,6 +73,10 @@ static int foo (int i){
/* indented code [[[ 3 ]]] */
/* indented code [[[[ 4 ]]]] */
/* indented code ]] unmatched [[ */
/* indented code ]]
* multiline unmatched [[
*/
%{
// non-indented code [ 1 ]
// non-indented code [[ 2 ]]
@@ -80,6 +90,23 @@ c /* action comment [[[ 3 ]]] */ ;
d /* action comment [[[[ 4 ]]]] */ ;
e /* action comment ]] unmatched [[ */ ;
f return 1+foo(a[b[c[0]]]);
g /* long action comment
* [ 1 ]
* [[ 2 ]]
* [[[ 3 ]]]
* [[[[ 4 ]]]]
* ]]
* multiline unmatched [[
*/ ;
h { } /* after action comment [ 1 ] */
i { } /* after action comment [[ 2 ]] */
j { } /* after action comment [[[ 3 ]]] */
k { } /* after action comment [[[[ 4 ]]]] */
l { } /* after action comment ]] unmatched [[ */
m { } /* after action comment
* ]]
* multiline unmatched [[
*/
.|\n {
#if 0
@@ -94,6 +121,9 @@ f return 1+foo(a[b[c[0]]]);
/* action block [[[ 3 ]]] TEST_XXX */
/* action block [[[[ 4 ]]]] TEST_XXX */
/* action block ]] unmatched [[ TEST_XXX */
/* action block ]]
* multiline unmatched [[
* TEST_XXX */
assert(!strcmp("[[ 2 ]]", "[""[ 2 ]""]"));
assert(!strcmp("[[[ 3 ]]]", "[""[""[ 3 ]""]""]"));
assert(!strcmp("[[[[ 4 ]]]]", "[""[""[""[ 4 ]""]""]""]"));
@@ -109,6 +139,8 @@ f return 1+foo(a[b[c[0]]]);
/* sect 3 [[[ 3 ]]] TEST_XXX */
/* sect 3 [[[[ 4 ]]]] TEST_XXX */
/* sect 3 ]] unmatched [[ TEST_XXX */
/* sect 3 ]]
* multiline unmatched [[ TEST_XXX */
static int bar (int i){
return c[b[a[i]]]; /* sect 3 code TEST_XXX */
}
+2 -222
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -66,7 +66,7 @@ EOF
done
done
# posixlycorrect is a special case becaae we need to set POSIXLY_CORRECT
# posixlycorrect is a special case because we need to set POSIXLY_CORRECT
# in Flex's environment while these .l files are being processed.
for backend in "$@" ; do
case $backend in
+1 -1
View File
@@ -1,6 +1,6 @@
#!/bin/sh
#
# testmaker.sh - asssemble tests from backend-independent rulesets and
# testmaker.sh - assemble tests from backend-independent rulesets and
# backend-dependent boilerplate. Generates both a Flex source file
# and an input text for it.
#
-1
View File
@@ -11,7 +11,6 @@ INPUT_DIRECTORY=""
INPUT_NAME=""
INPUT_COUNT=0
USE_REDIRECT=0
DO_COMPARISON=0
while getopts d:i:r OPTION ; do
case $OPTION in
+1 -1
View File
@@ -21,7 +21,7 @@
* PURPOSE.
*/
/*
* Test yyless. What should haooen is:
* Test yyless. What should happen is:
* 1. "foobar" is matched by the first rule.
* 2. "bar" is pushed back by yyless(3)
* 3. "bar" is matched by the second rule