Spelling suggestions: "subject:"preprocessor"" "subject:"reprocessor""
1 |
Rejuvenating C++ Programs through DemacrofictationAditya Kumar, - 14 March 2013 (has links)
As we migrate software to new versions of programming languages, we would like to improve the style of its design and implementation by replacing brittle idioms and abstractions with the more robust features of the language and its libraries. This process is called source code rejuvenation. In this context, we are interested in replacing C preprocessor macros in C++ programs with C++11 declarations.
The kinds of problems engendered by the C preprocessor are many and well known. Because the C preprocessor operates on the token stream independently from the host language’s syntax, its extensive use can lead to hard-to-debug semantic errors. In C++11, the use of generalized constant expressions, type deduction, perfect forwarding, lambda expressions, and alias templates eliminate the need for many previous preprocessor-based idioms and solutions. Additionally, these features can be used to replace macros from legacy code providing better type safety and reducing software-maintenance efforts.
In order to remove the macros, we have established a correspondence between different kinds of macros and the C++11 declarations to which they could be trans- formed. We have also developed a set of tools to automate the task of demacrofying C++ programs. One of the tools suggest a one-to-one mapping between a macro and its corresponding C++11 declaration. Other tools assist in carrying out iterative application of refactorings into a software build and generating rejuvenated programs. We have applied the tools to seven C++ libraries to assess the extent to which these libraries might be improved by demacrofication. Results indicate that between 52% and 98% of potentially refactorable macros could be transformed into C++11 declarations.
|
2 |
Visualisierung von Variabilität in C-QuellcodeSixtus, Christina 16 September 2019 (has links)
In C-Quellcode wird der C-Präprozessor häufig verwendet, um ein Softwaresystem für verschiedene Ausführungsumgebungen und Varianten zu konfigurieren. Anweisungen zur bedingten Kompilierung ermöglichen es, dass Quellcodeteile bei der Verarbeitung durch den
Präprozessor ein- oder ausgeblendet werden. Dies erzeugt verschiedene Varianten der Software, erschwert jedoch die Lesbarkeit und Wartung des Quellcodes. Insbesondere die Auswirkungen einzelner Makrodefinitionen sind oft nicht einfach zu ermitteln. In dieser Arbeit
soll der Frage nachgegangen werden, wie das Verständnis des Quellcodes und der Auswirkungen von Makrodefinitionen mithilfe von Softwarevisualisierung unterstützt werden kann.
Dazu wird eine bestehende Visualisierungsmetapher an den Anwendungsfall angepasst. Anschließend folgt der Entwurf eines Verarbeitungsprozesses, um den Quellcode automatisiert
darstellen zu können. Mithilfe eines Prototyps wird die Machbarkeit gezeigt.:Inhaltsverzeichnis
Inhaltsverzeichnis I
Abbildungsverzeichnis III
Tabellenverzeichnis IV
Listings V
Abkürzungsverzeichnis VI
1 Einleitung 1
1.1 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Zielsetzung . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.3 Vorgehensweise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.4 Stand der Forschung . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2 Grundlagen 6
2.1 Die Programmiersprache C . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.1.1 Eigenschaften . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.1.2 Wichtige Sprachelemente . . . . . . . . . . . . . . . . . . . . . . 7
2.1.3 Der C-Präprozessor . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.1.4 Ablauf der Kompilierung . . . . . . . . . . . . . . . . . . . . . . . 10
2.2 Softwarevisualisierung . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.2.1 Eigenschaften und Ziele . . . . . . . . . . . . . . . . . . . . . . . 11
2.2.2 Getaviz . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.3 Graphdatenbanken und Neo4j . . . . . . . . . . . . . . . . . . . . . . . . 14
3 Konzeption 17
3.1 Anwendungsfall . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.2 Extraktion der benötigten Informationen . . . . . . . . . . . . . . . . . . . 19
3.2.1 Sprachmittel im C-Standard . . . . . . . . . . . . . . . . . . . . . 19
3.2.2 Variabilität in C-Quellcode . . . . . . . . . . . . . . . . . . . . . . 21
3.2.3 Extraktion von Variabilität . . . . . . . . . . . . . . . . . . . . . . 25
3.2.4 Entwurf eines Graphmodells für C-Quellcode . . . . . . . . . . . . 29
3.3 Visualisierung . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
3.3.1 Analyse bestehender Metaphern . . . . . . . . . . . . . . . . . . . 34
3.3.2 Darstellung der Variabilität in der Benutzungsoberfläche . . . . . . 37
3.4 Überblick über den Generierungsprozess . . . . . . . . . . . . . . . . . . . 39
4 Implementierung 42
4.1 Vorverarbeitung des Quellcodes . . . . . . . . . . . . . . . . . . . . . . . 42
4.1.1 Anpassung von TypeChef . . . . . . . . . . . . . . . . . . . . . . 42
4.1.2 Aufbau des Abstract Syntax Tree . . . . . . . . . . . . . . . . . . 43
4.2 Das jQAssistant-Plugin . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
4.2.1 Aufbau und grundsätzliche Funktionsweise . . . . . . . . . . . . . 44
4.2.2 Wichtige Descriptors und Relations . . . . . . . . . . . . . . . . . 46
4.2.3 Verarbeitung der XML-Datei . . . . . . . . . . . . . . . . . . . . . 46
4.2.4 Parsen der Bedingungen . . . . . . . . . . . . . . . . . . . . . . . 49II
4.3 Anpassung von Getaviz . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
4.4 Erweiterung der graphischen Oberfläche . . . . . . . . . . . . . . . . . . . 52
4.5 Test und Evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
5 Fazit 55
5.1 Zusammenfassung . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
5.2 Kritische Würdigung . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
5.3 Ausblick . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
A Übersicht über die Sprachmittel im C-Standard VII
Literaturverzeichnis XI
|
3 |
Integrated tooling framework for software configuration analysisSingh, Nieraj 05 May 2011 (has links)
Configurable software systems adapt to changes in hardware and execution environments, and often exhibit a variety of complex maintenance issues. Many tools exist to aid developers in analysing and maintaining large configurable software systems. Some are standalone applications, while a growing number are becoming part of Integrated Development Environments (IDE) like Eclipse. Reusable tooling frameworks can reduce development time for tools that concentrate on software configuration analysis. This thesis presents C-CLEAR, a common, reusable, and extensible tooling framework for software configuration analysis, where clear separation of concern exists between tooling functionality and definitions that characterise a software system. Special emphasis will be placed on common mechanisms for data abstraction and automatic IDE integration independent of the software system that is being analysed. / Graduate
|
4 |
Well-Formed and Scalable Invasive Software Composition / Wohlgeformte und Skalierbare Invasive SoftwarekompositionKarol, Sven 26 June 2015 (has links) (PDF)
Software components provide essential means to structure and organize software effectively. However, frequently, required component abstractions are not available in a programming language or system, or are not adequately combinable with each other. Invasive software composition (ISC) is a general approach to software composition that unifies component-like abstractions such as templates, aspects and macros. ISC is based on fragment composition, and composes programs and other software artifacts at the level of syntax trees. Therefore, a unifying fragment component model is related to the context-free grammar of a language to identify extension and variation points in syntax trees as well as valid component types. By doing so, fragment components can be composed by transformations at respective extension and variation points so that always valid composition results regarding the underlying context-free grammar are yielded. However, given a language’s context-free grammar, the composition result may still be incorrect.
Context-sensitive constraints such as type constraints may be violated so that the program cannot be compiled and/or interpreted correctly. While a compiler can detect such errors after composition, it is difficult to relate them back to the original transformation step in the composition system, especially in the case of complex compositions with several hundreds of such steps. To tackle this problem, this thesis proposes well-formed ISC—an extension to ISC that uses reference attribute grammars (RAGs) to specify fragment component models and fragment contracts to guard compositions with context-sensitive constraints. Additionally, well-formed ISC provides composition strategies as a means to configure composition algorithms and handle interferences between composition steps.
Developing ISC systems for complex languages such as programming languages is a complex undertaking. Composition-system developers need to supply or develop adequate language and parser specifications that can be processed by an ISC composition engine. Moreover, the specifications may need to be extended with rules for the intended composition abstractions.
Current approaches to ISC require complete grammars to be able to compose fragments in the respective languages. Hence, the specifications need to be developed exhaustively before any component model can be supplied. To tackle this problem, this thesis introduces scalable ISC—a variant of ISC that uses island component models as a means to define component models for partially specified languages while still the whole language is supported. Additionally, a scalable workflow for agile composition-system development is proposed which supports a development of ISC systems in small increments using modular extensions.
All theoretical concepts introduced in this thesis are implemented in the Skeletons and Application Templates framework SkAT. It supports “classic”, well-formed and scalable ISC by leveraging RAGs as its main specification and implementation language. Moreover, several composition systems based on SkAT are discussed, e.g., a well-formed composition system for Java and a C preprocessor-like macro language. In turn, those composition systems are used as composers in several example applications such as a library of parallel algorithmic skeletons.
|
5 |
Well-Formed and Scalable Invasive Software CompositionKarol, Sven 18 May 2015 (has links)
Software components provide essential means to structure and organize software effectively. However, frequently, required component abstractions are not available in a programming language or system, or are not adequately combinable with each other. Invasive software composition (ISC) is a general approach to software composition that unifies component-like abstractions such as templates, aspects and macros. ISC is based on fragment composition, and composes programs and other software artifacts at the level of syntax trees. Therefore, a unifying fragment component model is related to the context-free grammar of a language to identify extension and variation points in syntax trees as well as valid component types. By doing so, fragment components can be composed by transformations at respective extension and variation points so that always valid composition results regarding the underlying context-free grammar are yielded. However, given a language’s context-free grammar, the composition result may still be incorrect.
Context-sensitive constraints such as type constraints may be violated so that the program cannot be compiled and/or interpreted correctly. While a compiler can detect such errors after composition, it is difficult to relate them back to the original transformation step in the composition system, especially in the case of complex compositions with several hundreds of such steps. To tackle this problem, this thesis proposes well-formed ISC—an extension to ISC that uses reference attribute grammars (RAGs) to specify fragment component models and fragment contracts to guard compositions with context-sensitive constraints. Additionally, well-formed ISC provides composition strategies as a means to configure composition algorithms and handle interferences between composition steps.
Developing ISC systems for complex languages such as programming languages is a complex undertaking. Composition-system developers need to supply or develop adequate language and parser specifications that can be processed by an ISC composition engine. Moreover, the specifications may need to be extended with rules for the intended composition abstractions.
Current approaches to ISC require complete grammars to be able to compose fragments in the respective languages. Hence, the specifications need to be developed exhaustively before any component model can be supplied. To tackle this problem, this thesis introduces scalable ISC—a variant of ISC that uses island component models as a means to define component models for partially specified languages while still the whole language is supported. Additionally, a scalable workflow for agile composition-system development is proposed which supports a development of ISC systems in small increments using modular extensions.
All theoretical concepts introduced in this thesis are implemented in the Skeletons and Application Templates framework SkAT. It supports “classic”, well-formed and scalable ISC by leveraging RAGs as its main specification and implementation language. Moreover, several composition systems based on SkAT are discussed, e.g., a well-formed composition system for Java and a C preprocessor-like macro language. In turn, those composition systems are used as composers in several example applications such as a library of parallel algorithmic skeletons.
|
Page generated in 0.059 seconds