Compare commits
167
Commits
westes-install
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a8a44278b8 | ||
|
|
94a5995c68 | ||
|
|
20beab090c | ||
|
|
4c7405e3b4 | ||
|
|
65dce1b907 | ||
|
|
a5b010582c | ||
|
|
c2edac78db | ||
|
|
257c3f083e | ||
|
|
0725218038 | ||
|
|
bdb5a14b57 | ||
|
|
13c8018e38 | ||
|
|
38e2465035 | ||
|
|
3241307056 | ||
|
|
9fcb2a4d09 | ||
|
|
575e0f42dd | ||
|
|
c749bd29a7 | ||
|
|
a75d893a68 | ||
|
|
790dccd637 | ||
|
|
bf254c75b1 | ||
|
|
8a59edae27 | ||
|
|
cff048484c | ||
|
|
1eb2280120 | ||
|
|
dff2e1b19f | ||
|
|
7b5b6690da | ||
|
|
051ab9ed8c | ||
|
|
c0c89c1265 | ||
|
|
25a5ade6cd | ||
|
|
a79d85283b | ||
|
|
6fc88bc133 | ||
|
|
d29a6c02d4 | ||
|
|
7191257ddc | ||
|
|
21eee2c2c1 | ||
|
|
91eb0d0d84 | ||
|
|
4cadf6d6e7 | ||
|
|
1cd24f8a47 | ||
|
|
396a2bfb37 | ||
|
|
9433e4f65f | ||
|
|
48371b32a9 | ||
|
|
719a1cafc6 | ||
|
|
546d905feb | ||
|
|
06f1ee7ee8 | ||
|
|
18fe45eaa4 | ||
|
|
ae83246128 | ||
|
|
203af5cfe5 | ||
|
|
c6114324f9 | ||
|
|
05909f20c5 | ||
|
|
ea5a7719ba | ||
|
|
74a132156c | ||
|
|
bbe2a15e2d | ||
|
|
787edd4183 | ||
|
|
2d08e2f469 | ||
|
|
3c70fb6932 | ||
|
|
1a7a3e0885 | ||
|
|
7e53fea7dc | ||
|
|
03b5af1572 | ||
|
|
1ac30394ec | ||
|
|
025095c847 | ||
|
|
3c97166fbd | ||
|
|
b7d76db200 | ||
|
|
dca87d9b1f | ||
|
|
cab0bbc85c | ||
|
|
f99d327117 | ||
|
|
e241be63dd | ||
|
|
3adb336992 | ||
|
|
1f27fff775 | ||
|
|
518108ed39 | ||
|
|
b012df90bb | ||
|
|
68eb57857f | ||
|
|
dae428c836 | ||
|
|
bf23944911 | ||
|
|
a4abd73431 | ||
|
|
80d756484c | ||
|
|
ccbd9f698b | ||
|
|
08ce73bb6f | ||
|
|
601cef4b28 | ||
|
|
26673bdce1 | ||
|
|
1a44eb990c | ||
|
|
d5770a0acd | ||
|
|
b577780992 | ||
|
|
5676be36e4 | ||
|
|
4f7f19e6bc | ||
|
|
2e5f4bc9d8 | ||
|
|
bab5ce6457 | ||
|
|
a8b07bac95 | ||
|
|
289796314f | ||
|
|
3726c1a88d | ||
|
|
b162ab50f4 | ||
|
|
19491a012a | ||
|
|
978faf231d | ||
|
|
ba1efdfa39 | ||
|
|
d009124da5 | ||
|
|
05f4e0c505 | ||
|
|
ba197cc47a | ||
|
|
363a534309 | ||
|
|
ff7ac43be2 | ||
|
|
52c3d81c24 | ||
|
|
221bee4fa7 | ||
|
|
3d2cc12a8b | ||
|
|
ba051d52d4 | ||
|
|
002cea24e6 | ||
|
|
c674b5faa3 | ||
|
|
d86f102dc1 | ||
|
|
61fd9e0403 | ||
|
|
9a8e61ce31 | ||
|
|
e09102edc4 | ||
|
|
cf9c659c54 | ||
|
|
1cd660e4d6 | ||
|
|
ec6bdb287e | ||
|
|
a997ad61b7 | ||
|
|
2285b0d5b8 | ||
|
|
5b5ec2420f | ||
|
|
e64e7e248f | ||
|
|
0874fccc85 | ||
|
|
65f8308496 | ||
|
|
7f062cf1ae | ||
|
|
f1eabccbef | ||
|
|
e4ccec1f49 | ||
|
|
fd91e0b78e | ||
|
|
7c053dac96 | ||
|
|
52eb5570b9 | ||
|
|
1a313b3fb8 | ||
|
|
1370faa58c | ||
|
|
a46776704b | ||
|
|
0591dc12ba | ||
|
|
97b8fa9c6f | ||
|
|
20bd1cd233 | ||
|
|
8453b08d82 | ||
|
|
9457969786 | ||
|
|
c47ca061c6 | ||
|
|
ee2d527aa0 | ||
|
|
7efebe2a17 | ||
|
|
63665f4c72 | ||
|
|
f7ea805ae1 | ||
|
|
c27726d60b | ||
|
|
3cb02c7555 | ||
|
|
fe90aa6ebe | ||
|
|
f2567970b0 | ||
|
|
2c0b6c791b | ||
|
|
6db99ccd7a | ||
|
|
ac962cd512 | ||
|
|
d7d1c54362 | ||
|
|
c2fae24fa3 | ||
|
|
541645a888 | ||
|
|
a97872a311 | ||
|
|
1b38ae28e7 | ||
|
|
a3022d064a | ||
|
|
d30bdf45a8 | ||
|
|
4a4bac0b29 | ||
|
|
2bb3bfd64f | ||
|
|
b822e533e1 | ||
|
|
3aedd28670 | ||
|
|
3352d7f1c9 | ||
|
|
a57e165cc5 | ||
|
|
74e8c880fc | ||
|
|
f1c2570502 | ||
|
|
bf59176220 | ||
|
|
e34253f1ca | ||
|
|
9e69eff334 | ||
|
|
cf66c9e5f1 | ||
|
|
06adbc6f0f | ||
|
|
ac1dc0d757 | ||
|
|
b746b2c3f6 | ||
|
|
3a24fa0366 | ||
|
|
4ec57cf108 | ||
|
|
853c232b7e | ||
|
|
13a2f02b80 | ||
|
|
0954f389d3 |
@@ -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:
|
||||
- "*"
|
||||
@@ -0,0 +1 @@
|
||||
github: westes
|
||||
@@ -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
|
||||
|
||||
@@ -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}}"
|
||||
|
||||
@@ -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
@@ -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!
|
||||
@@ -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
@@ -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
@@ -39,7 +39,8 @@ dist_doc_DATA = \
|
||||
|
||||
EXTRA_DIST = \
|
||||
.indent.pro \
|
||||
INSTALL
|
||||
INSTALL.md \
|
||||
CONTRIBUTING.md
|
||||
|
||||
dist_noinst_SCRIPTS = \
|
||||
autogen.sh \
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
@@ -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
@@ -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
|
||||
|
||||
@@ -25,3 +25,6 @@ flex.ps
|
||||
version.texi
|
||||
flex.html
|
||||
flex.t2p
|
||||
|
||||
flex
|
||||
flex.exe
|
||||
|
||||
+41
-7
@@ -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
@@ -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
@@ -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.
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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,3 +1,4 @@
|
||||
*.la
|
||||
*.lo
|
||||
*.o
|
||||
*.obj
|
||||
|
||||
+1
-1
@@ -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
@@ -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
|
||||
|
||||
@@ -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
@@ -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
@@ -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.
|
||||
#
|
||||
|
||||
@@ -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
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
@@ -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 ) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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
@@ -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
@@ -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 *);
|
||||
|
||||
@@ -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
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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
@@ -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
@@ -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
@@ -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"']*/ "&",/'
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
@@ -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 );
|
||||
}
|
||||
|
||||
@@ -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
@@ -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
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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. */
|
||||
|
||||
|
||||
@@ -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. */
|
||||
|
||||
|
||||
@@ -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
@@ -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 */
|
||||
|
||||
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
|
||||
|
||||
@@ -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
@@ -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
|
||||
|
||||
@@ -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
@@ -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,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
File diff suppressed because one or more lines are too long
+1
-1
@@ -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
@@ -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.
|
||||
#
|
||||
|
||||
@@ -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
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user