| |
|
| java.lang.Object xtc.lang.SourceMapExtractor
SourceMapExtractor | public class SourceMapExtractor (Code) | | A class to extract a line number mapping for a source-to-source
transformation. The "input source" and the "output source" are input and
output of the source-to-source transformation. For instance, Main.jni and
Main.java are input source and output source files in the Jeannie framework.
This source map extractor assumes that the output source file contains the
input source line directives in a "//#line ${lineno} ${source file} form, and
this form is similiar to the C line number directive.
The source map extractor takes an output source file (Main.java), and
produces a mapping from the input source files (Main.jni) to output source
file (Main.java) in JSR45 SMAP format. For more information, look at JSR45
[http://jcp.org/en/jsr/detail?id=45].
author: Byeongcheol Lee |
Method Summary | |
public void | genSMAP() Search for line number directive (//#line ...) to generate a
source-to-source mapping information. | public int | getNumberOfInputSourceFiles() | protected String | getSingleSourceFileName() This routine returns a source file name that appeared in all the line
number directive. | protected int | getSingleSourceLine(int sourceLineNumber) Given output source line number (e.g. | public static void | main(String[] args) Drives printing the source remapping infomation for the given
#line-decorated source file. | public String | toStringInSMAPFormat() Return the source-to-source information in SMAP (JSR45) format. |
inputSourceFile2id | final protected HashMap<String, Integer> inputSourceFile2id(Code) | | The mapping from an inputSourceFile to its unique id. Here, the input
source files appear in the line directive.
|
numInputSourceFiles | protected int numInputSourceFiles(Code) | | The number of input source files so far. This is to generate unique id for
new input file.
|
numSourceLines | protected int numSourceLines(Code) | | The total number of lines in the source file.
|
smapLineEntries | final protected TreeSet<SMAPLineEntry> smapLineEntries(Code) | | The line-to-line mapping from the input source file to the output source
file.
|
sourceFile | final protected String sourceFile(Code) | | The input source file.
|
SourceMapExtractor | public SourceMapExtractor(String s)(Code) | | Parameters: s - An input source file. |
genSMAP | public void genSMAP() throws IOException(Code) | | Search for line number directive (//#line ...) to generate a
source-to-source mapping information.
|
getNumberOfInputSourceFiles | public int getNumberOfInputSourceFiles()(Code) | | A number of input source files in the source-to-source mapping. |
getSingleSourceFileName | protected String getSingleSourceFileName()(Code) | | This routine returns a source file name that appeared in all the line
number directive. This routine is only for the -fatten option in the
ClassSOurceRemapper.
A source file name. |
getSingleSourceLine | protected int getSingleSourceLine(int sourceLineNumber)(Code) | | Given output source line number (e.g. in Main.java), this routine returns a
corresponding input source line number (e.g. in Main.jni). This routine is
only for the -fatten option in the ClassSOurceRemapper.
Parameters: sourceLineNumber - An output source line number. An input source line number. |
main | public static void main(String[] args)(Code) | | Drives printing the source remapping infomation for the given
#line-decorated source file.
Parameters: args - A command line arguments. |
toStringInSMAPFormat | public String toStringInSMAPFormat()(Code) | | Return the source-to-source information in SMAP (JSR45) format.
A text in SMAP format. |
|
|
|