C# Class System.Xml.Xsl.IlGen.XmlILVisitor

Creates Msil code for an entire QilExpression graph. Code is generated in one of two modes: push or pull. In push mode, code is generated to push the values in an iterator to the XmlWriter interface. In pull mode, the values in an iterator are stored in a physical location such as the stack or a local variable by an iterator. The iterator is passive, and will just wait for a caller to pull the data and/or instruct the iterator to enumerate the next value.
Inheritance: System.Xml.Xsl.Qil.QilVisitor
ファイルを表示 Open project: gbarnett/shared-source-cli-2.0 Class Usage Examples

Public Methods

Method Description
StartLetBinding ( QilIterator ndLet ) : void

Bind values in the "ndLet" expression to a non-stack location that can later be referenced.

Visit ( QilExpression qil, GenerateHelper helper, MethodInfo methRoot ) : void

Visits the specified QilExpression graph and generates MSIL code.

Protected Methods

Method Description
Visit ( QilNode nd ) : QilNode

Generate a query plan for the QilExpression subgraph.

VisitAdd ( QilBinary ndPlus ) : QilNode

Generate code for QilNodeType.Add.

VisitAfter ( QilBinary ndAfter ) : QilNode

Generate code for QilNodeType.VisitAfter.

VisitAncestor ( QilUnary ndAnc ) : QilNode

Find physical query plan for QilNodeType.Ancestor.

VisitAncestorOrSelf ( QilUnary ndAnc ) : QilNode

Find physical query plan for QilNodeType.AncestorOrSelf.

VisitAnd ( QilBinary ndAnd ) : QilNode

Generate code for QilNodeType.And.

BranchingContext.OnFalse context: (expr1) and (expr2) ==> if (!expr1) goto LabelParent; if (!expr2) goto LabelParent; BranchingContext.OnTrue context: (expr1) and (expr2) ==> if (!expr1) goto LabelTemp; if (expr1) goto LabelParent; LabelTemp: BranchingContext.None context: (expr1) and (expr2) ==> if (!expr1) goto LabelTemp; if (!expr1) goto LabelTemp; push true(); goto LabelSkip; LabelTemp: push false(); LabelSkip:

VisitAttribute ( QilBinary ndAttr ) : QilNode

Generate code for for QilNodeType.Attribute.

VisitAttributeCtor ( QilBinary ndAttr ) : QilNode

Generate code for QilNodeType.AttributeCtor.

VisitAverage ( QilUnary ndAvg ) : QilNode

Generate code for QilNodeType.Average.

VisitBefore ( QilBinary ndBefore ) : QilNode

Generate code for QilNodeType.VisitBefore.

VisitChildren ( QilNode parent ) : QilNode

VisitChildren should never be called.

VisitChoice ( QilChoice ndChoice ) : QilNode

Generate code for QilNodeType.Choice.

VisitCommentCtor ( QilUnary ndComment ) : QilNode

Generate code for QilNodeType.CommentCtor.

VisitConditional ( QilTernary ndCond ) : QilNode

Generate code for QilNodeType.Conditional.

VisitContent ( QilUnary ndContent ) : QilNode

Generate code for for QilNodeType.Content.

VisitDataSource ( QilDataSource ndSrc ) : QilNode

Generate code for QilNodeType.DataSource.

Generates code to retrieve a document using the XmlResolver.

VisitDeref ( QilBinary ndDeref ) : QilNode

Generate code for for QilNodeType.Deref.

VisitDescendant ( QilUnary ndDesc ) : QilNode

Find physical query plan for QilNodeType.Descendant.

VisitDescendantOrSelf ( QilUnary ndDesc ) : QilNode

Generate code for for QilNodeType.DescendantOrSelf.

VisitDifference ( QilBinary ndDiff ) : QilNode

Generate code for QilNodeType.Difference.

VisitDivide ( QilBinary ndDiv ) : QilNode

Generate code for QilNodeType.Divide.

VisitDocOrderDistinct ( QilUnary ndDod ) : QilNode

Generate code for for QilNodeType.DocOrderDistinct.

VisitDocumentCtor ( QilUnary ndDoc ) : QilNode

Generate code for QilNodeType.DocumentCtor.

VisitElementCtor ( QilBinary ndElem ) : QilNode

Generate code for QilNodeType.ElementCtor.

VisitEq ( QilBinary ndEq ) : QilNode

Generate code for QilNodeType.Eq.

VisitError ( QilUnary ndErr ) : QilNode

Generate code for QilNodeType.Error.

VisitFalse ( QilNode ndFalse ) : QilNode

Generate code for QilNodeType.False.

BranchingContext.OnFalse context: goto LabelParent; BranchingContext.OnTrue context: [nothing] BranchingContext.None context: push false();

VisitFilter ( QilLoop ndFilter ) : QilNode

Generate code for a QilNodeType.Filter.

VisitFollowingSibling ( QilUnary ndFollSib ) : QilNode

Find physical query plan for QilNodeType.FollowingSibling.

VisitFor ( QilIterator ndFor ) : QilNode

Generate code for a QilNodeType.For.

VisitGe ( QilBinary ndGe ) : QilNode

Generate code for QilNodeType.Ne.

VisitGt ( QilBinary ndGt ) : QilNode

Generate code for QilNodeType.Gt.

VisitIntersection ( QilBinary ndInter ) : QilNode

Generate code for QilNodeType.Intersection.

VisitInvoke ( QilInvoke ndInvoke ) : QilNode

Generate code for for QilNodeType.Invoke.

VisitIs ( QilBinary ndIs ) : QilNode

Generate code for QilNodeType.VisitIs.

VisitIsEmpty ( QilUnary ndIsEmpty ) : QilNode

Generate code for QilNodeType.IsEmpty.

BranchingContext.OnFalse context: is-empty(expr) ==> foreach (item in expr) goto LabelBranch; BranchingContext.OnTrue context: is-empty(expr) ==> foreach (item in expr) break; ... LabelOnEnd: (called if foreach is empty) goto LabelBranch; BranchingContext.None context: is-empty(expr) ==> foreach (item in expr) break; push true(); ... LabelOnEnd: (called if foreach is empty) push false();

VisitIsType ( QilTargetType ndIsType ) : QilNode

Generate code for QilNodeType.IsType.

VisitLe ( QilBinary ndLe ) : QilNode

Generate code for QilNodeType.Le.

VisitLength ( QilUnary ndSetLen ) : QilNode

Generate code for QilNodeType.Length.

int length = 0; foreach (item in expr) length++;

VisitLet ( QilIterator ndLet ) : QilNode

Generate code for a QilNodeType.Let.

VisitLiteralDecimal ( QilLiteral ndDec ) : QilNode

Generate code for QilNodeType.LiteralDecimal.

VisitLiteralDouble ( QilLiteral ndDbl ) : QilNode

Generate code for QilNodeType.LiteralDouble.

VisitLiteralInt32 ( QilLiteral ndInt ) : QilNode

Generate code for QilNodeType.LiteralInt32.

VisitLiteralInt64 ( QilLiteral ndLong ) : QilNode

Generate code for QilNodeType.LiteralInt64.

VisitLiteralQName ( QilName ndQName ) : QilNode

Generate code for QilNodeType.LiteralQName.

VisitLiteralString ( QilLiteral ndStr ) : QilNode

Generate code for QilNodeType.LiteralString.

VisitLocalNameOf ( QilUnary ndName ) : QilNode

Generate code for QilNodeType.LocalNameOf.

VisitLoop ( QilLoop ndLoop ) : QilNode

Generate code for a QilNodeType.Loop.

VisitLt ( QilBinary ndLt ) : QilNode

Generate code for QilNodeType.Lt.

VisitMaximum ( QilUnary ndMax ) : QilNode

Generate code for QilNodeType.Maximum.

VisitMinimum ( QilUnary ndMin ) : QilNode

Generate code for QilNodeType.Minimum.

VisitModulo ( QilBinary ndMod ) : QilNode

Generate code for QilNodeType.Modulo.

VisitMultiply ( QilBinary ndMul ) : QilNode

Generate code for QilNodeType.Multiply.

VisitNameOf ( QilUnary ndName ) : QilNode

Generate code for QilNodeType.NameOf.

VisitNamespaceDecl ( QilBinary ndNmsp ) : QilNode

Generate code for QilNodeType.NamespaceDecl.

VisitNamespaceUriOf ( QilUnary ndName ) : QilNode

Generate code for QilNodeType.NamespaceUriOf.

VisitNe ( QilBinary ndNe ) : QilNode

Generate code for QilNodeType.Ne.

VisitNegate ( QilUnary ndNeg ) : QilNode

Generate code for QilNodeType.Negate.

VisitNodeRange ( QilBinary ndRange ) : QilNode

Find physical query plan for QilNodeType.NodeRange.

VisitNop ( QilUnary ndNop ) : QilNode

Generate code for QilNodeType.Nop.

VisitNot ( QilUnary ndNot ) : QilNode

Generate code for QilNodeType.Not.

BranchingContext.OnFalse context: not(expr1) ==> if (expr1) goto LabelParent; BranchingContext.OnTrue context: not(expr1) ==> if (!expr1) goto LabelParent; BranchingContext.None context: not(expr1) ==> if (expr1) goto LabelTemp; push false(); goto LabelSkip; LabelTemp: push true(); LabelSkip:

VisitOptimizeBarrier ( QilUnary ndBarrier ) : QilNode

Generate code for QilNodeType.OptimizeBarrier.

VisitOr ( QilBinary ndOr ) : QilNode

Generate code for QilNodeType.Or.

BranchingContext.OnFalse context: (expr1) or (expr2) ==> if (expr1) goto LabelTemp; if (!expr2) goto LabelParent; LabelTemp: BranchingContext.OnTrue context: (expr1) or (expr2) ==> if (expr1) goto LabelParent; if (expr1) goto LabelParent; BranchingContext.None context: (expr1) or (expr2) ==> if (expr1) goto LabelTemp; if (expr1) goto LabelTemp; push false(); goto LabelSkip; LabelTemp: push true(); LabelSkip:

VisitPICtor ( QilBinary ndPI ) : QilNode

Generate code for QilNodeType.PICtor.

VisitParameter ( QilParameter ndParameter ) : QilNode

Generate code for a QilNodeType.Parameter.

VisitParent ( QilUnary ndParent ) : QilNode

Generate code for for QilNodeType.Parent.

VisitPositionOf ( QilUnary ndPos ) : QilNode

Generate code for QilNodeType.PositionOf.

VisitPreceding ( QilUnary ndPrec ) : QilNode

Find physical query plan for QilNodeType.Preceding.

VisitPrecedingSibling ( QilUnary ndPreSib ) : QilNode

Find physical query plan for QilNodeType.PrecedingSibling.

VisitPrefixOf ( QilUnary ndName ) : QilNode

Generate code for QilNodeType.PrefixOf.

VisitRawTextCtor ( QilUnary ndText ) : QilNode

Generate code for QilNodeType.RawTextCtor.

VisitRoot ( QilUnary ndRoot ) : QilNode

Generate code for for QilNodeType.Root.

VisitRtfCtor ( QilBinary ndRtf ) : QilNode

Generate code for for QilNodeType.RtfCtor.

VisitSequence ( QilList ndSeq ) : QilNode

Find physical query plan for QilNodeType.Sequence.

VisitSort ( QilLoop ndSort ) : QilNode

Generate code for QilNodeType.Sort.

VisitStrConcat ( QilStrConcat ndStrConcat ) : QilNode

Generate code for QilNodeType.StrConcat.

VisitStrLength ( QilUnary ndLen ) : QilNode

Generate code for QilNodeType.StrLength.

VisitStrParseQName ( QilBinary ndParsedTagName ) : QilNode

Generate code for QilNodeType.StrParseQName.

VisitSubtract ( QilBinary ndMinus ) : QilNode

Generate code for QilNodeType.Subtract.

VisitSum ( QilUnary ndSum ) : QilNode

Generate code for QilNodeType.Sum.

VisitTextCtor ( QilUnary ndText ) : QilNode

Generate code for QilNodeType.TextCtor.

VisitTrue ( QilNode ndTrue ) : QilNode

Generate code for QilNodeType.True.

BranchingContext.OnFalse context: [nothing] BranchingContext.OnTrue context: goto LabelParent; BranchingContext.None context: push true();

VisitTypeAssert ( QilTargetType ndTypeAssert ) : QilNode

Find physical query plan for QilNodeType.TypeAssert.

VisitUnion ( QilBinary ndUnion ) : QilNode

Generate code for QilNodeType.Union.

VisitWarning ( QilUnary ndWarning ) : QilNode

