Skip to content

Commit

Permalink
Try to get the
Browse files Browse the repository at this point in the history
  • Loading branch information
cdietrich committed Nov 7, 2013
1 parent f01485f commit 213c6c5
Show file tree
Hide file tree
Showing 18 changed files with 118 additions and 2,173 deletions.
20 changes: 20 additions & 0 deletions csep.tests/xtend-gen/csep/tests/basic/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/.ArrayTest.java._trace
/.AssignTest.java._trace
/.ClassTest.java._trace
/.ControlFlowTest.java._trace
/.DictionaryTest.java._trace
/.FunctionCallTest.java._trace
/.LambdaTest.java._trace
/.LiteralTest.java._trace
/.OperatorsTest.java._trace
/.ScopeTest.java._trace
/ArrayTest.java
/AssignTest.java
/ClassTest.java
/ControlFlowTest.java
/DictionaryTest.java
/FunctionCallTest.java
/LambdaTest.java
/LiteralTest.java
/OperatorsTest.java
/ScopeTest.java
4 changes: 4 additions & 0 deletions csep.tests/xtend-gen/csep/tests/coffee/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/.NodesCoffeeTest.java._trace
/.Showcase.java._trace
/NodesCoffeeTest.java
/Showcase.java
2 changes: 1 addition & 1 deletion csep.tests/xtend-gen/csep/tests/coffee/Showcase.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public void test_interpolation() {
_builder.append("quote = \"A picture is a fact. -- #{ author }\"");
_builder.newLine();
_builder.newLine();
_builder.append("sentence = \"#{ 22 / 7 } is a decent approximation of \uFFFD\uFFFD\"");
_builder.append("sentence = \"#{ 22 / 7 } is a decent approximation of \ufffd\ufffd\"");
_builder.newLine();
this.ok(_builder);
}
Expand Down
Binary file modified csep.tests/xtend-gen/csep/tests/lexer/.PositionTest.java._trace
Binary file not shown.
4 changes: 4 additions & 0 deletions csep.tests/xtend-gen/csep/tests/lexer/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/.PositionTest.java._trace
/.TokenTest.java._trace
/PositionTest.java
/TokenTest.java
6 changes: 6 additions & 0 deletions csep.tests/xtend-gen/csep/tests/other/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/.CakefileTest.java._trace
/.ErrorLocationTest.java._trace
/.MissingFeaturesTest.java._trace
/CakefileTest.java
/ErrorLocationTest.java
/MissingFeaturesTest.java
2 changes: 2 additions & 0 deletions csep.tests/xtend-gen/csep/tests/parser/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/.HelperTest.java._trace
/HelperTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import org.eclipse.xtext.ui.editor.contentassist.ContentAssistContext;

