Skip to content
forked from JMU-CS/less-java

Language and compiler designed for teaching introductory programming

License

Notifications You must be signed in to change notification settings

Zamua/less-java

 
 

Repository files navigation

Build Status

Less-Java

A procedural programming language with a simple and concise syntax, implicit but strong typing via type inference, and built-in unit testing.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Building The Compiler

Start out by building the compiler using Gradle. This project makes use of the Gradle wrapper so installing Gradle is not necessary.

./gradlew build

Compiling a Less-Java Program

A script is provided to compile any Less-Java program, and there are several examples in the tests/ directory. Compiling is fairly straightforward.

./compile.sh <file-name>

For example,

./compile.sh tests/fact.lj

Running

It is possible to just run the most recently compiled program, or run a specific previously compiled Less-Java program.

Running A Less-Java Program

Ensure that the program you wish to run has already been compiled following the instructions above. To run the most recently compiled or ran program, simply type:

./run.sh

To run a specific Less-Java program, use the name of the file you compiled. The extension is optional. For example:

./run.sh fact.lj

You will need to make sure that your program has a main() method if you want to run it. If it does not have a main() method, you will receive an error similar to the following.

Error: Main method not found in class Main, please define the main method as:
   public static void main(String[] args)
or a JavaFX application class must extend javafx.application.Application

You can also compile and run a Less-Java program with a single instruction using the go script. It works the same way as compilation:

./go.sh tests/fact.lj

##Testing

Running Tests From A File

Ensure that the file you wish to run the test from has been compiled following the instructions above. Then simply run:

./test.sh

Running All Tests

It is possible to run all the tests in the tests/ directory and to set the expected output for any of those tests.

Setting expected output

To set the expected output to the output from a particular execution of the program, run the following:

./dotests.sh -s <file-name>

This will update or set the output for that program to the output from that execution. This can be used to change the expected output for programs that take input and then displays the input (or uses it in a way that changes the output).

Running all sample tests against expected outputs

To run all sample programs in the tests/ directory against their expected corresponding outputs in tests/outputs/, you can run the following:

./dotests.sh -r tests

Distributing

Less-Java can be distributed by running ./distro.sh. The files to distribute will be located in the distribution/ directory.

Contributing

Contributions are welcome. Issues with the 'help wanted' tag that are not assigned are open to be worked on. If you have ideas or suggestions that are not already issues, please create an issue to discuss the feature before beginning work. Please open a pull request to have your changes merged.

For information on working on this project as part of an honors thesis, reach out to Dr. Lam.

Authors

License

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 3.

For more information, see the LICENSE file.

Academic Citations

If you use this project in an academic project, please cite the following paper:

Paper: Zamua O. Nasrawt and Michael O. Lam. 2019. Less-Java, more learning: language design for introductory programming. J. Comput. Sci. Coll. 34, 3 (January 2019), 64-72. ACM DL

About

Language and compiler designed for teaching introductory programming

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 95.8%
  • Shell 2.7%
  • ANTLR 1.5%