Create() public abstract method

Constructs an AST instance.
public abstract Create ( ) : antlr.collections.AST
return antlr.collections.AST
Ejemplo n.º 1
0
        private AST createFromNodeName(string nodeTypeName)
        {
            AST newNode = null;

            ASTNodeCreator creator = (ASTNodeCreator)typename2creator_[nodeTypeName];

            if (creator != null)
            {
                newNode = creator.Create();
                if (newNode == null)
                {
                    throw new ArgumentException("Unable to create AST Node Type: '" + nodeTypeName + "'");
                }
            }
            else
            {
                newNode = createFromNodeTypeObject(loadNodeTypeObject(nodeTypeName));
            }
            return(newNode);
        }
Ejemplo n.º 2
0
        private AST createFromAST(AST node)
        {
            AST  newNode       = null;
            Type nodeAsTypeObj = node.GetType();

            ASTNodeCreator creator = (ASTNodeCreator)typename2creator_[nodeAsTypeObj.FullName];

            if (creator != null)
            {
                newNode = creator.Create();
                if (newNode == null)
                {
                    throw new ArgumentException("Unable to create AST Node Type: '" + nodeAsTypeObj.FullName + "'");
                }
            }
            else
            {
                newNode = createFromNodeTypeObject(nodeAsTypeObj);
            }
            return(newNode);
        }