Generate code for QilNodeType.Warning.

VisitXPathFollowing ( QilUnary ndFoll ) : QilNode

Find physical query plan for QilNodeType.XPathFollowing.

VisitXPathNamespace ( QilUnary ndNmsp ) : QilNode

Find physical query plan for QilNodeType.XPathNamespace.

VisitXPathNodeValue ( QilUnary ndVal ) : QilNode

Generate code for QilNodeType.XPathNodeValue.

VisitXPathPreceding ( QilUnary ndPrec ) : QilNode

Find physical query plan for QilNodeType.XPathPreceding.

VisitXmlContext ( QilNode ndCtxt ) : QilNode

Generate code for QilNodeType.XmlContext.

Generates code to retrieve the default document using the XmlResolver.

VisitXsltConvert ( QilTargetType ndConv ) : QilNode

Generate code for QilNodeType.XsltConvert.

VisitXsltCopy ( QilBinary ndCopy ) : QilNode

Generate code for QilNodeType.XsltCopy.

VisitXsltCopyOf ( QilUnary ndCopyOf ) : QilNode

Generate code for QilNodeType.XsltCopyOf.

VisitXsltGenerateId ( QilUnary ndGenId ) : QilNode

Generate code for QilNodeType.XsltGenerateId.

VisitXsltInvokeEarlyBound ( QilInvokeEarlyBound ndInvoke ) : QilNode

Generate code for for QilNodeType.XsltInvokeEarlyBound.

VisitXsltInvokeLateBound ( QilInvokeLateBound ndInvoke ) : QilNode

Generate code for for QilNodeType.XsltInvokeLateBound.

Private Methods

Method Description
AfterEndChecks ( QilNode ndCtor ) : void

This method is called after calling any WriteEnd??? method. It generates code to perform runtime construction checks separately. This should only be called if the XmlQueryOutput::EndElementChk method will *not* be called.

ArithmeticOp ( QilBinary ndOp ) : QilNode

Generate code for two-argument arithmetic operations.

BeforeStartChecks ( QilNode ndCtor ) : void

This method is called before calling any WriteEnd??? method. It generates code to perform runtime construction checks separately. This should only be called if the XmlQueryOutput::StartElementChk method will *not* be called.

CachesResult ( QilNode nd ) : bool

Returns true if the specified QilExpression node type is *guaranteed* to cache its results in an XmlQuerySequence, where items in the cache are stored using the default storage type.

CheckEnumAttrs ( XmlILConstructInfo info ) : bool

Return true if a runtime check needs to be made in order to transition into the EnumAttrs state.

CheckWithinContent ( XmlILConstructInfo info ) : bool

Return true if a runtime check needs to be made in order to transition into the WithinContent state.

ClrCompare ( QilNodeType relOp, XmlTypeCode code ) : void

For QilExpression types that map directly to CLR primitive types, the built-in CLR comparison operators can be used to perform the specified relational operation.

Compare ( QilBinary ndComp ) : void

Generate code for comparison operations.

ComparePosition ( QilBinary ndComp ) : void

Generate code for QilNodeType.VisitBefore and QilNodeType.VisitAfter.

ConditionalBranch ( QilNode ndBranch, Type itemStorageType, LocalBuilder locResult ) : void

Generate code for one of the branches of QilNodeType.Conditional.

CopySequence ( QilNode nd ) : void

Iterate over items produced by the "nd" expression and copy each item to output.

CreateAggregator ( QilUnary ndAgg, string aggName, XmlILStorageMethods methods, MethodInfo methAgg, MethodInfo methResult ) : QilNode

Generate code for QilNodeType.Sum, QilNodeType.Average, QilNodeType.Minimum, and QilNodeType.Maximum.

CreateContainerIterator ( QilUnary ndDod, string iterName, Type iterType, MethodInfo methCreate, MethodInfo methNext, XmlNodeKindFlags kinds, QilName ndName, TriState orSelf ) : void

Generate boiler-plate code to create an Xml iterator that controls a nested iterator.

Iterator iter; iter.Create(filter [, orSelf]); ...nested iterator... navInput = nestedNested; goto LabelCall; LabelNext: navInput = null; LabelCall: switch (iter.MoveNext(navInput)) { case IteratorState.NoMoreNodes: goto LabelNextCtxt; case IteratorState.NextInputNode: goto LabelNextNested; }

CreateFilteredIterator ( QilNode ndCtxt, string iterName, Type iterType, MethodInfo methCreate, MethodInfo methNext, XmlNodeKindFlags kinds, QilName ndName, TriState orSelf, QilNode ndEnd ) : void

Generate boiler-plate code to create an Xml iterator that uses an XmlNavigatorFilter to filter items.

Iterator iter; iter.Create(navCtxt, filter [, orSelf] [, navEnd]); LabelNext: if (!iter.MoveNext()) goto LabelNextCtxt;

CreateSetIterator ( QilBinary ndSet, string iterName, Type iterType, MethodInfo methCreate, MethodInfo methNext ) : QilNode

Generate code to combine nodes from two nested iterators using Union, Intersection, or Difference semantics.

CreateSimpleIterator ( QilNode ndCtxt, string iterName, Type iterType, MethodInfo methCreate, MethodInfo methNext ) : void

Generate boiler-plate code to create a simple Xml iterator.

Iterator iter; iter.Create(navCtxt); LabelNext: if (!iter.MoveNext()) goto LabelNextCtxt;

ElementCachesAttributes ( XmlILConstructInfo info ) : bool

Returns true if the specified element should cache attributes.

EndBinding ( QilIterator ndIter ) : void

Mark iterator variables as out-of-scope.

EndConjunctiveTests ( BranchingContext brctxt, Label lblBranch, Label lblOnFalse ) : void

Anchor any remaining labels.

EndNestedIterator ( QilNode nd ) : void

End construction of the current iterator.

EndWriterLoop ( QilNode nd, bool hasOnEnd, Label lblOnEnd ) : void

Construction within a loop is ending. If transition from non-Any to Any state occurs, then ensure that runtime state will be set.

Function ( QilFunction ndFunc ) : void

Generate code for the specified function.

GenerateConcat ( QilNode ndStr, LocalBuilder locStringConcat ) : void

Generate code to concatenate string values returned by expression "ndStr" using the StringConcat helper class.

GenerateContainerIterator ( QilNode nd, LocalBuilder locIter, Label lblOnEndNested, MethodInfo methNext, Type itemStorageType ) : void

