Java Code Examples for org.eclipse.xtext.nodemodel.INode

The following examples show how to use org.eclipse.xtext.nodemodel.INode. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: gef   Source File: DotHtmlLabelProposalProvider.java    License: Eclipse Public License 2.0 6 votes vote down vote up
private void proposeHtmlBgColorAttributeValues(ContentAssistContext context,
		ICompletionProposalAcceptor acceptor) {
	INode currentNode = context.getCurrentNode();
	String fullText = currentNode.getText();
	String text = fullText;
	int beginReplacementOffset = currentNode.getOffset();

	if (context.getPrefix().contains(":")) { //$NON-NLS-1$
		int colonOffset = fullText.indexOf(':') + 1;
		text = fullText.substring(colonOffset);
		beginReplacementOffset += colonOffset;
	} else {
		beginReplacementOffset += beginsWithQuote(text) ? 1 : 0;
	}
	proposeHtmlColorAttributeValues(context, acceptor,
			text.replaceAll("['\"]", ""), //$NON-NLS-1$ //$NON-NLS-2$
			beginReplacementOffset, context.getOffset());
	if (!fullText.contains(":")) { //$NON-NLS-1$
		acceptor.accept(new ConfigurableCompletionProposal(":", //$NON-NLS-1$
				context.getOffset(), 0, 1));
	}
}
 
Example 2
Source Project: xtext-core   Source File: SequenceFeeder.java    License: Eclipse Public License 2.0 6 votes vote down vote up
protected void acceptRuleCall(RuleCall rc, Object value, String token, int index, INode node) {
	CrossReference crossRef = GrammarUtil.containingCrossReference(rc);
	if (crossRef != null) {
		if (rc.getRule() instanceof ParserRule)
			sequenceAcceptor.acceptAssignedCrossRefDatatype(rc, token, (EObject) value, index,
					getCompositeNode(node));
		else if (rc.getRule() instanceof TerminalRule)
			sequenceAcceptor.acceptAssignedCrossRefTerminal(rc, token, (EObject) value, index, getLeafNode(node));
		else if (rc.getRule() instanceof EnumRule)
			sequenceAcceptor.acceptAssignedCrossRefEnum(rc, token, (EObject) value, index, getCompositeNode(node));
	} else {
		if (rc.getRule() instanceof ParserRule) {
			AbstractRule rule = rc.getRule();
			if (rule.getType() != null && rule.getType().getClassifier() instanceof EClass)
				acceptEObjectRuleCall(rc, (EObject) value, getCompositeNode(node));
			else
				sequenceAcceptor.acceptAssignedDatatype(rc, token, value, index, getCompositeNode(node));
		} else if (rc.getRule() instanceof TerminalRule)
			sequenceAcceptor.acceptAssignedTerminal(rc, token, value, index, getLeafNode(node));
		else if (rc.getRule() instanceof EnumRule)
			sequenceAcceptor.acceptAssignedEnum(rc, token, value, index, getCompositeNode(node));
	}
}
 
Example 3
Source Project: xtext-extras   Source File: XbaseFormatter2.java    License: Eclipse Public License 2.0 6 votes vote down vote up
protected XClosure builder(final List<XExpression> params) {
  XClosure _xifexpression = null;
  XExpression _last = IterableExtensions.<XExpression>last(params);
  boolean _tripleNotEquals = (_last != null);
  if (_tripleNotEquals) {
    XClosure _xblockexpression = null;
    {
      INode _nodeForEObject = this._nodeModelAccess.nodeForEObject(IterableExtensions.<XExpression>last(params));
      final EObject grammarElement = ((ICompositeNode) _nodeForEObject).getFirstChild().getGrammarElement();
      XClosure _xifexpression_1 = null;
      if (((Objects.equal(grammarElement, this._xbaseGrammarAccess.getXMemberFeatureCallAccess().getMemberCallArgumentsXClosureParserRuleCall_1_1_4_0()) || 
        Objects.equal(grammarElement, this._xbaseGrammarAccess.getXFeatureCallAccess().getFeatureCallArgumentsXClosureParserRuleCall_4_0())) || 
        Objects.equal(grammarElement, this._xbaseGrammarAccess.getXConstructorCallAccess().getArgumentsXClosureParserRuleCall_5_0()))) {
        XExpression _last_1 = IterableExtensions.<XExpression>last(params);
        _xifexpression_1 = ((XClosure) _last_1);
      }
      _xblockexpression = _xifexpression_1;
    }
    _xifexpression = _xblockexpression;
  }
  return _xifexpression;
}
 
