Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include addconfig.ac from backends/extensions directories in configur… #2

Merged
merged 1 commit into from
Apr 6, 2016

Conversation

ChrisDodd
Copy link
Contributor

…e.ac; rerun create-makefile.am.sh if anything is out of date

…e.ac; rerun create-makefile.am.sh if anything is out of date
@ChrisDodd ChrisDodd merged commit 58fb6da into master Apr 6, 2016
sethfowler added a commit to sethfowler/p4c that referenced this pull request May 2, 2017
The main refactoring taking place in this PR is to port the P4-14 and
P4-16 lexers and parsers to use the C++ modes of Flex and Bison. In C++
mode, Flex generates a lexer that reads from a `std::istream` object
instead of a file descriptor. That produces a bit of an impedance
mismatch, because typically before we parse anything we run it through
the C preprocessor via `popen()`, and `popen()` uses C `FILE*`-based I/O
rather than iostreams.

The C++-11 standard library does not include a `FILE*` wrapper that
produces an `std::istream`. If we don't want to write and maintain one
ourselves (and I'd argue we don't) that leaves us with three options:

1. Stop using `popen()` and implement the subset of C preprocessor
   features we need directly.

2. Read the entire file in and wrap it in a `std::stringstream` or
   similar. This obviously isn't as efficient as it could be.

3. Use Boost's IOStreams library to do the job more efficiently.

In the large term, my view is that p4lang#1 is the best choice, but in the
short run p4lang#3 seems like a win with no real downsides other than adding
another dependency. (It's only an additional dependency on Ubuntu, which
splits Boost into a number of small packages. On macOS there's actually
no change.)

In the interest of getting this PR landed ASAP, I've actually
implemented both p4lang#2 and p4lang#3, so the Boost IOStreams dependency is
optional. I would vastly prefer to make it mandatory, though.
sethfowler added a commit to sethfowler/p4c that referenced this pull request May 3, 2017
The main refactoring taking place in this PR is to port the P4-14 and
P4-16 lexers and parsers to use the C++ modes of Flex and Bison. In C++
mode, Flex generates a lexer that reads from a `std::istream` object
instead of a file descriptor. That produces a bit of an impedance
mismatch, because typically before we parse anything we run it through
the C preprocessor via `popen()`, and `popen()` uses C `FILE*`-based I/O
rather than iostreams.

The C++-11 standard library does not include a `FILE*` wrapper that
produces an `std::istream`. If we don't want to write and maintain one
ourselves (and I'd argue we don't) that leaves us with three options:

1. Stop using `popen()` and implement the subset of C preprocessor
   features we need directly.

2. Read the entire file in and wrap it in a `std::stringstream` or
   similar. This obviously isn't as efficient as it could be.

3. Use Boost's IOStreams library to do the job more efficiently.

In the large term, my view is that p4lang#1 is the best choice, but in the
short run p4lang#3 seems like a win with no real downsides other than adding
another dependency. (It's only an additional dependency on Ubuntu, which
splits Boost into a number of small packages. On macOS there's actually
no change.)

In the interest of getting this PR landed ASAP, I've actually
implemented both p4lang#2 and p4lang#3, so the Boost IOStreams dependency is
optional. I would vastly prefer to make it mandatory, though.
sethfowler added a commit to sethfowler/p4c that referenced this pull request May 4, 2017
The main refactoring taking place in this PR is to port the P4-14 and
P4-16 lexers and parsers to use the C++ modes of Flex and Bison. In C++
mode, Flex generates a lexer that reads from a `std::istream` object
instead of a file descriptor. That produces a bit of an impedance
mismatch, because typically before we parse anything we run it through
the C preprocessor via `popen()`, and `popen()` uses C `FILE*`-based I/O
rather than iostreams.

The C++-11 standard library does not include a `FILE*` wrapper that
produces an `std::istream`. If we don't want to write and maintain one
ourselves (and I'd argue we don't) that leaves us with three options:

1. Stop using `popen()` and implement the subset of C preprocessor
   features we need directly.

