diff options
author | Henrik Rentz-Reichert | 2018-10-12 08:12:07 +0000 |
---|---|---|
committer | Henrik Rentz-Reichert | 2018-10-18 17:35:04 +0000 |
commit | 8dced9082d8503bc829812d33a6c91209ffc99ab (patch) | |
tree | bad52bc70c834b1e322a62e00f4419cfcc7aacf7 /plugins/org.eclipse.etrice.core.room.ui/src/org/eclipse/etrice/core/ui/highlight/HighlightingAstVisitor.xtend | |
parent | 7b98005ca20f56ac60807ee6c47c6c701d674a64 (diff) | |
download | org.eclipse.etrice-v_2.0.0-M1-alpha.tar.gz org.eclipse.etrice-v_2.0.0-M1-alpha.tar.xz org.eclipse.etrice-v_2.0.0-M1-alpha.zip |
removed usage of DCTools againv_2.0.0-M1-alphabranch_2.0.0M1_correct
rolled back to previous implementation
Conflicts:
plugins/org.eclipse.etrice.core.room.ui/src/org/eclipse/etrice/core/ui/highlight/HighlightingAstVisitor.xtend
Change-Id: Ia5a87b54bfc64070082cb3ac0bc2ff5fe9c83851
Diffstat (limited to 'plugins/org.eclipse.etrice.core.room.ui/src/org/eclipse/etrice/core/ui/highlight/HighlightingAstVisitor.xtend')
-rw-r--r-- | plugins/org.eclipse.etrice.core.room.ui/src/org/eclipse/etrice/core/ui/highlight/HighlightingAstVisitor.xtend | 91 |
1 files changed, 0 insertions, 91 deletions
diff --git a/plugins/org.eclipse.etrice.core.room.ui/src/org/eclipse/etrice/core/ui/highlight/HighlightingAstVisitor.xtend b/plugins/org.eclipse.etrice.core.room.ui/src/org/eclipse/etrice/core/ui/highlight/HighlightingAstVisitor.xtend deleted file mode 100644 index f20a4621d..000000000 --- a/plugins/org.eclipse.etrice.core.room.ui/src/org/eclipse/etrice/core/ui/highlight/HighlightingAstVisitor.xtend +++ /dev/null @@ -1,91 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2011 protos software gmbh (http://www.protos.de). - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * CONTRIBUTORS: - * Henrik Rentz-Reichert (initial contribution) - * - *******************************************************************************/ - -package org.eclipse.etrice.core.ui.highlight - -import org.eclipse.etrice.core.room.Attribute -import org.eclipse.etrice.core.room.InterfaceItem -import org.eclipse.etrice.core.room.MessageData -import org.eclipse.etrice.core.room.Operation -import org.eclipse.etrice.core.room.VarDecl -import org.eclipse.etrice.dctools.fsm.ast.nodes.DCAstIdentifierNode -import org.eclipse.etrice.dctools.fsm.ast.nodes.DCAstNode -import org.eclipse.etrice.dctools.fsm.ast.nodes.DCAstOtherNode -import org.eclipse.etrice.dctools.fsm.ast.util.IDCAstNodeVisitor -import org.eclipse.xtext.ide.editor.syntaxcoloring.IHighlightedPositionAcceptor -import org.eclipse.xtext.nodemodel.INode -import org.eclipse.etrice.dctools.ast.DCUtil -import org.eclipse.etrice.dctools.fsm.ast.nodes.DCAstOperationCallNode -import org.eclipse.etrice.core.room.Message - -class HighlightingAstVisitor implements IDCAstNodeVisitor { - - IHighlightedPositionAcceptor acceptor - int baseOffset - - static def highlight(INode node, IHighlightedPositionAcceptor acceptor, DCUtil util) { - val ast = util.parseAndLink(node) - val offset = util.getDelimiterAdjustedOffset(node) - val visitor = new HighlightingAstVisitor(acceptor, offset) - ast.visit(visitor) - } - - private new(IHighlightedPositionAcceptor acceptor, int baseOffset) { - this.acceptor = acceptor - this.baseOffset = baseOffset - } - - override boolean visitBegin(DCAstNode node) { - var int begin - var int length - val highlightId = switch node { - DCAstOtherNode: { - begin = node.token.begin - length = node.token.length - switch node.token.token.kind { - case COMMENT: RoomHighlightingConfiguration.COMMENT_ID - case STRING: RoomHighlightingConfiguration.STRING_ID - case NUMBER: RoomHighlightingConfiguration.NUMBER_ID - case KEYWORD: RoomHighlightingConfiguration.KEYWORD_ID - default: null - } - } - DCAstIdentifierNode: { - begin = node.token.begin - length = node.token.length - switch DCUtil.getLinkedObject(node) { - Attribute, - MessageData, - VarDecl: RoomHighlightingConfiguration.HL_EXPR_ATTRIBUTE_ID - InterfaceItem: RoomHighlightingConfiguration.HL_EXPR_INTERFACE_ITEM_ID - Operation: RoomHighlightingConfiguration.HL_EXPR_OPERATION_ID - default: null - } - } - DCAstOperationCallNode: { - begin = node.idNode.token.begin - length = node.idNode.token.length - switch node.linkedObject { - Message: RoomHighlightingConfiguration.HL_EXPR_OPERATION_ID - default: null - } - } - } - if (highlightId !== null) { - acceptor.addPosition(baseOffset + begin, length, highlightId) - } - return true - } - - override void visitEnd(DCAstNode node) { - } -} |