C Parser (Front End)
The C parser (front end) enables the construction of C custom compilers, analysis tools, or source transformation tools. It is a member of SD's family of language front ends, based on first-class infrastructure (DMS) for implementing such custom tools. The C front end includes:
- Lexical analysis including ASCII and ISO 8859-1
- Conversion of literal values (numbers, escaped strings) into native values to enable easy computation over literal values
- String literals represented internally in Unicode to support 16-bit characters
- Explicit grammar directly implements defacto and real standards and extensions
- Full C (ISO 9899:1990) parser
- Option for C99 (ISO 9899:1999) dialect
- Option for GNU C (GCC2 and GCC3) dialect
- Option for Microsoft Visual6 C dialect
- Easy extension for other dialects
- Preprocessor support
- Controllable include directory paths
- Option to fully expand preprocessor directives
- Option to parse include files for definitions
- Option to parse preserving preprocessor conditional directives, macros and include directives
- Automatic construction of complete abstract syntax tree
- Capture of comments and formats (shape) of literal values
- Capture of ambiguous parses during parsing
- Ability to parse large systems of files into same workspace, enabling interprocedural and cross-file analysis/transformation
- Ability to parse different languages into same workspace, enabling cross-language analysis/transformation
- Facilities to process syntax trees
- Complete procedural API to visit/query/update/construct/print syntax trees
- Source regeneration by prettyprinting and/or fidelity printing of syntax trees with comments and lexical formats
- Automatically generated source-to-source transformation system
- Ability to define custom attribute-grammar-based analyzers
- Name and Type resolution
- Type representation system for all C types defined
- All identifiers resolved to their C-defined type and stored in symbol tables
- Automatic deletion of erroneous alternatives of ambiguous parses
- Ability to condition transforms on identifier type
- Abilility to visit/query/update symbol tables
- Constructed for each function definition
- Ties control flow nodes to ASTs
- Exposes sequence points
- Computes Post-dominators
- Computes Control Dependences (Sample control flow graph)
- Qualifies function pointers by "address taken" and argument types
- Computes Transitive "Has-side-effect" information
- Forward and Backward Iterative Flow analyzers
- Reaching definitions for scalar values, struct members, array elements, structs and arrays (Sample reaching definitions graph)
- Use-definition chains
- Definition-use chains
- Reachable-uses analysis
- Means to manage multiple language dialects with highly shared common core
Many of these facilities come as a consistent consequence of the front end being built on top of DMS.
Here are some sample tools (many offered by SD as products) built using the C front end:
- Preprocessor conditional simplification given fixed assertions about #defined identifiers.
- Source Formatter
- Obfuscator
- Test Coverage
- Profiler
- Duplicate Code Detection and removal
Your organization may use DMS with the C front end to implement and deploy your own custom tools. The sample tools can be obtained in source form as part of the C front end for customization. Semantic Designs is also willing to build custom tools under contract.
Copyright © 1995-2008 Semantic Designs, Incorporated
DMS and "Design Maintenance System" are registered trademarks of Semantic Designs, Inc.
The SD logo and "Semantic Designs" are registered service marks of Semantic Designs, Inc.
CloneDR, PARLANSE and Thicket are trademarks of Semantic Designs, Inc.
The OMG logo is a registered trademark of the Object Management Group, Inc. in the United States and other countries.
To view our Privacy Policy, click here
Comments or problems: webmaster@semdesigns.com
