本文整理汇总了C#中EmptyStatement类的典型用法代码示例。如果您正苦于以下问题:C# EmptyStatement类的具体用法?C# EmptyStatement怎么用?C# EmptyStatement使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
EmptyStatement类属于命名空间,在下文中一共展示了EmptyStatement类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Construtor_Coloca_Type_Corretamente_Em_Nos_Filhos
public void Construtor_Coloca_Type_Corretamente_Em_Nos_Filhos()
{
var programa = new Program();
Assert.AreEqual(programa.Type, "Program");
var emptyStatement = new EmptyStatement();
Assert.AreEqual(emptyStatement.Type, "EmptyStatement");
}
示例2: Visit
public override object Visit(ICSharpCode.NRefactory.MonoCSharp.EmptyStatement emptyStatement)
{
var result = new EmptyStatement();
result.Location = Convert(emptyStatement.loc);
return result;
}
示例3: VisitEmptyStatement
public void VisitEmptyStatement(EmptyStatement emptyStmt)
{
//no op
}
示例4: PostWalk
public override void PostWalk(EmptyStatement node) { }
示例5: CSharpGrammar
//.........这里部分代码省略.........
var queryBodyClauses = new GrammarDefinition("QueryBodyClauses");
queryBodyClauses.Rule = queryBodyClause | queryBodyClauses + queryBodyClause;
var queryBodyClausesOptional = new GrammarDefinition("QueryBodyClausesOptional",
rule: null | queryBodyClauses);
var linqExpression = new GrammarDefinition("LinqExpression",
rule: fromClause + queryBodyClausesOptional + selectClause,
createNode: node =>
{
var result = new LinqExpression();
result.Clauses.Add((LinqClause) node.Children[0].Result);
if (node.Children[1].HasChildren)
{
result.Clauses.AddRange(node.Children[1].Children[0].GetAllListAstNodes().Cast<LinqClause>());
}
result.Clauses.Add((LinqClause) node.Children[2].Result);
return result;
});
expression.Rule = conditionalExpression
| linqExpression
| lambdaExpression
| assignmentExpression;
#endregion
#region Statements
var statement = new GrammarDefinition("Statement");
var embeddedStatement = new GrammarDefinition("EmbeddedStatement");
var emptyStatement = new GrammarDefinition("EmptyStatement",
rule: ToElement(SEMICOLON),
createNode: node =>
{
var result = new EmptyStatement();
result.AddChild(AstNodeTitles.Semicolon, node.Children[0].Result);
return result;
});
var labelStatement = new GrammarDefinition("LabelStatement",
rule: identifierInsideBody + ToElement(COLON),
createNode: node => new LabelStatement((Identifier) node.Children[0].Result)
{
Colon = (AstToken) node.Children[1].Result
});
var expressionStatement = new GrammarDefinition("ExpressionStatement",
rule: expression + ToElement(SEMICOLON)
| Error + ToElement(SEMICOLON)
| Error + ToElement(CLOSE_BRACE)
| expression + ToElement(CLOSE_BRACE), // Common mistake in C# is to forget the semicolon at the end of a statement.
createNode: node =>
{
var result = new ExpressionStatement(node.Children[0].Result as Expression);
var endingToken = (AstToken) node.Children[1].Result;
if (endingToken.GetTokenCode() == (int) SEMICOLON)
{
result.AddChild(AstNodeTitles.Semicolon, node.Children[1].Result);
}
else
{
node.Context.SyntaxErrors.Add(new SyntaxError(
示例6: PostWalk
protected internal virtual void PostWalk(EmptyStatement node) { }
示例7: Exit
public override void Exit(EmptyStatement node)
{
level--;
}
示例8: case_907
void case_907()
#line 6067 "cs-parser.jay"
{
Error_SyntaxError (yyToken);
yyVal = new EmptyStatement (GetLocation (yyVals[0+yyTop]));
}
示例9: case_859
void case_859()
#line 5773 "cs-parser.jay"
{
/* Uses lexer.Location because semicolon location is not kept in quick mode*/
yyVal = new EmptyStatement (lexer.Location);
}
示例10: yyparse
//.........这里部分代码省略.........
break;
case 938:
case_938();
break;
case 939:
#line 6264 "cs-parser.jay"
{
yyVal = yyVals[0+yyTop];
}
break;
case 940:
case_940();
break;
case 941:
case_941();
break;
case 942:
#line 6285 "cs-parser.jay"
{
yyVal = yyVals[0+yyTop];
}
break;
case 943:
case_943();
break;
case 944:
case_944();
break;
case 945:
case_945();
break;
case 946:
#line 6319 "cs-parser.jay"
{ yyVal = new EmptyStatement (lexer.Location); }
break;
case 948:
case_948();
break;
case 949:
case_949();
break;
case 951:
#line 6343 "cs-parser.jay"
{ yyVal = null; }
break;
case 953:
#line 6348 "cs-parser.jay"
{ yyVal = new EmptyStatement (lexer.Location); }
break;
case 957:
case_957();
break;
case 958:
case_958();
break;
case 959:
case_959();
break;
case 960:
case_960();
break;
case 961:
case_961();
break;
case 962:
case_962();
示例11: VisitEmptyStatement
public void VisitEmptyStatement(EmptyStatement emptyStatement)
{
// EMPTY
}
示例12: VisitEmptyStatement
public override void VisitEmptyStatement(EmptyStatement emptyStatement)
{
_result.Add(new JsEmptyStatement());
}
示例13: VisitEmptyStatement
public void VisitEmptyStatement(EmptyStatement statement)
{
Formatter.StartNode(statement);
WriteSemicolon();
Formatter.EndNode();
}
示例14: Visit
public override object Visit (Mono.CSharpPs.EmptyStatement emptyStatement)
{
var result = new EmptyStatement ();
result.Location = Convert (emptyStatement.loc);
return result;
}
示例15: VisitEmptyStatement
public override void VisitEmptyStatement(EmptyStatement emptyStatement)
{
// Empty
}