cagdasgerede / Veysel

2 stars 3 forks source link

Pattern Implementation #1

Open cagdasgerede opened 7 years ago

cagdasgerede commented 7 years ago

Pattern:

sourcePattern:
  Id: {
    long: formalParameter -> variableDeclaratorId -> sourceNode
    short: 77 -> 56
  },
  name: "Parameter name change",
  attributes: {
    "parameter_index" : function(sourceTreeCache, targetTreeCache) {Way to compute}
    "method_name" : function(...) {Way to compute}
    "source_line_no": function(...) {Way to compute}
    "target_line_no": function(...) {Way to compute}
    "old_name": function(...) {Way to compute}
    "new_name": function(...) {Way to compute}
  },
  viewTemplate: "{{parameter_index}}th parameter's name of method {{method_name}} is changed from {{old_name}} to {{new_name}} (original line {{source_line_no}} and updated line {{target_line_no}}"

======================================================

mvn exec:java -Dexec.mainClass="jtdiff.antlr.ParseTreeCache" -Dexec.args="32"
public interface I {
  public boolean m(int param);
}
Name of the node: param
Path to the root:
variableDeclaratorId
56
formalParameter
77
lastFormalParameter
79
formalParameterList
75
methodDeclarator
74
methodHeader
72
interfaceMethodDeclaration
107
interfaceMemberDeclaration
104
interfaceBody
103
normalInterfaceDeclaration
100
interfaceDeclaration
99
typeDeclaration
40
compilationUnit
32
cagdasgerede commented 7 years ago

Remaining work: Addition of all "method parameter name change" related extractions