Macneil Shonle
Ankit Shah
Version 1.1
12 March 2003
Download Source Code of SourceExtractor Class
public class SourceExtractor
implements JavaTokenTypes
{
public SourceExtractor(String[] files);
public AspectInfo[] extractAspects() throws Exception;
public void extractPureAjcCode(File dir) throws Exception;
private Token lexer_nextToken() throws Exception;
private void extractAspects(JavaLexer jlexer, List aspectInfos) throws antlr.TokenStreamException, Exception;
private AspectInfo match_definition() throws Exception;
private void match_extends_implements(String ex_imp, List list) throws Exception;
private String match_body() throws Exception;
private String possible_newline();
private String match_import_stmt() throws Exception;
private String match_type_name() throws Exception;
private String match() throws Exception;
private String match(int tokenType) throws Exception;
private String match(int tokenType, String lexeme) throws Exception;
private void match_keyword(String lexeme);
private static boolean is_modifier(String s);
private static boolean is_def_keyword(String s);
}
This class is wholly responsible for parsing all the input files and generating the necessary AspectInfo objects. Certain pure classes are stoved away in a file since they are not to be passed to the plugins.
Takes in a list of source filenames. These are the files that will be processed.
The interface available to XAJC, these methods are used to invoke the functionality of SourceExtractor. extractAspects compiles all the data into AspectInfo objects while extractPureAspects collect all the pure classes into some file for further use. The File parameter is a reference to the directory where the generated files of pure classes will be placed.
The private extractAspects method, not available to the user, is the one that actually does the main job of controlling the parsing of input files.
Methods that implement the pattern matching capability. These methods match the syntax and / or the keywords to come up with various tokens used in analysis and populating AspectInfo objects.
Grammar is defined in xaspectj.g file and interpreter files generated using ANTLR. The 2 files JavaLexer.java and JavaTokenTypes.java are generated by ANTLR.
Download Source Code of xaspectj.g Grammar File
Download Source Code of JavaLexer Class
Download Source Code of JavaTokenTypes Class
XAspects Project Home Page, <http://www.ccs.neu.edu/research/demeter/xaspects>.
|
Author: Ankit Shah. Copyright © 2003. All rights reserved. |