Generate boiler-plate code that calls MoveNext on an Xml iterator that controls a nested iterator. Iterator should have already been created by calling code.

... goto LabelCall; LabelNext: navCtxt = null; LabelCall: switch (iter.MoveNext(navCtxt)) { case IteratorState.NoMoreNodes: goto LabelNextCtxt; case IteratorState.NextInputNode: goto LabelNextNested; }

GenerateSimpleIterator ( Type itemStorageType, LocalBuilder locIter, MethodInfo methNext ) : void

Generate boiler-plate code that calls MoveNext on a simple Xml iterator. Iterator should have already been created by calling code.

... LabelNext: if (!iter.MoveNext()) goto LabelNextCtxt;

GetItemStorageType ( QilNode nd ) : Type

Shortcut call to XmlILTypeHelper.GetStorageType, using an expression's prime type.

GetItemStorageType ( XmlQueryType typ ) : Type

Shortcut call to XmlILTypeHelper.GetStorageType, using the prime type.

GetStorageType ( QilNode nd ) : Type

Shortcut call to XmlILTypeHelper.GetStorageType.

GetStorageType ( XmlQueryType typ ) : Type

Shortcut call to XmlILTypeHelper.GetStorageType.

GetXsltConvertMethod ( XmlQueryType typSrc, XmlQueryType typDst, MethodInfo &meth ) : bool

Get the XsltConvert method that converts from "typSrc" to "typDst". Return false if no such method exists. This conversion matrix should match the one in XsltConvert.ExternalValueToExternalValue.

HandleDodPatterns ( QilUnary ndDod ) : bool

There are a number of path patterns that can be rooted at DocOrderDistinct nodes. Determine whether one of these patterns has been previously matched on "ndDod". If so, generate code for the pattern and return true. Otherwise, just return false.

HandleFilterPatterns ( QilLoop ndFilter ) : bool

There are a number of path patterns that can be rooted at Filter nodes. Determine whether one of these patterns has been previously matched on "ndFilter". If so, generate code for the pattern and return true. Otherwise, just return false.

IsNodeTypeUnion ( XmlNodeKindFlags xmlTypes ) : bool

Return true if more than one node type is set.

LoadNameAndType ( XPathNodeType nodeType, QilNode ndName, bool isStart, bool callChk ) : GenerateNameType

Load XmlQueryOutput, load a name (computed or literal) and load an index to an Xml schema type. Return an enumeration that specifies what kind of name was loaded.

LoadSelectFilter ( XmlNodeKindFlags xmlTypes, QilName ndName ) : void

Load an XmlNavigatorFilter that matches only the specified name and types onto the stack.

MatchesNodeKinds ( QilTargetType ndIsType, XmlQueryType typDerived, XmlQueryType typBase ) : bool

Faster code can be generated if type test is just a node kind test. If this special case is detected, then generate code and return true. Otherwise, return false, and a call to MatchesXmlType will be generated instead.

MightHaveNamespacesAfterAttributes ( XmlILConstructInfo info ) : bool

Returns true if the specified node's owner element might have local namespaces added to it after attributes have already been added.

NestedConstruction ( QilNode nd ) : void

Generate code to cache a sequence of items that are pushed to output.

NestedVisit ( QilNode nd ) : void

Calls NestedVisit(QilNode, Type, bool), storing result in the default storage type for "nd".

NestedVisit ( QilNode nd, Label lblOnEnd ) : void

Recursively generate code to iterate over the results of the "nd" expression. When the expression has been fully iterated, it will jump to "lblOnEnd".

NestedVisit ( QilNode nd, Type itemStorageType, bool isCached ) : void

Recursively generate code to iterate over the results of the "nd" expression. If "nd" is pushed to the writer, then there are no results. If "nd" is a singleton expression and isCached is false, then generate code to construct the singleton. Otherwise, cache the sequence in an XmlQuerySequence object. Ensure that all items are converted to the specified "itemStorageType".

NestedVisitEnsureCache ( QilNode nd, Type itemStorageType ) : void

Generate code for the QilExpression node and ensure that results are fully cached as an XmlQuerySequence. All results should be converted to "itemStorageType" before being added to the cache.

NestedVisitEnsureLocal ( QilNode nd, LocalBuilder loc ) : void

Call NestedVisit(QilNode) and ensure that result is stored in local variable "loc".

NestedVisitEnsureStack ( QilNode nd ) : void

Call NestedVisit(QilNode) and ensure that result is pushed onto the IL stack.

NestedVisitEnsureStack ( QilNode ndLeft, QilNode ndRight ) : void

Generate code for both QilExpression nodes and ensure that each result is pushed onto the IL stack.

NestedVisitEnsureStack ( QilNode nd, Type itemStorageType, bool isCached ) : void

Call NestedVisit(QilNode, Type, bool) and ensure that result is pushed onto the IL stack.

NestedVisitWithBranch ( QilNode nd, BranchingContext brctxt, Label lblBranch ) : void

Start a nested iterator in a branching context and recursively generate code for the specified QilExpression node.

PrepareGlobalValues ( QilList globalIterators ) : void

Create IteratorDescriptor for each global value. This pre-visit is necessary because a global early in the list may reference a global later in the list and therefore expect its IteratorDescriptor to already be initialized.

QilConstructorToNodeType ( QilNodeType typ ) : XPathNodeType

Map a QilExpression constructor type into the XPathNodeType enumeration.

QilXmlToXPathNodeType ( XmlNodeKindFlags xmlTypes ) : XPathNodeType

Map the XmlNodeKindFlags enumeration into the XPathNodeType enumeration.

Sequence ( QilList ndSeq ) : void

Generate code for QilNodeType.Sequence, when sort-merging to retain document order is not necessary.

StartBinding ( QilIterator ndIter ) : void

Generate code for a Let, For, or Parameter iterator. Bind iterated value to a variable.

StartConjunctiveTests ( BranchingContext brctxt, Label lblBranch ) : Label

Fixup branching context for all but the last test in a conjunctive (Logical And) expression. Return a temporary label which will be passed to StartLastAndBranch() and EndAndBranch().

StartForBinding ( QilIterator ndFor, OptimizerPatterns patt ) : void

Bind values produced by the "ndFor" expression to a non-stack location that can later be referenced.

StartLastConjunctiveTest ( BranchingContext brctxt, Label lblBranch, Label lblOnFalse ) : void

