Author: scabanovich
Date: 2011-07-26 19:29:27 -0400 (Tue, 26 Jul 2011)
New Revision: 33222
Modified:
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/parser/LexicalToken.java
Log:
JBIDE-9087
https://issues.jboss.org/browse/JBIDE-9087
Modified:
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/parser/LexicalToken.java
===================================================================
---
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/parser/LexicalToken.java 2011-07-26
22:57:18 UTC (rev 33221)
+++
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/parser/LexicalToken.java 2011-07-26
23:29:27 UTC (rev 33222)
@@ -147,4 +147,22 @@
if(next != null) next.shift(delta);
}
+ /**
+ * Computes combined token that starts with this token and ends with last token
+ * @param last
+ * @return
+ */
+ public LexicalToken getCombinedToken(LexicalToken last) {
+ StringBuffer sb = new StringBuffer();
+ LexicalToken t = this;
+ while(t != null && t != last) {
+ sb.append(t.getText());
+ t = t.getNextToken();
+ }
+ LexicalToken token = new LexicalToken(this.start, last.getStart() + last.getLength() -
start, sb.toString(), this.type);
+ token.previous = this.previous;
+ token.next = last.next;
+ return token;
+ }
+
}