Content deleted Content added
Disambiguated: GLR → GLR parser using Dab solver |
m rm some extra spaces throughout the article |
||
Line 24:
| website = {{URL|http://www.semanticdesigns.com/Products/DMS/DMSToolkit.html}}
}}
The '''DMS Software Reengineering Toolkit'''<ref>[http://portal.acm.org/citation.cfm?id=999466&dl=GUIDE&coll=GUIDE&CFID=55567354&CFTOKEN=76359207 ''DMS: Program Transformations for Practical Scalable Software Evolution''. Proceedings International Conference on Software Engineering 2004] [http://www.semanticdesigns.com/Company/Publications/DMS-for-ICSE2004-reprint.pdf Reprint]</ref> is a proprietary set of [[program transformation]] tools available for automating custom source program analysis, modification, translation or generation of software systems for arbitrary mixtures of source languages for large scale software systems.
DMS has been used to implement a wide variety of practical tools, include [[___domain-specific language]]s (such as code generation for factory control), test coverage<ref>[http://www.semanticdesigns.com/Company/Publications/TestCoverage.pdf Branch Coverage for Arbitrary Languages Made Easy]</ref> and profiling tools, [[Duplicate code
The toolkit provides means for defining language grammars and will produce [[parser]]s which automatically construct [[abstract syntax trees]] (ASTs), and [[prettyprinter]]s to convert original or modified ASTs back into compilable source text. The parse trees capture, and the prettyprinters regenerate, complete detail about the original source program, including source position, comments, radix and format of numbers, etc., to ensure that regenerated source text is as recognizable to a programmer as the original text modulo any applied transformations.
Line 34 ⟶ 35:
DMS uses [[GLR parser|GLR]] parsing technology, enabling it to handle all practical context-free grammars. Semantic predicates extend this capability to interesting non-context-free grammars ([[Fortran]] requires matching of multiple DO loops with shared CONTINUE statements by label; GLR with semantic predicates enables the DMS Fortran parser to produce ASTs for correctly nested loops as it parses).
DMS provides [[attribute grammar]] evaluators for computing custom analyses over ASTs, such as metrics, and including special support for [[symbol table]] construction.
Changes to ASTs can be accomplished by both procedural methods coded in PARLANSE and source-to-source tree transformations coded as rewrite rules using surface-syntax conditioned by any extracted program facts.
rule simplify_conditional_assignment(v:left_hand_side,e1:expression,e2:expression)
Line 44 ⟶ 45:
if no_side_effects(v);
Rewrite '''rule'''s have names, e.g. '''simplify_conditional_assignment'''.
Achieving a complex transformation on code is accomplished by providing a number of rules that cooperate to achieve the desired effect.
A [http://www.semanticdesigns.com/Products/DMS/SimpleDMSDomainExample.html complete example] of a language definition and source-to-source transformation rules defined and applied is shown using high school [[algebra]] and a bit of [[calculus]] as a ___domain-specific language.
Line 52 ⟶ 53:
DMS has a variety of predefined language front ends, covering most real dialects of [[C (programming language)|C]] and [[C++]] including [[C++0x]], [[C Sharp (programming language)|C#]], [[Java (programming language)|Java]], [[Python (programming language)|Python]], [[PHP]], [[EGL (programming language)|EGL]], [[Fortran]], [[COBOL]], [[Visual Basic]], [[Verilog]], [[VHDL]] and some 20 or more other languages. Predefined languages enable customizers to immediately focus on their reengineering task rather than on the details of the languages to be processed.
DMS is additionally unusual in being implemented in a [[parallel programming]] language, PARLANSE, that uses [[symmetric multiprocessor]]s available on commodity [[workstations]].
DMS was originally motivated by a theory for maintaining designs of software called ''Design Maintenance Systems.''<ref>[http://portal.acm.org/citation.cfm?id=129859 ''Design Maintenance Systems''. Communications of the ACM 1992][http://www.semanticdesigns.com/Company/Publications/DMS-CACM-1992-baxter.pdf Reprint]
|