Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
resarch:nlpa:xpath_tools_on_srcml [2015/01/07 00:29] preethac |
resarch:nlpa:xpath_tools_on_srcml [2015/01/07 01:21] (current) preethac |
||
|---|---|---|---|
| Line 86: | Line 86: | ||
| </unit> | </unit> | ||
| Preethas-MacBook-Pro:srcML preethac$ | Preethas-MacBook-Pro:srcML preethac$ | ||
| - | ** | + | \\ ** |
| \\ Extracting method call sequences between control statements** | \\ Extracting method call sequences between control statements** | ||
| \\ **Important: Does not work for commented out snippets of code.** | \\ **Important: Does not work for commented out snippets of code.** | ||
| Line 129: | Line 129: | ||
| </unit> | </unit> | ||
| Preethas-MacBook-Pro:srcML preethac$ | Preethas-MacBook-Pro:srcML preethac$ | ||
| + | ** | ||
| + | \\ With Position Enabled** | ||
| + | \\ Preethas-MacBook-Pro:srcML preethac$ ./srcml2src --xpath="//src:if//src:call/src:name" CuringDepressionActivity.xml | ||
| + | <?xml version="1.0" encoding="UTF-8" standalone="yes"?> | ||
| + | <unit xmlns="http://www.sdml.info/srcML/src" xmlns:pos="http://www.sdml.info/srcML/position"> | ||
| + | |||
| + | <unit language="Java" filename="CuringDepressionActivity.java" pos:tabs="8" pos:line="1" pos:column="1" item="1"><name pos:line="97" pos:column="17">moveTaskToBack</name></unit> | ||
| + | |||
| + | <unit language="Java" filename="CuringDepressionActivity.java" pos:tabs="8" pos:line="1" pos:column="1" item="2"><name pos:line="102" pos:column="13">setContentView</name></unit> | ||
| + | |||
| + | <unit language="Java" filename="CuringDepressionActivity.java" pos:tabs="8" pos:line="1" pos:column="1" item="3"><name><name pos:line="113" pos:column="17">question</name>.<name pos:line="113" pos:column="26">type</name>.<name pos:line="113" pos:column="31">equals</name></name></unit> | ||
| + | |||
| + | <unit language="Java" filename="CuringDepressionActivity.java" pos:tabs="8" pos:line="1" pos:column="1" item="4"><name><name pos:line="116" pos:column="22">question</name>.<name pos:line="116" pos:column="31">type</name>.<name pos:line="116" pos:column="36">equals</name></name></unit> | ||
| + | |||
| + | <unit language="Java" filename="CuringDepressionActivity.java" pos:tabs="8" pos:line="1" pos:column="1" item="5"><name><name pos:line="119" pos:column="22">question</name>.<name pos:line="119" pos:column="31">type</name>.<name pos:line="119" pos:column="36">equals</name></name></unit> | ||
| + | |||
| + | \\ Preethas-MacBook-Pro:srcML preethac$ ./srcml2src --xpath="//src:if//src:block//src:call/src:name" CuringDepressionActivity.xml | ||
| + | |||
| + | \\ <?xml version="1.0" encoding="UTF-8" standalone="yes"?> | ||
| + | <unit xmlns="http://www.sdml.info/srcML/src"> | ||
| + | |||
| + | <unit language="Java" filename="CuringDepressionActivity.java" item="1"><name>moveTaskToBack</name></unit> | ||
| + | |||
| + | <unit language="Java" filename="CuringDepressionActivity.java" item="2"><name>setContentView</name></unit> | ||
| + | |||
| + | </unit> | ||
| + | |||
| + | **\\ With position enabled:** | ||
| + | |||
| + | \\ Preethas-MacBook-Pro:srcML preethac$ ./srcml2src --xpath="//src:if//src:block//src:call/src:name" CuringDepressionActivity.xml | ||
| + | <?xml version="1.0" encoding="UTF-8" standalone="yes"?> | ||
| + | <unit xmlns="http://www.sdml.info/srcML/src" xmlns:pos="http://www.sdml.info/srcML/position"> | ||
| + | |||
| + | <unit language="Java" filename="CuringDepressionActivity.java" pos:tabs="8" pos:line="1" pos:column="1" item="1"><name pos:line="97" pos:column="17">moveTaskToBack</name></unit> | ||
| + | |||
| + | <unit language="Java" filename="CuringDepressionActivity.java" pos:tabs="8" pos:line="1" pos:column="1" item="2"><name pos:line="102" pos:column="13">setContentView</name></unit> | ||
| + | |||
| + | |||
| + | \\ | ||
| + | **\\ To store line numbers of source code** | ||
| + | \\ Preethas-MacBook-Pro:srcML preethac$ ./src2srcml --position CuringDepressionActivity.java -o CuringDepressionActivity.xml | ||
| + | \\ | ||
| + | **\\ Question?** | ||
| + | \\ How to determine the control statements?if/for etc? | ||