Example 4
@Override
protected EObject resolveCrossReferencedElement(INode node) {
	EObject referencedElement = super.resolveCrossReferencedElement(node);
	EObject referenceOwner = NodeModelUtils.findActualSemanticObjectFor(node);
	if(referenceOwner instanceof XConstructorCall) {
		if (referenceOwner.eContainer() instanceof AnonymousClass) {
			AnonymousClass anon = (AnonymousClass) referenceOwner.eContainer();
			JvmGenericType superType = anonymousClassUtil.getSuperType(anon);
			if(superType != null) {
				if (referencedElement instanceof JvmGenericType)  
					return superType;
				else if(referencedElement instanceof JvmConstructor) {
					if(superType.isInterface())
						return superType;
					JvmConstructor superConstructor = anonymousClassUtil.getSuperTypeConstructor(anon);
					if(superConstructor != null)
						return superConstructor;
				}
			}
		}
	}
	return referencedElement;
}
 
Example 5
Source Project: xtext-xtend   Source File: AnonymousClassUtil.java    License: Eclipse Public License 2.0 6 votes vote down vote up
public JvmDeclaredType getSuperTypeNonResolving(AnonymousClass anonymousClass, IScope typeScope) {
	XConstructorCall constructorCall = anonymousClass.getConstructorCall();
	EObject constructorProxy = (EObject) constructorCall.eGet(XbasePackage.Literals.XCONSTRUCTOR_CALL__CONSTRUCTOR, false);
	IEObjectDescription description = null;
	if (constructorProxy != null) {
		if (!constructorProxy.eIsProxy()) {
			return getSuperType(anonymousClass);
		}
		String fragment = EcoreUtil.getURI(constructorProxy).fragment();
		INode node = uriEncoder.getNode(constructorCall, fragment);
		String name = linkingHelper.getCrossRefNodeAsString(node, true);
		QualifiedName superTypeName = qualifiedNameConverter.toQualifiedName(name);
		description = typeScope.getSingleElement(superTypeName);
	}
	if (description == null || !EcoreUtil2.isAssignableFrom(TypesPackage.Literals.JVM_DECLARED_TYPE, description.getEClass())) {
		description = typeScope.getSingleElement(QualifiedName.create("java", "lang", "Object"));
	}
	if (description != null && EcoreUtil2.isAssignableFrom(TypesPackage.Literals.JVM_DECLARED_TYPE, description.getEClass())) {
		JvmDeclaredType type = (JvmDeclaredType) description.getEObjectOrProxy();
		if (!type.eIsProxy())
			return type;
		return (JvmDeclaredType) EcoreUtil.resolve(type, anonymousClass);
	}
	return null;
}
 
Example 6
Source Project: xtext-core   Source File: NodeModelUtils.java    License: Eclipse Public License 2.0 6 votes vote down vote up
public static ParserRule getEntryParserRule(INode node) {
	ICompositeNode root = node.getRootNode();
	EObject ge1 = root.getGrammarElement();
	if (ge1 instanceof ParserRule) {
		return (ParserRule) ge1;
	} else if (ge1 instanceof Action) {
		INode firstChild = root.getFirstChild();
		while (firstChild.getGrammarElement() instanceof Action && firstChild instanceof CompositeNode) {
			firstChild = ((CompositeNode)firstChild).getFirstChild();
		}
		EObject ge2 = firstChild.getGrammarElement();
		if (ge2 instanceof ParserRule) {
			return (ParserRule) ge2;
		}
	}
	throw new IllegalStateException("No Root Parser Rule found; The Node Model is broken.");
}
 
Example 7
Source Project: xtext-core   Source File: Bug437669Test.java    License: Eclipse Public License 2.0 6 votes vote down vote up
@Test
public void testUnresolved_02() {
	Type type = getContext();
	INode nameNode = NodeModelUtils.findNodesForFeature(type, ImportedURIPackage.Literals.TYPE__NAME).get(0);
	resolve(type, "BlaBlaBla", nameNode.getOffset(), nameNode.getLength());
	Resource resource = type.eResource();
	assertEquals(resource.getErrors().toString(), 1, resource.getErrors().size());
	
	LineAndColumn lineAndColumn = NodeModelUtils.getLineAndColumn(nameNode, nameNode.getOffset());

	Diagnostic diagnostic = (Diagnostic) resource.getErrors().get(0);
	assertEquals(nameNode.getOffset(), diagnostic.getOffset());
	assertEquals(nameNode.getLength(), diagnostic.getLength());
	assertEquals(lineAndColumn.getLine(), diagnostic.getLine());
	assertEquals(lineAndColumn.getColumn(), diagnostic.getColumn());
	assertEquals("Couldn't resolve reference to Type 'BlaBlaBla'.", diagnostic.getMessage());
}
 
Example 8
@Override
protected void handleLastCompleteNodeIsAtEndOfDatatypeNode() {
	String prefix = getPrefix(lastCompleteNode);
	INode previousNode = getLastCompleteNodeByOffset(rootNode, lastCompleteNode.getOffset());
	EObject previousModel = previousNode.getSemanticElement();
	INode currentDatatypeNode = getContainingDatatypeRuleNode(currentNode);
	Collection<FollowElement> followElements = parseFollowElements(lastCompleteNode.getOffset(), false);
	int prevSize = contextBuilders.size();
	doCreateContexts(previousNode, currentDatatypeNode, prefix, previousModel, followElements);

	if (lastCompleteNode instanceof ILeafNode && lastCompleteNode.getGrammarElement() == null
			&& contextBuilders.size() != prevSize) {
		handleLastCompleteNodeHasNoGrammarElement(contextBuilders.subList(prevSize, contextBuilders.size()),
				previousModel);
	}
}
 
Example 9
Source Project: gef   Source File: DotHtmlLabelValidator.java    License: Eclipse Public License 2.0 6 votes vote down vote up
private void reportRangeBasedError(String issueCode, String message,
		EObject object, EStructuralFeature feature, String[] issueData) {

	List<INode> nodes = NodeModelUtils.findNodesForFeature(object, feature);

	if (nodes.size() != 1) {
		throw new IllegalStateException(
				"Exact 1 node is expected for the feature, but got "
						+ nodes.size() + " node(s).");
	}

	INode node = nodes.get(0);
	int offset = node.getTotalOffset();
	int length = node.getLength();

	getMessageAcceptor().acceptError(message, object, offset, length,
			issueCode, issueData);
}
 
Example 10
Source Project: n4js   Source File: N4JSDocHelper.java    License: Eclipse Public License 1.0 6 votes vote down vote up
/**
 * Get JSDoc comment for the given element. The element may be an AST node such as <code>N4MethodDeclaration</code>
 * or a type model element such as <code>TMethod</code>. In the latter case, this method will follow the link to the
 * AST which may cause a load of the N4JS resource if it is not fully loaded (i.e. if only the TModule was loaded
 * from the Xtext index).
 * <p>
 * Thus, <b>this method may have a side effect on the containing resource of the given element</b>. If that is not
 * desired, use method {@link #getDocSafely(ResourceSet, EObject)} instead.
 */
public String getDoc(EObject element) {
	if (element == null)
		throw new IllegalArgumentException("element must not be null");
	if (element.eIsProxy()) {
		return null;
		// throw new IllegalArgumentException("element must not be proxy: " + element.toString());
	}

	final List<INode> docNodes = documentationProviderExt.getDocumentationNodes(element);
	if (!docNodes.isEmpty()) {
		final StringBuilder sb = new StringBuilder(docNodes.get(0).getText());
		for (int idx = 1; idx < docNodes.size(); idx++) {
			sb.append("\n").append(docNodes.get(idx).getText());
		}
		return sb.toString();
	}
	return null;
}
 
Example 11
Source Project: xtext-core   Source File: NodeTreeIterator.java    License: Eclipse Public License 2.0 5 votes vote down vote up
@Override
public INode next() {
	if (next == null && !hasNext())
		throw new NoSuchElementException();
	lastNextReturned = next;
	lastPreviousReturned = null;
	afterAdvance();
	return lastNextReturned;
}
 
Example 12
Source Project: xtext-core   Source File: InternalNodeModelUtils.java    License: Eclipse Public License 2.0 5 votes vote down vote up
/**
 * Obtain the line breaks from the document and search / compute the line number
 * and column number at the given document offset.
 */
protected static LineAndColumn getLineAndColumn(INode anyNode, int documentOffset) {
	INode rootNode = anyNode.getRootNode();
	int[] lineBreaks = getLineBreakOffsets(rootNode);
	String document = rootNode.getText();
	return getLineAndColumn(document, lineBreaks, documentOffset);
}
 
