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:52] preethac |
resarch:nlpa:xpath_tools_on_srcml [2015/01/07 01:21] (current) preethac |
||
---|---|---|---|
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 | \\ Preethas-MacBook-Pro:srcML preethac$ ./srcml2src --xpath="//src:if//src:block//src:call/src:name" CuringDepressionActivity.xml | ||
Line 141: | Line 155: | ||
</unit> | </unit> | ||
- | **\\ Limitations:** | + | |
- | \\ srcml does not store source code line numbers | + | **\\ 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?** | **\\ Question?** | ||
\\ How to determine the control statements?if/for etc? | \\ How to determine the control statements?if/for etc? | ||