Download Shareware and Freeware Software for Windows, Linux, Macintosh, PDA

line Home  |  About Us  |  Link To Us  |  FAQ  |  Contact

Serving Software Downloads in 956 Categories, Downloaded 49.479.622 Times

cpphs 1.0

  Date Added: October 08, 2010  |  Visits: 978

cpphs

Report Broken Link
Printer Friendly Version


Product Homepage
Download (85 downloads)



cpphs is a liberalised re-implementation of cpp, the C pre-processor, in Haskell. Why re-implement cpp? Rightly or wrongly, the C pre-processor is widely used in Haskell source code. It enables conditional compilation for different compilers, different versions of the same compiler, and different OS platforms. It is also occasionally used for its macro language, which can enable certain forms of platform-specific detail-filling, such as the tedious boilerplate generation of instance definitions and FFI declarations. However, there are two problems with cpp, aside from the obvious aesthetic ones: * For some Haskell systems, notably Hugs on Windows, a true cpp is not available by default. * Even for the other Haskell systems, the common cpp provided by the gcc 3.x series is changing subtly in ways that are incompatible with Haskells syntax. There have always been problems with, for instance, string gaps, and prime characters in identifiers. These problems are only going to get worse. So, it seemed right to provide an alternative to cpp, both more compatible with Haskell, and itself written in Haskell so that it can be distributed with compilers. This version of the C pre-processor is pretty-much feature-complete, and compatible with the -traditional style. It has two main modes: * conditional compilation only (--nomacro), * and full macro-expansion (default). In --nomacro mode, cpphs performs only conditional compilation actions, namely #includes, #ifs, and #ifdefs are processed according to text-replacement definitions (both command-line and internal), but no parameterised macro expansion is performed. In full compatibility mode (the default), textual replacements and macro expansions are also processed in the remaining body of non-cpp text. Working features: #ifdef simple conditional compilation #if the full boolean language of defined(), &&, ||, ==, etc. #elif chained conditionals #define in-line definitions (text replacements and macros) #undef in-line revocation of definitions #include file inclusion #line line number directives line continuations within all # directives /**/ token catenation within a macro definition ## ANSI-style token catenation # ANSI-style token stringisation __FILE__ special text replacement for DIY error messages __LINE__ special text replacement for DIY error messages __DATE__ special text replacement __TIME__ special text replacement Macro expansion is recursive. Redefinition of a macro name does not generate a warning. Macros can be defined on the command-line with -D just like textual replacements. Macro names are permitted to be Haskell identifiers e.g. with the prime and backtick ` characters, which is slightly looser than in C, but they still may not include operator symbols. Numbering of lines in the output is preserved so that any later processor can give meaningful error messages. When a file is #included, cpphs inserts #line directives for the same reason. Numbering should be correct even in the presence of line continuations. If you dont want #line directives in the final output, use the --noline option. Any syntax errors in cpp directives gives a message to stderr and halts the program. Failure to find a #included file produces a warning to stderr, but processing continues. Differences from cpp: In general, cpphs is based on the -traditional behaviour, not ANSI C, and has the following main differences from the standard cpp. General - The # that introduces any cpp directive must be in the first column of a line (whereas ANSI permits whitespace before the #). - Generates the #line n "filename" syntax, not the # n "filename" variant. - C comments are only removed from within cpp directives. They are not stripped from other text. Consider for instance that in Haskell, all of the following are valid operator symbols: /* */ */* However, you can turn on C-comment removal with the --strip option. - Macros are never expanded within Haskell comments, strings, or character constants, unless you give the --text option to disable lexing the input as Haskell. - Macros are always expanded recursively, unlike ANSI, which detects and prevents self-recursion. For instance, #define foo x:foo expands foo once only to x:foo in ANSI, but in cpphs it becomes an infinite list x:x:x:x:..., i.e. cpphs does not terminate. Macro definition language - Accepts /**/ for token-pasting in a macro definition. However, /* */ (with any text between the open/close comment) inserts whitespace. - The ANSI ## token-pasting operator is available with the --hashes flag. This is to avoid misinterpreting any valid Haskell operator of the same name. - Replaces a macro formal parameter with the actual, even inside a string (double or single quoted). This is -traditional behaviour, not supported in ANSI. - Recognises the # stringisation operator in a macro definition only if you use the --hashes option. (It is an ANSI addition, only needed because quoted stringisation (above) is prohibited by ANSI.) - Preserves whitespace within a textual replacement definition exactly (modulo newlines), but leading and trailing space is eliminated. - Preserves whitespace within a macro definition (and trailing it) exactly (modulo newlines), but leading space is eliminated. - Preserves whitespace within macro call arguments exactly (including newlines), but leading and trailing space is eliminated. - With the --layout option, line continuations in a textual replacement or macro definition are preserved as line-breaks in the macro call. (Useful for layout-sensitive code in Haskell.) Whats New in This Release: - This release now includes a compatibility script for command line arguments to match the original cpp. - There are several minor bugfixes, e.g. quotes around replacements for special macros like __FILE__, etc. - Interaction with preprocessors like hsc2hs is also improved: if they allow non-cpp directives like #def, these are now passed through to the output with a warning to stderr, rather than halting with an error. - Likewise, a #! line in a shell script is now ignored..

Requirements: No special requirements
Platforms: Linux
Keyword: Ansi Conditional Compilation Cpp Cpphs Haskell Line Macro Preprocessors Programming Special Text Text Replacement
Users rating: 0/10

