Skip to content

Commit 6e6acbf

Browse files
rascalrascal
rascal
authored and
rascal
committed
initial commit
0 parents  commit 6e6acbf

12 files changed

+2222
-0
lines changed

.classpath

+7
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="org.eclipse.pde.core.requiredPlugins"/>
5+
<classpathentry kind="src" path="src"/>
6+
<classpathentry kind="output" path="bin"/>
7+
</classpath>

.project

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>rascal-Java8</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
<buildCommand>
14+
<name>rascal_eclipse.rascal_builder</name>
15+
<arguments>
16+
</arguments>
17+
</buildCommand>
18+
<buildCommand>
19+
<name>rascal_eclipse.term_builder</name>
20+
<arguments>
21+
</arguments>
22+
</buildCommand>
23+
<buildCommand>
24+
<name>org.eclipse.pde.ManifestBuilder</name>
25+
<arguments>
26+
</arguments>
27+
</buildCommand>
28+
<buildCommand>
29+
<name>org.eclipse.pde.SchemaBuilder</name>
30+
<arguments>
31+
</arguments>
32+
</buildCommand>
33+
</buildSpec>
34+
<natures>
35+
<nature>rascal_eclipse.rascal_nature</nature>
36+
<nature>org.eclipse.jdt.core.javanature</nature>
37+
<nature>org.eclipse.pde.PluginNature</nature>
38+
<nature>rascal_eclipse.term_nature</nature>
39+
</natures>
40+
</projectDescription>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
eclipse.preferences.version=1
2+
encoding/<project>=UTF-8

META-INF/MANIFEST.MF

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Manifest-Version: 1.0
2+
Bundle-ManifestVersion: 2
3+
Bundle-Name: antlr
4+
Bundle-SymbolicName: rascal-Java8
5+
Bundle-Version: 1.0.0
6+
Require-Bundle: rascal_eclipse
7+
Bundle-RequiredExecutionEnvironment: JavaSE-1.8

META-INF/RASCAL.MF

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Manifest-Version: 0.0.1
2+
Main-Function: main
3+
Main-Module: Plugin
4+
Source: src
5+

bin/AllTestes.rsc

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
module AllTestes
2+
3+
import Java18;
4+
import ParseTree;
5+
import IO;
6+
7+
/**
8+
* Parse all files within the testes directory.
9+
* This method is usefull for testing the Java18 grammar.
10+
*/
11+
void parseAllFiles() {
12+
entries = listJavaFiles(|project://rascal-Java8/testes|);
13+
14+
for(loc s <- entries) {
15+
print("[parsing file:] " + s.path);
16+
17+
try {
18+
//f = find(s, [|project://rascal-Java8/testes|]);
19+
contents = readFile(s);
20+
CompilationUnit cu = parse(#CompilationUnit, contents);
21+
println("... ok");
22+
}
23+
catch ParseError(loc l): {
24+
println("... found an error at line <l.begin.line>, column <l.begin.column> ");
25+
}
26+
}
27+
}
28+
29+
/**
30+
* List all Java files from an original location.
31+
*/
32+
list[loc] listJavaFiles(loc location) {
33+
res = [];
34+
list[loc] allFiles = location.ls;
35+
36+
for(loc l <- allFiles) {
37+
if(isDirectory(l)) {
38+
res = res + (listJavaFiles(l));
39+
}
40+
else {
41+
if(l.extension == "java") {
42+
res = l + res;
43+
};
44+
};
45+
};
46+
return res;
47+
}
48+
49+

0 commit comments

Comments
 (0)