Fixup branching context for the last test in a conjunctive (Logical And) expression.

StartNestedIterator ( QilNode nd ) : void

Start construction of a new nested iterator. If this.iterCurr == null, then the new iterator is a top-level, or root iterator. Otherwise, the new iterator will be nested within the current iterator.

StartNestedIterator ( QilNode nd, Label lblOnEnd ) : void

Calls StartNestedIterator(nd) and also sets up the nested iterator to branch to "lblOnEnd" when iteration is complete.

StartWriterLoop ( QilNode nd, bool &hasOnEnd, Label &lblOnEnd ) : void

Construction within a loop is starting. If transition from non-Any to Any state occurs, then ensure that runtime state will be set.

SyncToNavigator ( LocalBuilder locNav, QilNode ndCtxt ) : void

Ensure that the "locNav" navigator is positioned to the context node "ndCtxt".

TryNameCompare ( QilNodeType relOp, QilNode ndFirst, QilNode ndSecond ) : bool

If the comparison involves a qname, then perform comparison using atoms and return true. Otherwise, return false (caller will perform comparison).

TryZeroCompare ( QilNodeType relOp, QilNode ndFirst, QilNode ndSecond ) : bool

If the first argument is a constant value that evaluates to zero, then a more optimal instruction sequence can be generated that does not have to push the zero onto the stack. Instead, a Brfalse or Brtrue instruction can be used.

VisitEmpty ( QilNode nd ) : void

Generate code for the empty sequence.

VisitGlobalValues ( QilList globalIterators ) : void

Visit each global variable or parameter. Create a IteratorDescriptor for each global value. Generate code for default values.

VisitNodeProperty ( QilUnary ndProp ) : QilNode

Generate code to push the local name, namespace uri, or qname of the context navigator.

VisitSortKey ( QilSortKey ndKey, LocalBuilder locKeys ) : void

Generate code to add a (value, collation) sort key to the XmlSortKeyAccumulator.

VisitStrParseQName ( QilBinary ndParsedTagName, bool preservePrefix ) : void

Generate code for QilNodeType.StrParseQName.

VisitTextCtor ( QilUnary ndText, bool disableOutputEscaping ) : QilNode

Generate code for QilNodeType.TextCtor and QilNodeType.RawTextCtor.

ZeroCompare ( QilNodeType relOp, bool isBoolVal ) : void

Generate code to compare the top stack value to 0 by using the Brfalse or Brtrue instructions, which avoid pushing zero onto the stack. Both of these instructions test for null/zero/false.

Method Details

StartLetBinding() public method

Bind values in the "ndLet" expression to a non-stack location that can later be referenced.
public StartLetBinding ( QilIterator ndLet ) : void
ndLet System.Xml.Xsl.Qil.QilIterator
return void

Visit() protected method

Generate a query plan for the QilExpression subgraph.
protected Visit ( QilNode nd ) : QilNode
nd QilNode
return QilNode

Visit() public method

Visits the specified QilExpression graph and generates MSIL code.
public Visit ( QilExpression qil, GenerateHelper helper, MethodInfo methRoot ) : void
qil System.Xml.Xsl.Qil.QilExpression
helper GenerateHelper
methRoot System.Reflection.MethodInfo
return void

VisitAdd() protected method

Generate code for QilNodeType.Add.
protected VisitAdd ( QilBinary ndPlus ) : QilNode
ndPlus System.Xml.Xsl.Qil.QilBinary
return QilNode

VisitAfter() protected method

Generate code for QilNodeType.VisitAfter.
protected VisitAfter ( QilBinary ndAfter ) : QilNode
ndAfter System.Xml.Xsl.Qil.QilBinary
return QilNode

VisitAncestor() protected method

Find physical query plan for QilNodeType.Ancestor.
protected VisitAncestor ( QilUnary ndAnc ) : QilNode
ndAnc System.Xml.Xsl.Qil.QilUnary
return QilNode

VisitAncestorOrSelf() protected method

Find physical query plan for QilNodeType.AncestorOrSelf.
protected VisitAncestorOrSelf ( QilUnary ndAnc ) : QilNode
ndAnc System.Xml.Xsl.Qil.QilUnary
return QilNode

VisitAnd() protected method

Generate code for QilNodeType.And.
BranchingContext.OnFalse context: (expr1) and (expr2) ==> if (!expr1) goto LabelParent; if (!expr2) goto LabelParent; BranchingContext.OnTrue context: (expr1) and (expr2) ==> if (!expr1) goto LabelTemp; if (expr1) goto LabelParent; LabelTemp: BranchingContext.None context: (expr1) and (expr2) ==> if (!expr1) goto LabelTemp; if (!expr1) goto LabelTemp; push true(); goto LabelSkip; LabelTemp: push false(); LabelSkip:
protected VisitAnd ( QilBinary ndAnd ) : QilNode
ndAnd System.Xml.Xsl.Qil.QilBinary
return QilNode

VisitAttribute() protected method

Generate code for for QilNodeType.Attribute.
protected VisitAttribute ( QilBinary ndAttr ) : QilNode
ndAttr System.Xml.Xsl.Qil.QilBinary
return QilNode

VisitAttributeCtor() protected method

Generate code for QilNodeType.AttributeCtor.
protected VisitAttributeCtor ( QilBinary ndAttr ) : QilNode
ndAttr System.Xml.Xsl.Qil.QilBinary
return QilNode

VisitAverage() protected method

Generate code for QilNodeType.Average.
protected VisitAverage ( QilUnary ndAvg ) : QilNode
ndAvg System.Xml.Xsl.Qil.QilUnary
return QilNode

VisitBefore() protected method

Generate code for QilNodeType.VisitBefore.
protected VisitBefore ( QilBinary ndBefore ) : QilNode
ndBefore System.Xml.Xsl.Qil.QilBinary
return QilNode

VisitChildren() protected method

VisitChildren should never be called.
protected VisitChildren ( QilNode parent ) : QilNode
parent QilNode
return QilNode

VisitChoice() protected method

Generate code for QilNodeType.Choice.
protected VisitChoice ( QilChoice ndChoice ) : QilNode
ndChoice System.Xml.Xsl.Qil.QilChoice
return QilNode

VisitCommentCtor() protected method

Generate code for QilNodeType.CommentCtor.
protected VisitCommentCtor ( QilUnary ndComment ) : QilNode
ndComment System.Xml.Xsl.Qil.QilUnary
return QilNode

