Git Product home page Git Product logo

cdecl-blocks's People

Contributors

michawiedenmann avatar ridiculousfish avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cdecl-blocks's Issues

Non-transitive behavior with function pointers and type qualifiers/specifiers.

Entering [declare funcptr as pointer to function (pointer to const int, const pointer to char) returning int prints out int (*funcptr)(const int *, char * const )](int (*funcptr)(const int *, char * const )). This is good.

Entering int (*funcptr)(const int *, char * const ) prints out syntax error. This is wrong. It should print declare funcptr as pointer to function (pointer to const int, const pointer to char) returning int.

Dropping the consts from the arguments prints correctly.

cdecl.shar

make cdecl.shar got:
make: *** No rule to make target 'makefile', needed by 'cdecl.shar'. Stop.

In the Makefile, ALLFILES should be:
ALLFILES= Makefile cdgram.y cdlex.l cdecl.c cdecl.1 testset testset++

Variable length arrays?

Is there any chance that variable length arrays (c99) might be supported some time in the future? thanks.

Released version has disappeared

Mac Homebrew used to build cdecl from the source at http://cdecl.org/files/cdecl-blocks-2.5.tar.gz, but the file has disappeared. Where are you now hosting the 2.5 release source?

Syntax error on C standard signal() function

The infamous, hard-to-read C standard signal() function
void (*signal(int sig, void(*handler)(int) ))(int)
results in syntax error in https://cdecl.org/

Expected result (just an example): declare signal as function (int, void(*)(int)) returning pointer to function (int) returning void

bad character '+' When the parameter definition is unknown

(((Thread_Local_Variables * ) ((char * ) & scheme_thread_locals_space + scheme_tls_delta ) ) -> scheme_current_thread_ ) -> gmp_tls

the
Thread_Local_Variables
scheme_thread_locals_space
scheme_tls_delta
scheme_current_thread_
gmp_tls
is definition in project,in that case ,can I can't use this tool ?

bad character '-'

// syntax error
#define TCP_SKB_CB(__skb) ((struct tcp_skb_cb *)&((__skb)->cb[0]))

// bad character '-'
((struct tcp_skb_cb *)&((__skb)->cb[0]))

The above snippet was copied from Understanding Linux Network Internals.
It is a type cast for writing data to a socket buffer control buffer.

Suggestion: Addable prompts

It would be cool if we could add additional prompts to the page.
This way we could enter different definitions and see how they differ.

Visual Example:
image

Webapp and README should credit Graham Ross

The excellent cdecl.org webapp currently says "by Ridiculous Fish". Would be better to also say "based on a tool by Graham Ross". The README should also credit him, as the source code correctly does.

(Graham was a classmate of mine at Reed; I used his new tool in the early 1980s.)

(cdecl.org) intermediate qualified pointers create syntax errors?

cannot parse `int declare;`

int declare; is perfectly valid C++ code but the parser fails, saying "syntax error".
Also fails on declare declare as int
The parser should accept declare as an identifier.

Simple code doesn't work?

I'm probably not using this properly, but any code I try doesn't work. Even something as simple as
int a = 1;
on the site tells me
bad character '='

function pointers

Hi,

void*(*f)(size_t) is recognized as

declare f as pointer to function (size_t) returning pointer to void

but

void*(*)(size_t) isn't recognized. I'm not sure if this is a bug or not, both valid C. Is there a reason why not support function pointers without identifiers?

Use parentheses to clarify the scope of words in an English sentence

Very long English sentences, without punctuation and replete with conjunctions, can have more than one unintentional meanings. Consider the current example sentence. It can be interpreted as, or at least I find it interpretable as,

declare x as array 3 of pointer (to function returning pointer to array 5 of char)
declare x as array 3 of pointer to function, returning pointer to array 5 of char

As you can see, putting some basic punctuation can have a significant effect on the meaning.

Is it possible to support punctuation in such cases?

Accepts qualified void arguments

void (*f)(const void)

yields:

declare f as pointer to function (const void) returning void

but it is not allowed to use const in this situation.

Syntax error when variable name is func

void (*fun)(int) is completely correct however void void (*func)(int) is completely wrong.

This is very tedious because the linux man calls most of function pointers func

can't parse function pointer

const volatile unsigned long long int*const&&(*const&& b)(const volatile unsigned long long int*const*const*const(*const*const*const&&v)[0x1fb]);

doesn't support constexpr

constexpr in a; shows syntax error.
Maybe the tool is purely C, and doesn't support C++.
This will not be a bug then.
Is there a similar tool for C++?
Simple googling didn't help.

English translations should have plurals when appropriate

The declaration

int (*a[])();

Prints "declare a as array of pointer to function returning int." It would make more grammatical sense if it were "declare a as an array of pointers to functions returning int."
Though, it's understandable if it's too tricky to integrate plurals into the translation.

_Bool and bool aren't supported

I can understand why bool give a syntax error, but _Bool has been a builtin since C99.

For reference, this is the example I've tried:

_Bool (*f)(void *, void *)

If I replace that with:

int (*f)(void *, void *)

Then everything works.

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.