2. Read the entire file in and wrap it in a `std::stringstream` or
   similar. This obviously isn't as efficient as it could be.

3. Use Boost's IOStreams library to do the job more efficiently.

In the large term, my view is that p4lang#1 is the best choice, but in the
short run p4lang#3 seems like a win with no real downsides other than adding
another dependency. (It's only an additional dependency on Ubuntu, which
splits Boost into a number of small packages. On macOS there's actually
no change.)

In the interest of getting this PR landed ASAP, I've actually
implemented both p4lang#2 and p4lang#3, so the Boost IOStreams dependency is
optional. I would vastly prefer to make it mandatory, though.
sethfowler added a commit to sethfowler/p4c that referenced this pull request May 4, 2017
The main refactoring taking place in this PR is to port the P4-14 and
P4-16 lexers and parsers to use the C++ modes of Flex and Bison. In C++
mode, Flex generates a lexer that reads from a `std::istream` object
instead of a file descriptor. That produces a bit of an impedance
mismatch, because typically before we parse anything we run it through
the C preprocessor via `popen()`, and `popen()` uses C `FILE*`-based I/O
rather than iostreams.

The C++-11 standard library does not include a `FILE*` wrapper that
produces an `std::istream`. If we don't want to write and maintain one
ourselves (and I'd argue we don't) that leaves us with three options:

1. Stop using `popen()` and implement the subset of C preprocessor
   features we need directly.

2. Read the entire file in and wrap it in a `std::stringstream` or
   similar. This obviously isn't as efficient as it could be.

3. Use Boost's IOStreams library to do the job more efficiently.

In the large term, my view is that p4lang#1 is the best choice, but in the
short run p4lang#3 seems like a win with no real downsides other than adding
another dependency. (It's only an additional dependency on Ubuntu, which
splits Boost into a number of small packages. On macOS there's actually
no change.)

In the interest of getting this PR landed ASAP, I've actually
implemented both p4lang#2 and p4lang#3, so the Boost IOStreams dependency is
optional. I would vastly prefer to make it mandatory, though.
sethfowler added a commit that referenced this pull request May 4, 2017
The main refactoring taking place in this PR is to port the P4-14 and
P4-16 lexers and parsers to use the C++ modes of Flex and Bison. In C++
mode, Flex generates a lexer that reads from a `std::istream` object
instead of a file descriptor. That produces a bit of an impedance
mismatch, because typically before we parse anything we run it through
the C preprocessor via `popen()`, and `popen()` uses C `FILE*`-based I/O
rather than iostreams.

The C++-11 standard library does not include a `FILE*` wrapper that
produces an `std::istream`. If we don't want to write and maintain one
ourselves (and I'd argue we don't) that leaves us with three options:

1. Stop using `popen()` and implement the subset of C preprocessor
   features we need directly.

2. Read the entire file in and wrap it in a `std::stringstream` or
   similar. This obviously isn't as efficient as it could be.

3. Use Boost's IOStreams library to do the job more efficiently.

In the large term, my view is that #1 is the best choice, but in the
short run #3 seems like a win with no real downsides other than adding
another dependency. (It's only an additional dependency on Ubuntu, which
splits Boost into a number of small packages. On macOS there's actually
no change.)

In the interest of getting this PR landed ASAP, I've actually
implemented both #2 and #3, so the Boost IOStreams dependency is
optional. I would vastly prefer to make it mandatory, though.
pzanna added a commit to pzanna/p4c that referenced this pull request Dec 5, 2020
@KekeZheng KekeZheng mentioned this pull request Feb 23, 2022
Abe149 added a commit that referenced this pull request Apr 7, 2022
…ts for the compiler driver} into a separate file, also in the “test_scripts” subdirectory; finished [I think] the refactoring for the 1st of those tests, but still WIP for #2 and #3
Abe149 added a commit that referenced this pull request Apr 9, 2022
…ts for the compiler driver} into a separate file, also in the “test_scripts” subdirectory; finished [I think] the refactoring for the 1st of those tests, but still WIP for #2 and #3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants