本文整理汇总了C#中ICSharpCode.NRefactory.Ast.CollectionInitializerExpression类的典型用法代码示例。如果您正苦于以下问题:C# CollectionInitializerExpression类的具体用法?C# CollectionInitializerExpression怎么用?C# CollectionInitializerExpression使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CollectionInitializerExpression类属于ICSharpCode.NRefactory.Ast命名空间,在下文中一共展示了CollectionInitializerExpression类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: VisitCollectionInitializerExpression
public override object VisitCollectionInitializerExpression(CollectionInitializerExpression collectionInitializerExpression, object data)
{
WriteLine("VisitCollectionInitializerExpression");
return base.VisitCollectionInitializerExpression(collectionInitializerExpression, data);
}
开发者ID:hpsa,项目名称:SharpDevelop,代码行数:5,代码来源:NRefactoryAstVisitor.cs
示例2: TrackedVisitCollectionInitializerExpression
public virtual object TrackedVisitCollectionInitializerExpression(CollectionInitializerExpression collectionInitializerExpression, object data) {
return base.VisitCollectionInitializerExpression(collectionInitializerExpression, data);
}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:3,代码来源:NodeTrackingAstVisitor.cs
示例3: ObjectCreateExpression
void ObjectCreateExpression(
//#line 2123 "VBNET.ATG"
out Expression oce) {
//#line 2125 "VBNET.ATG"
TypeReference type = null;
CollectionInitializerExpression initializer = null;
List<Expression> arguments = null;
ArrayList dimensions = null;
oce = null;
Location startLocation = la.Location;
bool canBeNormal; bool canBeReDim;
Expect(162);
if (StartOf(8)) {
NonArrayTypeName(
//#line 2134 "VBNET.ATG"
out type, false);
if (la.kind == 37) {
lexer.NextToken();
NormalOrReDimArgumentList(
//#line 2135 "VBNET.ATG"
out arguments, out canBeNormal, out canBeReDim);
Expect(38);
if (la.kind == 35 ||
//#line 2136 "VBNET.ATG"
la.kind == Tokens.OpenParenthesis) {
if (
//#line 2136 "VBNET.ATG"
la.kind == Tokens.OpenParenthesis) {
ArrayTypeModifiers(
//#line 2137 "VBNET.ATG"
out dimensions);
CollectionInitializer(
//#line 2138 "VBNET.ATG"
out initializer);
} else {
CollectionInitializer(
//#line 2139 "VBNET.ATG"
out initializer);
}
}
//#line 2141 "VBNET.ATG"
if (canBeReDim && !canBeNormal && initializer == null) initializer = new CollectionInitializerExpression();
}
}
//#line 2145 "VBNET.ATG"
if (initializer == null) {
oce = new ObjectCreateExpression(type, arguments);
} else {
if (dimensions == null) dimensions = new ArrayList();
dimensions.Insert(0, (arguments == null) ? 0 : Math.Max(arguments.Count - 1, 0));
type.RankSpecifier = (int[])dimensions.ToArray(typeof(int));
ArrayCreateExpression ace = new ArrayCreateExpression(type, initializer);
ace.Arguments = arguments;
oce = ace;
}
if (la.kind == 126 || la.kind == 233) {
if (la.kind == 233) {
//#line 2160 "VBNET.ATG"
MemberInitializerExpression memberInitializer = null;
Expression anonymousMember = null;
lexer.NextToken();
//#line 2165 "VBNET.ATG"
CollectionInitializerExpression memberInitializers = new CollectionInitializerExpression();
memberInitializers.StartLocation = la.Location;
Expect(35);
if (la.kind == 26 || la.kind == 147) {
MemberInitializer(
//#line 2170 "VBNET.ATG"
out memberInitializer);
//#line 2171 "VBNET.ATG"
memberInitializers.CreateExpressions.Add(memberInitializer);
} else if (StartOf(24)) {
Expr(
//#line 2172 "VBNET.ATG"
out anonymousMember);
//#line 2173 "VBNET.ATG"
memberInitializers.CreateExpressions.Add(anonymousMember);
} else SynErr(270);
while (la.kind == 22) {
lexer.NextToken();
if (la.kind == 26 || la.kind == 147) {
MemberInitializer(
//#line 2177 "VBNET.ATG"
out memberInitializer);
//#line 2178 "VBNET.ATG"
memberInitializers.CreateExpressions.Add(memberInitializer);
} else if (StartOf(24)) {
Expr(
//.........这里部分代码省略.........
开发者ID:Altaxo,项目名称:Altaxo,代码行数:101,代码来源:Parser.cs
示例4: ObjectCreateExpression
void ObjectCreateExpression(
#line 1935 "VBNET.ATG"
out Expression oce) {
#line 1937 "VBNET.ATG"
TypeReference type = null;
Expression initializer = null;
List<Expression> arguments = null;
ArrayList dimensions = null;
oce = null;
bool canBeNormal; bool canBeReDim;
Expect(148);
if (StartOf(7)) {
NonArrayTypeName(
#line 1945 "VBNET.ATG"
out type, false);
if (la.kind == 25) {
lexer.NextToken();
NormalOrReDimArgumentList(
#line 1946 "VBNET.ATG"
out arguments, out canBeNormal, out canBeReDim);
Expect(26);
if (la.kind == 23 ||
#line 1947 "VBNET.ATG"
la.kind == Tokens.OpenParenthesis) {
if (
#line 1947 "VBNET.ATG"
la.kind == Tokens.OpenParenthesis) {
ArrayTypeModifiers(
#line 1948 "VBNET.ATG"
out dimensions);
CollectionInitializer(
#line 1949 "VBNET.ATG"
out initializer);
} else {
CollectionInitializer(
#line 1950 "VBNET.ATG"
out initializer);
}
}
#line 1952 "VBNET.ATG"
if (canBeReDim && !canBeNormal && initializer == null) initializer = new CollectionInitializerExpression();
}
}
#line 1956 "VBNET.ATG"
if (initializer == null) {
oce = new ObjectCreateExpression(type, arguments);
} else {
if (dimensions == null) dimensions = new ArrayList();
dimensions.Insert(0, (arguments == null) ? 0 : Math.Max(arguments.Count - 1, 0));
type.RankSpecifier = (int[])dimensions.ToArray(typeof(int));
ArrayCreateExpression ace = new ArrayCreateExpression(type, initializer as CollectionInitializerExpression);
ace.Arguments = arguments;
oce = ace;
}
if (la.kind == 218) {
#line 1970 "VBNET.ATG"
NamedArgumentExpression memberInitializer = null;
lexer.NextToken();
#line 1974 "VBNET.ATG"
CollectionInitializerExpression memberInitializers = new CollectionInitializerExpression();
memberInitializers.StartLocation = la.Location;
Expect(23);
MemberInitializer(
#line 1978 "VBNET.ATG"
out memberInitializer);
#line 1979 "VBNET.ATG"
memberInitializers.CreateExpressions.Add(memberInitializer);
while (la.kind == 12) {
lexer.NextToken();
MemberInitializer(
#line 1981 "VBNET.ATG"
out memberInitializer);
#line 1982 "VBNET.ATG"
memberInitializers.CreateExpressions.Add(memberInitializer);
}
Expect(24);
#line 1986 "VBNET.ATG"
memberInitializers.EndLocation = t.Location;
if(oce is ObjectCreateExpression)
{
((ObjectCreateExpression)oce).ObjectInitializer = memberInitializers;
}
}
}
开发者ID:Adam-Fogle,项目名称:agentralphplugin,代码行数:97,代码来源:Parser.cs
示例5: VisitCollectionInitializerExpression
public virtual object VisitCollectionInitializerExpression(CollectionInitializerExpression collectionInitializerExpression, object data) {
throw new global::System.NotImplementedException("CollectionInitializerExpression");
}
开发者ID:Altaxo,项目名称:Altaxo,代码行数:3,代码来源:NotImplementedAstVisitor.cs
示例6: ObjectCreateExpression
void ObjectCreateExpression(
#line 1860 "VBNET.ATG"
out Expression oce) {
#line 1862 "VBNET.ATG"
TypeReference type = null;
Expression initializer = null;
List<Expression> arguments = null;
ArrayList dimensions = null;
oce = null;
bool canBeNormal; bool canBeReDim;
Expect(127);
NonArrayTypeName(
#line 1869 "VBNET.ATG"
out type, false);
if (la.kind == 24) {
lexer.NextToken();
NormalOrReDimArgumentList(
#line 1870 "VBNET.ATG"
out arguments, out canBeNormal, out canBeReDim);
Expect(25);
if (la.kind == 22 ||
#line 1871 "VBNET.ATG"
la.kind == Tokens.OpenParenthesis) {
if (
#line 1871 "VBNET.ATG"
la.kind == Tokens.OpenParenthesis) {
ArrayTypeModifiers(
#line 1872 "VBNET.ATG"
out dimensions);
CollectionInitializer(
#line 1873 "VBNET.ATG"
out initializer);
} else {
CollectionInitializer(
#line 1874 "VBNET.ATG"
out initializer);
}
}
#line 1876 "VBNET.ATG"
if (canBeReDim && !canBeNormal && initializer == null) initializer = new CollectionInitializerExpression();
}
#line 1879 "VBNET.ATG"
if (type == null) type = new TypeReference("Object"); // fallback type on parser errors
if (initializer == null) {
oce = new ObjectCreateExpression(type, arguments);
} else {
if (dimensions == null) dimensions = new ArrayList();
dimensions.Insert(0, (arguments == null) ? 0 : Math.Max(arguments.Count - 1, 0));
type.RankSpecifier = (int[])dimensions.ToArray(typeof(int));
ArrayCreateExpression ace = new ArrayCreateExpression(type, initializer as CollectionInitializerExpression);
ace.Arguments = arguments;
oce = ace;
}
}
开发者ID:almazik,项目名称:ILSpy,代码行数:59,代码来源:Parser.cs
示例7: CollectionInitializer
void CollectionInitializer(
#line 1447 "cs.ATG"
out Expression outExpr) {
#line 1449 "cs.ATG"
Expression expr = null;
CollectionInitializerExpression initializer = new CollectionInitializerExpression();
Expect(16);
#line 1453 "cs.ATG"
initializer.StartLocation = t.Location;
if (StartOf(30)) {
VariableInitializer(
#line 1454 "cs.ATG"
out expr);
#line 1455 "cs.ATG"
SafeAdd(initializer, initializer.CreateExpressions, expr);
while (
#line 1456 "cs.ATG"
NotFinalComma()) {
Expect(14);
VariableInitializer(
#line 1457 "cs.ATG"
out expr);
#line 1458 "cs.ATG"
SafeAdd(initializer, initializer.CreateExpressions, expr);
}
if (la.kind == 14) {
lexer.NextToken();
}
}
Expect(17);
#line 1462 "cs.ATG"
initializer.EndLocation = t.Location; outExpr = initializer;
}
开发者ID:pluraldj,项目名称:SharpDevelop,代码行数:39,代码来源:Parser.cs
示例8: ArrayCreateExpression
public ArrayCreateExpression(TypeReference createType, CollectionInitializerExpression arrayInitializer) {
CreateType = createType;
ArrayInitializer = arrayInitializer;
arguments = new List<Expression>();
}
开发者ID:Altaxo,项目名称:Altaxo,代码行数:5,代码来源:Generated.cs
示例9: ObjectCreateExpression
public ObjectCreateExpression(TypeReference createType, List<Expression> parameters) {
CreateType = createType;
Parameters = parameters;
objectInitializer = CollectionInitializerExpression.Null;
}
开发者ID:Altaxo,项目名称:Altaxo,代码行数:5,代码来源:Generated.cs
示例10: VisitCollectionInitializerExpression
public virtual object VisitCollectionInitializerExpression(CollectionInitializerExpression collectionInitializerExpression, object data)
{
Debug.Assert((collectionInitializerExpression != null));
Debug.Assert((collectionInitializerExpression.CreateExpressions != null));
foreach (Expression o in collectionInitializerExpression.CreateExpressions) {
Debug.Assert(o != null);
o.AcceptVisitor(this, data);
}
return null;
}
开发者ID:pusp,项目名称:o2platform,代码行数:10,代码来源:AbstractASTVisitor.cs
示例11: VisitCollectionInitializerExpression
public object VisitCollectionInitializerExpression(CollectionInitializerExpression collectionInitializerExpression, object data)
{
throw new NotImplementedException ();
}
开发者ID:Monobjc,项目名称:monobjc-tools,代码行数:4,代码来源:CodeDomExpressionPrinter.cs
示例12: VisitCollectionInitializerExpression
public virtual bool VisitCollectionInitializerExpression(CollectionInitializerExpression collectionInitializerExpression, object d)
{
if ((collectionInitializerExpression == null)) {
return SetFailure();
}
if ((d == null)) {
return SetFailure();
}
if ((collectionInitializerExpression.CreateExpressions == null)) {
return SetFailure();
}
if(collectionInitializerExpression.GetType() != d.GetType()) {return SetFailure();}
var data = (CollectionInitializerExpression)d;
if (!IsMatch(collectionInitializerExpression, data)) {
return SetFailure();
}
if (collectionInitializerExpression.CreateExpressions.Count == data.CreateExpressions.Count) {
for (int i=0; i<collectionInitializerExpression.CreateExpressions.Count;i++) {
Expression o = collectionInitializerExpression.CreateExpressions[i];
if(o == null){return SetFailure();}
if((bool)o.AcceptVisitor(this, data.CreateExpressions[i]) == false) return SetFailure();
} } else { return SetFailure(); }
return true;
}
开发者ID:jbuedel,项目名称:AgentRalphPlugin,代码行数:24,代码来源:AstComparisonVisitor.Generated.cs
示例13: VisitCollectionInitializerExpression
public override object VisitCollectionInitializerExpression (CollectionInitializerExpression collectionInitializerExpression, object data)
{
if (collectionInitializerExpression.CreateExpressions.Count == 0)
return null;
DomReturnType type = null;
IType typeObject = null;
for (int i = 0; i < collectionInitializerExpression.CreateExpressions.Count; i++) {
DomReturnType curType = (DomReturnType)ResolveType (collectionInitializerExpression.CreateExpressions[i]);
// if we found object or we have only one create expression we can stop
if (curType.DecoratedFullName == DomReturnType.Object.DecoratedFullName || collectionInitializerExpression.CreateExpressions.Count == 1) {
type = curType;
break;
}
IType curTypeObject = resolver.Dom.GetType (curType);
if (curTypeObject == null)
continue;
if (type == null || resolver.Dom.GetInheritanceTree (typeObject).Any (t => t.DecoratedFullName == curTypeObject.DecoratedFullName)) {
type = curType;
typeObject = curTypeObject;
}
}
if (type != null)
type.ArrayDimensions++;
return CreateResult (type);
}
开发者ID:Ein,项目名称:monodevelop,代码行数:27,代码来源:ResolveVisitor.cs
示例14: VisitCollectionInitializerExpression
public virtual object VisitCollectionInitializerExpression(CollectionInitializerExpression collectionInitializerExpression, object data) {
Debug.Assert((collectionInitializerExpression != null));
Debug.Assert((collectionInitializerExpression.CreateExpressions != null));
for (int i = 0; i < collectionInitializerExpression.CreateExpressions.Count; i++) {
Expression o = collectionInitializerExpression.CreateExpressions[i];
Debug.Assert(o != null);
nodeStack.Push(o);
o.AcceptVisitor(this, data);
o = (Expression)nodeStack.Pop();
if (o == null)
collectionInitializerExpression.CreateExpressions.RemoveAt(i--);
else
collectionInitializerExpression.CreateExpressions[i] = o;
}
return null;
}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:16,代码来源:AbstractAstTransformer.cs
示例15: CreateAnonymousClass
IType CreateAnonymousClass (CollectionInitializerExpression initializer)
{
DomType result;
if (!anonymousTypes.TryGetValue (initializer, out result)) {
result = new AnonymousType ();
result.SourceProjectDom = resolver.Dom;
foreach (Expression expr in initializer.CreateExpressions) {
var oldPos = resolver.ResolvePosition;
if (!expr.StartLocation.IsEmpty)
resolver.resolvePosition = new DomLocation (expr.StartLocation.Line + resolver.CallingMember.Location.Line, expr.StartLocation.Column);
DomProperty newProperty = new DomProperty (GetAnonymousTypeFieldName (expr), MonoDevelop.Projects.Dom.Modifiers.Public, DomLocation.Empty, DomRegion.Empty, ResolveType (expr));
newProperty.DeclaringType = result;
result.Add (newProperty);
resolver.resolvePosition = oldPos;
}
anonymousTypes[initializer] = result;
}
return result;
}
开发者ID:Ein,项目名称:monodevelop,代码行数:19,代码来源:ResolveVisitor.cs
示例16: VisitCollectionInitializerExpression
public virtual object VisitCollectionInitializerExpression(CollectionInitializerExpression collectionInitializerExpression, object data) {
throw CreateException(collectionInitializerExpression);
}
开发者ID:hallvar,项目名称:Joddes.CS,代码行数:3,代码来源:JsVisitor.cs
示例17: CollectionInitializer
void CollectionInitializer(
#line 1468 "VBNET.ATG"
out Expression outExpr) {
#line 1470 "VBNET.ATG"
Expression expr = null;
CollectionInitializerExpression initializer = new CollectionInitializerExpression();
Expect(22);
if (StartOf(28)) {
VariableInitializer(
#line 1475 "VBNET.ATG"
out expr);
#line 1477 "VBNET.ATG"
if (expr != null) { initializer.CreateExpressions.Add(expr); }
while (
#line 1480 "VBNET.ATG"
NotFinalComma()) {
Expect(12);
VariableInitializer(
#line 1480 "VBNET.ATG"
out expr);
#line 1481 "VBNET.ATG"
if (expr != null) { initializer.CreateExpressions.Add(expr); }
}
}
Expect(23);
#line 1484 "VBNET.ATG"
outExpr = initializer;
}
开发者ID:almazik,项目名称:ILSpy,代码行数:34,代码来源:Parser.cs
示例18: CollectionInitializer
void CollectionInitializer(
#line 1423 "Frames/cs.ATG"
out Expression outExpr) {
#line 1425 "Frames/cs.ATG"
Expression expr = null;
CollectionInitializerExpression initializer = new CollectionInitializerExpression();
Expect(16);
#line 1429 "Frames/cs.ATG"
initializer.StartLocation = t.Location;
if (StartOf(31)) {
VariableInitializer(
#line 1430 "Frames/cs.ATG"
out expr);
#line 1431 "Frames/cs.ATG"
SafeAdd(initializer, initializer.CreateExpressions, expr);
while (
#line 1432 "Frames/cs.ATG"
NotFinalComma()) {
Expect(14);
VariableInitializer(
#line 1433 "Frames/cs.ATG"
out expr);
#line 1434 "Frames/cs.ATG"
SafeAdd(initializer, initializer.CreateExpressions, expr);
}
if (la.kind == 14) {
lexer.NextToken();
}
}
Expect(17);
#line 1438 "Frames/cs.ATG"
initializer.EndLocation = t.Location; outExpr = initializer;
}
开发者ID:okrmartin,项目名称:monodevelop,代码行数:39,代码来源:Parser.cs
示例19: CollectionOrObjectInitializer
void CollectionOrObjectInitializer(
#line 1465 "cs.ATG"
out Expression outExpr) {
#line 1467 "cs.ATG"
Expression expr = null;
CollectionInitializerExpression initializer = new CollectionInitializerExpression();
Expect(16);
#line 1471 "cs.ATG"
initializer.StartLocation = t.Location;
if (StartOf(30)) {
ObjectPropertyInitializerOrVariableInitializer(
#line 1472 "cs.ATG"
out expr);
#line 1473 "cs.ATG"
SafeAdd(initializer, initializer.CreateExpressions, expr);
while (
#line 1474 "cs.ATG"
NotFinalComma()) {
Expect(14);
ObjectPropertyInitializerOrVariableInitializer(
#line 1475 "cs.ATG"
out expr);
#line 1476 "cs.ATG"
SafeAdd(initializer, initializer.CreateExpressions, expr);
}
if (la.kind == 14) {
lexer.NextToken();
}
}
Expect(17);
#line 1480 "cs.ATG"
initializer.EndLocation = t.Location; outExpr = initializer;
}
开发者ID:pluraldj,项目名称:SharpDevelop,代码行数:39,代码来源:Parser.cs
示例20: CollectionOrObjectInitializer
void CollectionOrObjectInitializer(
#line 1441 "Frames/cs.ATG"
out Expression outExpr) {
#line 1443 "Frames/cs.ATG"
Expression expr = null;
CollectionInitializerExpression initializer = new CollectionInitializerExpression();
Expect(16);
#line 1447 "Frames/cs.ATG"
initializer.StartLocation = t.Location;
if (StartOf(31)) {
ObjectPropertyInitializerOrVariableInitializer(
#line 1448 "Frames/cs.ATG"
out expr);
#line 1449 "Frames/cs.ATG"
SafeAdd(initializer, initializer.CreateExpressions, expr);
while (
#line 1450 "Frames/cs.ATG"
NotFinalComma()) {
Expect(14);
ObjectPropertyInitializerOrVariableInitializer(
#line 1451 "Frames/cs.ATG"
out expr);
#line 1452 "Frames/cs.ATG"
SafeAdd(initializer, initializer.CreateExpressions, expr);
}
if (la.kind == 14) {
lexer.NextToken();
}
}
Expect(17);
#line 1456 "Frames/cs.ATG"
initializer.EndLocation = t.Location; outExpr = initializer;
}
开发者ID:okrmartin,项目名称:monodevelop,代码行数:39,代码来源:Parser.cs
注:本文中的ICSharpCode.NRefactory.Ast.CollectionInitializerExpression类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论