Created
August 11, 2016 12:46
-
-
Save AljoschaMeyer/94c72cee673cafe9573a0d3a0eae668c to your computer and use it in GitHub Desktop.
Different representations of two simple Java classes, one of which extends the other. Classes are represented as source code, as ASTs, as ASGs without unification and as ASGs with unification.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="ASCII"?> | |
<javagraphs:JavaASG xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:javagraphs="http://aljoscha-meyer.de/javagraphs/javagraphs/asg"> | |
<allPackageBindings Name="foo" referringNames="//@allCompilationUnits.0/@Package/@Name //@allCompilationUnits.1/@Package/@Name" referringPackageDeclarations="//@allCompilationUnits.0/@Package //@allCompilationUnits.1/@Package"/> | |
<allTypeBindings Modifiers="1" Name="Foo" referringNames="//@allCompilationUnits.0/@Types.0/@Name //@allCompilationUnits.1/@Types.0/@SuperclassType/@Name" Rank="-1" Class="true" BinaryName="foo.Foo" TopLevel="true" FromSource="true" QualifiedName="foo.Foo" DeclaredModifiers="1" Package="//@allPackageBindings.0" TypeDeclaration="//@allTypeBindings.0" Erasure="//@allTypeBindings.0" referringTypes="//@allCompilationUnits.1/@Types.0/@SuperclassType" referringExpressions="//@allCompilationUnits.0/@Types.0/@Name //@allCompilationUnits.1/@Types.0/@SuperclassType/@Name" referringAbstractTypeDeclarations="//@allCompilationUnits.0/@Types.0"/> | |
<allTypeBindings Modifiers="1" Name="Bar" referringNames="//@allCompilationUnits.1/@Types.0/@Name" Rank="-1" Class="true" BinaryName="foo.Bar" TopLevel="true" FromSource="true" QualifiedName="foo.Bar" DeclaredModifiers="1" Superclass="//@allTypeBindings.0" Package="//@allPackageBindings.0" TypeDeclaration="//@allTypeBindings.1" Erasure="//@allTypeBindings.1" referringExpressions="//@allCompilationUnits.1/@Types.0/@Name" referringAbstractTypeDeclarations="//@allCompilationUnits.1/@Types.0"/> | |
<allCompilationUnits path="/FooBar/src/foo/Foo.java"> | |
<Package PackageBinding="//@allPackageBindings.0"> | |
<Name xsi:type="javagraphs:SimpleName" Binding="//@allPackageBindings.0" Identifier="foo"/> | |
</Package> | |
<Types xsi:type="javagraphs:TypeDeclaration" TypeBinding="//@allTypeBindings.0"> | |
<Name TypeBinding="//@allTypeBindings.0" Binding="//@allTypeBindings.0" Identifier="Foo"/> | |
<Modifiers xsi:type="javagraphs:Modifier" Keyword="PUBLIC_KEYWORD"/> | |
</Types> | |
</allCompilationUnits> | |
<allCompilationUnits path="/FooBar/src/foo/Bar.java"> | |
<Package PackageBinding="//@allPackageBindings.0"> | |
<Name xsi:type="javagraphs:SimpleName" Binding="//@allPackageBindings.0" Identifier="foo"/> | |
</Package> | |
<Types xsi:type="javagraphs:TypeDeclaration" TypeBinding="//@allTypeBindings.1"> | |
<SuperclassType xsi:type="javagraphs:SimpleType" TypeBinding="//@allTypeBindings.0"> | |
<Name xsi:type="javagraphs:SimpleName" TypeBinding="//@allTypeBindings.0" Binding="//@allTypeBindings.0" Identifier="Foo"/> | |
</SuperclassType> | |
<Name TypeBinding="//@allTypeBindings.1" Binding="//@allTypeBindings.1" Identifier="Bar"/> | |
<Modifiers xsi:type="javagraphs:Modifier" Keyword="PUBLIC_KEYWORD"/> | |
</Types> | |
</allCompilationUnits> | |
</javagraphs:JavaASG> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="ASCII"?> | |
<javagraphs:JavaAST xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:javagraphs="http://aljoscha-meyer.de/javagraphs/javagraphs/ast"> | |
<allCompilationUnits path="/FooBar/src/foo/Foo.java"> | |
<Package> | |
<Name xsi:type="javagraphs:SimpleName" Identifier="foo"/> | |
</Package> | |
<Types xsi:type="javagraphs:TypeDeclaration"> | |
<Name Identifier="Foo"/> | |
<Modifiers xsi:type="javagraphs:Modifier" Keyword="PUBLIC_KEYWORD"/> | |
</Types> | |
</allCompilationUnits> | |
<allCompilationUnits path="/FooBar/src/foo/Bar.java"> | |
<Package> | |
<Name xsi:type="javagraphs:SimpleName" Identifier="foo"/> | |
</Package> | |
<Types xsi:type="javagraphs:TypeDeclaration"> | |
<SuperclassType xsi:type="javagraphs:SimpleType"> | |
<Name xsi:type="javagraphs:SimpleName" Identifier="Foo"/> | |
</SuperclassType> | |
<Name Identifier="Bar"/> | |
<Modifiers xsi:type="javagraphs:Modifier" Keyword="PUBLIC_KEYWORD"/> | |
</Types> | |
</allCompilationUnits> | |
</javagraphs:JavaAST> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package foo; | |
public class Bar extends Foo { | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package foo; | |
public class Foo { | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="ASCII"?> | |
<javagraphs:JavaTrivialASG xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:javagraphs="http://aljoscha-meyer.de/javagraphs/javagraphs/trivial"> | |
<allPackageBindings Name="foo" referringNames="//@allCompilationUnits.0/@Package/@Name //@allCompilationUnits.1/@Package/@Name" referringPackageDeclarations="//@allCompilationUnits.0/@Package //@allCompilationUnits.1/@Package"> | |
<NameComponents>foo</NameComponents> | |
</allPackageBindings> | |
<allTypeBindings Modifiers="1" Name="Foo" referringNames="//@allCompilationUnits.0/@Types.0/@Name //@allCompilationUnits.1/@Types.0/@SuperclassType/@Name" QualifiedName="foo.Foo" BinaryName="foo.Foo" Rank="-1" Class="true" FromSource="true" TopLevel="true" DeclaredModifiers="1" Package="//@allPackageBindings.0" Erasure="//@allTypeBindings.0" TypeDeclaration="//@allTypeBindings.0" referringTypes="//@allCompilationUnits.1/@Types.0/@SuperclassType" referringExpressions="//@allCompilationUnits.0/@Types.0/@Name //@allCompilationUnits.1/@Types.0/@SuperclassType/@Name" referringAbstractTypeDeclarations="//@allCompilationUnits.0/@Types.0"/> | |
<allTypeBindings Modifiers="1" Name="Bar" referringNames="//@allCompilationUnits.1/@Types.0/@Name" QualifiedName="foo.Bar" BinaryName="foo.Bar" Rank="-1" Class="true" FromSource="true" TopLevel="true" DeclaredModifiers="1" Superclass="//@allTypeBindings.0" Package="//@allPackageBindings.0" Erasure="//@allTypeBindings.1" TypeDeclaration="//@allTypeBindings.1" referringExpressions="//@allCompilationUnits.1/@Types.0/@Name" referringAbstractTypeDeclarations="//@allCompilationUnits.1/@Types.0"/> | |
<allCompilationUnits path="/FooBar/src/foo/Foo.java"> | |
<Package PackageBinding="//@allPackageBindings.0"> | |
<Name xsi:type="javagraphs:SimpleName" Binding="//@allPackageBindings.0" Identifier="foo"/> | |
</Package> | |
<Types xsi:type="javagraphs:TypeDeclaration" TypeBinding="//@allTypeBindings.0"> | |
<Name TypeBinding="//@allTypeBindings.0" Binding="//@allTypeBindings.0" Identifier="Foo"/> | |
<Modifiers xsi:type="javagraphs:Modifier" Keyword="PUBLIC_KEYWORD"/> | |
</Types> | |
</allCompilationUnits> | |
<allCompilationUnits path="/FooBar/src/foo/Bar.java"> | |
<Package PackageBinding="//@allPackageBindings.0"> | |
<Name xsi:type="javagraphs:SimpleName" Binding="//@allPackageBindings.0" Identifier="foo"/> | |
</Package> | |
<Types xsi:type="javagraphs:TypeDeclaration" TypeBinding="//@allTypeBindings.1"> | |
<SuperclassType xsi:type="javagraphs:SimpleType" TypeBinding="//@allTypeBindings.0"> | |
<Name xsi:type="javagraphs:SimpleName" TypeBinding="//@allTypeBindings.0" Binding="//@allTypeBindings.0" Identifier="Foo"/> | |
</SuperclassType> | |
<Name TypeBinding="//@allTypeBindings.1" Binding="//@allTypeBindings.1" Identifier="Bar"/> | |
<Modifiers xsi:type="javagraphs:Modifier" Keyword="PUBLIC_KEYWORD"/> | |
</Types> | |
</allCompilationUnits> | |
</javagraphs:JavaTrivialASG> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment