本文整理汇总了C#中Mono.CSharp.Using类的典型用法代码示例。如果您正苦于以下问题:C# Using类的具体用法?C# Using怎么用?C# Using使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Using类属于Mono.CSharp命名空间,在下文中一共展示了Using类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: Visit
public override object Visit (Using usingStatement)
{
throw new InvalidOperationException ("should never happen (is handled in Block).");
}
开发者ID:pgoron,项目名称:monodevelop,代码行数:4,代码来源:CSharpParser.cs
示例2: case_937
void case_937()
#line 6292 "cs-parser.jay"
{
Error_SyntaxError (yyToken);
yyVal = new Using ((Expression) yyVals[-1+yyTop], null, GetLocation (yyVals[-3+yyTop]));
lbag.AddStatement (yyVal, GetLocation (yyVals[-2+yyTop]));
}
开发者ID:segaman,项目名称:NRefactory,代码行数:8,代码来源:cs-parser.cs
示例3: Visit
public override object Visit(Using usingStatement)
{
var result = new UsingStatement();
var location = LocationsBag.GetLocations(usingStatement);
result.AddChild(new CSharpTokenNode(Convert(usingStatement.loc), UsingStatement.UsingKeywordRole), UsingStatement.UsingKeywordRole);
if (location != null)
result.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.LPar), Roles.LPar);
if (usingStatement.Expr != null)
result.AddChild((AstNode)usingStatement.Expr.Accept(this), UsingStatement.ResourceAcquisitionRole);
if (location != null && location.Count > 1)
result.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.RPar), Roles.RPar);
if (usingStatement.Statement != null)
result.AddChild((Statement)usingStatement.Statement.Accept(this), Roles.EmbeddedStatement);
return result;
}
开发者ID:0xb1dd1e,项目名称:NRefactory,代码行数:18,代码来源:CSharpParser.cs
示例4: case_935
void case_935()
#line 6274 "cs-parser.jay"
{
if (yyVals[0+yyTop] is EmptyStatement && lexer.peek_token () == Token.OPEN_BRACE)
Warning_EmptyStatement (GetLocation (yyVals[0+yyTop]));
Using u = new Using ((Using.VariableDeclaration) yyVals[-1+yyTop], (Statement) yyVals[0+yyTop], GetLocation (yyVals[-8+yyTop]));
lbag.AddStatement (u, GetLocation (yyVals[-7+yyTop]), GetLocation (yyVals[-2+yyTop]));
current_block.AddStatement (u);
yyVal = end_block (GetLocation (yyVals[-2+yyTop]));
}
开发者ID:segaman,项目名称:NRefactory,代码行数:11,代码来源:cs-parser.cs
示例5: case_936
void case_936()
#line 6284 "cs-parser.jay"
{
if (yyVals[0+yyTop] is EmptyStatement && lexer.peek_token () == Token.OPEN_BRACE)
Warning_EmptyStatement (GetLocation (yyVals[0+yyTop]));
yyVal = new Using ((Expression) yyVals[-2+yyTop], (Statement) yyVals[0+yyTop], GetLocation (yyVals[-4+yyTop]));
lbag.AddStatement (yyVal, GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[-1+yyTop]));
}
开发者ID:segaman,项目名称:NRefactory,代码行数:9,代码来源:cs-parser.cs
示例6: RewriteForDeclarators
public Statement RewriteForDeclarators (BlockContext bc, Statement stmt)
{
for (int i = declarators.Count - 1; i >= 0; --i) {
var d = declarators [i];
var vd = new VariableDeclaration (d.Variable, type_expr.Location);
vd.Initializer = d.Initializer;
vd.IsNested = true;
vd.dispose_call = CreateDisposeCall (bc, d.Variable);
vd.dispose_call.Resolve (bc);
stmt = new Using (vd, stmt, d.Variable.Location);
}
declarators = null;
return stmt;
}
开发者ID:alisci01,项目名称:mono,代码行数:16,代码来源:statement.cs
示例7: Visit
public virtual object Visit (Using usingStatement)
{
return null;
}
开发者ID:KAW0,项目名称:Alter-Native,代码行数:4,代码来源:visit.cs
示例8: Visit
public override object Visit (Using usingStatement)
{
var result = new UsingStatement ();
var location = LocationsBag.GetLocations (usingStatement);
result.AddChild (new CSharpTokenNode (Convert (usingStatement.loc), "using".Length), UsingStatement.Roles.Keyword);
if (location != null)
result.AddChild (new CSharpTokenNode (Convert (location[0]), 1), UsingStatement.Roles.LPar);
result.AddChild ((INode)usingStatement.Expression.Accept (this), UsingStatement.Roles.Initializer);
if (location != null)
result.AddChild (new CSharpTokenNode (Convert (location[1]), 1), UsingStatement.Roles.RPar);
result.AddChild ((INode)usingStatement.Statement.Accept (this), UsingStatement.Roles.EmbeddedStatement);
return result;
}
开发者ID:silk,项目名称:monodevelop,代码行数:17,代码来源:CSharpParser.cs
示例9: yyparse
//.........这里部分代码省略.........
}
int yyV = yyTop + 1-yyLen[yyN];
if (debug != null)
debug.reduce(yyState, yyStates[yyV-1], yyN, YYRules.getRule (yyN), yyLen[yyN]);
yyVal = yyDefault(yyV > yyTop ? null : yyVals[yyV]);
switch (yyN) {
case 5:
#line 379 "cs-parser.jay"
{ Lexer.CompleteOnEOF = false; }
break;
case 7:
#line 384 "cs-parser.jay"
{
Lexer.check_incorrect_doc_comment ();
}
break;
case 8:
#line 388 "cs-parser.jay"
{
Lexer.check_incorrect_doc_comment ();
}
break;
case 16:
#line 411 "cs-parser.jay"
{
var lt = (Tokenizer.LocatedToken) yyVals[-2+yyTop];
string s = lt.Value;
if (s != "alias"){
syntax_error (lt.Location, "`alias' expected");
} else if (RootContext.Version == LanguageVersion.ISO_1) {
Report.FeatureIsNotAvailable (lt.Location, "external alias");
} else {
lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop];
current_namespace.AddUsingExternalAlias (lt.Value, lt.Location, Report);
}
}
break;
case 17:
#line 424 "cs-parser.jay"
{
syntax_error (GetLocation (yyVals[-1+yyTop]), "`alias' expected"); /* TODO: better*/
}
break;
case 20:
#line 436 "cs-parser.jay"
{
if (RootContext.Documentation != null)
Lexer.doc_state = XmlCommentState.Allowed;
}
break;
case 21:
#line 441 "cs-parser.jay"
{
if (RootContext.Documentation != null)
Lexer.doc_state = XmlCommentState.Allowed;
}
break;
case 22:
#line 449 "cs-parser.jay"
{
var lt = (Tokenizer.LocatedToken) yyVals[-3+yyTop];
current_namespace.AddUsingAlias (lt.Value, (MemberName) yyVals[-1+yyTop], GetLocation (yyVals[-4+yyTop]));
}
break;
case 23:
#line 453 "cs-parser.jay"
开发者ID:speier,项目名称:shake,代码行数:67,代码来源:cs-parser.cs
示例10: case_886
void case_886()
{
Error_SyntaxError (yyToken);
yyVal = new Using ((Expression) yyVals[-1+yyTop], null, GetLocation (yyVals[-3+yyTop]));
lbag.AddStatement (yyVal, GetLocation (yyVals[-2+yyTop]));
}
开发者ID:animaonline,项目名称:Portable-Mono.CSharp,代码行数:7,代码来源:cs-parser.cs
示例11: case_884
void case_884()
{
if (yyVals[0+yyTop] is EmptyStatement && lexer.peek_token () == Token.OPEN_BRACE)
Warning_EmptyStatement (GetLocation (yyVals[0+yyTop]));
Using u = new Using ((Using.VariableDeclaration) yyVals[-1+yyTop], (Statement) yyVals[0+yyTop], GetLocation (yyVals[-8+yyTop]));
current_block.AddStatement (u);
yyVal = end_block (GetLocation (yyVals[-2+yyTop]));
}
开发者ID:animaonline,项目名称:Portable-Mono.CSharp,代码行数:9,代码来源:cs-parser.cs
示例12: yyparse
//.........这里部分代码省略.........
if (yyVals[0+yyTop] != null) {
Attributes attrs = (Attributes) yyVals[0+yyTop];
report.Error (1730, attrs.Attrs [0].Location,
"Assembly and module attributes must precede all other elements except using clauses and extern alias declarations");
}
}
break;
case 7:
#line 409 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{
module.AddAttributes ((Attributes) yyVals[0+yyTop], current_namespace);
}
break;
case 8:
#line 413 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{
if (yyToken == Token.EXTERN_ALIAS)
report.Error (439, lexer.Location, "An extern alias declaration must precede all other elements");
else
Error_SyntaxError (yyToken);
}
break;
case 13:
#line 433 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{
var lt = (Tokenizer.LocatedToken) yyVals[-2+yyTop];
string s = lt.Value;
if (s != "alias"){
syntax_error (lt.Location, "`alias' expected");
} else if (lang_version == LanguageVersion.ISO_1) {
FeatureIsNotAvailable (lt.Location, "external alias");
} else {
lt = (Tokenizer.LocatedToken) yyVals[-1+yyTop];
current_namespace.AddUsingExternalAlias (lt.Value, lt.Location, report);
}
}
break;
case 14:
#line 446 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{
syntax_error (GetLocation (yyVals[-1+yyTop]), "`alias' expected"); /* TODO: better*/
}
break;
case 17:
#line 458 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{
if (doc_support)
Lexer.doc_state = XmlCommentState.Allowed;
}
break;
case 18:
#line 463 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{
if (doc_support)
Lexer.doc_state = XmlCommentState.Allowed;
}
break;
case 19:
#line 471 "D:\GitHub\M\Marvin\mcs\cs-parser.jay"
{
var lt = (Tokenizer.LocatedToken) yyVals[-3+yyTop];
if (lang_version != LanguageVersion.ISO_1 && lt.Value == "global") {
report.Warning (440, 2, lt.Location,
"An alias named `global' will not be used when resolving `global::'. The global namespace will be used instead");
}
开发者ID:runefs,项目名称:Marvin,代码行数:66,代码来源:cs-parser.cs
示例13: case_853
void case_853()
#line 5434 "C:\Projects\Junk\mono\mcs\class\Mono.CSharp\..\..\mcs\cs-parser.jay"
{
if (yyVals[0+yyTop] is EmptyStatement && lexer.peek_token () == Token.OPEN_BRACE)
Warning_EmptyStatement (GetLocation (yyVals[0+yyTop]));
Using u = new Using ((Expression) yyVals[-2+yyTop], (Statement) yyVals[0+yyTop], GetLocation (yyVals[-4+yyTop]));
lbag.AddStatement (u, GetLocation (yyVals[-3+yyTop]), GetLocation (yyVals[-1+yyTop]));
yyVal = u;
}
开发者ID:RainsSoft,项目名称:MonoCompilerAsAService,代码行数:10,代码来源:cs-parser.cs
示例14: case_852
void case_852()
#line 5425 "C:\Projects\Junk\mono\mcs\class\Mono.CSharp\..\..\mcs\cs-parser.jay"
{
if (yyVals[0+yyTop] is EmptyStatement && lexer.peek_token () == Token.OPEN_BRACE)
Warning_EmptyStatement (GetLocation (yyVals[0+yyTop]));
Using u = new Using ((Using.VariableDeclaration) yyVals[-1+yyTop], (Statement) yyVals[0+yyTop], GetLocation (yyVals[-9+yyTop]));
current_block.AddStatement (u);
yyVal = end_block (GetLocation (yyVals[-2+yyTop]));
}
开发者ID:RainsSoft,项目名称:MonoCompilerAsAService,代码行数:10,代码来源:cs-parser.cs
注:本文中的Mono.CSharp.Using类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论