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()
Step 2. In addition, you will need the following third party software:
Third Party Software | ||||
|
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