Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Print feature tree #4

Open
edefazio opened this issue Jun 16, 2020 · 0 comments
Open

Print feature tree #4

edefazio opened this issue Jun 16, 2020 · 0 comments

Comments

@edefazio
Copy link
Collaborator

Instead of just printing a tree of (unlabeled) nodes

package math.geometry;...}" _codeUnit : (1,1)-(34,3)
├─"package math.geometry;" _package : (1,1)-(1,22)
│ └─"math.geometry" _name : (1,9)-(1,21)
│   └─"math" _name : (1,9)-(1,12)
├─"import java.util.UUID;" _import : (3,1)-(3,22)
│ └─"java.util.UUID" _name : (3,8)-(3,21)
│   └─"java.util" _name : (3,8)-(3,16)
│     └─"java" _name : (3,8)-(3,11)
└─"public class Point {...}" _class : (5,1)-(34,1)
  ├─"public" _modifier : (5,1)-(5,6)
  ├─"Point" _name : (5,14)-(5,18)
  ├─"int x = 0, y = 0;" _field : (7,5)-(7,21)
  │ ├─"x = 0" _field : (7,9)-(7,13)
  │ │ ├─"int" _typeRef : (7,5)-(7,7)
  │ │ ├─"x" _name : (7,9)-(7,9)
  │ │ └─"0" _intExpr : (7,13)-(7,13)
  │ └─"y = 0" _field : (7,16)-(7,20)
  │   ├─"int" _typeRef : (7,5)-(7,7)
  │   ├─"y" _name : (7,16)-(7,16)
  │   └─"0" _intExpr : (7,20)-(7,20)
  ├─"public String toString() {...}" _method : (9,5)-(11,5)
  │ ├─"public" _modifier : (9,5)-(9,10)
  │ ├─"toString" _name : (9,19)-(9,26)
  │ ├─"String" _typeRef : (9,12)-(9,17)
  │ │ └─"String" _name : (9,12)-(9,17)
  │ └─"{...}" _blockStmt : (9,30)-(11,5)
  │   └─"return "(" + x + "," + y + ")";" _returnStmt : (10,9)-(10,39)
  │     └─""(" + x + "," + y + ")"" _binaryExpr : (10,16)-(10,38)
  │       ├─""(" + x + "," + y" _binaryExpr : (10,16)-(10,32)
  │       │ ├─""(" + x + ","" _binaryExpr : (10,16)-(10,28)
  │       │ │ ├─""(" + x" _binaryExpr : (10,16)-(10,22)
  │       │ │ │ ├─""("" _stringExpr : (10,16)-(10,18)
  │       │ │ │ └─"x" _nameExpr : (10,22)-(10,22)
  │       │ │ │   └─"x" _name : (10,22)-(10,22)
  │       │ │ └─"","" _stringExpr : (10,26)-(10,28)
  │       │ └─"y" _nameExpr : (10,32)-(10,32)
  │       │   └─"y" _name : (10,32)-(10,32)
  │       └─"")"" _stringExpr : (10,36)-(10,38)
  ├─"public int getX() {...}" _method : (13,5)-(15,5)
  │ ├─"public" _modifier : (13,5)-(13,10)
  │ ├─"getX" _name : (13,16)-(13,19)
  │ ├─"int" _typeRef : (13,12)-(13,14)
  │ └─"{...}" _blockStmt : (13,23)-(15,5)
  │   └─"return x;" _returnStmt : (14,9)-(14,17)
  │     └─"x" _nameExpr : (14,16)-(14,16)
  │       └─"x" _name : (14,16)-(14,16)
  ├─"public void setX(final int x) {...}" _method : (17,5)-(19,5)
  │ ├─"public" _modifier : (17,5)-(17,10)
  │ ├─"setX" _name : (17,17)-(17,20)
  │ ├─"final int x" _param : (17,22)-(17,32)
  │ │ ├─"final" _modifier : (17,22)-(17,26)
  │ │ ├─"int" _typeRef : (17,28)-(17,30)
  │ │ └─"x" _name : (17,32)-(17,32)
  │ ├─"void" _typeRef : (17,12)-(17,15)
  │ └─"{...}" _blockStmt : (17,35)-(19,5)
  │   └─"this.x = x;" _exprStmt : (18,9)-(18,19)
  │     └─"this.x = x" _assignExpr : (18,9)-(18,18)
  │       ├─"this.x" _fieldAccessExpr : (18,9)-(18,14)
  │       │ ├─"this" _thisExpr : (18,9)-(18,12)
  │       │ └─"x" _name : (18,14)-(18,14)
  │       └─"x" _nameExpr : (18,18)-(18,18)
  │         └─"x" _name : (18,18)-(18,18)
  ├─"public int getY() {...}" _method : (21,5)-(23,5)
  │ ├─"public" _modifier : (21,5)-(21,10)
  │ ├─"getY" _name : (21,16)-(21,19)
  │ ├─"int" _typeRef : (21,12)-(21,14)
  │ └─"{...}" _blockStmt : (21,23)-(23,5)
  │   └─"return y;" _returnStmt : (22,9)-(22,17)
  │     └─"y" _nameExpr : (22,16)-(22,16)
  │       └─"y" _name : (22,16)-(22,16)
  ├─"public void setY(final int y) {...}" _method : (25,5)-(27,5)
  │ ├─"public" _modifier : (25,5)-(25,10)
  │ ├─"setY" _name : (25,17)-(25,20)
  │ ├─"final int y" _param : (25,22)-(25,32)
  │ │ ├─"final" _modifier : (25,22)-(25,26)
  │ │ ├─"int" _typeRef : (25,28)-(25,30)
  │ │ └─"y" _name : (25,32)-(25,32)
  │ ├─"void" _typeRef : (25,12)-(25,15)
  │ └─"{...}" _blockStmt : (25,35)-(27,5)
  │   └─"this.y = y;" _exprStmt : (26,9)-(26,19)
  │     └─"this.y = y" _assignExpr : (26,9)-(26,18)
  │       ├─"this.y" _fieldAccessExpr : (26,9)-(26,14)
  │       │ ├─"this" _thisExpr : (26,9)-(26,12)
  │       │ └─"y" _name : (26,14)-(26,14)
  │       └─"y" _nameExpr : (26,18)-(26,18)
  │         └─"y" _name : (26,18)-(26,18)
  ├─"public static final String ID = UUID.randomUUID().toString();" _field : (29,5)-(29,65)
  │ ├─"public" _modifier : (29,5)-(29,10)
  │ ├─"static" _modifier : (29,12)-(29,17)
  │ ├─"final" _modifier : (29,19)-(29,23)
  │ └─"ID = UUID.randomUUID().toString()" _field : (29,32)-(29,64)
  │   ├─"String" _typeRef : (29,25)-(29,30)
  │   │ └─"String" _name : (29,25)-(29,30)
  │   ├─"ID" _name : (29,32)-(29,33)
  │   └─"UUID.randomUUID().toString()" _methodCallExpr : (29,37)-(29,64)
  │     ├─"UUID.randomUUID()" _methodCallExpr : (29,37)-(29,53)
  │     │ ├─"UUID" _nameExpr : (29,37)-(29,40)
  │     │ │ └─"UUID" _name : (29,37)-(29,40)
  │     │ └─"randomUUID" _name : (29,42)-(29,51)
  │     └─"toString" _name : (29,55)-(29,62)
  └─"public int hashCode() {...}" _method : (31,5)-(33,5)
    ├─"public" _modifier : (31,5)-(31,10)
    ├─"hashCode" _name : (31,16)-(31,23)
    ├─"int" _typeRef : (31,12)-(31,14)
    └─"{...}" _blockStmt : (31,27)-(33,5)
      └─"return 31 * x * y * 31;" _returnStmt : (32,9)-(32,31)
        └─"31 * x * y * 31" _binaryExpr : (32,16)-(32,30)
          ├─"31 * x * y" _binaryExpr : (32,16)-(32,25)
          │ ├─"31 * x" _binaryExpr : (32,16)-(32,21)
          │ │ ├─"31" _intExpr : (32,16)-(32,17)
          │ │ └─"x" _nameExpr : (32,21)-(32,21)
          │ │   └─"x" _name : (32,21)-(32,21)
          │ └─"y" _nameExpr : (32,25)-(32,25)
          │   └─"y" _name : (32,25)-(32,25)
          └─"31" _intExpr : (32,29)-(32,30)

Print a tree where the "edges" are ordered & labeled by feature name
(NOTE: collapse _nameExpr & _name)

package math.geometry;...}" _codeUnit : (1,1)-(34,3)
├─"package math.geometry;" _package : (1,1)-(1,22)
│ └─"math.geometry" _name : (1,9)-(1,21)
├─"import java.util.UUID;" _import : (3,1)-(3,22)
│ └─"java.util.UUID" _name : (3,8)-(3,21)
└─"public class Point {...}" _class : (5,1)-(34,1)
  ├─"public" _modifier : (5,1)-(5,6)
  ├─"Point" _name : (5,14)-(5,18)
  ├─"int x = 0, y = 0;" _field : (7,5)-(7,21)
  │ ├─"x = 0" _field : (7,9)-(7,13)
  │ │ ├─"int" _typeRef : (7,5)-(7,7)
  │ │ ├─"x" _name : (7,9)-(7,9)
  │ │ └─"0" _intExpr : (7,13)-(7,13)
  │ └─"y = 0" _field : (7,16)-(7,20)
  │   ├─"int" _typeRef : (7,5)-(7,7)
  │   ├─"y" _name : (7,16)-(7,16)
  │   └─"0" _intExpr : (7,20)-(7,20)
  ├─"public String toString() {...}" _method : (9,5)-(11,5)
  │ ├─"public" _modifier : (9,5)-(9,10)
  │ ├─"toString" _name : (9,19)-(9,26)
  │ ├─"String" _typeRef : (9,12)-(9,17)
  │ │ └─"String" _name : (9,12)-(9,17)
  │ └─"{...}" _blockStmt : (9,30)-(11,5)
  │   └─"return "(" + x + "," + y + ")";" _returnStmt : (10,9)-(10,39)
  │     └─""(" + x + "," + y + ")"" _binaryExpr : (10,16)-(10,38)
  │       ├─""(" + x + "," + y" _binaryExpr : (10,16)-(10,32)
  │       │ ├─""(" + x + ","" _binaryExpr : (10,16)-(10,28)
  │       │ │ ├─""(" + x" _binaryExpr : (10,16)-(10,22)
  │       │ │ │ ├─""("" _stringExpr : (10,16)-(10,18)
  │       │ │ │ └─"x" _nameExpr : (10,22)-(10,22)
  │       │ │ └─"","" _stringExpr : (10,26)-(10,28)
  │       │ └─"y" _nameExpr : (10,32)-(10,32)
  │       └─"")"" _stringExpr : (10,36)-(10,38)
  ├─"public int getX() {...}" _method : (13,5)-(15,5)
  │ ├─"public" _modifier : (13,5)-(13,10)
  │ ├─"getX" _name : (13,16)-(13,19)
  │ ├─"int" _typeRef : (13,12)-(13,14)
  │ └─"{...}" _blockStmt : (13,23)-(15,5)
  │   └─"return x;" _returnStmt : (14,9)-(14,17)
  │     └─"x" _nameExpr : (14,16)-(14,16)
  ├─"public void setX(final int x) {...}" _method : (17,5)-(19,5)
  │ ├─"public" _modifier : (17,5)-(17,10)
  │ ├─"setX" _name : (17,17)-(17,20)
  │ ├─"final int x" _param : (17,22)-(17,32)
  │ │ ├─"final" _modifier : (17,22)-(17,26)
  │ │ ├─"int" _typeRef : (17,28)-(17,30)
  │ │ └─"x" _name : (17,32)-(17,32)
  │ ├─"void" _typeRef : (17,12)-(17,15)
  │ └─"{...}" _blockStmt : (17,35)-(19,5)
  │   └─"this.x = x;" _exprStmt : (18,9)-(18,19)
  │     └─"this.x = x" _assignExpr : (18,9)-(18,18)
  │       ├─"this.x" _fieldAccessExpr : (18,9)-(18,14)
  │       │ ├─"this" _thisExpr : (18,9)-(18,12)
  │       │ └─"x" _name : (18,14)-(18,14)
  │       └─"x" _nameExpr : (18,18)-(18,18)
  ├─"public int getY() {...}" _method : (21,5)-(23,5)
  │ ├─"public" _modifier : (21,5)-(21,10)
  │ ├─"getY" _name : (21,16)-(21,19)
  │ ├─"int" _typeRef : (21,12)-(21,14)
  │ └─"{...}" _blockStmt : (21,23)-(23,5)
  │   └─"return y;" _returnStmt : (22,9)-(22,17)
  │     └─"y" _nameExpr : (22,16)-(22,16)
  ├─"public void setY(final int y) {...}" _method : (25,5)-(27,5)
  │ ├─"public" _modifier : (25,5)-(25,10)
  │ ├─"setY" _name : (25,17)-(25,20)
  │ ├─"final int y" _param : (25,22)-(25,32)
  │ │ ├─"final" _modifier : (25,22)-(25,26)
  │ │ ├─"int" _typeRef : (25,28)-(25,30)
  │ │ └─"y" _name : (25,32)-(25,32)
  │ ├─"void" _typeRef : (25,12)-(25,15)
  │ └─"{...}" _blockStmt : (25,35)-(27,5)
  │   └─"this.y = y;" _exprStmt : (26,9)-(26,19)
  │     └─"this.y = y" _assignExpr : (26,9)-(26,18)
  │       ├─"this.y" _fieldAccessExpr : (26,9)-(26,14)
  │       │ ├─"this" _thisExpr : (26,9)-(26,12)
  │       │ └─"y" _name : (26,14)-(26,14)
  │       └─"y" _nameExpr : (26,18)-(26,18)
  ├─"public static final String ID = UUID.randomUUID().toString();" _field : (29,5)-(29,65)
  │ ├─"public" _modifier : (29,5)-(29,10)
  │ ├─"static" _modifier : (29,12)-(29,17)
  │ ├─"final" _modifier : (29,19)-(29,23)
  │ └─"ID = UUID.randomUUID().toString()" _field : (29,32)-(29,64)
  │   ├─"String" _typeRef : (29,25)-(29,30)
  │   │ └─"String" _name : (29,25)-(29,30)
  │   ├─"ID" _name : (29,32)-(29,33)
  │   └─"UUID.randomUUID().toString()" _methodCallExpr : (29,37)-(29,64)
  │     ├─"UUID.randomUUID()" _methodCallExpr : (29,37)-(29,53)
  │     │ ├─"UUID" _nameExpr : (29,37)-(29,40)
  │     │ └─"randomUUID" _name : (29,42)-(29,51)
  │     └─"toString" _name : (29,55)-(29,62)
  └─"public int hashCode() {...}" _method : (31,5)-(33,5)
    ├─"public" _modifier : (31,5)-(31,10)
    ├─"hashCode" _name : (31,16)-(31,23)
    ├─"int" _typeRef : (31,12)-(31,14)
    └─"{...}" _blockStmt : (31,27)-(33,5)
      └─"return 31 * x * y * 31;" _returnStmt : (32,9)-(32,31)
        └─"31 * x * y * 31" _binaryExpr : (32,16)-(32,30)
          ├─"31 * x * y" _binaryExpr : (32,16)-(32,25)
          │ ├─"31 * x" _binaryExpr : (32,16)-(32,21)
          │ │ ├─"31" _intExpr : (32,16)-(32,17)
          │ │ └─"x" _nameExpr : (32,21)-(32,21)
          │ └─"y" _nameExpr : (32,25)-(32,25)
          └─"31" _intExpr : (32,29)-(32,30)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant