Accéder au contenu principal

[Python] CCodeInline to replace np_inline.

An home-made design, not Warning, no exception enter in 500 lines and can merely compile everything in C. Designed to be more like C++, np_inline is a Boiler plate extracted from bare-bottom python doc

where my Actual development of CCodeInline is a class implementation of the same idiom... Adding possibility to upgrade the skeleton, it also come with possibility to add Include header ( what was really missing inside the Initial boiler-plate of a good C extension of Python compiled code )

Some other story from my github can also comment more on development and what was achieved... But on 3 days of works it merely show a same-to-same comparison be achieved... Parsing is 90% complete and the inherent design like writing the code inside a temporary-path, building and loading module with imp is 100% ported from my class design... A Big Plus, More than one code can be inserted in a skeleton, and Include list ( Should ) follow... Example from the file inside the __main__ demonstrate it's capacity to keep the merged/parsed information and can be switched from a current skeleton to another...

So maybe another fews days, and the code will support many Parameter in entry, C/C++ function will have a choosen C/C++ parameter before compiling, Header-file will be fully integrated and Function itself will not throw an assert on entry-function parameter being only Int or float, PyObject, String and many more parameter will be accessible...

Also planned to be released on pypi.python.org, this one will be up and growing...


Example of Managing a Skeleton with CCodeInline:

Managing the Skeleton

    
### Main example to define some code , some skeleton-Index and calling the
### inline_debug .
    
BInlineCode=r'''printf( "Program #%i: Hello world.\n", i ) ;'''
BCode = CCodeInline( args=(1, ), py_types=(( int, 'i'),)  )
### Note, the object is ready and we only need to define a Skeleton
### with property SkeletonIndex
BCode.SkeletonIndex = 1
BCode.AddSkeleton
### Also good if you do Errors by calling BCode.GenerateCode and parse tag and
### and realize there is an error inside the result, re-add the
### skeleton like this step to Initialize a Skeleton
### Just to sneak-out what inside to print a Generated/Parsed Skeleton
### you can call BCode.VarDefSkeleton property which is the active
### variable manager for current Skeleton
print BCode.VarDefSkeleton
### Don't forget to add the code:
BCode.FCCode = BInlineCode
### Did you add a malloc somewhere in your code.. Still need to add
### an Header ...
BCode.IncludeHeaderType = 'internal'
### IncludeHeaderType one of two words, 'internal', 'external'
### Based on Standard, an internal header will be handled like this : #include <...>
### and external-one will look like this : #include '...'
BCode.DictIncludeHeader = 'stdlib.h'
### Updating the Header list ready for parsing.
BCode.UpdateIncludeHeader
  
### If you do like to see once again, call GenerateCode and you will see appear it inside
### the Include-Header section...
BCode.GenerateCode()

XText may contains errors, syntax errors or lexical error...
XNow with SpellChecking and Editable text. Up to you to get something correct.


  • 1No Interest
  • 2Somewhat good
  • 3Good
  • 4Special.

Posts les plus consultés de ce blog

What are you doing here, another one ?

 Yeah, that's another one piece of Intel Corporation. Not in is box, already plugged somewhere. And now it's not sold with a board and not only wrap into a bubble bag. It come with the plastic box, and at least.    At 5.59$CA, if one of my board ares misconfiguration and lacking BIOS update to support higher than 10 Mb of memory, for family e5 2650v4 with 10 core rather than 14 and less than 20 Mb of L3 cache and will probably report only 60% of the memory is inaccessible rather than yelling for 66% of the memory if this one calculate the L3 memory as internal memory error for being unable to count the edge. Yes it's true an e5-2650 own 30Mb of L3 cache while the e5-2630 own 25 Mb. Ok it's not also the theoretical 2 cores in less. I seriously believe the second one will fail, for not having around 6 to 8 core and up to 15 Mb of memory on L3 cache. But apparently there is so many option withing the bios it let you disable the core. And mean I do request to investigate fo...

South Park Season 6 episode 8, Getting entry from everywhere, and talk that purge.

 Inside Red Hot Catholic love: Mostly engaged in a quest with old paper that compromise Vatican, we can empirically see the spider invade the Vatican as web that is origin of the sin and may compromise a story long of a big king willing to eat whole religion itself and there is drawn a idea the king will someday enter in the Vatican to invade it. But it's not the detailed reason, two other sub-talk from parent and delegation of believe do something strange among South Park resident.   Starting at the seventh minutes where Cartman challenge everyone. He not only winning but  got a slang talk to inherit from a strange symptoms against talk .     And manifestation of that symptoms lets people refluxing theirs 'expelation' back from the exit to normal way we are using to eat or express themselves.   We call it intro-digestion symptoms and beware of what you are doing it take you by surprise.  Accordingly to Stan report or Cartman slang to get a pooh out of...

Does George Santos have receive money from Honest Gill.

 Back to five point of Honest Gill was :  76% of Americans say their representatives do a very bad job of listening to them. We used to aim big in this country – what happened? I’ll work hard to make sure 100% of Americans feel unrepresented.  I’ll make elections more representative for people who pay me. Ranked Choice Voting would disenfranchise campaign mega-donors and carelessly empower everyday Americans who don’t understand the wants and needs of the fundraising class. I’ll strengthen partisan gerry mandering. It’s better that politicians choose their voters, not the other way around, right ? Lobbyists spend $4 million per member of Congress. How are us poor Congress Members supposed to live on chump change? I pledge to continue to take gobs of cash from unscrupulous lobbyists. Just 4% of U.S. adults say the political system is working extremely or very well. Honest Gil will do his gosh darndest to get that number down to 0%.   To point 1, Honest Gil wi...