package carray.ast;

import polyglot.ast.NodeFactory_c;
import polyglot.ast.TypeNode;
import polyglot.util.Position;

/**
 * NodeFactory for carray extension.
 */
public class CArrayNodeFactory_c extends NodeFactory_c implements
        CArrayNodeFactory {
    public CArrayNodeFactory_c(CArrayLang lang, CArrayExtFactory extFactory) {
        super(lang, extFactory);
    }

    @Override
    public CArrayExtFactory extFactory() {
        return (CArrayExtFactory) super.extFactory();
    }

    @Override
    public ConstArrayTypeNode ConstArrayTypeNode(Position pos, TypeNode base) {
        // First, create the AST node to be returned.
        ConstArrayTypeNode_c n = new ConstArrayTypeNode_c(pos, base);
        // Then, attach any extension objects to n.
        n = ext(n, extFactory().extConstArrayTypeNode());
        return n;
    }
}