VisitConditional() protected method

Generate code for QilNodeType.Conditional.
protected VisitConditional ( QilTernary ndCond ) : QilNode
ndCond System.Xml.Xsl.Qil.QilTernary
return QilNode

VisitContent() protected method

Generate code for for QilNodeType.Content.
protected VisitContent ( QilUnary ndContent ) : QilNode
ndContent System.Xml.Xsl.Qil.QilUnary
return QilNode

VisitDataSource() protected method

Generate code for QilNodeType.DataSource.
Generates code to retrieve a document using the XmlResolver.
protected VisitDataSource ( QilDataSource ndSrc ) : QilNode
ndSrc System.Xml.Xsl.Qil.QilDataSource
return QilNode

VisitDeref() protected method

Generate code for for QilNodeType.Deref.
protected VisitDeref ( QilBinary ndDeref ) : QilNode
ndDeref System.Xml.Xsl.Qil.QilBinary
return QilNode

VisitDescendant() protected method

Find physical query plan for QilNodeType.Descendant.
protected VisitDescendant ( QilUnary ndDesc ) : QilNode
ndDesc System.Xml.Xsl.Qil.QilUnary
return QilNode

VisitDescendantOrSelf() protected method

Generate code for for QilNodeType.DescendantOrSelf.
protected VisitDescendantOrSelf ( QilUnary ndDesc ) : QilNode
ndDesc System.Xml.Xsl.Qil.QilUnary
return QilNode

VisitDifference() protected method

Generate code for QilNodeType.Difference.
protected VisitDifference ( QilBinary ndDiff ) : QilNode
ndDiff System.Xml.Xsl.Qil.QilBinary
return QilNode

VisitDivide() protected method

Generate code for QilNodeType.Divide.
protected VisitDivide ( QilBinary ndDiv ) : QilNode
ndDiv System.Xml.Xsl.Qil.QilBinary
return QilNode

VisitDocOrderDistinct() protected method

Generate code for for QilNodeType.DocOrderDistinct.
protected VisitDocOrderDistinct ( QilUnary ndDod ) : QilNode
ndDod System.Xml.Xsl.Qil.QilUnary
return QilNode

VisitDocumentCtor() protected method

Generate code for QilNodeType.DocumentCtor.
protected VisitDocumentCtor ( QilUnary ndDoc ) : QilNode
ndDoc System.Xml.Xsl.Qil.QilUnary
return QilNode

VisitElementCtor() protected method

Generate code for QilNodeType.ElementCtor.
protected VisitElementCtor ( QilBinary ndElem ) : QilNode
ndElem System.Xml.Xsl.Qil.QilBinary
return QilNode

VisitEq() protected method

Generate code for QilNodeType.Eq.
protected VisitEq ( QilBinary ndEq ) : QilNode
ndEq System.Xml.Xsl.Qil.QilBinary
return QilNode

VisitError() protected method

Generate code for QilNodeType.Error.
protected VisitError ( QilUnary ndErr ) : QilNode
ndErr System.Xml.Xsl.Qil.QilUnary
return QilNode

VisitFalse() protected method

Generate code for QilNodeType.False.
BranchingContext.OnFalse context: goto LabelParent; BranchingContext.OnTrue context: [nothing] BranchingContext.None context: push false();
protected VisitFalse ( QilNode ndFalse ) : QilNode
ndFalse QilNode
return QilNode

VisitFilter() protected method

Generate code for a QilNodeType.Filter.
protected VisitFilter ( QilLoop ndFilter ) : QilNode
ndFilter System.Xml.Xsl.Qil.QilLoop
return QilNode

VisitFollowingSibling() protected method

Find physical query plan for QilNodeType.FollowingSibling.
protected VisitFollowingSibling ( QilUnary ndFollSib ) : QilNode
ndFollSib System.Xml.Xsl.Qil.QilUnary
return QilNode

VisitFor() protected method

Generate code for a QilNodeType.For.
protected VisitFor ( QilIterator ndFor ) : QilNode
ndFor System.Xml.Xsl.Qil.QilIterator
return QilNode

VisitGe() protected method

Generate code for QilNodeType.Ne.
protected VisitGe ( QilBinary ndGe ) : QilNode
ndGe System.Xml.Xsl.Qil.QilBinary
return QilNode

VisitGt() protected method

Generate code for QilNodeType.Gt.
protected VisitGt ( QilBinary ndGt ) : QilNode
ndGt System.Xml.Xsl.Qil.QilBinary
return QilNode

VisitIntersection() protected method

Generate code for QilNodeType.Intersection.
protected VisitIntersection ( QilBinary ndInter ) : QilNode
ndInter System.Xml.Xsl.Qil.QilBinary
return QilNode

VisitInvoke() protected method

Generate code for for QilNodeType.Invoke.
protected VisitInvoke ( QilInvoke ndInvoke ) : QilNode
ndInvoke System.Xml.Xsl.Qil.QilInvoke
return QilNode

VisitIs() protected method

Generate code for QilNodeType.VisitIs.
protected VisitIs ( QilBinary ndIs ) : QilNode
ndIs System.Xml.Xsl.Qil.QilBinary
return QilNode

VisitIsEmpty() protected method

Generate code for QilNodeType.IsEmpty.
BranchingContext.OnFalse context: is-empty(expr) ==> foreach (item in expr) goto LabelBranch; BranchingContext.OnTrue context: is-empty(expr) ==> foreach (item in expr) break; ... LabelOnEnd: (called if foreach is empty) goto LabelBranch; BranchingContext.None context: is-empty(expr) ==> foreach (item in expr) break; push true(); ... LabelOnEnd: (called if foreach is empty) push false();
protected VisitIsEmpty ( QilUnary ndIsEmpty ) : QilNode
ndIsEmpty System.Xml.Xsl.Qil.QilUnary
return QilNode

VisitIsType() protected method

Generate code for QilNodeType.IsType.
protected VisitIsType ( QilTargetType ndIsType ) : QilNode
ndIsType System.Xml.Xsl.Qil.QilTargetType
return QilNode

VisitLe() protected method

Generate code for QilNodeType.Le.
protected VisitLe ( QilBinary ndLe ) : QilNode
ndLe System.Xml.Xsl.Qil.QilBinary
return QilNode

VisitLength() protected method

