Skip to content

Commit 3938044

Browse files
author
komaz
committed
Contributing to new repository
1 parent a1a65b4 commit 3938044

File tree

628 files changed

+81382
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

628 files changed

+81382
-0
lines changed

com.xored.f4.astView/.buildpath

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<buildpath>
3+
<buildpathentry kind="src" path="fan"/>
4+
<buildpathentry kind="con" path="org.eclipse.dltk.launching.INTERPRETER_CONTAINER"/>
5+
</buildpath>

com.xored.f4.astView/.classpath

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
4+
<classpathentry kind="con" path="com.xored.fanide.jdt.launching.FANJAVA_CONTAINER"/>
5+
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
6+
<classpathentry kind="output" path="bin"/>
7+
</classpath>

com.xored.f4.astView/.project

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>com.xored.f4.astView</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.dltk.core.scriptbuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
<buildCommand>
14+
<name>org.eclipse.jdt.core.javabuilder</name>
15+
<arguments>
16+
</arguments>
17+
</buildCommand>
18+
<buildCommand>
19+
<name>org.eclipse.pde.ManifestBuilder</name>
20+
<arguments>
21+
</arguments>
22+
</buildCommand>
23+
<buildCommand>
24+
<name>org.eclipse.pde.SchemaBuilder</name>
25+
<arguments>
26+
</arguments>
27+
</buildCommand>
28+
</buildSpec>
29+
<natures>
30+
<nature>org.eclipse.pde.PluginNature</nature>
31+
<nature>org.eclipse.jdt.core.javanature</nature>
32+
<nature>com.xored.fanide.core.nature</nature>
33+
</natures>
34+
</projectDescription>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#Fri Apr 23 17:32:05 NOVST 2010
2+
eclipse.preferences.version=1
3+
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
4+
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
5+
org.eclipse.jdt.core.compiler.compliance=1.5
6+
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
7+
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
8+
org.eclipse.jdt.core.compiler.source=1.5
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
Manifest-Version: 1.0
2+
Bundle-ManifestVersion: 2
3+
Bundle-Name: AstDebug
4+
Bundle-SymbolicName: com.xored.f4.astView;singleton:=true
5+
Bundle-Version: 1.0.0.qualifier
6+
Bundle-Vendor: XORED
7+
Bundle-RequiredExecutionEnvironment: J2SE-1.5
8+
Require-Bundle: org.eclipse.core.runtime,
9+
org.eclipse.core.resources,
10+
org.eclipse.jface.text,
11+
org.eclipse.ui,
12+
org.eclipse.ui.editors,
13+
org.eclipse.dltk.core;bundle-version="2.0.0",
14+
org.eclipse.dltk.ui;bundle-version="2.0.0",
15+
com.xored.fanide.core,
16+
com.xored.fanide.ui,
17+
org.fantom.sys;bundle-version="1.0.52"

com.xored.f4.astView/build.fan

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
using build
2+
3+
class Build : build::BuildPod
4+
{
5+
new make()
6+
{
7+
podName = "f4astView"
8+
summary = ""
9+
srcDirs = [`fan/`]
10+
outDir = `./`
11+
depends = ["sys 1.0", "f4parser 1.0", "f4core 1.0", "f4model 1.0"]
12+
}
13+
}

com.xored.f4.astView/build.properties

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
output.. = bin/
2+
bin.includes = META-INF/,\
3+
.,\
4+
plugin.xml,\
5+
f4astView.pod

com.xored.f4.astView/f4astView.pod

9.1 KB
Binary file not shown.
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
using [java]org.eclipse.jface.viewers
2+
3+
class AstContentProvider : ITreeContentProvider
4+
{
5+
6+
AstNode? root := null
7+
8+
override Obj?[]? getChildren(Obj? parentElement) {
9+
if (parentElement is AstNode) {
10+
return (Obj?[]?)(parentElement->children)
11+
} else {
12+
return [,]
13+
}
14+
}
15+
16+
override Obj? getParent(Obj? element) {
17+
if (element is AstNode) {
18+
return element->parent
19+
} else {
20+
return null
21+
}
22+
}
23+
24+
override Bool hasChildren(Obj? element) {
25+
return getChildren(element).size > 0
26+
}
27+
28+
override Obj?[]? getElements(Obj? inputElement) {
29+
if (root == null) {
30+
return [,]
31+
} else {
32+
return [root]
33+
}
34+
}
35+
36+
override Void dispose() {
37+
38+
}
39+
40+
override Void inputChanged(Viewer? viewer, Obj? oldInput, Obj? newInput) {
41+
if (newInput is AstNode[]) {
42+
root = newInput->first
43+
} else {
44+
root = null
45+
}
46+
}
47+
48+
}
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
using [java]org.eclipse.jface.viewers
2+
using [java]org.eclipse.swt.graphics
3+
4+
using f4parser
5+
class AstLabelProvider : ILabelProvider
6+
{
7+
8+
override Void addListener(ILabelProviderListener? listener) {
9+
10+
}
11+
12+
override Void dispose() {
13+
14+
}
15+
16+
override Bool isLabelProperty(Obj? element, Str? property) {
17+
return false
18+
}
19+
20+
override Void removeListener(ILabelProviderListener? listener) {
21+
22+
}
23+
24+
override Image? getImage(Obj? node) {
25+
return null
26+
}
27+
28+
override Str? getText(Obj? node) {
29+
if (node is AstNode)
30+
return label(node->node)
31+
else return node->typeof->name
32+
}
33+
34+
private Str label(Node node)
35+
{
36+
result := node.typeof.name
37+
if(node is Expr) result = "$result (${node->resolvedType?->genericQname}) (op ${node->id->name})"
38+
return result
39+
}
40+
}

0 commit comments

Comments
 (0)