Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
182 changed files
with
33,919 additions
and
0 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,56 @@ | ||
# Windows image file caches | ||
Thumbs.db | ||
ehthumbs.db | ||
|
||
# Folder config file | ||
Desktop.ini | ||
|
||
# Recycle Bin used on file shares | ||
$RECYCLE.BIN/ | ||
|
||
# Windows Installer files | ||
*.cab | ||
*.msi | ||
*.msm | ||
*.msp | ||
|
||
# Windows shortcuts | ||
*.lnk | ||
|
||
# ========================= | ||
# Operating System Files | ||
# ========================= | ||
|
||
# OSX | ||
# ========================= | ||
|
||
.DS_Store | ||
.AppleDouble | ||
.LSOverride | ||
|
||
# Thumbnails | ||
._* | ||
|
||
# Files that might appear in the root of a volume | ||
.DocumentRevisions-V100 | ||
.fseventsd | ||
.Spotlight-V100 | ||
.TemporaryItems | ||
.Trashes | ||
.VolumeIcon.icns | ||
|
||
# Directories potentially created on remote AFP share | ||
.AppleDB | ||
.AppleDesktop | ||
Network Trash Folder | ||
Temporary Items | ||
.apdisk | ||
|
||
# Java class files | ||
*.class | ||
*.jar | ||
/out/ | ||
core/.idea/workspace.xml | ||
/.idea/ | ||
target | ||
hs_err_pid*.log |
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,24 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4"> | ||
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_17"> | ||
<output url="file://$MODULE_DIR$/target/classes" /> | ||
<output-test url="file://$MODULE_DIR$/target/test-classes" /> | ||
<content url="file://$MODULE_DIR$"> | ||
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" /> | ||
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" /> | ||
<excludeFolder url="file://$MODULE_DIR$/target" /> | ||
</content> | ||
<orderEntry type="inheritedJdk" /> | ||
<orderEntry type="sourceFolder" forTests="false" /> | ||
<orderEntry type="library" name="Maven: org.eclipse.collections:eclipse-collections:9.0.0" level="project" /> | ||
<orderEntry type="library" name="Maven: org.eclipse.collections:eclipse-collections-api:9.0.0" level="project" /> | ||
<orderEntry type="library" name="Maven: org.locationtech.jts:jts-core:1.18.2" level="project" /> | ||
<orderEntry type="library" name="Maven: org.ow2.asm:asm:9.0" level="project" /> | ||
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.12" level="project" /> | ||
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" /> | ||
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-api:2.11.1" level="project" /> | ||
<orderEntry type="library" name="Maven: org.apache.logging.log4j:log4j-core:2.11.1" level="project" /> | ||
</component> | ||
</module> |
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,142 @@ | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>com.geodesk</groupId> | ||
<artifactId>geodesk</artifactId> | ||
<version>0.0.1-SNAPSHOT</version> | ||
<packaging>jar</packaging> | ||
|
||
<name>GeoDesk</name> | ||
<url>http://www.geodesk.com</url> | ||
|
||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
<maven.compiler.source>17</maven.compiler.source> | ||
<maven.compiler.target>17</maven.compiler.target> | ||
</properties> | ||
|
||
<dependencies> | ||
|
||
<!-- primitive collections --> | ||
<dependency> | ||
<groupId>org.eclipse.collections</groupId> | ||
<artifactId>eclipse-collections</artifactId> | ||
<version>9.0.0</version> | ||
</dependency> | ||
|
||
<!-- geometry --> | ||
<dependency> | ||
<groupId>org.locationtech.jts</groupId> | ||
<artifactId>jts-core</artifactId> | ||
<version>1.18.2</version> | ||
</dependency> | ||
|
||
<!-- Java Bytecode Manipulation --> | ||
<dependency> | ||
<groupId>org.ow2.asm</groupId> | ||
<artifactId>asm</artifactId> | ||
<version>9.0</version> | ||
</dependency> | ||
|
||
<!-- Testing --> | ||
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
<version>4.12</version> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
<!-- Logging (temporary) --> | ||
<dependency> | ||
<groupId>org.apache.logging.log4j</groupId> | ||
<artifactId>log4j-api</artifactId> | ||
<version>2.11.1</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.apache.logging.log4j</groupId> | ||
<artifactId>log4j-core</artifactId> | ||
<version>2.11.1</version> | ||
</dependency> | ||
|
||
|
||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
|
||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<configuration> | ||
<source>17</source> | ||
<target>17</target> | ||
</configuration> | ||
</plugin> | ||
|
||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-site-plugin</artifactId> | ||
<version>3.7.1</version> | ||
</plugin> | ||
|
||
|
||
</plugins> | ||
</build> | ||
|
||
<reporting> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-javadoc-plugin</artifactId> | ||
<version>3.3.1</version> | ||
|
||
<configuration> | ||
<doctitle>GeoDesk (Preview Release)</doctitle> | ||
<windowtitle>GeoDesk (Preview Release)</windowtitle> | ||
<excludePackageNames> | ||
benchmarks; | ||
com.clarisma.*; | ||
com.geodesk.benchmark; | ||
com.geodesk.examples; | ||
com.geodesk.feature.*; | ||
com.geodesk.gol; | ||
com.geodesk.gol.*; | ||
com.geodesk.geom; | ||
com.geodesk.geom.*; | ||
com.geodesk.io.*; | ||
com.geodesk.map; | ||
</excludePackageNames> | ||
<links> | ||
<link>https://locationtech.github.io/jts/javadoc/</link> | ||
</links> | ||
</configuration> | ||
|
||
<!-- | ||
<configuration> | ||
<doclet>fr.faylixe.marklet.Marklet</doclet> | ||
<docletArtifact> | ||
<groupId>fr.faylixe</groupId> | ||
<artifactId>marklet</artifactId> | ||
<version>1.1.0</version> | ||
</docletArtifact> | ||
<reportOutputDirectory>./</reportOutputDirectory> | ||
<destDir>./</destDir> | ||
<useStandardDocletOptions>false</useStandardDocletOptions> | ||
</configuration> | ||
<configuration> | ||
<doclet>ch.raffael.mddoclet.MarkdownDoclet</doclet> | ||
<docletArtifact> | ||
<groupId>ch.raffael.markdown-doclet</groupId> | ||
<artifactId>markdown-doclet</artifactId> | ||
<version>1.4</version> | ||
</docletArtifact> | ||
<useStandardDocletOptions>true</useStandardDocletOptions> | ||
</configuration> | ||
--> | ||
</plugin> | ||
</plugins> | ||
</reporting> | ||
|
||
</project> |
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,6 @@ | ||
package com.clarisma.common.ast; | ||
|
||
public abstract class Ast | ||
{ | ||
public abstract <R> R accept(AstVisitor<R> visitor); | ||
} |
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,13 @@ | ||
package com.clarisma.common.ast; | ||
|
||
public interface AstVisitor<R> | ||
{ | ||
R visitExpression(Expression exp); | ||
R visitBinary(BinaryExpression exp); | ||
R visitUnary(UnaryExpression exp); | ||
R visitString(StringExpression exp); | ||
R visitLiteral(Literal exp); | ||
R visitVariable(Variable exp); | ||
R visitCall(CallExpression exp); | ||
R visitConditional(ConditionalExpression exp); | ||
} |
61 changes: 61 additions & 0 deletions
61
src/main/java/com/clarisma/common/ast/BinaryExpression.java
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,61 @@ | ||
package com.clarisma.common.ast; | ||
|
||
import java.util.Objects; | ||
|
||
public class BinaryExpression extends Expression | ||
{ | ||
private final Operator operator; | ||
private final Expression left; | ||
private final Expression right; | ||
|
||
public BinaryExpression(Operator operator, Expression left, Expression right) | ||
{ | ||
this.operator = operator; | ||
this.left = left; | ||
this.right = right; | ||
} | ||
|
||
@Override public boolean equals(Object o) | ||
{ | ||
if (this == o) return true; | ||
if (o == null || getClass() != o.getClass()) return false; | ||
BinaryExpression that = (BinaryExpression) o; | ||
return Objects.equals(operator, that.operator) && Objects.equals(left, | ||
that.left) && Objects.equals(right, that.right); | ||
} | ||
|
||
/* | ||
@Override public Object clone() | ||
{ | ||
BinaryExpression v = (BinaryExpression)super.clone(); | ||
v.left = (Expression)left.clone(); | ||
v.right = (Expression)right.clone(); | ||
return v; | ||
} | ||
*/ | ||
|
||
@Override public int hashCode() | ||
{ | ||
return Objects.hash(operator, left, right); | ||
} | ||
|
||
public Operator operator() | ||
{ | ||
return operator; | ||
} | ||
|
||
public Expression left() | ||
{ | ||
return left; | ||
} | ||
|
||
public Expression right() | ||
{ | ||
return right; | ||
} | ||
|
||
@Override public <R> R accept(AstVisitor<R> visitor) | ||
{ | ||
return visitor.visitBinary(this); | ||
} | ||
} |
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,20 @@ | ||
package com.clarisma.common.ast; | ||
|
||
public class CallExpression extends Expression | ||
{ | ||
private final Expression callee; | ||
private final Expression[] arguments; | ||
|
||
|
||
public CallExpression(Expression callee, Expression[] arguments) | ||
{ | ||
this.callee = callee; | ||
this.arguments = arguments; | ||
} | ||
|
||
|
||
@Override public <R> R accept(AstVisitor<R> visitor) | ||
{ | ||
return visitor.visitCall(this); | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
src/main/java/com/clarisma/common/ast/ConditionalExpression.java
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,35 @@ | ||
package com.clarisma.common.ast; | ||
|
||
public class ConditionalExpression extends Expression | ||
{ | ||
private final Expression condition; | ||
private final Expression ifTrue; | ||
private final Expression ifFalse; | ||
|
||
public ConditionalExpression(Expression condition, Expression ifTrue, Expression ifFalse) | ||
{ | ||
this.condition = condition; | ||
this.ifTrue = ifTrue; | ||
this.ifFalse = ifFalse; | ||
} | ||
|
||
public Expression condition() | ||
{ | ||
return condition; | ||
} | ||
|
||
public Expression ifTrue() | ||
{ | ||
return ifTrue; | ||
} | ||
|
||
public Expression ifFalse() | ||
{ | ||
return ifFalse; | ||
} | ||
|
||
@Override public <R> R accept(AstVisitor<R> visitor) | ||
{ | ||
return visitor.visitConditional(this); | ||
} | ||
} |
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,20 @@ | ||
package com.clarisma.common.ast; | ||
|
||
public abstract class Expression extends Ast | ||
{ | ||
/* | ||
@Override public Object clone() | ||
{ | ||
try | ||
{ | ||
return super.clone(); | ||
} | ||
catch(CloneNotSupportedException ex) | ||
{ | ||
throw new RuntimeException(); | ||
} | ||
} | ||
*/ | ||
|
||
// TODO: why is accept() not implemented here? | ||
} |
Oops, something went wrong.