Generate code for QilNodeType.Length.
int length = 0; foreach (item in expr) length++;
protected VisitLength ( QilUnary ndSetLen ) : QilNode
ndSetLen System.Xml.Xsl.Qil.QilUnary
return QilNode

VisitLet() protected method

Generate code for a QilNodeType.Let.
protected VisitLet ( QilIterator ndLet ) : QilNode
ndLet System.Xml.Xsl.Qil.QilIterator
return QilNode

VisitLiteralDecimal() protected method

Generate code for QilNodeType.LiteralDecimal.
protected VisitLiteralDecimal ( QilLiteral ndDec ) : QilNode
ndDec System.Xml.Xsl.Qil.QilLiteral
return QilNode

VisitLiteralDouble() protected method

Generate code for QilNodeType.LiteralDouble.
protected VisitLiteralDouble ( QilLiteral ndDbl ) : QilNode
ndDbl System.Xml.Xsl.Qil.QilLiteral
return QilNode

VisitLiteralInt32() protected method

Generate code for QilNodeType.LiteralInt32.
protected VisitLiteralInt32 ( QilLiteral ndInt ) : QilNode
ndInt QilLiteral
return QilNode

VisitLiteralInt64() protected method

Generate code for QilNodeType.LiteralInt64.
protected VisitLiteralInt64 ( QilLiteral ndLong ) : QilNode
ndLong QilLiteral
return QilNode

VisitLiteralQName() protected method

Generate code for QilNodeType.LiteralQName.
protected VisitLiteralQName ( QilName ndQName ) : QilNode
ndQName QilName
return QilNode

VisitLiteralString() protected method

Generate code for QilNodeType.LiteralString.
protected VisitLiteralString ( QilLiteral ndStr ) : QilNode
ndStr QilLiteral
return QilNode

VisitLocalNameOf() protected method

Generate code for QilNodeType.LocalNameOf.
protected VisitLocalNameOf ( QilUnary ndName ) : QilNode
ndName QilUnary
return QilNode

VisitLoop() protected method

Generate code for a QilNodeType.Loop.
protected VisitLoop ( QilLoop ndLoop ) : QilNode
ndLoop QilLoop
return QilNode

VisitLt() protected method

Generate code for QilNodeType.Lt.
protected VisitLt ( QilBinary ndLt ) : QilNode
ndLt QilBinary
return QilNode

VisitMaximum() protected method

Generate code for QilNodeType.Maximum.
protected VisitMaximum ( QilUnary ndMax ) : QilNode
ndMax QilUnary
return QilNode

VisitMinimum() protected method

Generate code for QilNodeType.Minimum.
protected VisitMinimum ( QilUnary ndMin ) : QilNode
ndMin QilUnary
return QilNode

VisitModulo() protected method

Generate code for QilNodeType.Modulo.
protected VisitModulo ( QilBinary ndMod ) : QilNode
ndMod QilBinary
return QilNode

VisitMultiply() protected method

Generate code for QilNodeType.Multiply.
protected VisitMultiply ( QilBinary ndMul ) : QilNode
ndMul QilBinary
return QilNode

VisitNameOf() protected method

Generate code for QilNodeType.NameOf.
protected VisitNameOf ( QilUnary ndName ) : QilNode
ndName QilUnary
return QilNode

VisitNamespaceDecl() protected method

Generate code for QilNodeType.NamespaceDecl.
protected VisitNamespaceDecl ( QilBinary ndNmsp ) : QilNode
ndNmsp QilBinary
return QilNode

VisitNamespaceUriOf() protected method

Generate code for QilNodeType.NamespaceUriOf.
protected VisitNamespaceUriOf ( QilUnary ndName ) : QilNode
ndName QilUnary
return QilNode

VisitNe() protected method

Generate code for QilNodeType.Ne.
protected VisitNe ( QilBinary ndNe ) : QilNode
ndNe QilBinary
return QilNode

VisitNegate() protected method

Generate code for QilNodeType.Negate.
protected VisitNegate ( QilUnary ndNeg ) : QilNode
ndNeg QilUnary
return QilNode

VisitNodeRange() protected method

Find physical query plan for QilNodeType.NodeRange.
protected VisitNodeRange ( QilBinary ndRange ) : QilNode
ndRange QilBinary
return QilNode

VisitNop() protected method

Generate code for QilNodeType.Nop.
protected VisitNop ( QilUnary ndNop ) : QilNode
ndNop QilUnary
return QilNode

VisitNot() protected method

Generate code for QilNodeType.Not.
BranchingContext.OnFalse context: not(expr1) ==> if (expr1) goto LabelParent; BranchingContext.OnTrue context: not(expr1) ==> if (!expr1) goto LabelParent; BranchingContext.None context: not(expr1) ==> if (expr1) goto LabelTemp; push false(); goto LabelSkip; LabelTemp: push true(); LabelSkip:
protected VisitNot ( QilUnary ndNot ) : QilNode
ndNot QilUnary
return QilNode

VisitOptimizeBarrier() protected method

Generate code for QilNodeType.OptimizeBarrier.
protected VisitOptimizeBarrier ( QilUnary ndBarrier ) : QilNode
ndBarrier QilUnary
return QilNode

VisitOr() protected method

Generate code for QilNodeType.Or.
BranchingContext.OnFalse context: (expr1) or (expr2) ==> if (expr1) goto LabelTemp; if (!expr2) goto LabelParent; LabelTemp: BranchingContext.OnTrue context: (expr1) or (expr2) ==> if (expr1) goto LabelParent; if (expr1) goto LabelParent; BranchingContext.None context: (expr1) or (expr2) ==> if (expr1) goto LabelTemp; if (expr1) goto LabelTemp; push false(); goto LabelSkip; LabelTemp: push true(); LabelSkip:
protected VisitOr ( QilBinary ndOr ) : QilNode
ndOr QilBinary
return QilNode

VisitPICtor() protected method

Generate code for QilNodeType.PICtor.
protected VisitPICtor ( QilBinary ndPI ) : QilNode
ndPI QilBinary
return QilNode

VisitParameter() protected method

Generate code for a QilNodeType.Parameter.
protected VisitParameter ( QilParameter ndParameter ) : QilNode
ndParameter QilParameter
return QilNode

VisitParent() protected method

Generate code for for QilNodeType.Parent.
protected VisitParent ( QilUnary ndParent ) : QilNode
ndParent QilUnary
return QilNode

