Skip to content

PLRI/arden2bytecode

 
 

Repository files navigation

Arden2ByteCode

Arden2ByteCode is a compiler for Arden Syntax with Java Bytecode output.

Usage

Check out the wiki to see how to install and start using Arden2ByteCode, learn more about Arden Syntax or for a list of command line options.

Compile an MLM:

arden2bytecode -c hello_world.mlm

Compile and run an MLM:

arden2bytecode -r hello_world.mlm

Building

To compile Arden2ByteCode, you first need to generate the parser using the SableCC parser generator:

  • To build the parser with Eclipse, import the project and choose ProjectBuild project from the menu. On the first build you need to refresh the Project (F5), so Eclipse finds the downloaded dependencies.
  • To build with Apache Ant, cd into the project root and type ant at the command line.

Both will automatically call the "sableCC" target in the build.xml and generate the .java files for the parser. This can take some time, but will only happen if the parser does not exist or is out-of-date.

Check out the wiki for detailed instructions.

Dependencies

The dependencies are downloaded automatically if you use Ant or Eclipse to build the project. See the "dependencies" target in build.xml for download links.

  • SableCC: A "compiler-compiler" which is used to generate the arden parser from a grammar file. Usage: java -jar tools/sablecc.jar -d src/ src/arden.scc src/ardenConstants.scc
  • JewelCli: A command line arguments parser.
  • JUnit: A testing framework to test the correct implementation and standard compliance.
  • Hamcrest-core: Used with JUnit to create short and concise tests.

Testing

This project contains two test suites:

To run the test suites you can use Eclipse or Ant:

  • To test in Eclipse, right-click on a test suite and select Run AsJUnit Test.
  • To test with Ant, cd to the project root and type ant test. A report will be generated into the report directory.

Standard Conformance

This compiler implements Arden Syntax 2.5 with the following exceptions:

Languages features not implemented:

  • Include Statement
  • Citation/links slots are not syntax checked.
  • The compiler does not check that no languages features newer than the specified 'Arden Version' are used.

Copyright and license

  • Copyright 2004: University of British Columbia
  • Copyright 2009-2010: Daniel Grunwald
  • Copyright 2011-2012: Hannes Flicka Portions (arden.scc)

See LICENSE.md for licensing information.