Java 类org.eclipse.xtext.parser.IAstFactory 实例源码

项目:xtext-core    文件:WhitespacePreservingCallbackTest.java   
@Test
public void testFail2() throws Exception {
    IAstFactory f = getASTFactory();
    EObject add = f.create(ComplexrewritetestPackage.Literals.ADD);

    // one operand INVALID
    EObject atom1 = f.create(ComplexrewritetestPackage.Literals.ATOM);
    f.set(atom1, "name", "x", null, null);
    f.add(add, "addOperands", atom1, null, null);
    failsWith(add);

    // two operands VALID
    EObject atom2 = f.create(ComplexrewritetestPackage.Literals.ATOM);
    f.set(atom2, "name", "x", null, null);
    f.add(add, "addOperands", atom2, null, null);
    assertNotNull(serialize(add));

    // three operands INVALID
    EObject atom3 = f.create(ComplexrewritetestPackage.Literals.ATOM);
    f.set(atom3, "name", "x", null, null);
    f.add(add, "addOperands", atom3, null, null);
    failsWith(add);
}
项目:OCCI-Studio    文件:OCCIRuntimeModule.java   
@Override
public Class<? extends IAstFactory> bindIAstFactory() {
  return CustomDefaultEcoreElementFactory.class;
}
项目:xtext-extras    文件:AbstractXtextTests.java   
protected IAstFactory getASTFactory() {
    return getInjector().getInstance(IAstFactory.class);
}
项目:xtext-core    文件:ParseResultFactory.java   
public void setFactory(IAstFactory factory) {
    this.factory = factory;
}
项目:xtext-core    文件:ParseResultFactory.java   
public IAstFactory getFactory() {
    return factory;
}
项目:xtext-core    文件:AbstractAntlrParser.java   
public IAstFactory getElementFactory() {
    return elementFactory;
}
项目:xtext-core    文件:AbstractAntlrParser.java   
public void setElementFactory(IAstFactory elementFactory) {
    this.elementFactory = elementFactory;
}
项目:xtext-core    文件:AbstractInternalAntlrParser.java   
public void setSemanticModelBuilder(IAstFactory semanticModelBuilder) {
    this.semanticModelBuilder = semanticModelBuilder;
}
项目:xtext-core    文件:AbstractInternalAntlrParser.java   
public IAstFactory getSemanticModelBuilder() {
    return semanticModelBuilder;
}
项目:xtext-core    文件:WhitespacePreservingCallbackTest.java   
@Test
public void testFail1() throws Exception {
    IAstFactory f = getASTFactory();
    failsWith(f.create(ComplexrewritetestPackage.Literals.ADD));
}
项目:xtext-core    文件:AbstractXtextTests.java   
protected IAstFactory getASTFactory() {
    return getInjector().getInstance(IAstFactory.class);
}
项目:n4js    文件:N4JSRuntimeModule.java   
/**
 * customized AST element factory, that sets the PropertyAssignment kind depending if the element is a
 * name-value-pair, a getter or setter and the feature is a name.
 *
 * @return Class<{@link PropertyNameAwareElementFactory}>
 */
@Override
public Class<? extends IAstFactory> bindIAstFactory() {
    return PropertyNameAwareElementFactory.class;
}