本文整理汇总了C#中CheckedExpression类的典型用法代码示例。如果您正苦于以下问题:C# CheckedExpression类的具体用法?C# CheckedExpression怎么用?C# CheckedExpression使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CheckedExpression类属于命名空间,在下文中一共展示了CheckedExpression类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: VisitCheckedExpression
public virtual void VisitCheckedExpression(CheckedExpression checkedExpression)
{
if (this.ThrowException)
{
throw (Exception)this.CreateException(checkedExpression);
}
}
示例2: VisitCheckedExpression
public StringBuilder VisitCheckedExpression(CheckedExpression checkedExpression, int data)
{
throw new SLSharpException("SL# can only operate in unchecked context.");
}
示例3: VisitCheckedExpression
public override void VisitCheckedExpression(CheckedExpression checkedExpression)
{
ForceSpacesAfter(checkedExpression.LParToken, policy.SpacesWithinCheckedExpressionParantheses);
ForceSpacesBefore(checkedExpression.RParToken, policy.SpacesWithinCheckedExpressionParantheses);
base.VisitCheckedExpression(checkedExpression);
}
示例4: ParseCheckedOrMakeRefOrRefTypeOrUnchecked
private Expression ParseCheckedOrMakeRefOrRefTypeOrUnchecked(TokenSet followers)
//^ requires this.currentToken == Token.Checked || this.currentToken == Token.MakeRef || this.currentToken == Token.RefType || this.currentToken == Token.Unchecked;
//^ ensures followers[this.currentToken] || this.currentToken == Token.EndOfFile;
{
SourceLocationBuilder slb = new SourceLocationBuilder(this.scanner.SourceLocationOfLastScannedToken);
Token tok = this.currentToken;
this.GetNextToken();
this.Skip(Token.LeftParenthesis);
Expression operand = this.ParseExpression(followers|Token.RightParenthesis);
Expression result;
switch (tok) {
case Token.Checked: result = new CheckedExpression(operand, slb); break;
case Token.MakeRef: result = new MakeTypedReference(operand, slb); break;
case Token.RefType: result = new GetTypeOfTypedReference(operand, slb); break;
case Token.Unchecked: result = new UncheckedExpression(operand, slb); break;
default:
//^ assert false;
goto case Token.Checked;
}
this.SkipOverTo(Token.RightParenthesis, followers);
return result;
}
示例5: Visit
public override object Visit(CheckedExpression checkedExpression, object data)
{
return checkedExpression.Expression.AcceptVisitor(this, data);
}
示例6: Visit
public override object Visit (CheckedExpr checkedExpression)
{
var result = new CheckedExpression ();
var location = LocationsBag.GetLocations (checkedExpression);
result.AddChild (new CSharpTokenNode (Convert (checkedExpression.Location), "checked".Length), TypeOfExpression.Roles.Keyword);
if (location != null)
result.AddChild (new CSharpTokenNode (Convert (location[0]), 1), TypeOfExpression.Roles.LPar);
result.AddChild ((INode)checkedExpression.Expr.Accept (this), TypeOfExpression.Roles.Expression);
if (location != null)
result.AddChild (new CSharpTokenNode (Convert (location[1]), 1), TypeOfExpression.Roles.RPar);
return result;
}
示例7: TrackedVisitCheckedExpression
public virtual object TrackedVisitCheckedExpression(CheckedExpression checkedExpression, object data) {
return base.VisitCheckedExpression(checkedExpression, data);
}
示例8: VisitCheckedExpression
public virtual object VisitCheckedExpression(CheckedExpression checkedExpression, object data) {
Debug.Assert((checkedExpression != null));
Debug.Assert((checkedExpression.Expression != null));
return checkedExpression.Expression.AcceptVisitor(this, data);
}
示例9: PrimaryExpr
//.........这里部分代码省略.........
Expect(21);
#line 1932 "cs.ATG"
pexpr = new TypeOfExpression(type);
} else if (la.kind == 63) {
lexer.NextToken();
Expect(20);
Type(
#line 1934 "cs.ATG"
out type);
Expect(21);
#line 1934 "cs.ATG"
pexpr = new DefaultValueExpression(type);
} else if (la.kind == 105) {
lexer.NextToken();
Expect(20);
Type(
#line 1935 "cs.ATG"
out type);
Expect(21);
#line 1935 "cs.ATG"
pexpr = new SizeOfExpression(type);
} else if (la.kind == 58) {
lexer.NextToken();
Expect(20);
Expr(
#line 1936 "cs.ATG"
out expr);
Expect(21);
#line 1936 "cs.ATG"
pexpr = new CheckedExpression(expr);
} else if (la.kind == 118) {
lexer.NextToken();
Expect(20);
Expr(
#line 1937 "cs.ATG"
out expr);
Expect(21);
#line 1937 "cs.ATG"
pexpr = new UncheckedExpression(expr);
} else if (la.kind == 64) {
lexer.NextToken();
AnonymousMethodExpr(
#line 1938 "cs.ATG"
out expr);
#line 1938 "cs.ATG"
pexpr = expr;
} else SynErr(209);
#line 1940 "cs.ATG"
if (pexpr != null) {
if (pexpr.StartLocation.IsEmpty)
pexpr.StartLocation = startLocation;
if (pexpr.EndLocation.IsEmpty)
pexpr.EndLocation = t.EndLocation;
}
while (StartOf(36)) {
if (la.kind == 31 || la.kind == 32) {
#line 1948 "cs.ATG"
示例10: VisitCheckedExpression
public void VisitCheckedExpression(CheckedExpression node)
{
NotSupported(node);
}
示例11: VisitCheckedExpression
public void VisitCheckedExpression(CheckedExpression checkedExpression)
{
JsonObject expression = CreateJsonExpression(checkedExpression);
AddKeyword(expression, CheckedExpression.CheckedKeywordRole);
expression.AddJsonValue("expression", GenExpression(checkedExpression.Expression));
Push(expression);
}
示例12: VisitCheckedExpression
public virtual object VisitCheckedExpression(CheckedExpression checkedExpression, object data) {
throw new global::System.NotImplementedException("CheckedExpression");
}
示例13: PrimaryExpr
//.........这里部分代码省略.........
else if (this.StartOf(9))
{
this.TypeWithRestriction(out typeReference, true, true);
}
else
{
base.SynErr(0xb6);
}
base.Expect(0x15);
pexpr = new TypeOfExpression(typeReference);
}
else if ((this.la.kind == 0x3e) && (this.Peek(1).kind == 20))
{
base.Expect(0x3e);
base.Expect(20);
this.Type(out typeReference);
base.Expect(0x15);
pexpr = new DefaultValueExpression(typeReference);
}
else if (this.la.kind == 0x68)
{
base.lexer.NextToken();
base.Expect(20);
this.Type(out typeReference);
base.Expect(0x15);
pexpr = new SizeOfExpression(typeReference);
}
else if (this.la.kind == 0x39)
{
base.lexer.NextToken();
base.Expect(20);
this.Expr(out expression);
base.Expect(0x15);
pexpr = new CheckedExpression(expression);
}
else if (this.la.kind == 0x75)
{
base.lexer.NextToken();
base.Expect(20);
this.Expr(out expression);
base.Expect(0x15);
pexpr = new UncheckedExpression(expression);
}
else if (this.la.kind == 0x3f)
{
base.lexer.NextToken();
this.AnonymousMethodExpr(out expression);
pexpr = expression;
}
else
{
base.SynErr(0xb7);
}
}
else
{
string typeName = null;
switch (this.la.kind)
{
case 0x3d:
base.lexer.NextToken();
typeName = "decimal";
break;
case 0x41:
base.lexer.NextToken();
示例14: VisitCheckedExpression
public virtual object VisitCheckedExpression(CheckedExpression checkedExpression, object data) {
Debug.Assert((checkedExpression != null));
Debug.Assert((checkedExpression.Expression != null));
nodeStack.Push(checkedExpression.Expression);
checkedExpression.Expression.AcceptVisitor(this, data);
checkedExpression.Expression = ((Expression)(nodeStack.Pop()));
return null;
}
示例15: Visit
public override object Visit(CheckedExpr checkedExpression)
{
var result = new CheckedExpression();
var location = LocationsBag.GetLocations(checkedExpression);
result.AddChild(new CSharpTokenNode(Convert(checkedExpression.Location), CheckedExpression.CheckedKeywordRole), CheckedExpression.CheckedKeywordRole);
if (location != null)
result.AddChild(new CSharpTokenNode(Convert(location [0]), Roles.LPar), Roles.LPar);
if (checkedExpression.Expr != null)
result.AddChild((Expression)checkedExpression.Expr.Accept(this), Roles.Expression);
if (location != null && location.Count > 1)
result.AddChild(new CSharpTokenNode(Convert(location [1]), Roles.RPar), Roles.RPar);
return result;
}