• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# CodeModel.ParseNodeList类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中ScriptSharp.CodeModel.ParseNodeList的典型用法代码示例。如果您正苦于以下问题:C# ParseNodeList类的具体用法?C# ParseNodeList怎么用?C# ParseNodeList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ParseNodeList类属于ScriptSharp.CodeModel命名空间,在下文中一共展示了ParseNodeList类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: EnumerationFieldNode

        public EnumerationFieldNode(ParseNodeList attributes, AtomicNameNode name,
                                    ParseNode value)
            : base(ParseNodeType.EnumerationFieldDeclaration, name.token) {
            _attributes = GetParentedNodeList(AttributeNode.GetAttributeList(attributes));
            _name = (AtomicNameNode)GetParentedNode(name);

            if (value is LiteralNode) {
                LiteralNode literalNode = (LiteralNode)value;
                _value = ((LiteralToken)literalNode.Token).LiteralValue;
            }
            else {
                // TODO: Clearly we need something more general...
                //       C# allows expressions. Likely expressions to be used
                //       include negative values, binary OR'd values,
                //       expressions involving other enum members (esp. hard to deal with)
                // For now, just adding support for negative numbers, as
                // everything else can be worked around in source code.

                UnaryExpressionNode expressionNode = value as UnaryExpressionNode;
                if ((expressionNode != null) && (expressionNode.Operator == TokenType.Minus) &&
                    (expressionNode.Child is LiteralNode)) {

                    try {
                        LiteralToken literalToken =
                            (LiteralToken)((LiteralNode)expressionNode.Child).Token;
                        int numericValue = (int)Convert.ChangeType(literalToken.LiteralValue, typeof(int));

                        _value = -numericValue;
                    }
                    catch {
                    }
                }
            }
        }
开发者ID:fugaku,项目名称:scriptsharp,代码行数:34,代码来源:EnumerationFieldNode.cs


示例2: SwitchNode

 public SwitchNode(Token token,
                   ParseNode condition,
                   ParseNodeList cases)
     : base(ParseNodeType.Switch, token) {
     _condition = GetParentedNode(condition);
     _cases = GetParentedNodeList(cases);
 }
开发者ID:fugaku,项目名称:scriptsharp,代码行数:7,代码来源:SwitchNode.cs


示例3: ConstantFieldDeclarationNode

 public ConstantFieldDeclarationNode(Token token,
                                     ParseNodeList attributes,
                                     Modifiers modifiers,
                                     ParseNode type,
                                     ParseNodeList initializers)
     : base(ParseNodeType.ConstFieldDeclaration, token, attributes, modifiers, type, initializers, false) {
 }
开发者ID:fugaku,项目名称:scriptsharp,代码行数:7,代码来源:ConstantFieldDeclarationNode.cs


示例4: DestructorDeclarationNode

 public DestructorDeclarationNode(Token token,
                                  ParseNodeList attributes,
                                  Modifiers modifiers,
                                  AtomicNameNode name,
                                  BlockStatementNode body)
     : base(ParseNodeType.DestructorDeclaration, token, attributes, modifiers, /* return type */ null, name, new ParseNodeList(), body) {
 }
开发者ID:fugaku,项目名称:scriptsharp,代码行数:7,代码来源:DestructorDeclarationNode.cs


示例5: SwitchSectionNode

 public SwitchSectionNode(Token token,
                          ParseNodeList labels,
                          ParseNodeList statements)
     : base(ParseNodeType.SwitchSection, token) {
     _labels = GetParentedNodeList(labels);
     _statements = GetParentedNodeList(statements);
 }
开发者ID:fugaku,项目名称:scriptsharp,代码行数:7,代码来源:SwitchSectionNode.cs


示例6: TypeParameterConstraintNode

 public TypeParameterConstraintNode(AtomicNameNode typeParameter, ParseNodeList typeConstraints,
                             bool hasConstructorConstraint)
     : base(ParseNodeType.ConstraintClause, typeParameter.token) {
     _typeParameter = typeParameter;
     _typeConstraints = typeConstraints;
     _hasConstructorConstraint = hasConstructorConstraint;
 }
开发者ID:fugaku,项目名称:scriptsharp,代码行数:7,代码来源:TypeParameterConstraintNode.cs


