lionelauroux / cnorm Goto Github PK
View Code? Open in Web Editor NEWA C Front End in Python with Pyrser
Home Page: http://pythonhosted.org/cnorm
License: GNU General Public License v3.0
A C Front End in Python with Pyrser
Home Page: http://pythonhosted.org/cnorm
License: GNU General Public License v3.0
CNORM does not identify the differences between function pointers and wrapped-with-parenthesis variables.
For an: int (*lol);
type=Decl:
_ctype type=PrimaryType:
_decltype type=PointerType:
_decltype type=ParenType:
_decltype
_params type=list:
_identifier str='int'
_specifier int=0
_storage int=0
_name str='lol'
For an: int (*fptr)();
type=Decl:
_ctype type=PrimaryType:
_decltype type=PointerType:
_decltype type=ParenType:
_decltype
_params type=list:
_identifier str='int'
_specifier int=0
_storage int=0
_name str='fptr'
Moreover, when we use the "to_c()" method with those Decls, CNORM only gives us wrapped-with-parenthesis variables.
int (*lol);
int (*fptr);
Thank you :)
I have this problem in Rathaxes:
If I declare something like:
unsigned char __iomem *ioaddr;
Then the following code is generated:
__iomem *ioaddr;
Likewise:
static int __init rtx_module_init(void)
Will generate:
static __init rtx_module_init(void)
Original issue reported on code.google.com by [email protected]
on 17 Oct 2012 at 5:54
According to the C standards, successive string literals are interpreted as one string, composed of all the strings concatenated (i.e. printf("Hello " "world !"); is the same as printf("Hello world !").
Pyrser raises an exception with this syntax, even though it is valid.
struct test
{
int i;
};
struct test * var1;
struct test const * var2;
The type identifier for the variable "var2" is not filled in this case.
[ 1 ] type=Decl:
_ctype type=ComposedType:
_decltype type=PointerType:
_decltype
_identifier str='test'
_specifier int=1
_storage int=0
_name str='var1'
[ 2 ] type=Decl:
_ctype type=ComposedType:
_decltype type=PointerType:
_decltype
_identifier str=''
_specifier int=1
_storage int=0
_name str='var2'
struct test
{
int i;
};
int main()
{
register const struct test const var1;
}
gives
[ 0 ] type=Decl:
_ctype type=ComposedType:
_decltype
_identifier str='var1'
_specifier int=1
_storage int=1
_name str=''
Cnorm doesn't detect any qualifier, and in this case the type identifier is set to "var1"
Globaly, all qualifiers for structs type doesn't apply.
int main(int ac, char **av)
{
int a;
return (sizeof ac);
}
Original issue reported on code.google.com by [email protected]
on 28 Jun 2011 at 1:48
A function cannot be static and inline at the same time for CNorm. When it is, the last qualifier is taken.
Ex:
inline static int f() {}
static inline int f() {}
gives this when it is parsed by Declaration and transformed into C:
static int f() {}
inline int f() {}
void test(int toto[static 45], int titi[const 45])
{
}
int main ()
{
return 1;
}
Cnorm omit the static and the const specifier in parameters.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.