/**
* Represents a generated, default implementation of interface {@link IProposalProvider}.
* Represents a generated, default implementation of superclass {@link org.eclipse.xtext.ui.editor.contentassist.AbstractJavaBasedContentProposalProvider}.
* Methods are dynamically dispatched on the first parameter, i.e., you can override them
* with a more concrete subtype.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
/**
* @author Sebastian Zarnekow - Initial contribution and API
*/
@SuppressWarnings("restriction")
public class PartialCoffeeScriptContentAssistParser extends CoffeeScriptParser implements IPartialContentAssistParser {

private AbstractRule rule;
Expand Down
2 changes: 1 addition & 1 deletion csep/src-gen/csep/CoffeeScript.genmodel
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
modelPluginID="csep" forceOverwrite="true" modelName="CoffeeScript" updateClasspath="false"
rootExtendsClass="org.eclipse.emf.ecore.impl.MinimalEObjectImpl$Container" complianceLevel="5.0"
copyrightFields="false" editPluginID="csep.edit" editorPluginID="csep.editor"
runtimeVersion="2.8">
runtimeVersion="2.9">
<genPackages prefix="CoffeeScript" basePackage="csep" disposableProviderFactory="true"
ecorePackage="CoffeeScript.ecore#/">
<genClasses ecoreClass="CoffeeScript.ecore#//Root"/>
Expand Down
2,164 changes: 0 additions & 2,164 deletions csep/src-gen/csep/CoffeeScript.xmi

This file was deleted.

Binary file added csep/src-gen/csep/CoffeeScript.xtextbin
Binary file not shown.
3 changes: 3 additions & 0 deletions csep/src-gen/csep/CoffeeScriptStandaloneSetupGenerated.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ public Injector createInjectorAndDoEMFRegistration() {
if (!Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().containsKey("xmi"))
Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put(
"xmi", new org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl());
if (!Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().containsKey("xtextbin"))
Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put(
"xtextbin", new org.eclipse.xtext.resource.impl.BinaryGrammarResourceFactoryImpl());
if (!EPackage.Registry.INSTANCE.containsKey(org.eclipse.xtext.XtextPackage.eNS_URI))
EPackage.Registry.INSTANCE.put(org.eclipse.xtext.XtextPackage.eNS_URI, org.eclipse.xtext.XtextPackage.eINSTANCE);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public static CoffeeScriptFactory init()
{
try
{
CoffeeScriptFactory theCoffeeScriptFactory = (CoffeeScriptFactory)EPackage.Registry.INSTANCE.getEFactory("http://www.coffeescript.org/eclipse");
CoffeeScriptFactory theCoffeeScriptFactory = (CoffeeScriptFactory)EPackage.Registry.INSTANCE.getEFactory(CoffeeScriptPackage.eNS_URI);
if (theCoffeeScriptFactory != null)
{
return theCoffeeScriptFactory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -359,8 +359,7 @@ private List<CoffeeSymbol> tokenize(String code, Map<String, Object> opts)
code = "\n" + code;
this.fOffsetCorrection -= 1;
}
code = code.replaceAll("\r", "").replaceFirst(
TRAILING_SPACES.pattern(), "");
code = code.replaceAll("\r", "");
this.fCode = code;
this.fLine = 0;
if (opts.containsKey("fLine")) {
Expand Down Expand Up @@ -891,7 +890,7 @@ private int lineToken() {
if (noNewlines) {
this.suppressNewlines();
} else {
this.newlineToken();
this.newlineToken(indent.length());
}
return indent.length();
}
Expand Down Expand Up @@ -969,9 +968,9 @@ private int whitespaceToken() {
return 0;
}

private void newlineToken() {
private void newlineToken(int i) {
if (this.tag() != Terminals.TERMINATOR) {
this.token(Terminals.TERMINATOR, "\n", 1);
this.token(Terminals.TERMINATOR, "\n", i);
}
// return this;
}
Expand Down
30 changes: 30 additions & 0 deletions csep/src/csep/Main.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package csep;

import java.io.FileInputStream;
import java.io.IOException;

import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.xtext.resource.XtextResource;

import com.google.inject.Injector;

public class Main {

public static void main(String[] args) throws IOException {
FileInputStream in = new FileInputStream("x.coffee");
int c = 0;
int n = 0;
while((n=in.read())>0) c++;
in.close();
System.out.println(c);


Injector i = new CoffeeScriptStandaloneSetup().createInjectorAndDoEMFRegistration();
ResourceSet rs = i.getInstance(ResourceSet.class);
XtextResource r = (XtextResource)rs.getResource(URI.createURI("x.coffee"), true);
r.load(null);
System.out.println(r.getParseResult().getRootNode().getTotalLength());
}

}
38 changes: 38 additions & 0 deletions csep/x.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@



#xxxxx

a = 1+1






1+1

1111+1111+111+111
xx=1+1+1
1+1


sssss=1+1







bla = 1+1










2 changes: 2 additions & 0 deletions csep/xtend-gen/csep/generator/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/.CoffeeScriptGenerator.java._trace
/CoffeeScriptGenerator.java

0 comments on commit 213c6c5

Please sign in to comment.