当前位置: 首页>>代码示例>>C#>>正文


C# Node.getProp方法代码示例

本文整理汇总了C#中EcmaScript.NET.Node.getProp方法的典型用法代码示例。如果您正苦于以下问题:C# Node.getProp方法的具体用法?C# Node.getProp怎么用?C# Node.getProp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在EcmaScript.NET.Node的用法示例。


在下文中一共展示了Node.getProp方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: getLocalBlockRef

 int getLocalBlockRef (Node node)
 {
     Node localBlock = (Node)node.getProp (Node.LOCAL_BLOCK_PROP);
     return localBlock.getExistingIntProp (Node.LOCAL_PROP);
 }
开发者ID:rumincayman,项目名称:EcmaScript.NET,代码行数:5,代码来源:Interpreter.cs

示例2: VisitExpression


//.........这里部分代码省略.........
                    break;


                case Token.SETVAR: {
                        if (itsData.itsNeedsActivation)
                            Context.CodeBug ();
                        string name = child.String;
                        child = child.Next;
                        VisitExpression (child, 0);
                        int index = scriptOrFn.getParamOrVarIndex (name);
                        addVarOp (Token.SETVAR, index);
                    }
                    break;



                case Token.NULL:
                case Token.THIS:
                case Token.THISFN:
                case Token.FALSE:
                case Token.TRUE:
                    addToken (type);
                    stackChange (1);
                    break;


                case Token.ENUM_NEXT:
                case Token.ENUM_ID:
                    addIndexOp (type, getLocalBlockRef (node));
                    stackChange (1);
                    break;


                case Token.REGEXP: {
                        int index = node.getExistingIntProp (Node.REGEXP_PROP);
                        addIndexOp (Token.REGEXP, index);
                        stackChange (1);
                    }
                    break;


                case Token.ARRAYLIT:
                case Token.OBJECTLIT:
                    VisitLiteral (node, child);
                    break;


                case Token.REF_SPECIAL:
                    VisitExpression (child, 0);
                    addStringOp (type, (string)node.getProp (Node.NAME_PROP));
                    break;


                case Token.REF_MEMBER:
                case Token.REF_NS_MEMBER:
                case Token.REF_NAME:
                case Token.REF_NS_NAME: {
                        int memberTypeFlags = node.getIntProp (Node.MEMBER_TYPE_PROP, 0);
                        // generate possible target, possible namespace and member
                        int childCount = 0;
                        do {
                            VisitExpression (child, 0);
                            ++childCount;
                            child = child.Next;
                        }
                        while (child != null);
                        addIndexOp (type, memberTypeFlags);
                        stackChange (1 - childCount);
                    }
                    break;


                case Token.DOTQUERY: {
                        int queryPC;
                        updateLineNumber (node);
                        VisitExpression (child, 0);
                        addIcode (Icode_ENTERDQ);
                        stackChange (-1);
                        queryPC = itsICodeTop;
                        VisitExpression (child.Next, 0);
                        addBackwardGoto (Icode_LEAVEDQ, queryPC);
                    }
                    break;


                case Token.DEFAULTNAMESPACE:
                case Token.ESCXMLATTR:
                case Token.ESCXMLTEXT:
                    VisitExpression (child, 0);
                    addToken (type);
                    break;

                default:
                    throw badTree (node);

            }
            //if (savedStackDepth + 1 != itsStackDepth) {
            //    EcmaScriptHelper.CodeBug();
            //}
        }
开发者ID:rumincayman,项目名称:EcmaScript.NET,代码行数:101,代码来源:Interpreter.cs

示例3: VisitLiteral

 void VisitLiteral (Node node, Node child)
 {
     int type = node.Type;
     int count;
     object [] propertyIds = null;
     if (type == Token.ARRAYLIT) {
         count = 0;
         for (Node n = child; n != null; n = n.Next) {
             ++count;
         }
     }
     else if (type == Token.OBJECTLIT) {
         propertyIds = (object [])node.getProp (Node.OBJECT_IDS_PROP);
         count = propertyIds.Length;
     }
     else {
         throw badTree (node);
     }
     addIndexOp (Icode_LITERAL_NEW, count);
     stackChange (1);
     while (child != null) {
         VisitExpression (child, 0);
         addIcode (Icode_LITERAL_SET);
         stackChange (-1);
         child = child.Next;
     }
     if (type == Token.ARRAYLIT) {
         int [] skipIndexes = (int [])node.getProp (Node.SKIP_INDEXES_PROP);
         if (skipIndexes == null) {
             addToken (Token.ARRAYLIT);
         }
         else {
             int index = itsLiteralIds.size ();
             itsLiteralIds.add (skipIndexes);
             addIndexOp (Icode_SPARE_ARRAYLIT, index);
         }
     }
     else {
         int index = itsLiteralIds.size ();
         itsLiteralIds.add (propertyIds);
         addIndexOp (Token.OBJECTLIT, index);
     }
 }
开发者ID:rumincayman,项目名称:EcmaScript.NET,代码行数:43,代码来源:Interpreter.cs


注:本文中的EcmaScript.NET.Node.getProp方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。