示例7: AttributeBlockNode

 public AttributeBlockNode(Token token,
                           AttributeTargets location,
                           ParseNodeList attributes)
     : base(ParseNodeType.AttributeBlock, token) {
     _location = location;
     _attributes = GetParentedNodeList(attributes);
 }
开发者ID:fugaku,项目名称:scriptsharp,代码行数:7,代码来源:AttributeBlockNode.cs


示例8: NamespaceNode

 public NamespaceNode(Token token, string name,
                      ParseNodeList usingClauses,
                      ParseNodeList members)
     : base(ParseNodeType.Namespace, token) {
     _name = name;
     _usingClauses = GetParentedNodeList(usingClauses);
     _members = GetParentedNodeList(members);
 }
开发者ID:fugaku,项目名称:scriptsharp,代码行数:8,代码来源:NamespaceNode.cs


示例9: VariableDeclarationNode

 public VariableDeclarationNode(Token token,
                                ParseNodeList attributes,
                                Modifiers modifiers,
                                ParseNode type,
                                ParseNodeList initializers,
                                bool isFixed)
     : this(ParseNodeType.VariableDeclaration, token, attributes, modifiers, type, initializers, isFixed) {
 }
开发者ID:fugaku,项目名称:scriptsharp,代码行数:8,代码来源:VariableDeclarationNode.cs


示例10: TryNode

 public TryNode(Token token,
                ParseNode body,
                ParseNodeList catchClauses,
                ParseNode finallyClause)
     : base(ParseNodeType.Try, token) {
     _body = GetParentedNode(body);
     _catchClauses = GetParentedNodeList(catchClauses);
     _finallyClause = GetParentedNode(finallyClause);
 }
开发者ID:fugaku,项目名称:scriptsharp,代码行数:9,代码来源:TryNode.cs


示例11: OperatorDeclarationNode

 public OperatorDeclarationNode(Token token,
                                ParseNodeList attributes,
                                Modifiers modifiers,
                                TokenType operatorNodeType,
                                ParseNode returnType,
                                ParseNodeList formals,
                                BlockStatementNode body)
     : base(ParseNodeType.OperatorDeclaration, token, attributes, modifiers, returnType, /* name */ null, formals, body) {
     this.operatorTokenType = operatorNodeType;
 }
开发者ID:fugaku,项目名称:scriptsharp,代码行数:10,代码来源:OperatorDeclarationNode.cs


示例12: PropertyDeclarationNode

 public PropertyDeclarationNode(Token token,
                                ParseNodeList attributes,
                                Modifiers modifiers,
                                ParseNode type,
                                NameNode interfaceType,
                                AtomicNameNode name,
                                AccessorNode getOrRemove,
                                AccessorNode setOrAdd)
     : this(ParseNodeType.PropertyDeclaration, token, attributes, modifiers, type, interfaceType, getOrRemove, setOrAdd) {
     _name = (AtomicNameNode)GetParentedNode(name);
 }
开发者ID:fugaku,项目名称:scriptsharp,代码行数:11,代码来源:PropertyDeclarationNode.cs


示例13: AccessorNode

 public AccessorNode(Token token,
                     ParseNodeList attributes,
                     AtomicNameNode name,
                     BlockStatementNode body,
                     Modifiers modifiers)
     : base(ParseNodeType.AccessorDeclaration, token) {
     _name = (AtomicNameNode)GetParentedNode(name);
     _implementation = (BlockStatementNode)GetParentedNode(body);
     _attributes = GetParentedNodeList(attributes);
     _modifiers = modifiers;
 }
开发者ID:fugaku,项目名称:scriptsharp,代码行数:11,代码来源:AccessorNode.cs


示例14: ParameterNode

 public ParameterNode(Token token,
                            ParseNodeList attributes,
                            ParameterFlags flags,
                            ParseNode type,
                            AtomicNameNode name)
     : base(ParseNodeType.FormalParameter, token) {
     _attributes = GetParentedNodeList(AttributeNode.GetAttributeList(attributes));
     _flags = flags;
     _type = GetParentedNode(type);
     _name = (AtomicNameNode)GetParentedNode(name);
 }
