当前位置: 首页>>代码示例>>Java>>正文


Java ISemanticSequenceAcceptor类代码示例

本文整理汇总了Java中org.eclipse.xtext.serializer.acceptor.ISemanticSequenceAcceptor的典型用法代码示例。如果您正苦于以下问题:Java ISemanticSequenceAcceptor类的具体用法?Java ISemanticSequenceAcceptor怎么用?Java ISemanticSequenceAcceptor使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ISemanticSequenceAcceptor类属于org.eclipse.xtext.serializer.acceptor包,在下文中一共展示了ISemanticSequenceAcceptor类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testSequence

import org.eclipse.xtext.serializer.acceptor.ISemanticSequenceAcceptor; //导入依赖的package包/类
private void testSequence(String stringModel) throws Exception {
	EObject model = getModel(stringModel);
	ISerializationContext context = nmSequencer.findContexts(model, true, null).iterator().next();
	DebugSequenceAcceptor actual = new NoEnterNodesDebugSequenceAcceptor(false);
	ISemanticSequencer semanticSequencer = semanticSequencerProvider.get();
	ISyntacticSequencer syntacticSequencer = syntacticSequencerProvider.get();
	IHiddenTokenSequencer hiddenTokenSequencer = hiddenTokenSequencerProvider.get();
	semanticSequencer
			.init((ISemanticSequenceAcceptor) syntacticSequencer, ISerializationDiagnostic.STDERR_ACCEPTOR);
	syntacticSequencer.init(context, model, (ISyntacticSequenceAcceptor) hiddenTokenSequencer,
			ISerializationDiagnostic.STDERR_ACCEPTOR);
	hiddenTokenSequencer.init(context, model, actual, ISerializationDiagnostic.STDERR_ACCEPTOR);
	semanticSequencer.createSequence(context, model);
	//		System.out.println(actual);
	//		System.out.println(NodeModelUtils.compactDump(NodeModelUtils.findActualNodeFor(model), true));
	assertEquals(Joiner.on("\n").join(getNodeSequence(model)), Joiner.on("\n").join(actual.getColumn(4)));
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:18,代码来源:HiddenTokenSequencerTest.java

示例2: serialize

import org.eclipse.xtext.serializer.acceptor.ISemanticSequenceAcceptor; //导入依赖的package包/类
@Override
public void serialize(ITextRegionDiffBuilder result) {
	ISemanticSequencer semantic = semanticSequencerProvider.get();
	ISyntacticSequencer syntactic = syntacticSequencerProvider.get();
	IHiddenTokenSequencer hidden = hiddenTokenSequencerProvider.get();
	semantic.init((ISemanticSequenceAcceptor) syntactic, errorAcceptor);
	syntactic.init(context, root, (ISyntacticSequenceAcceptor) hidden, errorAcceptor);
	ISequenceAcceptor acceptor;
	if (insertAt instanceof IHiddenRegion) {
		IHiddenRegion h = (IHiddenRegion) insertAt;
		acceptor = result.replaceSequence(h, h, context, root);
	} else {
		IHiddenRegion originalFirst = insertAt.getPreviousHiddenRegion();
		IHiddenRegion originalLast = insertAt.getNextHiddenRegion();
		acceptor = result.replaceSequence(originalFirst, originalLast, context, root);
	}
	hidden.init(context, root, acceptor, errorAcceptor);
	if (acceptor instanceof TokenStreamSequenceAdapter)
		((TokenStreamSequenceAdapter) acceptor).init(context);
	semantic.createSequence(context, root);
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:22,代码来源:PartialSerializer.java

示例3: serialize

import org.eclipse.xtext.serializer.acceptor.ISemanticSequenceAcceptor; //导入依赖的package包/类
/**
 * @since 2.3
 */
protected String serialize(EObject semanticObject, DelegatingSequenceAcceptor... acceptors) {
	ISequenceAcceptor debug = null;
	try {
		ISerializationDiagnostic.Acceptor errors = ISerializationDiagnostic.EXCEPTION_THROWING_ACCEPTOR;
		ISemanticSequencer semantic = semanticSequencerProvider.get();
		ISyntacticSequencer syntactic = syntacticSequencerProvider.get();
		IHiddenTokenSequencer hidden = hiddenTokenSequencerProvider.get();
		ISequenceAcceptor result = new StringBufferSequenceAcceptor();
		ISequenceAcceptor out = result;
		for (DelegatingSequenceAcceptor delegate : acceptors) {
			delegate.setDelegate(out);
			out = delegate;
		}
		out = debug = new DebugSequenceAcceptor(out);
		semantic.init((ISemanticSequenceAcceptor) syntactic, errors);
		ISerializationContext context = getContext(semanticObject);
		syntactic.init(context, semanticObject, (ISyntacticSequenceAcceptor) hidden, errors);
		hidden.init(context, semanticObject, out, errors);
		semantic.createSequence(context, semanticObject);
		return result.toString();
	} catch (Exception t) {
		if (debug != null) {
			System.out.println("Serializer debug output:");
			System.out.println(debug.toString());
		}
		Exceptions.sneakyThrow(t);
		return "";
	}
}
 
开发者ID:eclipse,项目名称:xtext-extras,代码行数:33,代码来源:SerializerTester.java

示例4: init

import org.eclipse.xtext.serializer.acceptor.ISemanticSequenceAcceptor; //导入依赖的package包/类
@Override
public void init(ISemanticSequencer sequencer, ISemanticSequenceAcceptor sequenceAcceptor,
		ISerializationDiagnostic.Acceptor errorAcceptor) {
	this.masterSequencer = sequencer;
	this.sequenceAcceptor = sequenceAcceptor;
	this.errorAcceptor = errorAcceptor;
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:8,代码来源:AbstractSemanticSequencer.java

示例5: serialize

import org.eclipse.xtext.serializer.acceptor.ISemanticSequenceAcceptor; //导入依赖的package包/类
/**
 * @deprecated use {@link #serialize(ISerializationContext, EObject, ISequenceAcceptor, ISerializationDiagnostic.Acceptor)}
 */
@Deprecated
protected void serialize(EObject semanticObject, EObject context, ISequenceAcceptor tokens,
		ISerializationDiagnostic.Acceptor errors) {
	ISemanticSequencer semantic = semanticSequencerProvider.get();
	ISyntacticSequencer syntactic = syntacticSequencerProvider.get();
	IHiddenTokenSequencer hidden = hiddenTokenSequencerProvider.get();
	semantic.init((ISemanticSequenceAcceptor) syntactic, errors);
	syntactic.init(context, semanticObject, (ISyntacticSequenceAcceptor) hidden, errors);
	hidden.init(context, semanticObject, tokens, errors);
	if (tokens instanceof TokenStreamSequenceAdapter)
		((TokenStreamSequenceAdapter) tokens).init(context);
	semantic.createSequence(context, semanticObject);
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:17,代码来源:Serializer.java

示例6: serialize

import org.eclipse.xtext.serializer.acceptor.ISemanticSequenceAcceptor; //导入依赖的package包/类
protected String serialize(EObject semanticObject, DelegatingSequenceAcceptor... acceptors) {
	ISequenceAcceptor debug = null;
	try {
		ISerializationDiagnostic.Acceptor errors = ISerializationDiagnostic.EXCEPTION_THROWING_ACCEPTOR;
		ISemanticSequencer semantic = semanticSequencerProvider.get();
		ISyntacticSequencer syntactic = syntacticSequencerProvider.get();
		IHiddenTokenSequencer hidden = hiddenTokenSequencerProvider.get();
		ISequenceAcceptor result = new StringBufferSequenceAcceptor();
		ISequenceAcceptor out = result;
		for (DelegatingSequenceAcceptor delegate : acceptors) {
			delegate.setDelegate(out);
			out = delegate;
		}
		out = debug = new DebugSequenceAcceptor(out);
		semantic.init((ISemanticSequenceAcceptor) syntactic, errors);
		ISerializationContext context = getContext(semanticObject);
		syntactic.init(context, semanticObject, (ISyntacticSequenceAcceptor) hidden, errors);
		hidden.init(context, semanticObject, out, errors);
		semantic.createSequence(context, semanticObject);
		return result.toString();
	} catch (Exception t) {
		if (debug != null) {
			System.out.println("Serializer debug output:");
			System.out.println(debug.toString());
		}
		Exceptions.sneakyThrow(t);
		return "";
	}
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:30,代码来源:SerializerTestHelper.java

示例7: serializeToTokenBuffer

import org.eclipse.xtext.serializer.acceptor.ISemanticSequenceAcceptor; //导入依赖的package包/类
protected void serializeToTokenBuffer(String model, ITokenStream out) throws Exception {
	EObject semanticObject = get(ParseHelper.class).parse(model);
	ISerializationDiagnostic.Acceptor errors = ISerializationDiagnostic.EXCEPTION_THROWING_ACCEPTOR;
	ISemanticSequencer semantic = get(ISemanticSequencer.class);
	ISyntacticSequencer syntactic = get(ISyntacticSequencer.class);
	IHiddenTokenSequencer hidden = get(IHiddenTokenSequencer.class);
	TokenStreamSequenceAdapter tokenstream = new TokenStreamSequenceAdapter(out, getGrammarAccess().getGrammar(), errors);
	semantic.init((ISemanticSequenceAcceptor) syntactic, errors);
	ISerializationContext context = new SerializationContext.RuleContext(null, (ParserRule) get(IGrammarAccess.class).getGrammar().getRules().get(0));
	syntactic.init(context, semanticObject, (ISyntacticSequenceAcceptor) hidden, errors);
	hidden.init(context, semanticObject, tokenstream, errors);
	tokenstream.init(context);
	semantic.createSequence(context, semanticObject);
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:15,代码来源:FormatterTest.java

示例8: testSequence

import org.eclipse.xtext.serializer.acceptor.ISemanticSequenceAcceptor; //导入依赖的package包/类
private void testSequence(String stringModel) throws Exception {
	EObject model = getModel(stringModel);
	ISerializationContext context = nmSequencer.findContexts(model, true, null).iterator().next();
	Acceptor actual = new Acceptor();
	ISemanticSequencer semanticSeq = semanticSequencerProvider.get();
	ISyntacticSequencer syntacticSeq = syntacticSequencerProvider.get();
	semanticSeq.init((ISemanticSequenceAcceptor) syntacticSeq, ISerializationDiagnostic.STDERR_ACCEPTOR);
	syntacticSeq.init(context, model, actual, ISerializationDiagnostic.STDERR_ACCEPTOR);
	semanticSeq.createSequence(context, model);
	assertEquals(Joiner.on("\n").join(getNodeSequence(model)), Joiner.on("\n").join(actual.getResult()));
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:12,代码来源:SyntacticSequencerTest.java

示例9: init

import org.eclipse.xtext.serializer.acceptor.ISemanticSequenceAcceptor; //导入依赖的package包/类
@Override
public void init(ISemanticSequencer sequencer, ISemanticSequenceAcceptor sequenceAcceptor, Acceptor errorAcceptor) {
	super.init(sequencer, sequenceAcceptor, errorAcceptor);
	this.genericSequencer = genericSequencerProvider.get();
	this.genericSequencer.init(sequencer, sequenceAcceptor, errorAcceptor);
}
 
开发者ID:amritbhat786,项目名称:DocIT,代码行数:7,代码来源:AbstractIOISemanticSequencer.java

示例10: init

import org.eclipse.xtext.serializer.acceptor.ISemanticSequenceAcceptor; //导入依赖的package包/类
void init(ISemanticSequencer sequencer, ISemanticSequenceAcceptor sequenceAcceptor,
ISerializationDiagnostic.Acceptor errorAcceptor);
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:3,代码来源:ISemanticSequencer.java

示例11: AssertStructureAcceptor

import org.eclipse.xtext.serializer.acceptor.ISemanticSequenceAcceptor; //导入依赖的package包/类
public AssertStructureAcceptor(ISemanticSequenceAcceptor delegate) {
	super(delegate);
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:4,代码来源:AssertStructureAcceptor.java

示例12: DebugSequenceAcceptor

import org.eclipse.xtext.serializer.acceptor.ISemanticSequenceAcceptor; //导入依赖的package包/类
public DebugSequenceAcceptor(ISemanticSequenceAcceptor delegate) {
	this(delegate, false);
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:4,代码来源:DebugSequenceAcceptor.java

示例13: AssertNodeModelAcceptor

import org.eclipse.xtext.serializer.acceptor.ISemanticSequenceAcceptor; //导入依赖的package包/类
public AssertNodeModelAcceptor(ISemanticSequenceAcceptor delegate) {
	super(delegate);
}
 
开发者ID:eclipse,项目名称:xtext-core,代码行数:4,代码来源:AssertNodeModelAcceptor.java


注:本文中的org.eclipse.xtext.serializer.acceptor.ISemanticSequenceAcceptor类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。