Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
more hacking on the Rascal contribution
- Loading branch information
1 parent
daf5c5f
commit e03cc7c
Showing
7 changed files
with
164 additions
and
48 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<classpath> | ||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> | ||
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> | ||
<classpathentry kind="src" path="src"/> | ||
<classpathentry kind="output" path="bin"/> | ||
</classpath> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>callref-rascal</name> | ||
<comment></comment> | ||
<projects> | ||
</projects> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>org.eclipse.jdt.core.javabuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>rascal_eclipse.rascal_builder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>rascal_eclipse.term_builder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>org.eclipse.pde.ManifestBuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>org.eclipse.pde.SchemaBuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
</buildSpec> | ||
<natures> | ||
<nature>rascal_eclipse.rascal_nature</nature> | ||
<nature>org.eclipse.jdt.core.javanature</nature> | ||
<nature>org.eclipse.pde.PluginNature</nature> | ||
<nature>rascal_eclipse.term_nature</nature> | ||
</natures> | ||
<linkedResources> | ||
<link> | ||
<name>eclipse</name> | ||
<type>2</type> | ||
<locationURI>rascal-library://eclipse</locationURI> | ||
</link> | ||
<link> | ||
<name>std</name> | ||
<type>2</type> | ||
<locationURI>rascal-library://rascal</locationURI> | ||
</link> | ||
</linkedResources> | ||
</projectDescription> |
2 changes: 2 additions & 0 deletions
2
hackathon/callref-rascal/.settings/org.eclipse.core.resources.prefs
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
eclipse.preferences.version=1 | ||
encoding//src/CallRef.rsc=UTF-8 |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
@contributor{Anastasia Izmaylova - SWAT, CWI} | ||
module PP | ||
|
||
import lang::java::jdt::Java; | ||
|
||
import List; | ||
|
||
public str toStr(entity(list[Id] ids)) = "<if(!isEmpty(ids)){><for(int i <- [0..size(ids)-1]){><if(i != size(ids)-1){><if(toStr(ids[i]) != "") {><toStr(ids[i])>.<}><}else{><toStr(ids[i])><}><}><}else{>_<}>"; | ||
public str toStr(package(str name)) = name; | ||
public str toStr(class(str name)) = name; | ||
public str toStr(class(str name, list[Entity] params)) = "<name>\<<for(int i <- [0..size(params)-1]){><if(i != size(params)-1){><toStr(params[i])>,<}else{><toStr(params[i])><}><}>\>"; | ||
public str toStr(interface(str name)) = name; | ||
public str toStr(interface(str name, list[Entity] params)) = "<name>\<<for(int i <- [0..size(params)-1]){><if(i != size(params)-1){><toStr(params[i])>,<}else{><toStr(params[i])><}><}>\>"; | ||
public str toStr(enum(str name)) = name; | ||
public str toStr(method(str name, list[Entity] params, Entity returnType)) = "<toStr(returnType)> <name>(<if(size(params) != 0){><for(int i <- [0..size(params)-1]){><if(i != size(params)-1){><toStr(params[i])>,<}else{><toStr(params[i])><}><}><}else{><}>)"; | ||
public str toStr(constr(list[Entity] params)) = "(<if(size(params) != 0){><for(int i <- [0..size(params)-1]){><if(i != size(params)-1){><toStr(params[i])>,<}else{><toStr(params[i])><}><}><}else{><}>)"; | ||
public str toStr(primitive(PrimitiveType primType)) = "<toStr(primType)>"; | ||
public str toStr(array(Entity elementType)) = "<toStr(elementType)>[]"; | ||
public str toStr(wildcard()) = "!"; | ||
public str toStr(wildcard(super(Entity b))) = "! super <toStr(b)>"; | ||
public str toStr(wildcard(extends(Entity b))) = "! extends <toStr(b)>"; | ||
public str toStr(captureof(Entity wildCard)) = "captureof <toStr(wildCard)>"; | ||
|
||
public default str toStr(Id id) { | ||
switch(id) { | ||
case initializer(): return "initializer"; | ||
case initializer(int nr): return "initializer(<nr>)"; | ||
case typeParameter(str name): return "<name> (type parameter)"; | ||
} | ||
throw "ups, unknown id <id>"; | ||
} | ||
|
||
|
||
public str toStr(byte()) = "byte"; | ||
public str toStr(short()) = "short"; | ||
public str toStr(\int()) = "int"; | ||
public str toStr(long()) = "long"; | ||
public str toStr(float()) = "float"; | ||
public str toStr(double()) = "double"; | ||
public str toStr(char()) = "char"; | ||
public str toStr(boolean()) = "boolean"; | ||
public str toStr(\void()) = "void"; | ||
public str toStr(null()) = "null"; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
@contributor{Vadim Zaytsev - vadim@grammarware.net - SWAT, CWI} | ||
module Visualise | ||
|
||
// will produce dot files |