Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: denschu/xtext-whitespace
base: 3fffab123f
...
head fork: denschu/xtext-whitespace
compare: 43da0bed9a
Checking mergeability… Don't worry, you can still create the pull request.
  • 2 commits
  • 4 files changed
  • 0 commit comments
  • 1 contributor
Commits on Mar 08, 2012
dennis.schulte hidden-Keyword 417b046
dennis.schulte Merge branch 'master' of
https://denschu@github.com/denschu/xtext-whitespace.git

Conflicts:
	com.denschu.xtext.whitespace/src/com/denschu/xtext/whitespace/MyDsl.xtext
	com.denschu.xtext.whitespace/src/com/denschu/xtext/whitespace/parser/IndentTokenSource.java
43da0be
View
14 com.denschu.xtext.whitespace/src/com/denschu/xtext/whitespace/MyDsl.xtext
@@ -5,17 +5,11 @@ generate myDsl "http://www.denschu.com/xtext/whitespace/MyDsl"
Test:
TAB keyword=Keyword (TAB arg+=Argument)* EOL;
-Keyword:
- keyword=String;
+Keyword hidden() : ID (" " ID)*;
-Argument:
- arg=String;
-
-String returns ecore::EString:
- (ID|WS|OTHER)*;
+Argument hidden() : ID (" " ID)*;
-terminal WS: ' ';
+terminal fragment WS: (' ') (' ')*;
terminal ID: ('a'..'z')+;
-terminal TAB: (WS WS | '\t')+;
+terminal TAB: (WS | '\t')+;
terminal EOL: ('\r'? '\n')+;
-terminal OTHER: .;
View
10 com.denschu.xtext.whitespace/src/com/denschu/xtext/whitespace/MyDslRuntimeModule.java
@@ -3,17 +3,9 @@
*/
package com.denschu.xtext.whitespace;
-import org.eclipse.xtext.parser.IParser;
-
-import com.denschu.xtext.whitespace.parser.IndentMyDslParser;
-
-
/**
* Use this class to register components to be used at runtime / without the Equinox extension registry.
*/
public class MyDslRuntimeModule extends com.denschu.xtext.whitespace.AbstractMyDslRuntimeModule {
- @Override
- public Class<? extends IParser> bindIParser() {
- return IndentMyDslParser.class;
- }
+
}
View
15 com.denschu.xtext.whitespace/src/com/denschu/xtext/whitespace/parser/IndentMyDslParser.java
@@ -1,15 +0,0 @@
-package com.denschu.xtext.whitespace.parser;
-
-import org.antlr.runtime.CharStream;
-import org.antlr.runtime.TokenSource;
-
-import com.denschu.xtext.whitespace.parser.antlr.MyDslParser;
-
-public class IndentMyDslParser extends MyDslParser {
- @Override
- protected TokenSource createLexer(CharStream stream) {
- IndentTokenSource tokenSource = new IndentTokenSource();
- tokenSource.setDelegate(super.createLexer(stream));
- return tokenSource;
- }
-}
View
34 com.denschu.xtext.whitespace/src/com/denschu/xtext/whitespace/parser/IndentTokenSource.java
@@ -1,34 +0,0 @@
-package com.denschu.xtext.whitespace.parser;
-
-import org.antlr.runtime.CommonToken;
-import org.antlr.runtime.Token;
-import org.eclipse.xtext.parser.antlr.AbstractSplittingTokenSource;
-import org.eclipse.xtext.parser.antlr.ITokenAcceptor;
-
-import com.denschu.xtext.whitespace.parser.antlr.internal.InternalMyDslLexer;
-
-/**
- * IndentTokenSource yields additional INDENT / DEDENT tokens for (\n+ \t*) NL
- * tokens whenever the amount of tabs (indentation) changes.
- */
-public class IndentTokenSource extends AbstractSplittingTokenSource {
-
- private Token lastToken;
-
- @Override
- protected boolean shouldSplitToken(Token token) {
- System.out.println("shouldSplitToken: " + token.toString());
- return true;
- }
-
- @Override
- protected void doSplitToken(Token token, ITokenAcceptor result) {
- lastToken = token;
- if(lastToken.getType() == InternalMyDslLexer.RULE_WS && token.getType() == InternalMyDslLexer.RULE_WS){
- result.accept(new CommonToken(InternalMyDslLexer.RULE_TAB, ""));
- }else{
- result.accept(lastToken);
- }
- }
-
-}

No commit comments for this range

Something went wrong with that request. Please try again.