Babel.Compiler.CallExpression.Accept C# (CSharp) Method

Accept() public method

public Accept ( NodeVisitor visitor ) : void
visitor NodeVisitor
return void
        public override void Accept(NodeVisitor visitor)
        {
            visitor.VisitCall(this);
        }

Usage Example

コード例 #1
0
ファイル: typecheck.cs プロジェクト: shugo/babel
 public override void VisitCase(CaseStatement caseStmt)
 {
     caseStmt.Test.Accept(this);
     caseStmt.TestName = getTemporallyName();
     localVariableStack.AddLocal(caseStmt.TestName,
                                 caseStmt.Test.NodeType);
     foreach (CaseWhen when in caseStmt.WhenPartList) {
         foreach (Expression value in when.ValueList) {
             LocalExpression test =
                 new LocalExpression(caseStmt.TestName, value.Location);
             ModalExpression arg =
                 new ModalExpression(ArgumentMode.In, value,
                                     value.Location);
             TypedNodeList args = new TypedNodeList(arg);
             CallExpression call =
                 new CallExpression(test, "is_eq", args, value.Location);
             call.Accept(this);
             if (call.NodeType == typeManager.BoolType) {
                 when.TestCallList.Append(call);
             }
             else {
                 if (call.NodeType != null) {
                     report.Error(value.Location,
                                  "no match for {0}::is_eq({1}):BOOL",
                                  caseStmt.Test.NodeType.FullName,
                                  value.NodeType.FullName);
                 }
             }
         }
         when.ThenPart.Accept(this);
     }
     if (caseStmt.ElsePart != null)
         caseStmt.ElsePart.Accept(this);
 }