From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,19b6efa2ecebaed0 X-Google-Attributes: gid103376,public From: "Jeff Burns" Subject: Re: Ada95 Pretty-Printers Date: 1997/06/12 Message-ID: <5np59j$bb4$1@client3.news.psi.net> X-Deja-AN: 247905879 References: <339C58A6.4D5A@sprintmail.com> Organization: PSI Public Usenet Link Newsgroups: comp.lang.ada Date: 1997-06-12T00:00:00+00:00 List-Id: Wes, thanks for mentioning Ada-ASSURED. I'm glad you think so highly of it. Ada-ASSURED may be a good solution for John Volan: > Apex is frustrating because it actively reformats > almost every syntactic structure in Ada to suit Rational's coding style. > This style is based on the LRM, but it does certain things that are > fairly intrusive. Ada-ASSURED also formats every syntactic structure, but the formatting is apparently higher quality and easier to customize. In both examples that you describe, Ada-ASSURED will print the code as desired: > procedure Operation > (This : in This_Type; > That : in That_Type; > Other : out Other_Type); > This is done automatically by the pretty-printer and can be customized. > if Very_Long_Conditional_Expression > Spanning_Multiple_Lines > then > First_Sequence_Of_Statements; > ... > elsif Short_One_Line_Conditional We provide a couple options for the above example: the user can choose to either align the "then" with the "if", or to leave the "then" on the same line as the "if". Once the customization is set, all occurrences of "if-then" will be formatted according to the choice. > Apex does a lot of this sort of thing (I don't _even_ want to begin on > how it mangles long expressions), but it doesn't provide very many hooks > to control this behavior. Ada-ASSURED has a long list of ways to change the pretty-printing according to a user's requirements. However, there are cases in which the pretty-printing cannot be easily customized [how meaningful would standardization really be if everything is customized by end-users?]. > > Are there any batch pretty-printers out there (commercial or free) that > can do syntax-level indenting while still respecting the user's > line-breaks? Or even better, are there any pretty-printers that can > actively reformat, but which are customizable, maybe using syntax > templates? GrammaTech has two tools to choose from: Ada-ASSURED and, soon to be released, Ada-Utilities. Both can actively reformat code according to user settings of the pretty-printing parameters. Batch processing is an option with Ada-ASSURED and a standard feature with Ada-Utilities. Ada-ASSURED is for sites that want an advanced language-sensitive editor for ensuring coding standards are followed as the code is being written. Ada-Utilities is for sites working with existing code that don't need or want a language-sensitive editor. It provides code analysis for identifying problem areas and a set of tools for correcting those problems, including a high quality pretty printer and language-sensitive code transformations. Ada-Utilities is intended to be used for QA and IV&V. Here are brief descriptions of both products: Ada-ASSURED (AA) is similar to the Apex editor, but it can be easily integrated with other tools and your choice of compilers (and it's much less expensive). AA checks for syntax errors, monitors/automates coding style, provides context-sensitive templates and a browser, and includes the option of structural editing in addition to conventional textual editing. AA formats code automatically or on-demand. One of its coolest features is dynamic formatting. In automatic mode AA formats your code as you're typing it in. If you change your window width, the formatting will adjust automatically so your code is still readable. This way you can have multiple windows of various sizes open at once and they'll all be easy to read. Of course, when you go to print your code Ada-ASSURED will print it at the standard 80 column width (or whatever you set it at, such as 132 or even "two up") with or without line number margins. AA does true syntax coloring, not just lexical coloring like Emacs (there is a difference). Pretty printing looks best when printed through a standard or color PostScript printer. In August we plan to release a new toolset called Ada-Utilities, which will include the same batch pretty-printing facilities as Ada-ASSURED. The other utilities it will include are: Ada-Audit: a programmable tool for monitoring compliance with coding standards. Creates reports viewable on web browsers with HTML links to coding errors and HTML cross-references to appropriate sections of the SPC AQ&S and the LRM. Ada-Grep: a structured find utility with an additional argument to narrow the search to a particular Ada structure, such as a name, an expression or a statement. Ada-Transform: imagine a language-sensitive version of awk, sed, or perl. This tool helps you precisely locate and modify, if you wish, any fragment of code locally or globally. Ada 95 and Ada 83 are supported by Ada-ASSURED and Ada-Utilities. Both include a Scheme-based scripting language providing access to the structure of your code and additional customizability. ----------------------------- Jeff Burns, Director of Marketing GrammaTech, Inc. One Hopkins Place Ithaca, NY 14850 ph: 607-273-7340 fax: 607-273-8752 e-mail: jeff@grammatech.com www: http://www.grammatech.com Team Ada ============================== Ada-ASSURED LSE Style Standards Enforcer Browser QA Tool Code Transformer "Cure for the Common Code" ==============================