Giter Site home page Giter Site logo

mjsir911 / cdecl Goto Github PK

View Code? Open in Web Editor NEW

This project forked from paul-j-lucas/cdecl

0.0 2.0 0.0 6.19 MB

Composing and deciphering C (or C++) declarations or casts, aka ‘‘gibberish.’’

License: GNU General Public License v3.0

Makefile 5.63% M4 0.84% C 68.52% Yacc 19.15% Lex 4.37% Shell 1.21% Python 0.28%

cdecl's Introduction

cdecl

Introduction

I’m still uncertain about the language declaration syntax, where in declarations, syntax is used that mimics the use of the variables being declared. It is one of the things that draws strong criticism, but it has a certain logic to it.

— Dennis M. Ritchie

I consider the C declarator syntax an experiment that failed.

— Bjarne Stroustrup

cdecl (see-deh-kull) is a program for composing and deciphering C (or C++) declarations or casts, aka ‘‘gibberish.’’ It can be used interactively on a terminal or accept input from either the command line or standard input.

This codebase fixes virtually all the deficiencies in earlier versions as well as adds many new features, most notably:

  • Using GNU Autotools for building.
  • Command-line long-options.
  • Distinguishes among K&R C, C89, C95, C99, C11, C17, C2X, C++98, C++03, C++11, C++14, C++17, and C++20.
  • Support for C89 const, restrict, and volatile qualifiers.
  • Support for C99 static, type-qualified, and variable length array function parameters.
  • Support for C99 extensions Embedded C and Unified Parallel C.
  • Support for inline function and variable declarations.
  • Support for typedef declarations.
  • Pre-defined typedef declarations for all standard C & C++ language types (_Bool, _Complex, _Imaginary, char8_t, wchar_t, etc.), many POSIX and standard library types (FILE, in_addr_t, int8_t, pid_t, pthread_t, ptrdiff_t, size_t, std::ostream, std::string, etc.), and all Microsoft Windows types.
  • Support for variadic function parameters.
  • Support for C and C++ alternative tokens (and, and_eq, etc.).
  • Support for C++ constructors, destructors, mutable data members, namespaces and scoped names, new-style casts, pointers to members, throw, overloaded operators, and friend, virtual and pure virtual member function declarations, and user-defined conversion operators.
  • Support for C++11 auto (as a deduced type), constexpr, enum class, fixed-type enumerations, final, noexcept, override, rvalue references, user-defined literals, using (as a typedef synonym), the function trailing return-type syntax, and ref-qualified member function declarations.
  • Support for C++20 consteval, constinit, and export declarations.
  • Support for C++ [[carries_dependency]], [[deprecated]], [[maybe_unused]], [[nodiscard]], and [[noreturn]] attribute specifiers.
  • Better warning and error messages complete with location information, color, and "Did you mean ...?" suggestions.

Installation

The git repository contains only the necessary source code. Things like configure are derived sources and should not be included in repositories. If you have autoconf, automake, and m4 installed, you can generate configure yourself by doing:

./bootstrap

You will also need flex and bison (lex and yacc won't do). Or you can download a released version that contains configure and the generated lexer and parser. In either case, then follow the generic installation instructions given in INSTALL.

If you would like to generate the developer documentation, you will also need Doxygen; then do:

make doc                            # or: make docs

and then open docs/html/index.html with a browser.

Licensing

cdecl was originally written by Graham Ross sometime in the mid-1980s. Tony Hansen, a major contributor, posted the source code with his changes to comp.sources.unix in 1988.

The source files have never had either a copyright notice or license. Attempts have been made independently by several people to contact Graham over the years to clear-up the licensing issue, all without success.

In 1996, David Conrad made contributions for version 2.5 and wrote:

I have no reason to believe there are any limitations on [cdecl's] use, and strongly believe it to be in the Public Domain.

(See the included README-2.5.txt for David's full comments.)

Something in the Public Domain allows anyone to do whatever they want with it. Assuming that David is correct and that cdecl is in the Public Domain, I therefore am licensing cdecl 3.0 (and later) under the GNU General Public License, v3.

Paul J. Lucas
San Francisco, California, USA
16 April 2017

cdecl's People

Contributors

mjsir911 avatar paul-j-lucas avatar ridiculousfish avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.