License: Freeware Size: 39.94 KB
USER REVIEWS
More Reviews or Write Review


CPPHS RELATED
Utilities  -  XMacroj 0.1.0
XMacroJ is an XML macro language for building text documents from XML components. The project removes the reliance on using the include directives and frees the programmer from locking the development directly into a specific framework. Using...
87.04 KB  
Programming  -  QualityMgnt ToolBox 1.1b013
Provides tools, supporting quality management or quality assurance for software: Assessment execution (ISO 15504 (SPiCE), AutomotiveSPiCE, CMMi), diff tool calculating sizes (SLoC) of diffs, identification of conditional compilation, and more.
11.53 MB  
Audio Tools  -  Publimark 0.1.3
Publimark is a command line tool to secretly embed text in an audio file. Like cryptography, Publimark project uses a pair of keys: the public one can be shared, whereas the private one must be kept secret. Anybody can send a steganographic...
286.72 KB  
Shell & Desktop  -  Hashell 0.013a
Hashell project is a shell that is written in Haskell language and which it is intended to provide a set of abstractions that allows you to use Haskell as a shell programming language. So that way you can use haskell for your daily...
15.36 KB  
Input Device Utilities  -  Short Keys 98 Lite 1.5a
ShortKeys is a macro utility allowing you to setup replacement text or paragraphs for any given number of user defined keystrokes. ShortKeys monitors the keyboard activity on a global nature and anytime a user defined keystroke combination is...
344 KB  
Programming  -  Atox 0.5
Atox is a fully customizable Python library and command-line tool for converting plain text into XML.
204.11 KB  
Text Management  -  odt2txt 0.3
odt2txt is a command-line tool which extracts the text out of OpenDocument Texts, as produced by OpenOffice.org, KOffice, StarOffice and others. Features: - small - supports multiple output encodings - adopts to your locale - able to substitute...
 
Programming  -  Pycco 0.1
Pocco is a Python port of Docco: the original quick-and-dirty, hundred-line-long, literate-programming-style documentation generator. It produces HTML that displays your comments alongside your code. Comments are passed through Markdown, and code...
10.24 KB  
Automation Tools  -  Macro Commander Basic 1.1.0.0
Introducing Macro Commander Basic - a versatile and free automation software for Windows, catering to all your macro recording, text expansion, mouse clicking, automated data entry, and general automation needs. Whether it's native applications or...
36.91 MB  
Libraries  -  sqlpp 0.06
sqlpp Perl package is a SQL preprocessor. sqlpp is a conventional cpp-alike preprocessor taught to understand SQL ( PgSQL, in particular) syntax specificities. In addition to the standard #define/#ifdef/#else/#endif cohort, provides also...
10.24 KB  
NEW DOWNLOADS IN LINUX SOFTWARE, PROGRAMMING
Linux Software  -  EasyEDA PCB Designer for Linux 2.0.0
EasyEDA, a great web based EDA(Electronics Design Automation) tool, online PCB tool, online PCB software for electronics engineers, educators, students, makers and enthusiasts. Theres no need to install any software. Just open EasyEDA in any...
34.4 MB  
Linux Software  -  wpCache® WordPress HTTP Cache 1.9
wpCache® is a high-performance, distributed object, caching system application, generic in nature, but intended for use in speeding up dynamic web applications, by decreasing database load time. wpCache® decreases dramatically the page...
3.51 MB  
Linux Software  -  Polling Autodialer Software 3.4
ICTBroadcast Auto Dialer software has a survey campaign for telephone surveys and polls. This auto dialer software automatically dials a list of numbers and asks them a set of questions that they can respond to, by using their telephone keypad....
488 B  
Linux Software  -  Total Video Converter Mac Free 3.5.5
Total Video Converter Mac Free developed by EffectMatrix Ltd is the official legal version of Total Video Converter which was a globally recognized brand since 2006. Total Video Converter Mac Free is a free but powerful all-in-one video...
17.7 MB  
Linux Software  -  Skeith mod_log_sql Analyzer 2.10beta2
Skeith is a php based front end for analyzing logs for Apache using mod_log_sql.
47.5 KB  
Programming  -  Cedalion for Linux 0.2.6
Cedalion is a programming language that allows its users to add new abstractions and define (and use) internal DSLs. Its innovation is in the fact that it uses projectional editing to allow the new abstractions to have no syntactic limitations.
471.04 KB  
Programming  -  Math::GMPf 0.29
Math::GMPf - perl interface to the GMP library's floating point (mpf) functions.
30.72 KB  
Programming  -  Net::Wire10 1.08
Net::Wire10 is a Pure Perl connector that talks to Sphinx, MySQL and Drizzle servers. Net::Wire10 implements the low-level network protocol, alias the MySQL wire protocol version 10, necessary for talking to one of the aforementioned...
30.72 KB  
Programming  -  logilab-common 0.56.2
a bunch of modules providing low level functionnalities shared among some python projects devel Please note that some of the modules have some extra dependencies. For instance, logilab.common.db will require a db-api 2.0 compliant...
174.08 KB  
Programming  -  OpenSSL for linux 1.0.0a
The OpenSSL Project is a collaborative effort to develop a robust, commercial-grade, full-featured, and Open Source toolkit implementing the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1) protocols as well as a...
3.83 MB