Example #1
0
        Parser(Parser copyFrom)
        {
            buildTree = false;

            rootState     = copyFrom.rootState;
            currentState  = copyFrom.currentState;
            previousState = copyFrom.previousState;

            position           = copyFrom.position;
            location           = copyFrom.location;
            stateTag           = copyFrom.stateTag;
            keywordBuilder     = new StringBuilder(copyFrom.keywordBuilder.ToString());
            currentStateLength = copyFrom.currentStateLength;

            //clone the node stack
            List <XObject> l = new List <XObject> (CopyXObjects(copyFrom.nodes));

            l.Reverse();
            nodes = new NodeStack(l);
        }
Example #2
0
        public void Reset()
        {
            currentState       = rootState;
            previousState      = rootState;
            position           = 0;
            stateTag           = 0;
            location           = new TextLocation(1, 1);
            keywordBuilder     = new StringBuilder();
            currentStateLength = 0;
            nodes = new NodeStack();
            nodes.Push(rootState.CreateDocument());

            if (buildTree)
            {
                errors = new List <Error> ();
            }
            else
            {
                errors = null;
            }
        }