USING THE OOSIML/JAVA COMPILER. With the Command Window

Similar documents
USING THE OOSIML/JAVA. With a Terminal Window

DEVELOPING OOSIML SIMULATION MODELS. Using Codeblocks

OOSIML SIMULATION MODELS. On Windows and Linux

IMPLEMENTING SCL PROGRAMS. Using Codeblocks

Supplement B. Creating, Compiling and Running Java Programs from the Command Window

USING CODEBLOCKS. Implementing Computational Models

Introduction to Java. Lecture 1 COP 3252 Summer May 16, 2017

3 CREATING YOUR FIRST JAVA APPLICATION (USING WINDOWS)

Chapter 2 First Java Programs

02/03/15. Compile, execute, debugging THE ECLIPSE PLATFORM. Blanks'distribu.on' Ques+ons'with'no'answer' 10" 9" 8" No."of"students"vs."no.

The Command Shell. Fundamentals of Computer Science

Getting Started with Java. Atul Prakash

Configuring Tools and Compiling OOSimL Programs

Object Oriented Program Correctness with OOSimL

CSC116: Introduction to Computing - Java

1. The Apache Derby database

Introduction to JAVA Programming Language

CSC116: Introduction to Computing - Java

Lesson 04: Our First Java Program (W01D4

Introduction to Java Programming

The Computer System. Hardware = Physical Computer. Software = Computer Programs. People = End Users & Programmers. people

Introduction. Overview of the Course on Java. Overview of Part 1 of the Course

UNic Eclipse Mini Tutorial (Updated 06/09/2012) Prepared by Harald Gjermundrod

Eclipse Tutorial. For Introduction to Java Programming By Y. Daniel Liang

Tutorial 1 CSC 201. Java Programming Concepts عؾادئماظربجمةمبادؿكدامماجلاصا

MEDIA COMPUTATION DRJAVA. Lecture 11.3 November 7, 2008

JVM interprets the Java bytecode, controls how it interacts with the operating system and manages memory.

Ibis RMI User s Guide

Life Without NetBeans

Java Language. Programs. Computer programs, known as software, are instructions to the computer. You tell a computer what to do through programs.

Disk Operating System

lejos NXJ Problem Solving with Robots [PRSOCO601]

COMP Computer Basics. Yi Hong May 13, 2015

Chapter 1 Introduction to Java

Lecture 1: Introduction to Java

Lesson 2: First Java Programs

1. The Apache Derby database

Eclipse. JVM, main method and using Eclipse. Dr. Siobhán Drohan. Produced by: Department of Computing and Mathematics

Getting Started. Introduction CHAPTER

5.4.8 Optional Lab: Managing System Files with Built-in Utilities in Windows Vista

Introduction to Java

Introduction to Computers and Java

Chapter 1 Introduction to Computers, Programs, and Java. What is a Computer? A Bit of History

Create Datamart. Alessandro Taurelli 2010/06/15 13:41

C02: Overview of Software Development and Java

Certified Core Java Developer VS-1036

You will need to download the Java software development kit from

Lecture 2 DOS & Windows file commands by: lecturer Raya N.Ismail

Full file at

Department of Computer Science. Software Usage Guide. CSC132 Programming Principles 2. By Andreas Grondoudis

WA1677 J2EE Application Development with Spring and Hibernate. Classroom Setup Guide. Web Age Solutions Inc.

WA1927 Introduction to Struts 2.x Using Eclipse. Classroom Setup Guide. Web Age Solutions Inc. Copyright Web Age Solutions Inc.

Learning objectives. The Java Environment. Java timeline (cont d) Java timeline. Understand the basic features of Java

Java Programming. Manuel Oriol, March 22nd, 2007

Computer Hardware. Java Software Solutions Lewis & Loftus. Key Hardware Components 12/17/2013

CS Introduction to Computational and Data Science. Instructor: Renzhi Cao Computer Science Department Pacific Lutheran University Spring 2017

Chapter 4 Java Language Fundamentals

An Introduction to Software Engineering. David Greenstein Monta Vista High School

COMP 110/401 WINDOWS COMMAND INTERPRETER. Instructor: Prasun Dewan (FB 150,

Software Development. COMP220/COMP285 Seb Coope Ant: Structured Build

These two items are all you'll need to write your first application reading instructions in English.

Object Oriented Discrete-Event Simulation with OOSimL CS 4632

Java Puzzle Ball Nick Ristuccia

1.00/1.001 HowTo: Install Eclipse

C++ Spring Break Packet 11 The Java Programming Language

Networks Programming Engr. Abdul-Rahman Mahmood MS, PMP, MCP, QMR(ISO9001:2000)

CSC116: Introduction to Computing - Java

In order to support developers, there needs to be a number of tools available which may be involved in the ultimate solution.

CHAPTER 1. Introduction to JAVA Programming

Objectives. Problem Solving. Introduction. An overview of object-oriented concepts. Programming and programming languages An introduction to Java

Instructions. First, download the file

Getting Started with Command Prompts

CSE 421 Course Overview and Introduction to Java

WA1884 Introduction to Java. using Oracle JDeveloper 11g. Classroom Setup Guide. Web Age Solutions Inc. Copyright Web Age Solutions Inc.

Introduction to Java. Nihar Ranjan Roy.

UNIVERSITY OF MICHIGAN INFORMATICS Charles Severance. You will need Apple QuickTime installed to view this video.

What is Eclipse? A free copy can be downloaded at:

INFO Object-Oriented Programming

Java language. Part 1. Java fundamentals. Yevhen Berkunskyi, NUoS

Introduction to Cygwin Operating Environment

CS260 Intro to Java & Android 02.Java Technology

Introduction to Computers and Java

Computational Applications in Nuclear Astrophysics using Java Java course Lecture 1

Chapter 11: File-System Interface

We d like to hear your suggestions for improving our indexes. Send to

RMI Case Study. A Typical RMI Application

Assoc. Prof. Dr. Marenglen Biba. (C) 2010 Pearson Education, Inc. All rights reserved.

Index. Course Outline. Grading Policy. Lab Time Distribution. Important Instructions

Test/Debug Guide. Reference Pages. Test/Debug Guide. Site Map Index

Windows 2000 Safe Mode

Chapter 1 Introduction to Computers, Programs, and Java

Guided Tour (Version 3.3) By Steven Castellucci as Modified by Brandon Haworth

Computer Basics 1/24/13. Computer Organization. Computer systems consist of hardware and software.

Command line and batch files Molekular Phylogenetics Practical

Notepad++ The COMPSCI 101 Text Editor for Windows. What is a text editor? Install Python 3. Installing Notepad++

Programming with Java

WA2621 DevOps Foundations for Java with Git, Jenkins, and Maven. Classroom Setup Guide. Web Age Solutions Inc. Web Age Solutions Inc.

CT 229. CT229 Lecture Notes. Labs. Tutorials. Lecture Notes. Programming II CT229. Objectives for CT229. IT Department NUI Galway

CS 553 Compiler Construction Fall 2009 Project #1 Adding doubles to MiniJava Due September 8, 2009


Transcription:

USING THE OOSIML/JAVA COMPILER With the Command Window On Windows Operating System José M. Garrido Department of Computer Science December 2017 College of Computing and Software Engineering Kennesaw State University

Using the OOSimL/Java 2 1 The OOSimL Compiler This document briefly describes the features and explains how to use the OOSimL compiler that generates Java code. The compiler that generates C++ code is explained in a separate document. The OOSimL model development is a two-phase process. The first phase involves a translation of a OOSimL source progrs (with an osl extension) into an equivalent Java source program, the second phase involves the corresponding Java compilation to Java byte-code. Figure 1: First phase of compilation of an OOSimL program The first phase of the compilation is illustrated in Figure 1. The second phase of compilation involves compiling the corresponding Java program and use of the Java compiler. Figure 2 shows what is involved in compilation of a source program in Java. The Java compiler checks for syntax errors in the source program and then translates it into a program in bytecode, which is the program in an intermediate form. Figure 2: Compiling a Java source program Note that the Java bytecode is not dependent on any particular platform or computer system. This makes the bytecode very portable from one machine to another. Figure 3 shows how to execute a program in bytecode. The Java virtual machine (JVM) carries out the interpretation of the program in bytecode. The OOSimL software, sample models, and documentation are stored in several archives and available from the OOSimL Web page: http://ksuweb.kennesaw.edu/~jgarrido/oosiml.html

Using the OOSimL/Java 3 Figure 3: Executing a Java program Currently, there are two general procedures on Windows for developing programs and simulation models with the OOSimL compiler. These procedures are: 1. Developing the simulation model with using an integrated development environment (IDE), such as Eclipse, jgrasp, or others. 2. Using a command window. The next sections introduce and explain how to configure and use the OOSimL compiler/translator with the command window. The OOSimL software consists of two main components: the compiler/translator executable program oosiml.exe or the oosimlvs.exe program file, and the simulation library, oosimlib.jar. The compiler/translator has the following functions: 1. Syntax checking of a source program in OOSimL; a list of errors is displayed and written to an error file with the same name as the source program 2. Generation of an equivalent program in Java 2 Installing the OOSimL Software and Models The first general step is to create a folder and then to store the relevant files in the folder. As mentioned previously, the two essential files are: the OOSimL compiler, which is an executable program called oosiml.exe or oosimlvs.exe, and the simulation library, oosimlib.jar. 1. Start and open a command window. You can do this by clicking the Start button and then selecting Run. In the Run window, type the word command or cmd and click the OK button. 2. Change to the root directory, and create a new directory, for example oosimldir. Now change to that new directory.

Using the OOSimL/Java 4 cd \ mkdir oosimldir cd oosimldir 3. Download the archive oosiml Win.zip from the web page. Store the archive in the current directory and extract the files using the Winows Explorer (or File Explorer). 4. Type the following command to uncompress the simulation model in the JAR file carwash.jar. This stores all the files of the Carwash model in a subdirectory carwash. jar xf carwash.jar Note that Carwash model is stored in its own subdirectory. The same applies to all simulation models. 5. To get a list of the files in the current directory, type dir and then press Enter. 3 Using a Command Window Any text editor can be used to write and edit a new program in OOSimL or to modify an existing OOSimL program. Two good editors for developing OOSimL and Java programs are Notepad++ and the Notepad2 Editor. For editing and using the OOSimL compiler in a command window, complete the following steps: 1. Change the directory to the one where the files of the simulation model is stored. Use the cd command. For example, cd carwash. 2. Start the editor. 3. Type and edit the source program (e.g., Carwash.osl) with the editor. Note that the source files have the.osl extension. 4. Invoke the OOSimL compiler to check syntax and generate a corresponding Java program. C:\oosimldir\oosiml.exe Carwash.osl

Using the OOSimL/Java 5 After a few seconds, you will see a message on the screen. In this case, File Carwash.osl, no syntax errors, lines processed: 49. 5. In the current directory, (or folder) two new files appear with the same name as your original source file. One of the files stores the syntax errors found. This file has the same name as the source program but with an err extension; for example, Carwash.err. 6. The second file contains the generated Java program; the file has the same name but with the java extension. For example, if your source program is Carwash.osl, then the Java program created is Carwash.java. 7. Use the Java compiler to compile the Java program (e.g. Carwash.java) generated by the OOSimL compiler. Compiling simulation programs, involve setting the classpath for the compiler to find the simulation library, oosimlib.jar. Assume that this library is located in the c:\oosimldirl directory and that the current directory contains the Java classes for the simulation model, the following command compiles all the Java files in the current directory. javac -classpath C:\oosimldirl\oosimlib.jar *.java 8. Use the Java Virtual Nachine (JVM) to run the compiled program. When starting execution, enter the input data to the program, if needed. The following command will start of the simulation model, assuming that the main class is named Carwash. java -classpath c:\oosimldir\oosimlib.jar;. Carwash Note that running a simulation model creates two new files in the current directory, these are: carwtrace.yxy and Carwstat.txt. The names of these files can be changed by edting the source file with the main class. 9. Return to the Windows desktop by typing exit while in the command window.