开发者ID:fugaku,项目名称:scriptsharp,代码行数:11,代码来源:ParameterNode.cs


示例15: CompilationUnitNode

 public CompilationUnitNode(Token token,
                            ParseNodeList externAliases,
                            ParseNodeList usingClauses,
                            ParseNodeList attributes,
                            ParseNodeList members)
     : base(ParseNodeType.CompilationUnit, token) {
     _externAliases = GetParentedNodeList(externAliases);
     _usingClauses = GetParentedNodeList(usingClauses);
     _attributes = GetParentedNodeList(attributes);
     _members = GetParentedNodeList(GetNamespaces(members));
 }
开发者ID:fugaku,项目名称:scriptsharp,代码行数:11,代码来源:CompilationUnitNode.cs


示例16: ConstructorDeclarationNode

 public ConstructorDeclarationNode(Token token,
                                   ParseNodeList attributes,
                                   Modifiers modifiers,
                                   AtomicNameNode name,
                                   ParseNodeList formals,
                                   bool callBase,
                                   ParseNode baseArguments,
                                   BlockStatementNode body)
     : base(ParseNodeType.ConstructorDeclaration, token, attributes, modifiers, /* return type */ null, name, formals, body) {
     _callBase = callBase;
     _baseArguments = GetParentedNode(baseArguments);
 }
开发者ID:fugaku,项目名称:scriptsharp,代码行数:12,代码来源:ConstructorDeclarationNode.cs


示例17: DelegateTypeNode

 public DelegateTypeNode(Token token,
                         ParseNodeList attributes,
                         Modifiers modifiers,
                         ParseNode returnType,
                         AtomicNameNode name,
                         ParseNodeList typeParameters,
                         ParseNodeList parameters,
                         ParseNodeList constraintClauses)
     : base(ParseNodeType.Delegate, token, TokenType.Delegate, attributes, modifiers, name, typeParameters, constraintClauses) {
     _returnType = GetParentedNode(returnType);
     _parameters = GetParentedNodeList(parameters);
 }
开发者ID:fugaku,项目名称:scriptsharp,代码行数:12,代码来源:DelegateTypeNode.cs


示例18: IndexerDeclarationNode

 public IndexerDeclarationNode(Token token,
                               ParseNodeList attributes,
                               Modifiers modifiers,
                               ParseNode type,
                               NameNode interfaceType,
                               ParseNodeList parameters,
                               AccessorNode get,
                               AccessorNode set)
     : base(ParseNodeType.IndexerDeclaration, token, attributes, modifiers, type, interfaceType, get, set)
 {
     _parameters = GetParentedNodeList(parameters);
 }
开发者ID:mobilligy,项目名称:scriptsharp,代码行数:12,代码来源:IndexerDeclarationNode.cs


示例19: CustomTypeNode

 public CustomTypeNode(Token token, TokenType type,
                       ParseNodeList attributes,
                       Modifiers modifiers,
                       AtomicNameNode name,
                       ParseNodeList typeParameters,
                       ParseNodeList baseTypes,
                       ParseNodeList constraintClauses,
                       ParseNodeList members)
     : base(ParseNodeType.Type, token, type, attributes, modifiers, name, typeParameters, constraintClauses) {
     _baseTypes = GetParentedNodeList(baseTypes);
     _members = GetParentedNodeList(members);
 }
开发者ID:fugaku,项目名称:scriptsharp,代码行数:12,代码来源:CustomTypeNode.cs


示例20: FieldDeclarationNode

 protected FieldDeclarationNode(ParseNodeType nodeType, Token token,
                                ParseNodeList attributes,
                                Modifiers modifiers,
                                ParseNode type,
                                ParseNodeList initializers,
                                bool isFixed)
     : base(nodeType, token) {
     _attributes = GetParentedNodeList(AttributeNode.GetAttributeList(attributes));
     _modifiers = modifiers;
     _type = GetParentedNode(type);
     _initializers = GetParentedNodeList(initializers);
     _isFixed = isFixed;
 }
开发者ID:fugaku,项目名称:scriptsharp,代码行数:13,代码来源:FieldDeclarationNode.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# CodeModel.Token类代码示例发布时间:2022-05-26
下一篇:
C# CodeModel.ParseNode类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap