]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.graph.compiler/src/org/simantics/graph/compiler/internal/ltk/SourcePart.java
Removed org.simantics.ltk[.antlr] bundles, exact import for antlr
[simantics/platform.git] / bundles / org.simantics.graph.compiler / src / org / simantics / graph / compiler / internal / ltk / SourcePart.java
diff --git a/bundles/org.simantics.graph.compiler/src/org/simantics/graph/compiler/internal/ltk/SourcePart.java b/bundles/org.simantics.graph.compiler/src/org/simantics/graph/compiler/internal/ltk/SourcePart.java
new file mode 100644 (file)
index 0000000..35a8b16
--- /dev/null
@@ -0,0 +1,45 @@
+package org.simantics.graph.compiler.internal.ltk;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+public class SourcePart implements ISource {
+       ISource originalSource;
+       int startPos;
+       int startLine;
+       
+       public SourcePart(ISource originalSource, int startPos, int startLine) {
+               this.originalSource = originalSource;
+               this.startPos = startPos;
+               this.startLine = startLine;
+       }
+
+       @Override
+       public String getName() {
+               return originalSource.getName();
+       }
+
+       @Override
+       public InputStream open() throws IOException {
+               throw new UnsupportedOperationException();
+       }
+
+       @Override
+       public int length() throws IOException {
+               throw new UnsupportedOperationException();
+       }
+
+       @Override
+       public int startPos() {
+               return startPos;
+       }
+
+       @Override
+       public int startLine() {
+               return startLine;
+       }
+
+       public ISource getOriginalSource() {
+               return originalSource;
+       }
+}