Depres: a Tool for Resolving Fully Qualified Names and Their

Total Page:16

File Type:pdf, Size:1020Kb

Depres: a Tool for Resolving Fully Qualified Names and Their DepRes: A Tool for Resolving Fully Qualified Names and Their Dependencies 1st Ali Shokri 2nd Mehdi Mirakhorli Global Cybersecurity Institute Global Cybersecurity Institute Rochester Institute of Technology Rochester Institute of Technology Rochester, USA Rochester, USA [email protected] [email protected] Abstract—Reusing code snippets shared by other programmers • FQN for a type (e.g., a class in an object oriented lan- on Q&A forums (e.g., StackOverflow) is a common practice guage): the full packaging name followed by the simple followed by software developers. However, lack of sufficient name of the type; information about the fully qualified name (FQN) of identifiers in borrowed code snippets, results in serious compile errors. • FQN for a method: the full signature of the method; Programmers either have to manually search for the correct For instance, in the code snippet shown in Figure1, FQN of identifiers which is a tedious and error-prone process, a possible FQN of both identifiers Pattern and p or use tools developed to automatically identify correct FQNs. in line 3 could be java.util.regex.Pattern. In such a Despite the efforts made by researchers to automatically identify FQNs in code snippets, the current approaches suffer from low case, the FQN of compile in the same line would accuracy when it comes to practice. Moreover, while these tools be java.util.regex.Pattern.compile(java.util.String)void. It focus on resolving the FQN for an identifier in a code snippet, means that compile is a method declared in class they leave the challenge of finding the correct third-party library java.util.regex.Pattern, with a single argument of type (i.e., dependency) implementing that FQN unresolved. Using an java.lang.String, which returns nothing (i.e., void). A pro- incorrect dependency or incorrect version of a dependency might lead to a semantic error which is not detectable by compilers. grammer needs to know the FQN of each identifier in the Therefore, it can result in serious damage in the run-time. code snippet to be able to add proper imports to the program. In this paper, we introduce DepRes, a tool that leverages a Otherwise, a compile error will be raised. A dependency, on sketch-based approach to resolve FQNs in java-based code snip- the other hand, refers to a third party library that actually pets and recommend the correct dependency for each FQN. The implements an FQN. Please note that each FQN can be source code, documentation, as well as a demo video of DepRes introduced in different libraries or even in different version tool is available from https://github.com/SoftwareDesignLab/ DepRes-Tool. of a same library and hence, have different implementations. Index Terms—Dependency Resolution, Fully Qualified Name, For instance, java.util.regex.Pattern is available in different Sketching, Constraint Solving versions of java JDK libraries. Adding an incorrect library or even an incorrect version of the expected library to the project can result in semantic errors in a program. These types of error I. INTRODUCTION are not necessarily detectable by compilers and might lead to run-time crashes. However, selecting the correct dependency Borrowing a code snippet shared on an open-source code and adding it to the project is not a trivial task. repository (e.g., GitHub1) or a Q&A forum (e.g., Stackover- 2 flow ) is a common practice followed by software developers 1. String input = "Inbound Call at 5:10:54 PM from 07970123123 (Jack Daniels)"; arXiv:2108.01165v1 [cs.SE] 2 Aug 2021 2. String regex = "(\\d{11}|\\d{5} \\d{6}|\\+\\d{12})"; [1], [2]. The application of the reused code varies from 3. Pattern p = Pattern.compile(regex); building a new software [3], to investigating properties of the 4. Matcher m = p.matcher(input); 5. System.out.println(); code snippet such as their API usage models [4], or even 6. System.debug("Find: " + m.find()); 7. System.debug("Group: " + m.group()); training a model for correct code retrieval [5]. While these 8. System.debug("Matches: " + m.matches()); 9. GitHub github = new GitHubBuilder().withOAuthToken(token).build(); code reuse approaches aim to save time, efforts, and avoid re- inventing the wheel, lack of providing fully qualified names Fig. 1. An example of a code snippet without FQNs (FQNs) of identifiers in the shared code snippets, as well as insufficient dependency declaration in the shared projects are There are several approaches introduced by researchers that serious barriers in achieving an accurate and proper outcome aim to find correct FQN for an identifier in a code snippet. [6]. Based on the role of an identifier in a code snippet, we Baker [7] creates an incomplete AST of a program and through consider two types of FQNs. an iterative process called deductive linking, gradually finds FQNs. It needs an oracle to guide the process. Based on 1https://github.com a corpus of programs in a code repository, StatType [6] 2https://stackoverflow.com learns co-occurrence of FQNs in a scope. It then analyzes DepRes 1 Learning <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <?xmlxsi:schemaLocation= version="1.0" encoding="http://maven.apache.org/POM/4.0.0"UTF-8"?> http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion><project xmlns=4.0.0"http://maven.apache.org/POM/4.0.0"</modelVersion> <groupId>org.example</groupId>xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <artifactId>DepRes</artifactId> <version>1.0xsi:schemaLocation=-SNAPSHOT</version>"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion><?xml version=4.0.0"1.0"</modelVersion>encoding="UTF-8"?> <properties><groupId>org.example</groupId><project xmlns="http://maven.apache.org/POM/4.0.0" <maven.compiler.source><artifactId>DepRes</artifactId>xmlns:xsi=8"http://www.w3.org/2001/XMLSchema</maven.compiler.source> -instance" <maven.compiler.target><version>1.0-SNAPSHOT</version>8</maven.compiler.target> <aetherVersion>xsi:schemaLocation=1.1.0</aetherVersion>"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <mavenVersion><properties><modelVersion>3.2.1</mavenVersion>4.0.0</modelVersion> <maven.compiler.source><groupId>org.example</groupId>8</maven.compiler.source> {A1, A2, A3} <maven.compiler.target><artifactId>DepRes</artifactId>8</maven.compiler.target> Annotated </properties> <dependencies><aetherVersion><version>1.0-1.1.0SNAPSHOT</version></aetherVersion> <!-- https:<mavenVersion>//mvnrepository.com/artifact/org.kohsuke/github3.2.1</mavenVersion> -api --> <dependency><properties> </properties><groupId>org.kohsuke</groupId><maven.compiler.source>8</maven.compiler.source> <dependencies><maven.compiler.target>8</maven.compiler.target> <artifactId>github<!-- https:<aetherVersion>//mvnrepository.com/artifact/org.kohsuke/github-api</artifactId>1.1.0</aetherVersion> -api --> <version><dependency><mavenVersion>1.123</version>3.2.1</mavenVersion> </dependency><groupId>org.kohsuke</groupId> <dependency></properties> <groupId>org.eclipse.jdt</groupId><dependencies><artifactId>github-api</artifactId> {A1, A4, A5, A6, A7} Class Hierarchies <version><!-- https:1.123//mvnrepository.com/artifact/org.kohsuke/github</version> -api --> <artifactId>org.eclipse.jdt.core</artifactId></dependency><dependency> <version><dependency>3.25.0<groupId>org.kohsuke</groupId></version> <groupId>org.eclipse.jdt</groupId> </dependency> <artifactId>github-api</artifactId> <artifactId>org.eclipse.jdt.core</artifactId><version>1.123</version> <version></dependency>3.25.0</version> </dependencies></dependency><dependency> </project> <groupId>org.eclipse.jdt</groupId> <artifactId>org.eclipse.jdt.core</artifactId> {A11, A5, A1, A2, A20} </dependencies><version>3.25.0</version> Resolving </project> </dependency> 3 </dependencies> </project> Dependency Item Sets FQNs Open-Source Dependency Repositories Declaration Repo. Itemset Verification Artifact Knowledgebase java.util.regex.Matcher java.util.regex.Pattern Resolve Sketches org.kohsuke.github.GitHubBuilder 2 Sketching org.kohsuke.github.GitHub package edu.rit.se.depres; import java.util.regex.Pattern; … package edu.rit.se.depres; Import, Type, Method, Field public classimportGitHubUtilsjava.util.regex.Pattern; { publicpublicint test(Stringclass GitHubUtils token){ { String input = "Inbound Call at 5:10:54 PM from 07970123123 (Jackpublic Daniels)"int test(String; token){ String regexString = "(input\\d{11}| = "Inbound\\d{5} \Call\d{6}| at\ \5:10:54+\\d{12})" PM ;from Pattern07970123123 p = Pattern.compile(regex);(Jack Daniels)"; Matcher mString = p.matcher(input); regex = "(\\d{11}|\\d{5} \\d{6}|\\+\\d{12})"; Pattern p = Pattern.compile(regex); System.out.println();Matcher m = p.matcher(input); System.debug("Find: " + m.find()); System.debug(System.out.println();"Group: " + m.group()); Evidence Mining FQN Sketches System.debug(System.debug("Matches:"Find: " + m.matches()); " + m.find()); System.debug("Group: " + m.group()); GitHub github = new GitHubBuilder().withOAuthToken(token).build();System.debug("Matches: " + m.matches()); Project Dependencies GitHub github = new GitHubBuilder().withOAuthToken(token).build(); … } } } } Source Code ?.matcher(java.lang.String)? org.kohsuke:github-api:1.123 <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 SMT Solver http://maven.apache.org/xsd/maven-4.0.0.xsd"> ?.compile(java.lang.String)?
Recommended publications
  • MANNING Greenwich (74° W
    Object Oriented Perl Object Oriented Perl DAMIAN CONWAY MANNING Greenwich (74° w. long.) For electronic browsing and ordering of this and other Manning books, visit http://www.manning.com. The publisher offers discounts on this book when ordered in quantity. For more information, please contact: Special Sales Department Manning Publications Co. 32 Lafayette Place Fax: (203) 661-9018 Greenwich, CT 06830 email: [email protected] ©2000 by Manning Publications Co. All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by means electronic, mechanical, photocopying, or otherwise, without prior written permission of the publisher. Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in the book, and Manning Publications was aware of a trademark claim, the designations have been printed in initial caps or all caps. Recognizing the importance of preserving what has been written, it is Manning’s policy to have the books we publish printed on acid-free paper, and we exert our best efforts to that end. Library of Congress Cataloging-in-Publication Data Conway, Damian, 1964- Object oriented Perl / Damian Conway. p. cm. includes bibliographical references. ISBN 1-884777-79-1 (alk. paper) 1. Object-oriented programming (Computer science) 2. Perl (Computer program language) I. Title. QA76.64.C639 1999 005.13'3--dc21 99-27793 CIP Manning Publications Co. Copyeditor: Adrianne Harun 32 Lafayette
    [Show full text]
  • Java/Java Packages.Htm Copyright © Tutorialspoint.Com
    JJAAVVAA -- PPAACCKKAAGGEESS http://www.tutorialspoint.com/java/java_packages.htm Copyright © tutorialspoint.com Packages are used in Java in order to prevent naming conflicts, to control access, to make searching/locating and usage of classes, interfaces, enumerations and annotations easier, etc. A Package can be defined as a grouping of related types classes, interfaces, enumerationsandannotations providing access protection and name space management. Some of the existing packages in Java are:: java.lang - bundles the fundamental classes java.io - classes for input , output functions are bundled in this package Programmers can define their own packages to bundle group of classes/interfaces, etc. It is a good practice to group related classes implemented by you so that a programmer can easily determine that the classes, interfaces, enumerations, annotations are related. Since the package creates a new namespace there won't be any name conflicts with names in other packages. Using packages, it is easier to provide access control and it is also easier to locate the related classes. Creating a package: While creating a package, you should choose a name for the package and include a package statement along with that name at the top of every source file that contains the classes, interfaces, enumerations, and annotation types that you want to include in the package. The package statement should be the first line in the source file. There can be only one package statement in each source file, and it applies to all types in the file. If a package statement is not used then the class, interfaces, enumerations, and annotation types will be placed in the current default package.
    [Show full text]
  • Quick Start Guide for Java Version 5.0
    Quick Start Guide for Java Version 5.0 Copyright © 2020 Twin Oaks Computing, Inc. Castle Rock, CO 80104 All Rights Reserved Welcome CoreDX DDS Quick Start Guide for Java Version 5.0 Nov 2020 Welcome to CoreDX DDS, a high-performance implementation of the OMG Data Distribution Service (DDS) standard. The CoreDX DDS Publish-Subscribe messaging infrastructure provides high-throughput, low-latency data communications. This Quick Start will guide you through the basic installation of CoreDX DDS, including installation and compiling and running an example Java application. You will learn how easy it is to integrate CoreDX DDS into an application. This Quick Start Guide is tailored for Java applications, and the examples differ slightly for other languages. Installation First things first: get CoreDX DDS onto your development system! Here’s what you need to do: 1. Once you have obtained CoreDX DDS from Twin Oaks Computing (or from the Eval CD), unpack the appropriate distribution for your machine somewhere on your system. We’ll refer to this directory throughout this guide as COREDX_HOME. For example, on a UNIX system this command will extract the distribution into the current directory: gunzip –c coredx-5.0.0-Linux_2.6_x86_64_gcc5-Release.tgz | tar xf – CoreDX DDS is available for multiple platform architectures, and multiple platform architectures of CoreDX DDS can be installed in the same top level (COREDX_TOP) directory. The directory structure under COREDX_TOP will look like: 2. If you are using an evaluation copy of CoreDX DDS, follow the instructions you received when you downloaded the software to obtain an evaluation license.
    [Show full text]
  • Importance of DNS Suffixes and Netbios
    Importance of DNS Suffixes and NetBIOS Priasoft DNS Suffixes? What are DNS Suffixes, and why are they important? DNS Suffixes are text that are appended to a host name in order to query DNS for an IP address. DNS works by use of “Domains”, equitable to namespaces and usually are a textual value that may or may not be “dotted” with other domains. “Support.microsoft.com” could be considers a domain or namespace for which there are likely many web servers that can respond to requests to that domain. There could be a server named SUPREDWA.support.microsoft.com, for example. The DNS suffix in this case is the domain “support.microsoft.com”. When an IP address is needed for a host name, DNS can only respond based on hosts that it knows about based on domains. DNS does not currently employ a “null” domain that can contain just server names. As such, if the IP address of a server named “Server1” is needed, more detail must be added to that name before querying DNS. A suffix can be appended to that name so that the DNS sever can look at the records of the domain, looking for “Server1”. A client host can be configured with multiple DNS suffixes so that there is a “best chance” of discovery for a host name. NetBIOS? NetBIOS is an older Microsoft technology from a time before popularity of DNS. WINS, for those who remember, was the Microsoft service that kept a table of names (NetBIOS names) for which IP address info could be returned.
    [Show full text]
  • Bigraphical Domain-Specific Language (BDSL): User Manual BDSL Version: V1.0-SNAPSHOT
    >_ Interpreter CLI BDSL BDSL User Manual BDSL v1.0-SNAPSHOT 1 Bigraphical Domain-specific Language (BDSL): User Manual BDSL Version: v1.0-SNAPSHOT Dominik Grzelak∗ Software Technology Group Technische Universit¨at Dresden, Germany Abstract This report describes Bigraphical DSL (BDSL), a domain-specific language for reactive systems, rooted in the mathematical spirit of the bigraph theory devised by Robin Milner. BDSL is not only a platform-agnostic programming language but also a development framework for reactive applications, written in the Java program- ming language, with a focus on stability and interoperability. The report serves as a user manual mainly elaborating on how to write and execute BDSL programs, further covering several features such as how to incorporate program verification. Moreover, the manual procures some best practices on design patterns in form of code listings. The BDSL development framework comes with a ready- to-use interpreter and may be a helpful research tool to experiment with the underlying bigraph theory. The framework is further in- tended for building reactive applications and systems based on the theory of bigraphical reactive systems. This report is ought to be a supplement to the explanation on the website www.bigraphs.org. The focus in this report lies in the basic usage of the command-line interpreter and mainly refers to the features available for the end-user, thus, providing a guidance for taking the first steps. It does not cover programmatic implementation details in great detail of the whole BDSL Interpreter Framework that is more suited to developers. Acknowledgment This research project is funded by the German Research Foundation (DFG, Deutsche Forschungsgemeinschaft) as part of Germany's Excel- lence Strategy { EXC 2050/1 { Project ID 390696704 { Cluster of Ex- cellence "Centre for Tactile Internet with Human-in-the-Loop" (CeTI) of Technische Universit¨at Dresden.
    [Show full text]
  • Java: Odds and Ends
    Computer Science 225 Advanced Programming Siena College Spring 2020 Topic Notes: More Java: Odds and Ends This final set of topic notes gathers together various odds and ends about Java that we did not get to earlier. Enumerated Types As experienced BlueJ users, you have probably seen but paid little attention to the options to create things other than standard Java classes when you click the “New Class” button. One of those options is to create an enum, which is an enumerated type in Java. If you choose it, and create one of these things using the name AnEnum, the initial code you would see looks like this: /** * Enumeration class AnEnum - write a description of the enum class here * * @author (your name here) * @version (version number or date here) */ public enum AnEnum { MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY } So we see here there’s something else besides a class, abstract class, or interface that we can put into a Java file: an enum. Its contents are very simple: just a list of identifiers, written in all caps like named constants. In this case, they represent the days of the week. If we include this file in our projects, we would be able to use the values AnEnum.MONDAY, AnEnum.TUESDAY, ... in our programs as values of type AnEnum. Maybe a better name would have been DayOfWeek.. Why do this? Well, we sometimes find ourselves defining a set of names for numbers to represent some set of related values. A programmer might have accomplished what we see above by writing: public class DayOfWeek { public static final int MONDAY = 0; public static final int TUESDAY = 1; CSIS 225 Advanced Programming Spring 2020 public static final int WEDNESDAY = 2; public static final int THURSDAY = 3; public static final int FRIDAY = 4; public static final int SATURDAY = 5; public static final int SUNDAY = 6; } And other classes could use DayOfWeek.MONDAY, DayOfWeek.TUESDAY, etc., but would have to store them in int variables.
    [Show full text]
  • Learning from Examples to Find Fully Qualified Names of API Elements In
    Learning from Examples to Find Fully Qualified Names of API Elements in Code Snippets C M Khaled Saifullah Muhammad Asaduzzaman† Chanchal K. Roy Department of Computer Science, University of Saskatchewan, Canada †School of Computing, Queen's University, Canada fkhaled.saifullah, [email protected][email protected] Abstract—Developers often reuse code snippets from online are difficult to compile and run. According to Horton and forums, such as Stack Overflow, to learn API usages of software Parnin [6] only 1% of the Java and C# code examples included frameworks or libraries. These code snippets often contain am- in the Stack Overflow posts are compilable. Yang et al. [7] biguous undeclared external references. Such external references make it difficult to learn and use those APIs correctly. In also report that less than 25% of Python code snippets in particular, reusing code snippets containing such ambiguous GitHub Gist are runnable. Resolving FQNs of API elements undeclared external references requires significant manual efforts can help to identify missing external references or declaration and expertise to resolve them. Manually resolving fully qualified statements. names (FQN) of API elements is a non-trivial task. In this paper, Prior studies link API elements in forum discussions to their we propose a novel context-sensitive technique, called COSTER, to resolve FQNs of API elements in such code snippets. The pro- documentation using Partial Program Analysis (PPA) [8], text posed technique collects locally specific source code elements as analysis [2], [9], and iterative deductive analysis [5]. All these well as globally related tokens as the context of FQNs, calculates techniques except Baker [5], need adequate documentation or likelihood scores, and builds an occurrence likelihood dictionary discussion in online forums.
    [Show full text]
  • Magic Tcl Tutorial #4: Simulation with IRSIM
    Magic Tcl Tutorial #4: Simulation with IRSIM R. Timothy Edwards Space Department Johns Hopkins University Applied Physics Laboratory Laurel, MD 20723 This tutorial corresponds to Tcl-based Magic version 7.2 Tutorials to read first: Magic Tutorial #1: Getting Started Magic Tutorial #2: Basic Painting and Selection Magic Tutorial #4: Cell Hierarchies Magic Tutorial #8: Circuit Extraction Magic Tutorial #11: Using IRSIM and RSIM with Magic Commands introduced in this tutorial: irsim , getnode, goto graphnode, watchnode, unwatchnode movenode, watchtime, unwatchtime, movetime (plus the standard IRSIM command set) Macros introduced in this tutorial: (None) 1 IRSIM Version 9.6 In version 9.6, IRSIM has been redesigned to work under the Tcl interpreter, in the same manner as Magic version 7.2 does. Like Magic version 7.2, section of Tcl as an interpreter is specified at compile-time, along with various use options. The “make” method has been rewritten to match the one which Magic uses, so IRSIM can be compiled and installed in a similar manner: make config make tcl make install-tcl –1– March22,2003 MagicTclTutorial#4:SimulationwithIRSIM Tcl-based IRSIM, like its non-interpreter version, can be run as a standalone product, and will simulate a circuit from a .sim format file. However, it is specifically designed to be operated in conjunction with magic, with methods for providing feedback directly into the layout from the simulation, and vice versa. There are a number of cross-application commands, detailed below, which belong to neither Magic or IRSIM, but are applicable when both are running in the Tcl interpreter at the same time.
    [Show full text]
  • Advanced Tcl E D
    PART II I I . A d v a n c Advanced Tcl e d T c l Part II describes advanced programming techniques that support sophisticated applications. The Tcl interfaces remain simple, so you can quickly construct pow- erful applications. Chapter 10 describes eval, which lets you create Tcl programs on the fly. There are tricks with using eval correctly, and a few rules of thumb to make your life easier. Chapter 11 describes regular expressions. This is the most powerful string processing facility in Tcl. This chapter includes a cookbook of useful regular expressions. Chapter 12 describes the library and package facility used to organize your code into reusable modules. Chapter 13 describes introspection and debugging. Introspection provides information about the state of the Tcl interpreter. Chapter 14 describes namespaces that partition the global scope for vari- ables and procedures. Namespaces help you structure large Tcl applications. Chapter 15 describes the features that support Internationalization, includ- ing Unicode, other character set encodings, and message catalogs. Chapter 16 describes event-driven I/O programming. This lets you run pro- cess pipelines in the background. It is also very useful with network socket pro- gramming, which is the topic of Chapter 17. Chapter 18 describes TclHttpd, a Web server built entirely in Tcl. You can build applications on top of TclHttpd, or integrate the server into existing appli- cations to give them a web interface. TclHttpd also supports regular Web sites. Chapter 19 describes Safe-Tcl and using multiple Tcl interpreters. You can create multiple Tcl interpreters for your application. If an interpreter is safe, then you can grant it restricted functionality.
    [Show full text]
  • Aras Innovator 12 Package Import Export Utilities
    Aras Innovator 12 Package Import Export Utilities Document #: 12.0.02019053801 Last Modified: 1/3/2020 Aras Innovator 12 Package Import Export Utilities Copyright Information Copyright © 2020 Aras Corporation. All Rights Reserved. Aras Corporation 100 Brickstone Square Suite 100 Andover, MA 01810 Phone: 978-806-9400 Fax: 978-794-9826 E-mail: [email protected] Website: https://www.aras.com Notice of Rights Copyright © 2020 by Aras Corporation. This material may be distributed only subject to the terms and conditions set forth in the Open Publication License, V1.0 or later (the latest version is presently available at http://www.opencontent.org/openpub/). Distribution of substantively modified versions of this document is prohibited without the explicit permission of the copyright holder. Distribution of the work or derivative of the work in any standard (paper) book form for commercial purposes is prohibited unless prior permission is obtained from the copyright holder. Aras Innovator, Aras, and the Aras Corp "A" logo are registered trademarks of Aras Corporation in the United States and other countries. All other trademarks referenced herein are the property of their respective owners. Notice of Liability The information contained in this document is distributed on an "As Is" basis, without warranty of any kind, express or implied, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose or a warranty of non- infringement. Aras shall have no liability to any person or entity with respect to any loss or damage caused or alleged to be caused directly or indirectly by the information contained in this document or by the software or hardware products described herein.
    [Show full text]
  • Magic Tcl Tutorial #4: Simulation with IRSIM
    Magic Tcl Tutorial #4: Simulation with IRSIM R. Timothy Edwards Space Department Johns Hopkins University Applied Physics Laboratory Laurel, MD 20723 This tutorial corresponds to Tcl-based Magic version 7.2 Tutorials to read first: Magic Tutorial #1: Getting Started Magic Tutorial #2: Basic Painting and Selection Magic Tutorial #4: Cell Hierarchies Magic Tutorial #8: Circuit Extraction Magic Tutorial #11: Using IRSIM and RSIM with Magic Commands introduced in this tutorial: irsim , getnode, goto graphnode, watchnode, unwatchnode movenode, watchtime, unwatchtime, movetime (plus the standard IRSIM command set) Macros introduced in this tutorial: (None) 1 IRSIM Version 9.6 In version 9.6, IRSIM has been redesigned to work under the Tcl interpreter, in the same manner as Magic version 7.2 does. Like Magic version 7.2, section of Tcl as an interpreter is specified at compile-time, along with various use options. The “make” method has been rewritten to match the one which Magic uses, so IRSIM can be compiled and installed in a similar manner: make config make tcl make install-tcl –1– April14,2006 MagicTclTutorial#4:SimulationwithIRSIM Tcl-based IRSIM, like its non-interpreter version, can be run as a standalone product, and will simulate a circuit from a .sim format file. However, it is specifically designed to be operated in conjunction with magic, with methods for providing feedback directly into the layout from the simulation, and vice versa. There are a number of cross-application commands, detailed below, which belong to neither Magic or IRSIM, but are applicable when both are running in the Tcl interpreter at the same time.
    [Show full text]
  • What Is Object-Oriented Perl?
    This is a series of extracts from Object Oriented Perl, a new book from Manning Publications that will be available in August 1999. For more information on this book, see http://www.manning.com/Conway/. What is object-oriented Perl? Object-oriented Perl is a small amount of additional syntax and semantics, added to the existing imperative features of the Perl programming language. Those extras allow regular Perl packages, variables, and subroutines to behave like classes, objects, and methods. It's also a small number of special variables, packages and modules, and a large number of new techniques, that together provide inheritance, data encapsulation, operator overloading, automated definition of commonly used methods, generic programming, multiply-dispatched polymorphism, and persistence. It's an idiosyncratic, no-nonsense, demystified approach to object-oriented programming, with a typically Perlish disregard for accepted rules and conventions. It draws inspiration (and sometimes syntax) from many different object-oriented predecessors, adapting their ideas to its own needs. It reuses and extends the functionality of existing Perl features, and in the process throws an entirely new slant on what they mean. In other words, it's everything that regular Perl is, only object-oriented. Using Perl makes object-oriented programming more enjoyable, and using object- oriented programming makes Perl more enjoyable too. Life is too short to endure the cultured bondage-and-discipline of Eiffel programming, or to wrestle the alligators that lurk in the muddy semantics of C++. Object-oriented Perl gives you all the power of those languages, with very few of their tribulations. And best of all, like regular Perl, it's fun! Before we look at object orientation in Perl, let’s talk about what object orientation is in general..
    [Show full text]