本文整理汇总了C#中QilNodeType类的典型用法代码示例。如果您正苦于以下问题:C# QilNodeType类的具体用法?C# QilNodeType怎么用?C# QilNodeType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
QilNodeType类属于命名空间,在下文中一共展示了QilNodeType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: QilFunction
//-----------------------------------------------
// Constructor
//-----------------------------------------------
/// <summary>
/// Construct a node
/// </summary>
public QilFunction(QilNodeType nodeType, QilNode arguments, QilNode definition, QilNode sideEffects, XmlQueryType resultType)
: base(nodeType) {
this.arguments = arguments;
this.definition = definition;
this.sideEffects = sideEffects;
this.xmlType = resultType;
}
示例2: QilName
//-----------------------------------------------
// Constructor
//-----------------------------------------------
/// <summary>
/// Construct a new node
/// </summary>
public QilName(QilNodeType nodeType, string local, string uri, string prefix) : base(nodeType, null)
{
LocalName = local;
NamespaceUri = uri;
Prefix = prefix;
Value = this;
}
示例3: QilExpression
/// <summary>
/// Construct QIL from a rooted graph of QilNodes with a specific factory.
/// </summary>
public QilExpression(QilNodeType nodeType, QilNode root, QilFactory factory) : base(nodeType) {
this.factory = factory;
this.isDebug = factory.False();
XmlWriterSettings settings = new XmlWriterSettings();
settings.ConformanceLevel = ConformanceLevel.Auto;
this.defWSet = factory.LiteralObject(settings);
this.wsRules = factory.LiteralObject(new List<WhitespaceRule>());
this.funList = factory.FunctionList();
this.gloVars = factory.GlobalVariableList();
this.gloParams = factory.GlobalParameterList();
this.rootNod = root;
}
示例4: QilExpression
/// <summary>
/// Construct QIL from a rooted graph of QilNodes with a specific factory.
/// </summary>
public QilExpression(QilNodeType nodeType, QilNode root, QilFactory factory) : base(nodeType)
{
_factory = factory;
_isDebug = factory.False();
XmlWriterSettings settings = new XmlWriterSettings();
settings.ConformanceLevel = ConformanceLevel.Auto;
_defWSet = factory.LiteralObject(settings);
_wsRules = factory.LiteralObject(new List<WhitespaceRule>());
_gloVars = factory.GlobalVariableList();
_gloParams = factory.GlobalParameterList();
_earlBnd = factory.LiteralObject(new List<EarlyBoundInfo>());
_funList = factory.FunctionList();
_rootNod = root;
}
示例5: IsStepPattern
/// <summary>
/// Return true if "patt" matches the Step pattern and the StepType argument is equal to "stepType".
/// </summary>
private bool IsStepPattern(OptimizerPatterns patt, QilNodeType stepType) {
return patt.MatchesPattern(OptimizerPatternName.Step) && ((QilNode) patt.GetArgument(OptimizerPatternArgument.StepNode)).NodeType == stepType;
}
示例6: QilInvokeEarlyBound
//-----------------------------------------------
// Constructor
//-----------------------------------------------
/// <summary>
/// Construct a new node
/// </summary>
/// <param name="method">QilLiteral containing the Clr MethodInfo for the early bound function</param>
public QilInvokeEarlyBound(QilNodeType nodeType, QilNode name, QilNode method, QilNode arguments, XmlQueryType resultType)
: base(nodeType, name, method, arguments) {
this.xmlType = resultType;
}
示例7: QilDataSource
//-----------------------------------------------
// Constructor
//-----------------------------------------------
/// <summary>
/// Construct a new node
/// </summary>
public QilDataSource(QilNodeType nodeType, QilNode name, QilNode baseUri) : base(nodeType, name, baseUri) {
}
示例8: InvokeRelationalOperator
public QilNode InvokeRelationalOperator(QilNodeType op, QilNode left, QilNode right) {
Debug.Assert(op == QilNodeType.Lt || op == QilNodeType.Le || op == QilNodeType.Gt || op == QilNodeType.Ge);
double opCode;
left = TypeAssert(left, T.ItemS);
right = TypeAssert(right, T.ItemS);
switch (op) {
case QilNodeType.Lt: opCode = (double)XsltLibrary.ComparisonOperator.Lt; break;
case QilNodeType.Le: opCode = (double)XsltLibrary.ComparisonOperator.Le; break;
case QilNodeType.Gt: opCode = (double)XsltLibrary.ComparisonOperator.Gt; break;
default: opCode = (double)XsltLibrary.ComparisonOperator.Ge; break;
}
return XsltInvokeEarlyBound(QName("RelationalOperator"),
XsltMethods.RelationalOperator, T.BooleanX, new QilNode[] { Double(opCode), left, right }
);
}
示例9: QilReference
//-----------------------------------------------
// Constructor
//-----------------------------------------------
/// <summary>
/// Construct a reference
/// </summary>
public QilReference(QilNodeType nodeType) : base(nodeType) {
}
示例10: QilList
//-----------------------------------------------
// Constructor
//-----------------------------------------------
/// <summary>
/// Construct a new (empty) QilList
/// </summary>
public QilList(QilNodeType nodeType) : base(nodeType) {
this.members = new QilNode[4];
this.xmlType = null;
}
示例11: CheckClassAndNodeType
private void CheckClassAndNodeType(QilNode node, Type clrTypeClass, QilNodeType nodeType) {
CheckClass(node, clrTypeClass);
Check(node.NodeType == nodeType, node, "Node must have QilNodeType." + nodeType);
}
示例12: QilInvokeLateBound
//-----------------------------------------------
// Constructor
//-----------------------------------------------
/// <summary>
/// Construct a new node
/// </summary>
public QilInvokeLateBound(QilNodeType nodeType, QilNode name, QilNode arguments) : base(nodeType, name, arguments) {
}
示例13: QilInvoke
//-----------------------------------------------
// Constructor
//-----------------------------------------------
/// <summary>
/// Construct a new node
/// </summary>
public QilInvoke(QilNodeType nodeType, QilNode function, QilNode arguments) : base(nodeType, function, arguments) {
}
示例14: FoldArithmetic
/// <summary>
/// Compute the arithmetic operation "opType" over two literal operands and return the result as a QilLiteral.
/// Arithmetic operations are always checked; in the case of an overflow or divide by zero exception, return
/// the unfolded result.
/// </summary>
private QilNode FoldArithmetic(QilNodeType opType, QilLiteral left, QilLiteral right) {
Debug.Assert(left.NodeType == right.NodeType);
// Catch any overflow or divide by zero exceptions
try {
checked {
switch (left.NodeType) {
case QilNodeType.LiteralInt32: {
int intLeft = left;
int intRight = right;
switch (opType) {
case QilNodeType.Add: return f.LiteralInt32(intLeft + intRight);
case QilNodeType.Subtract: return f.LiteralInt32(intLeft - intRight);
case QilNodeType.Multiply: return f.LiteralInt32(intLeft * intRight);
case QilNodeType.Divide: return f.LiteralInt32(intLeft / intRight);
case QilNodeType.Modulo: return f.LiteralInt32(intLeft % intRight);
}
break;
}
case QilNodeType.LiteralInt64: {
long lngLeft = left;
long lngRight = right;
switch (opType) {
case QilNodeType.Add: return f.LiteralInt64(lngLeft + lngRight);
case QilNodeType.Subtract: return f.LiteralInt64(lngLeft - lngRight);
case QilNodeType.Multiply: return f.LiteralInt64(lngLeft * lngRight);
case QilNodeType.Divide: return f.LiteralInt64(lngLeft / lngRight);
case QilNodeType.Modulo: return f.LiteralInt64(lngLeft % lngRight);
}
break;
}
case QilNodeType.LiteralDecimal: {
decimal lngLeft = left;
decimal lngRight = right;
switch (opType) {
case QilNodeType.Add: return f.LiteralDecimal(lngLeft + lngRight);
case QilNodeType.Subtract: return f.LiteralDecimal(lngLeft - lngRight);
case QilNodeType.Multiply: return f.LiteralDecimal(lngLeft * lngRight);
case QilNodeType.Divide: return f.LiteralDecimal(lngLeft / lngRight);
case QilNodeType.Modulo: return f.LiteralDecimal(lngLeft % lngRight);
}
break;
}
case QilNodeType.LiteralDouble: {
double lngLeft = left;
double lngRight = right;
switch (opType) {
case QilNodeType.Add: return f.LiteralDouble(lngLeft + lngRight);
case QilNodeType.Subtract: return f.LiteralDouble(lngLeft - lngRight);
case QilNodeType.Multiply: return f.LiteralDouble(lngLeft * lngRight);
case QilNodeType.Divide: return f.LiteralDouble(lngLeft / lngRight);
case QilNodeType.Modulo: return f.LiteralDouble(lngLeft % lngRight);
}
break;
}
}
}
}
catch (OverflowException) {
}
catch (DivideByZeroException) {
}
// An error occurred, so don't fold operationo
switch (opType) {
case QilNodeType.Add: return f.Add(left, right);
case QilNodeType.Subtract: return f.Subtract(left, right);
case QilNodeType.Multiply: return f.Multiply(left, right);
case QilNodeType.Divide: return f.Divide(left, right);
case QilNodeType.Modulo: return f.Modulo(left, right);
}
Debug.Assert(false, "Cannot fold this arithmetic operation: " + opType);
return null;
}
示例15: CanFoldArithmetic
/// <summary>
/// Return true if arithmetic operation "opType" can be computed over two literal operands without causing
/// an overflow or divide by zero exception.
/// </summary>
private bool CanFoldArithmetic(QilNodeType opType, QilLiteral left, QilLiteral right) {
return (FoldArithmetic(opType, left, right) is QilLiteral);
}