Example 13
Source Project: xtext-core   Source File: TokenUtil.java    License: Eclipse Public License 2.0 5 votes vote down vote up
public Pair<List<ILeafNode>, List<ILeafNode>> getLeadingAndTrailingHiddenTokens(INode node) {
	Pair<List<ILeafNode>, List<ILeafNode>> result = Tuples.<List<ILeafNode>, List<ILeafNode>> create(Lists
			.<ILeafNode> newArrayList(), Lists.<ILeafNode> newArrayList());
	List<ILeafNode> leafNodes = Lists.newArrayList(node.getLeafNodes());
	int begin = 0, end = leafNodes.size() - 1;
	while (begin <= end && leafNodes.get(begin).isHidden())
		result.getFirst().add(leafNodes.get(begin++));
	while (begin <= end && leafNodes.get(end).isHidden())
		result.getSecond().add(0, leafNodes.get(end--));
	return result;
}
 
Example 14
@Override
protected void emitUnassignedTokens(EObject semanticObject, ISynTransition transition, INode fromNode, INode toNode) {
	if (transition.getAmbiguousSyntaxes().isEmpty()) return;
	List<INode> transitionNodes = collectNodes(fromNode, toNode);
	for (AbstractElementAlias syntax : transition.getAmbiguousSyntaxes()) {
		List<INode> syntaxNodes = getNodesFor(transitionNodes, syntax);
		if (match_ModelElement_SemicolonKeyword_3_0_or___LeftCurlyBracketKeyword_3_1_0_RightCurlyBracketKeyword_3_1_2__.equals(syntax))
			emit_ModelElement_SemicolonKeyword_3_0_or___LeftCurlyBracketKeyword_3_1_0_RightCurlyBracketKeyword_3_1_2__(semanticObject, getLastNavigableState(), syntaxNodes);
		else if (match_RootModel___LeftCurlyBracketKeyword_3_0_RightCurlyBracketKeyword_3_2__q.equals(syntax))
			emit_RootModel___LeftCurlyBracketKeyword_3_0_RightCurlyBracketKeyword_3_2__q(semanticObject, getLastNavigableState(), syntaxNodes);
		else acceptNodes(getLastNavigableState(), syntaxNodes);
	}
}
 
Example 15
Source Project: xtext-core   Source File: AbstractNode.java    License: Eclipse Public License 2.0 5 votes vote down vote up
/**
 * @since 2.5
 */
@Override
public int getEndOffset() {
	BidiIterator<AbstractNode> iter = basicIterator();
	while(iter.hasPrevious()) {
		INode prev = iter.previous();
		if (prev instanceof ILeafNode && !((ILeafNode) prev).isHidden()) {
			return prev.getTotalEndOffset();
		}
	}
	return getTotalEndOffset();
}
 
Example 16
public BigInteger toValue(String string, INode node) {
	if (Strings.isEmpty(string))
		throw new ValueConverterException("Couldn't convert empty string to number.", node, null);
	try {
		return new BigInteger(string.substring(2), 16);
	} catch (NumberFormatException e) {
		throw new ValueConverterException("Couldn't convert '" + string + "' to number.", node, null);
	}
}
 
Example 17
Source Project: statecharts   Source File: BoolValueConverter.java    License: Eclipse Public License 1.0 5 votes vote down vote up
public Boolean toValue(String string, INode node) {

		if (Strings.isEmpty(string))
			throw new ValueConverterException("Couldn't convert empty string to boolean.", node, null);
		
		if ("true".equals(string.toLowerCase()) || "yes".equals(string.toLowerCase())) {
			return true;
		}
		
		if ("false".equals(string.toLowerCase()) || "no".equals(string.toLowerCase())) {
			return false;
		}
		
		throw new ValueConverterException("Couldn't convert '" + string + "' to boolean.", node, null);
	}
 
Example 18
protected List<INode> getNodesFor(List<INode> nodes, AbstractElementAlias ele) {
	if (nodes == null)
		return null;
	Set<AbstractElement> elments = Sets.newHashSet();
	collectAbstractElements(ele, elments);
	List<INode> result = Lists.newArrayList();
	for (INode n : nodes)
		if (elments.contains(n.getGrammarElement()))
			result.add(n);
	return result;
}
 
Example 19
Source Project: xtext-core   Source File: InvariantChecker.java    License: Eclipse Public License 2.0 5 votes vote down vote up
protected int doCheckCompositeNodeAndReturnTotalLength(ICompositeNode node, int startsAt) {
	if (node.getTotalOffset() != startsAt)
		throw new InconsistentNodeModelException("node with unexpected offset");
	int length = 0;
	Iterator<AbstractNode> iter = ((CompositeNode) node).basicGetChildren().iterator();
	while(iter.hasNext()) {
		INode child = iter.next();
		length += doCheckChildNodeAndReturnTotalLength(child, node, startsAt + length);
	}
	if (length != node.getTotalLength())
		throw new InconsistentNodeModelException("node's computed length differs from actual total length");
	return length;
}
 
Example 20
Source Project: dsl-devkit   Source File: LazyLinkingResource2.java    License: Eclipse Public License 1.0 5 votes vote down vote up
/**
 * {@inheritDoc}
 *
 * @return true if the {@link ICrossReferenceHelper} returns true
 */
@Override
public boolean suppressDiagnostic(final Triple<EObject, EReference, INode> triple) {
  final EObject context = triple.getFirst();
  final EReference reference = triple.getSecond();
  final INode node = triple.getThird();
  return crossReferenceHelper.isOptionalReference(context, reference, node);
}
 
Example 21
protected EObject findGrammarElement(INode node, EObject obj) {
	INode current = node;
	String feature = obj.eContainingFeature().getName();
	while (current != null) {
		EObject grammarElement = current.getGrammarElement();
		Assignment assignment = GrammarUtil.containingAssignment(grammarElement);
		if (assignment != null && feature.equals(assignment.getFeature()))
			return grammarElement;
		if (grammarElement instanceof Action) {
			Action action = (Action) grammarElement;
			if (feature.equals(action.getFeature()))
				return grammarElement;
			else if (current == node && current instanceof ICompositeNode) {
				INode child = ((ICompositeNode) current).getFirstChild();
				while (child instanceof ICompositeNode) {
					EObject grammarElement2 = child.getGrammarElement();
					Assignment assignment2 = GrammarUtil.containingAssignment(grammarElement2);
					if (assignment2 != null && feature.equals(assignment2.getFeature()))
						return grammarElement2;
					// if (child.hasDirectSemanticElement() && child.getSemanticElement() != obj)
					// break;
					child = ((ICompositeNode) child).getFirstChild();
				}
			}
		}
		if (current.hasDirectSemanticElement() && current.getSemanticElement() != obj)
			return null;
		current = current.getParent();
	}
	return null;
}
 
Example 22
protected void completeBinaryOperation(final EObject model, final Assignment assignment, final ContentAssistContext context, final IIdeContentProposalAcceptor acceptor) {
  if ((model instanceof XBinaryOperation)) {
    int _length = context.getPrefix().length();
    boolean _tripleEquals = (_length == 0);
    if (_tripleEquals) {
      final INode currentNode = context.getCurrentNode();
      final int offset = currentNode.getOffset();
      final int endOffset = currentNode.getEndOffset();
      if ((((offset < context.getOffset()) && (endOffset >= context.getOffset())) && (currentNode.getGrammarElement() instanceof CrossReference))) {
        return;
      }
    }
    int _endOffset = NodeModelUtils.findActualNodeFor(model).getEndOffset();
    int _offset = context.getOffset();
    boolean _lessEqualsThan = (_endOffset <= _offset);
    if (_lessEqualsThan) {
      AbstractElement _terminal = assignment.getTerminal();
      this.createReceiverProposals(((XExpression) model), ((CrossReference) _terminal), context, acceptor);
    } else {
      AbstractElement _terminal_1 = assignment.getTerminal();
      this.createReceiverProposals(((XBinaryOperation)model).getLeftOperand(), 
        ((CrossReference) _terminal_1), context, acceptor);
    }
  } else {
    final EObject previousModel = context.getPreviousModel();
    if ((previousModel instanceof XExpression)) {
      if (((context.getPrefix().length() == 0) && (NodeModelUtils.getNode(previousModel).getEndOffset() > context.getOffset()))) {
        return;
      }
      AbstractElement _terminal_2 = assignment.getTerminal();
      this.createReceiverProposals(((XExpression)previousModel), 
        ((CrossReference) _terminal_2), context, acceptor);
    }
  }
}
 
Example 23
Source Project: xtext-core   Source File: EmitterNodeUtil.java    License: Eclipse Public License 2.0 5 votes vote down vote up
private static INode findNext(INode node, INode to) {
	if (node instanceof ICompositeNode) {
		INode firstChild = ((ICompositeNode) node).getFirstChild();
		if (firstChild != null) {
			if (firstChild == to) {
				return null;
			}
			return firstChild;
		}
	}
	return findNextSibling(node, to);
}
 
Example 24
@Override
public String getImportedTypeName() {
	String result = getImportedNamespace();
	if (result == null) {
		if (this.eIsSet(XtypePackage.Literals.XIMPORT_DECLARATION__IMPORTED_TYPE)) {
			JvmType unresolvedType = (JvmType) this.eGet(XtypePackage.Literals.XIMPORT_DECLARATION__IMPORTED_TYPE, false);
			if(!unresolvedType.eIsProxy())
				return unresolvedType.getIdentifier();
			List<INode> list = NodeModelUtils.findNodesForFeature(this,
					XtypePackage.Literals.XIMPORT_DECLARATION__IMPORTED_TYPE);
			StringBuilder sb = new StringBuilder();
			for (INode iNode : list) {
				sb.append(NodeModelUtils.getTokenText(iNode).replace("^", ""));
			}
			result = sb.toString().replace(" ", "");
			if (isStatic()) {
				return trim(result, 1);
			}
			return result;
		}
		return null;
	}
	if (isWildcard()) {
		return trim(result, 2);
	}
	return result;
}
 
Example 25
protected boolean isNameNode(EObject element, EStructuralFeature feature, ILeafNode node) {
	List<INode> nameNode = NodeModelUtils.findNodesForFeature(element, feature);
	for (INode iNode : nameNode) {
		if (iNode.getOffset() <= node.getOffset() && iNode.getLength()>= node.getLength()) {
			return true;
		}
	}
	return false;
}
 
Example 26
@Override
protected void emitUnassignedTokens(EObject semanticObject, ISynTransition transition, INode fromNode, INode toNode) {
	if (transition.getAmbiguousSyntaxes().isEmpty()) return;
	List<INode> transitionNodes = collectNodes(fromNode, toNode);
	for (AbstractElementAlias syntax : transition.getAmbiguousSyntaxes()) {
		List<INode> syntaxNodes = getNodesFor(transitionNodes, syntax);
		acceptNodes(getLastNavigableState(), syntaxNodes);
	}
}
 
Example 27
private CrossReference findCrossReference(EObject context, INode node) {
	if (node == null || (node.hasDirectSemanticElement() && context.equals(node.getSemanticElement())))
		return null;

	EObject grammarElement = node.getGrammarElement();
	if (grammarElement instanceof CrossReference) {
		return (CrossReference) grammarElement;
	} else
		return findCrossReference(context, node.getParent());
}
 
Example 28
Source Project: xtext-xtend   Source File: RichStringFormatter.java    License: Eclipse Public License 2.0 5 votes vote down vote up
protected boolean _hasSyntaxError(final NodeEObjectRegion region) {
  final BidiTreeIterator<INode> i = region.getNode().getAsTreeIterable().iterator();
  while (i.hasNext()) {
    SyntaxErrorMessage _syntaxErrorMessage = i.next().getSyntaxErrorMessage();
    boolean _tripleNotEquals = (_syntaxErrorMessage != null);
    if (_tripleNotEquals) {
      return true;
    }
  }
  return false;
}
 
Example 29
@Override
protected void emitUnassignedTokens(EObject semanticObject, ISynTransition transition, INode fromNode, INode toNode) {
	if (transition.getAmbiguousSyntaxes().isEmpty()) return;
	List<INode> transitionNodes = collectNodes(fromNode, toNode);
	for (AbstractElementAlias syntax : transition.getAmbiguousSyntaxes()) {
		List<INode> syntaxNodes = getNodesFor(transitionNodes, syntax);
		acceptNodes(getLastNavigableState(), syntaxNodes);
	}
}
 
Example 30
@Override
protected void emitUnassignedTokens(EObject semanticObject, ISynTransition transition, INode fromNode, INode toNode) {
	if (transition.getAmbiguousSyntaxes().isEmpty()) return;
	List<INode> transitionNodes = collectNodes(fromNode, toNode);
	for (AbstractElementAlias syntax : transition.getAmbiguousSyntaxes()) {
		List<INode> syntaxNodes = getNodesFor(transitionNodes, syntax);
		acceptNodes(getLastNavigableState(), syntaxNodes);
	}
}