Meta-AspectJ

David Zook, Shan Shan Huang, Yannis Smaragdakis

Download/Installation Instructions

MAJ source code and binaries have been moved to
Google Code for hosting.

Binary Installation Instruction

Download from maj-XXX.jar from Google Code. The tarball should include two jar files. Put both in your class path.

To invoke the MAJ parser, type:

% java maj.Main <your-maj-file>.maj;
A file named <your-maj-file>.java will be created, with code generated to represent the quoted code fragments. To print out the quoted code, use unparse()

Source Code

Step 1. Check out MAJ source code anonymously from Google Code by following the instructions on this page.

Step 2. In addition, you will need the following third party software:

  Third Party Software
Java J2SE 1.4.2 or higher Download
ANTLR 2.7.2 Download

Source Compilation Instructions

1. Install Java J2SE, ANT, and Antlr according to the instructions on their respective websites. Make sure that their libraries are in your CLASSPATH.
2. The source code you check out from svn should have the following structure:
    maj/           
        AspectJ.g   (AspectJ grammar)
        Meta.g      (Super grammar with common components 
	             between AspectJ.g and MetaAspectJ.g)
        MetaAspectJ.g (Java grammar + handling for meta characters)
	MAJ2Java.g  (AST walker that transforms quoted code 
                     into constructors for AST clasess)


        semant/     (Directory for MAJ type checking code)
        error/      (Directory for MAJ error handling code)

	Main.java   (java file used to invoke MAJ parser)
        JavaEmitter.java (java file used for pretty printing)
        IndentingPrintStream.java (utility file used for pretty printing)
	
	MajAST.java (AST class, extending ANTLR's AST class)
        MajASTFactory.java (AST factory class)

	( ANTLR generated files from grammar files in g/ directory)
	*Lexer.java
	*Recognizer.java
	*TokenTypes.java
	MAJ2JavaTranslator.java  
 
   org/	(Directory for aspectJ AST classes)
3. Import the source code into your IDE of choice and build. 4. If you want to play around with the grammar file, and regenerate the parsers, you will need to type:
% java antlr.Tool Meta.g
% java antlr.Tool -glib Meta.g MetaAspectJ.g
% java antlr.Tool -glib Meta.g AspectJ.g