VisitPositionOf() protected method

Generate code for QilNodeType.PositionOf.
protected VisitPositionOf ( QilUnary ndPos ) : QilNode
ndPos QilUnary
return QilNode

VisitPreceding() protected method

Find physical query plan for QilNodeType.Preceding.
protected VisitPreceding ( QilUnary ndPrec ) : QilNode
ndPrec QilUnary
return QilNode

VisitPrecedingSibling() protected method

Find physical query plan for QilNodeType.PrecedingSibling.
protected VisitPrecedingSibling ( QilUnary ndPreSib ) : QilNode
ndPreSib QilUnary
return QilNode

VisitPrefixOf() protected method

Generate code for QilNodeType.PrefixOf.
protected VisitPrefixOf ( QilUnary ndName ) : QilNode
ndName QilUnary
return QilNode

VisitRawTextCtor() protected method

Generate code for QilNodeType.RawTextCtor.
protected VisitRawTextCtor ( QilUnary ndText ) : QilNode
ndText QilUnary
return QilNode

VisitRoot() protected method

Generate code for for QilNodeType.Root.
protected VisitRoot ( QilUnary ndRoot ) : QilNode
ndRoot QilUnary
return QilNode

VisitRtfCtor() protected method

Generate code for for QilNodeType.RtfCtor.
protected VisitRtfCtor ( QilBinary ndRtf ) : QilNode
ndRtf QilBinary
return QilNode

VisitSequence() protected method

Find physical query plan for QilNodeType.Sequence.
protected VisitSequence ( QilList ndSeq ) : QilNode
ndSeq QilList
return QilNode

VisitSort() protected method

Generate code for QilNodeType.Sort.
protected VisitSort ( QilLoop ndSort ) : QilNode
ndSort QilLoop
return QilNode

VisitStrConcat() protected method

Generate code for QilNodeType.StrConcat.
protected VisitStrConcat ( QilStrConcat ndStrConcat ) : QilNode
ndStrConcat QilStrConcat
return QilNode

VisitStrLength() protected method

Generate code for QilNodeType.StrLength.
protected VisitStrLength ( QilUnary ndLen ) : QilNode
ndLen QilUnary
return QilNode

VisitStrParseQName() protected method

Generate code for QilNodeType.StrParseQName.
protected VisitStrParseQName ( QilBinary ndParsedTagName ) : QilNode
ndParsedTagName QilBinary
return QilNode

VisitSubtract() protected method

Generate code for QilNodeType.Subtract.
protected VisitSubtract ( QilBinary ndMinus ) : QilNode
ndMinus QilBinary
return QilNode

VisitSum() protected method

Generate code for QilNodeType.Sum.
protected VisitSum ( QilUnary ndSum ) : QilNode
ndSum QilUnary
return QilNode

VisitTextCtor() protected method

Generate code for QilNodeType.TextCtor.
protected VisitTextCtor ( QilUnary ndText ) : QilNode
ndText QilUnary
return QilNode

VisitTrue() protected method

Generate code for QilNodeType.True.
BranchingContext.OnFalse context: [nothing] BranchingContext.OnTrue context: goto LabelParent; BranchingContext.None context: push true();
protected VisitTrue ( QilNode ndTrue ) : QilNode
ndTrue QilNode
return QilNode

VisitTypeAssert() protected method

Find physical query plan for QilNodeType.TypeAssert.
protected VisitTypeAssert ( QilTargetType ndTypeAssert ) : QilNode
ndTypeAssert QilTargetType
return QilNode

VisitUnion() protected method

Generate code for QilNodeType.Union.
protected VisitUnion ( QilBinary ndUnion ) : QilNode
ndUnion QilBinary
return QilNode

VisitWarning() protected method

Generate code for QilNodeType.Warning.
protected VisitWarning ( QilUnary ndWarning ) : QilNode
ndWarning QilUnary
return QilNode

VisitXPathFollowing() protected method

Find physical query plan for QilNodeType.XPathFollowing.
protected VisitXPathFollowing ( QilUnary ndFoll ) : QilNode
ndFoll QilUnary
return QilNode

VisitXPathNamespace() protected method

Find physical query plan for QilNodeType.XPathNamespace.
protected VisitXPathNamespace ( QilUnary ndNmsp ) : QilNode
ndNmsp QilUnary
return QilNode

VisitXPathNodeValue() protected method

Generate code for QilNodeType.XPathNodeValue.
protected VisitXPathNodeValue ( QilUnary ndVal ) : QilNode
ndVal QilUnary
return QilNode

VisitXPathPreceding() protected method

Find physical query plan for QilNodeType.XPathPreceding.
protected VisitXPathPreceding ( QilUnary ndPrec ) : QilNode
ndPrec QilUnary
return QilNode

VisitXmlContext() protected method

Generate code for QilNodeType.XmlContext.
Generates code to retrieve the default document using the XmlResolver.
protected VisitXmlContext ( QilNode ndCtxt ) : QilNode
ndCtxt QilNode
return QilNode

VisitXsltConvert() protected method

Generate code for QilNodeType.XsltConvert.
protected VisitXsltConvert ( QilTargetType ndConv ) : QilNode
ndConv QilTargetType
return QilNode

VisitXsltCopy() protected method

Generate code for QilNodeType.XsltCopy.
protected VisitXsltCopy ( QilBinary ndCopy ) : QilNode
ndCopy QilBinary
return QilNode

VisitXsltCopyOf() protected method

Generate code for QilNodeType.XsltCopyOf.
protected VisitXsltCopyOf ( QilUnary ndCopyOf ) : QilNode
ndCopyOf QilUnary
return QilNode

VisitXsltGenerateId() protected method

Generate code for QilNodeType.XsltGenerateId.
protected VisitXsltGenerateId ( QilUnary ndGenId ) : QilNode
ndGenId QilUnary
return QilNode

VisitXsltInvokeEarlyBound() protected method

Generate code for for QilNodeType.XsltInvokeEarlyBound.
protected VisitXsltInvokeEarlyBound ( QilInvokeEarlyBound ndInvoke ) : QilNode
ndInvoke QilInvokeEarlyBound
return QilNode

VisitXsltInvokeLateBound() protected method

Generate code for for QilNodeType.XsltInvokeLateBound.
protected VisitXsltInvokeLateBound ( QilInvokeLateBound ndInvoke ) : QilNode
ndInvoke QilInvokeLateBound
return QilNode