本文整理汇总了C#中Mono.CSharp.BlockVariableDeclaration类的典型用法代码示例。如果您正苦于以下问题:C# BlockVariableDeclaration类的具体用法?C# BlockVariableDeclaration怎么用?C# BlockVariableDeclaration使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BlockVariableDeclaration类属于Mono.CSharp命名空间,在下文中一共展示了BlockVariableDeclaration类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Visit
public virtual object Visit (BlockVariableDeclaration blockVariableDeclaration)
{
return null;
}
开发者ID:KAW0,项目名称:Alter-Native,代码行数:4,代码来源:visit.cs
示例2: AsLocalFunction
public AsLocalFunction (Location loc, string name, AnonymousMethodExpression methodExpr, BlockVariableDeclaration varDecl)
{
this.loc = loc;
this.Name = name;
this.MethodExpr = methodExpr;
this.VarDecl = varDecl;
}
开发者ID:johnv315,项目名称:playscript-mono,代码行数:7,代码来源:ps-lang.cs
示例3: end_anonymous
/*
* Completes the anonymous method processing, if lambda_expr is null, this
* means that we have a Statement instead of an Expression embedded
*/
AnonymousMethodExpression end_anonymous (ParametersBlock anon_block)
{
AnonymousMethodExpression retval;
if (async_block)
anon_block.IsAsync = true;
current_anonymous_method.Block = anon_block;
retval = current_anonymous_method;
async_block = (bool) oob_stack.Pop ();
current_variable = (BlockVariableDeclaration) oob_stack.Pop ();
current_local_parameters = (ParametersCompiled) oob_stack.Pop ();
current_anonymous_method = (AnonymousMethodExpression) oob_stack.Pop ();
return retval;
}
开发者ID:kaagati,项目名称:NRefactory,代码行数:21,代码来源:cs-parser.cs
示例4: case_864
void case_864()
#line 5774 "cs-parser.jay"
{
var lt = (Tokenizer.LocatedToken) yyVals[0+yyTop];
var li = new LocalVariable (current_block, lt.Value, lt.Location);
current_block.AddLocalName (li);
current_variable = new BlockVariableDeclaration ((FullNamedExpression) yyVals[-1+yyTop], li);
}
开发者ID:kaagati,项目名称:NRefactory,代码行数:8,代码来源:cs-parser.cs
示例5: Define
//
// Creates the type
//
public override bool Define ()
{
if (!base.Define ())
return false;
if (member_type.Kind == MemberKind.Void && parameters.IsEmpty && MemberName.Arity == 0 && MemberName.Name == Destructor.MetadataName) {
Report.Warning (465, 1, Location,
"Introducing `Finalize' method can interfere with destructor invocation. Did you intend to declare a destructor?");
}
if (Compiler.Settings.StdLib && ReturnType.IsSpecialRuntimeType) {
Error1599 (Location, ReturnType, Report);
return false;
}
if (CurrentTypeParameters == null) {
if (base_method != null && !IsExplicitImpl) {
if (parameters.Count == 1 && ParameterTypes[0].BuiltinType == BuiltinTypeSpec.Type.Object && MemberName.Name == "Equals")
Parent.PartialContainer.Mark_HasEquals ();
else if (parameters.IsEmpty && MemberName.Name == "GetHashCode")
Parent.PartialContainer.Mark_HasGetHashCode ();
}
} else {
DefineTypeParameters ();
}
// PlayScript - We need to create an "Array" for our args parameters for ActionScript/PlayScript..
if ((Parent.FileType == SourceFileType.PlayScript && !PsExtended) &&
parameters != null && parameters.FixedParameters != null && parameters.FixedParameters.Length > 0 && block != null) {
var param = parameters.FixedParameters[parameters.FixedParameters.Length - 1] as Parameter;
if (param != null && (param.ParameterModifier & Parameter.Modifier.PARAMS) != 0) {
string argName = param.Name.Substring(2); // Arg should start with "__" (we added it in the parser).
var li = new LocalVariable (block.ParametersBlock.TopBlock, argName, block.loc);
var decl = new BlockVariableDeclaration(new Mono.CSharp.TypeExpression(this.Module.PredefinedTypes.AsArray.Resolve(), block.loc), li);
var arguments = new Arguments(1);
arguments.Add (new Argument(new SimpleName(param.Name, block.loc)));
decl.Initializer = new Invocation(new MemberAccess(new MemberAccess(new SimpleName("PlayScript", block.loc), "Support", block.loc), "CreateArgListArray", block.loc), arguments);
block.AddLocalName (li);
block.ParametersBlock.TopBlock.AddScopeStatement (decl);
}
}
if (block != null) {
if (block.IsIterator) {
//
// Current method is turned into automatically generated
// wrapper which creates an instance of iterator
//
Iterator.CreateIterator (this, Parent.PartialContainer, ModFlags);
ModFlags |= Modifiers.DEBUGGER_HIDDEN;
}
if ((ModFlags & Modifiers.ASYNC) != 0) {
if (ReturnType.Kind != MemberKind.Void &&
ReturnType != Module.PredefinedTypes.Task.TypeSpec &&
!ReturnType.IsGenericTask) {
Report.Error (1983, Location, "The return type of an async method must be void, Task, or Task<T>");
}
block = (ToplevelBlock) block.ConvertToAsyncTask (this, Parent.PartialContainer, parameters, ReturnType, null, Location);
ModFlags |= Modifiers.DEBUGGER_HIDDEN;
}
if (Compiler.Settings.WriteMetadataOnly)
block = null;
}
if ((ModFlags & Modifiers.STATIC) == 0)
return true;
if (parameters.HasExtensionMethodType) {
if (Parent.PartialContainer.IsStatic && !Parent.IsGenericOrParentIsGeneric) {
if (!Parent.IsTopLevel)
Report.Error (1109, Location, "`{0}': Extension methods cannot be defined in a nested class",
GetSignatureForError ());
PredefinedAttribute pa = Module.PredefinedAttributes.Extension;
if (!pa.IsDefined) {
Report.Error (1110, Location,
"`{0}': Extension methods require `System.Runtime.CompilerServices.ExtensionAttribute' type to be available. Are you missing an assembly reference?",
GetSignatureForError ());
}
ModFlags |= Modifiers.METHOD_EXTENSION;
Parent.PartialContainer.ModFlags |= Modifiers.METHOD_EXTENSION;
Spec.DeclaringType.SetExtensionMethodContainer ();
Parent.Module.HasExtensionMethod = true;
} else {
Report.Error (1106, Location, "`{0}': Extension methods must be defined in a non-generic static class",
GetSignatureForError ());
}
}
//
// This is used to track the Entry Point,
//
//.........这里部分代码省略.........
开发者ID:qqbbcr,项目名称:playscript-mono,代码行数:101,代码来源:method.cs
示例6: Visit
public override object Visit(BlockVariableDeclaration blockVariableDeclaration)
{
var result = new VariableDeclarationStatement ();
result.AddChild (ConvertToType (blockVariableDeclaration.TypeExpression), Roles.Type);
var varInit = new VariableInitializer ();
var location = LocationsBag.GetLocations (blockVariableDeclaration);
varInit.AddChild (Identifier.Create (blockVariableDeclaration.Variable.Name, Convert (blockVariableDeclaration.Variable.Location)), Roles.Identifier);
if (blockVariableDeclaration.Initializer != null) {
if (location != null && location.Count > 0)
varInit.AddChild (new CSharpTokenNode (Convert (location [0]), Roles.Assign), Roles.Assign);
varInit.AddChild ((Expression)blockVariableDeclaration.Initializer.Accept (this), Roles.Expression);
}
result.AddChild (varInit, Roles.Variable);
if (blockVariableDeclaration.Declarators != null) {
foreach (var decl in blockVariableDeclaration.Declarators) {
var loc = LocationsBag.GetLocations (decl);
var init = new VariableInitializer ();
if (loc != null && loc.Count > 0)
result.AddChild (new CSharpTokenNode (Convert (loc [0]), Roles.Comma), Roles.Comma);
init.AddChild (Identifier.Create (decl.Variable.Name, Convert (decl.Variable.Location)), Roles.Identifier);
if (decl.Initializer != null) {
if (loc != null && loc.Count > 1)
init.AddChild (new CSharpTokenNode (Convert (loc [1]), Roles.Assign), Roles.Assign);
init.AddChild ((Expression)decl.Initializer.Accept (this), Roles.Expression);
} else {
}
result.AddChild (init, Roles.Variable);
}
}
if (location != null && (blockVariableDeclaration.Initializer == null || location.Count > 1))
result.AddChild (new CSharpTokenNode (Convert (location [location.Count - 1]), Roles.Semicolon), Roles.Semicolon);
return result;
}
开发者ID:kaagati,项目名称:NRefactory,代码行数:36,代码来源:CSharpParser.cs
示例7: case_751
void case_751()
{
yyVal = current_variable;
current_variable = null;
lbag.AddLocation (yyVal, GetLocation (yyVals[-6+yyTop]), GetLocation (yyVals[0+yyTop]));
}
开发者ID:animaonline,项目名称:Portable-Mono.CSharp,代码行数:6,代码来源:cs-parser.cs
示例8: case_924
void case_924()
#line 6211 "cs-parser.jay"
{
start_block (GetLocation (yyVals[-2+yyTop]));
current_block.IsCompilerGenerated = true;
var lt = (Tokenizer.LocatedToken) yyVals[0+yyTop];
var li = new LocalVariable (current_block, lt.Value, LocalVariable.Flags.UsingVariable | LocalVariable.Flags.Used, lt.Location);
current_block.AddLocalName (li);
current_variable = new Using.VariableDeclaration ((FullNamedExpression) yyVals[-1+yyTop], li);
}
开发者ID:kaagati,项目名称:NRefactory,代码行数:11,代码来源:cs-parser.cs
示例9: case_790
void case_790()
#line 5313 "cs-parser.jay"
{
if (current_variable.Initializer != null) {
lbag.AddLocation (current_variable, GetLocation (yyVals[-6+yyTop]), savedLocation, GetLocation (yyVals[0+yyTop]));
} else {
lbag.AddLocation (current_variable, GetLocation (yyVals[-6+yyTop]), GetLocation (yyVals[0+yyTop]));
}
yyVal = current_variable;;
current_variable = null;
}
开发者ID:kaagati,项目名称:NRefactory,代码行数:11,代码来源:cs-parser.cs
示例10: case_865
void case_865()
#line 5781 "cs-parser.jay"
{
yyVal = current_variable;
current_variable = null;
}
开发者ID:kaagati,项目名称:NRefactory,代码行数:6,代码来源:cs-parser.cs
示例11: case_849
void case_849()
#line 5426 "cs-parser.jay"
{
yyVal = current_variable;
current_variable = null;
}
开发者ID:Ein,项目名称:monodevelop,代码行数:6,代码来源:cs-parser.cs
示例12: case_788
void case_788()
#line 5300 "cs-parser.jay"
{
yyVal = current_variable;
current_variable = null;
lbag.AppendTo (yyVal, GetLocation (yyVals[0+yyTop]));
}
开发者ID:kaagati,项目名称:NRefactory,代码行数:7,代码来源:cs-parser.cs
示例13: case_882
void case_882()
#line 5864 "cs-parser.jay"
{
yyVal = current_variable;
current_variable = null;
}
开发者ID:xamarin-release-manager,项目名称:monodevelop,代码行数:6,代码来源:cs-parser.cs
示例14: case_800
void case_800()
#line 5103 "cs-parser.jay"
{
yyVal = current_variable;
current_variable = null;
}
开发者ID:Tak,项目名称:monodevelop-novell,代码行数:6,代码来源:cs-parser.cs
示例15: case_877
void case_877()
#line 5832 "cs-parser.jay"
{
yyVal = current_variable;
current_variable = null;
}
开发者ID:nieve,项目名称:NRefactory,代码行数:6,代码来源:cs-parser.cs
示例16: case_825
void case_825()
#line 5469 "cs-parser.jay"
{
yyVal = current_variable;
current_variable = null;
}
开发者ID:xamarin-release-manager,项目名称:monodevelop,代码行数:6,代码来源:cs-parser.cs
示例17: case_811
void case_811()
#line 5197 "cs-parser.jay"
{
yyVal = current_variable;
current_variable = null;
}
开发者ID:hduregger,项目名称:monodevelop,代码行数:6,代码来源:cs-parser.cs
示例18: case_883
void case_883()
{
yyVal = current_variable;
current_variable = null;
}
开发者ID:animaonline,项目名称:Portable-Mono.CSharp,代码行数:5,代码来源:cs-parser.cs
示例19: case_879
void case_879()
{
start_block (GetLocation (yyVals[-2+yyTop]));
current_block.IsCompilerGenerated = true;
var lt = (Tokenizer.LocatedToken) yyVals[0+yyTop];
var li = new LocalVariable (current_block, lt.Value, LocalVariable.Flags.FixedVariable | LocalVariable.Flags.Used, lt.Location);
current_block.AddLocalName (li);
current_variable = new Fixed.VariableDeclaration ((FullNamedExpression) yyVals[-1+yyTop], li);
}
开发者ID:animaonline,项目名称:Portable-Mono.CSharp,代码行数:10,代码来源:cs-parser.cs
示例20: case_799
void case_799()
#line 5098 "cs-parser.jay"
{
yyVal = current_variable;
current_variable = null;
}
开发者ID:Ein,项目名称:monodevelop,代码行数:6,代码来源:cs-parser.cs
注:本文中的Mono.CSharp.BlockVariableDeclaration类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论