protected VariableDeclarationNode(ParseNodeType nodeType, Token token,
                                   ParseNodeList attributes,
                                   Modifiers modifiers,
                                   ParseNode type,
                                   ParseNodeList initializers,
                                   bool isFixed)
     : base(nodeType, token) {
     this.attributes = GetParentedNodeList(attributes);
     this.modifiers = modifiers;
     this.type = GetParentedNode(type);
     this.initializers = GetParentedNodeList(initializers);
     this.isFixed = isFixed;
 }
 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;
 }
Beispiel #3
0
 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;
 }
Beispiel #4
0
 public UserTypeNode(ParseNodeType type, Token token, TokenType tokenType,
                     ParseNodeList attributes,
                     Modifiers modifiers,
                     AtomicNameNode name,
                     ParseNodeList typeParameters,
                     ParseNodeList constraintClauses)
     : base(type, token) {
     _type = tokenType;
     _attributes = GetParentedNodeList(AttributeNode.GetAttributeList(attributes));
     _modifiers = modifiers;
     _nameNode = name;
     _typeParameters = GetParentedNodeList(typeParameters);
     _constraintClauses = GetParentedNodeList(constraintClauses);
 }
Beispiel #5
0
 protected VariableDeclarationNode(ParseNodeType nodeType, Token token,
                                   ParseNodeList attributes,
                                   Modifiers modifiers,
                                   ParseNode type,
                                   ParseNodeList initializers,
                                   bool isFixed)
     : base(nodeType, token)
 {
     this.attributes   = GetParentedNodeList(attributes);
     this.modifiers    = modifiers;
     this.type         = GetParentedNode(type);
     this.initializers = GetParentedNodeList(initializers);
     this.isFixed      = isFixed;
 }
 protected MethodDeclarationNode(ParseNodeType nodeType, Token token,
                                 ParseNodeList attributes,
                                 Modifiers modifiers,
                                 ParseNode returnType,
                                 AtomicNameNode name,
                                 ParseNodeList formals,
                                 BlockStatementNode body)
     : base(nodeType, token) {
     _attributes = GetParentedNodeList(AttributeNode.GetAttributeList(attributes));
     _modifiers = modifiers;
     _returnType = GetParentedNode(returnType);
     _name = (AtomicNameNode)GetParentedNode(name);
     _parameters = GetParentedNodeList(formals);
     _implementation = (BlockStatementNode)GetParentedNode(body);
 }
 protected PropertyDeclarationNode(ParseNodeType nodeType, Token token,
                                   ParseNodeList attributes,
                                   Modifiers modifiers,
                                   ParseNode type,
                                   NameNode interfaceType,
                                   AccessorNode getOrRemove,
                                   AccessorNode setOrAdd)
     : base(nodeType, token) {
     _attributes = GetParentedNodeList(AttributeNode.GetAttributeList(attributes));
     _modifiers = modifiers;
     _type = GetParentedNode(type);
     _interfaceType = (NameNode)GetParentedNode(interfaceType);
     _getOrRemove = (AccessorNode)GetParentedNode(getOrRemove);
     _setOrAdd = (AccessorNode)GetParentedNode(setOrAdd);
 }
Beispiel #8
0
 public UserTypeNode(ParseNodeType type, Token token, TokenType tokenType,
                     ParseNodeList attributes,
                     Modifiers modifiers,
                     AtomicNameNode name,
                     ParseNodeList typeParameters,
                     ParseNodeList constraintClauses)
     : base(type, token)
 {
     _type              = tokenType;
     _attributes        = GetParentedNodeList(AttributeNode.GetAttributeList(attributes));
     _modifiers         = modifiers;
     _nameNode          = name;
     _typeParameters    = GetParentedNodeList(typeParameters);
     _constraintClauses = GetParentedNodeList(constraintClauses);
 }
Beispiel #9
0
 protected MethodDeclarationNode(ParseNodeType nodeType, Token token,
                                 ParseNodeList attributes,
                                 Modifiers modifiers,
                                 ParseNode returnType,
                                 AtomicNameNode name,
                                 ParseNodeList formals,
                                 BlockStatementNode body)
     : base(nodeType, token)
 {
     _attributes     = GetParentedNodeList(AttributeNode.GetAttributeList(attributes));
     _modifiers      = modifiers;
     _returnType     = GetParentedNode(returnType);
     _name           = (AtomicNameNode)GetParentedNode(name);
     _parameters     = GetParentedNodeList(formals);
     _implementation = (BlockStatementNode)GetParentedNode(body);
 }
Beispiel #10
0
 protected PropertyDeclarationNode(ParseNodeType nodeType, Token token,
                                   ParseNodeList attributes,
                                   Modifiers modifiers,
                                   ParseNode type,
                                   NameNode interfaceType,
                                   AccessorNode getOrRemove,
                                   AccessorNode setOrAdd)
     : base(nodeType, token)
 {
     _attributes    = GetParentedNodeList(AttributeNode.GetAttributeList(attributes));
     _modifiers     = modifiers;
     _type          = GetParentedNode(type);
     _interfaceType = (NameNode)GetParentedNode(interfaceType);
     _getOrRemove   = (AccessorNode)GetParentedNode(getOrRemove);
     _setOrAdd      = (AccessorNode)GetParentedNode(setOrAdd);
 }
Beispiel #11
0
 public UserTypeNode(ParseNodeType type, Token token, TokenType tokenType,
                     ParseNodeList attributes,
                     Modifiers modifiers,
                     AtomicNameNode name,
                     ParseNodeList typeParameters,
                     ParseNodeList constraintClauses,
                     bool isNestedType = false)
     : base(type, token)
 {
     Type                   = tokenType;
     Attributes             = GetParentedNodeList(AttributeNode.GetAttributeList(attributes));
     Modifiers              = modifiers;
     nameNode               = name;
     this.TypeParameters    = GetParentedNodeList(typeParameters);
     this.constraintClauses = GetParentedNodeList(constraintClauses);
     IsNestedType           = isNestedType;
 }
Beispiel #12
0
 protected ExpressionNode(ParseNodeType nodeType, Token token)
     : base(nodeType, token)
 {
 }
Beispiel #13
0
 protected ParseNode(ParseNodeType nodeType, Token token)
 {
     this.nodeType = nodeType;
     this.token    = token;
 }
Beispiel #14
0
        private Type GetValidatorType(ParseNodeType nodeType, CompilerOptions options)
        {
            switch (nodeType)
            {
            case ParseNodeType.CompilationUnit:
                return(typeof(CompilationUnitNodeValidator));

            case ParseNodeType.Namespace:
                return(typeof(NamespaceNodeValidator));

            case ParseNodeType.Name:
            case ParseNodeType.GenericName:
                return(typeof(NameNodeValidator));

            case ParseNodeType.Type:
                return(typeof(CustomTypeNodeValidator));

            case ParseNodeType.ArrayType:
                return(typeof(ArrayTypeNodeValidator));

            case ParseNodeType.FormalParameter:
                return(typeof(ParameterNodeValidator));

            case ParseNodeType.EnumerationFieldDeclaration:
                return(typeof(EnumerationFieldNodeValidator));

            case ParseNodeType.FieldDeclaration:
            case ParseNodeType.ConstFieldDeclaration:
                return(typeof(FieldDeclarationNodeValidator));

            case ParseNodeType.IndexerDeclaration:
                return(typeof(IndexerDeclarationNodeValidator));

            case ParseNodeType.PropertyDeclaration:
                return(typeof(PropertyDeclarationNodeValidator));

            case ParseNodeType.EventDeclaration:
                return(typeof(EventDeclarationNodeValidator));

            case ParseNodeType.MethodDeclaration:
            case ParseNodeType.ConstructorDeclaration:
                return(typeof(MethodDeclarationNodeValidator));

            case ParseNodeType.Throw:
                return(typeof(ThrowNodeValidator));

            case ParseNodeType.Try:
                return(typeof(TryNodeValidator));

            case ParseNodeType.ArrayNew:
                return(typeof(ArrayNewNodeValidator));

            case ParseNodeType.New:
                return(typeof(NewNodeValidator));

            case ParseNodeType.Catch:
            case ParseNodeType.ArrayInitializer:
            case ParseNodeType.Literal:
            case ParseNodeType.AttributeBlock:
            case ParseNodeType.Attribute:
            case ParseNodeType.AccessorDeclaration:
            case ParseNodeType.VariableDeclaration:
            case ParseNodeType.ConstDeclaration:
            case ParseNodeType.MultiPartName:
            case ParseNodeType.UsingNamespace:
            case ParseNodeType.PredefinedType:
            case ParseNodeType.UnaryExpression:
            case ParseNodeType.Conditional:
            case ParseNodeType.Block:
            case ParseNodeType.ExpressionStatement:
            case ParseNodeType.EmptyStatement:
            case ParseNodeType.VariableDeclarator:
            case ParseNodeType.IfElse:
            case ParseNodeType.Switch:
            case ParseNodeType.SwitchSection:
            case ParseNodeType.For:
            case ParseNodeType.Foreach:
            case ParseNodeType.While:
            case ParseNodeType.DoWhile:
            case ParseNodeType.CaseLabel:
            case ParseNodeType.DefaultLabel:
            case ParseNodeType.This:
            case ParseNodeType.Base:
            case ParseNodeType.Cast:
            case ParseNodeType.ExpressionList:
            case ParseNodeType.Break:
            case ParseNodeType.Continue:
            case ParseNodeType.Return:
            case ParseNodeType.Typeof:
            case ParseNodeType.Delegate:
            case ParseNodeType.UsingAlias:
            case ParseNodeType.AnonymousMethod:
            case ParseNodeType.BinaryExpression:
                // No validation required
                break;

            case ParseNodeType.PointerType:
            case ParseNodeType.OperatorDeclaration:
            case ParseNodeType.DestructorDeclaration:
            case ParseNodeType.Goto:
            case ParseNodeType.Lock:
            case ParseNodeType.UnsafeStatement:
            case ParseNodeType.YieldReturn:
            case ParseNodeType.YieldBreak:
            case ParseNodeType.LabeledStatement:
            case ParseNodeType.Checked:
            case ParseNodeType.Unchecked:
            case ParseNodeType.Using:
            case ParseNodeType.Sizeof:
            case ParseNodeType.Fixed:
            case ParseNodeType.StackAlloc:
            case ParseNodeType.DefaultValueExpression:
            case ParseNodeType.ExternAlias:
            case ParseNodeType.AliasQualifiedName:
            case ParseNodeType.TypeParameter:
            case ParseNodeType.ConstraintClause:
                return(typeof(UnsupportedParseNodeValidator));

            default:
                Debug.Fail("Unexpected node type in validator: " + nodeType);
                break;
            }

            return(null);
        }
 protected TypeNode(ParseNodeType nodeType, Token token)
     : base(nodeType, token)
 {
 }
Beispiel #16
0
 protected ParseNode(ParseNodeType nodeType, Token token) {
     this.nodeType = nodeType;
     this.token = token;
 }
Beispiel #17
0
 protected AtomicNameNode(ParseNodeType nodeType, IdentifierToken identifier)
     : base(nodeType, identifier)
 {
     _identifier = identifier;
 }
Beispiel #18
0
 protected NameNode(ParseNodeType nodeType, Token token)
     : base(nodeType, token) {
 }
        private Type GetValidatorType(ParseNodeType nodeType, CompilerOptions options) {
            switch (nodeType) {
                case ParseNodeType.CompilationUnit:
                    return typeof(CompilationUnitNodeValidator);
                case ParseNodeType.Namespace:
                    return typeof(NamespaceNodeValidator);
                case ParseNodeType.Name:
                case ParseNodeType.GenericName:
                    return typeof(NameNodeValidator);
                case ParseNodeType.Type:
                    return typeof(CustomTypeNodeValidator);
                case ParseNodeType.ArrayType:
                    return typeof(ArrayTypeNodeValidator);
                case ParseNodeType.FormalParameter:
                    return typeof(ParameterNodeValidator);
                case ParseNodeType.EnumerationFieldDeclaration:
                    return typeof(EnumerationFieldNodeValidator);
                case ParseNodeType.FieldDeclaration:
                case ParseNodeType.ConstFieldDeclaration:
                    return typeof(FieldDeclarationNodeValidator);
                case ParseNodeType.IndexerDeclaration:
                    return typeof(IndexerDeclarationNodeValidator);
                case ParseNodeType.PropertyDeclaration:
                    return typeof(PropertyDeclarationNodeValidator);
                case ParseNodeType.EventDeclaration:
                    return typeof(EventDeclarationNodeValidator);
                case ParseNodeType.MethodDeclaration:
                case ParseNodeType.ConstructorDeclaration:
                    return typeof(MethodDeclarationNodeValidator);
                case ParseNodeType.Throw:
                    return typeof(ThrowNodeValidator);
                case ParseNodeType.Try:
                    return typeof(TryNodeValidator);
                case ParseNodeType.ArrayNew:
                    return typeof(ArrayNewNodeValidator);
                case ParseNodeType.New:
                    return typeof(NewNodeValidator);
                case ParseNodeType.Catch:
                case ParseNodeType.ArrayInitializer:
                case ParseNodeType.Literal:
                case ParseNodeType.AttributeBlock:
                case ParseNodeType.Attribute:
                case ParseNodeType.AccessorDeclaration:
                case ParseNodeType.VariableDeclaration:
                case ParseNodeType.ConstDeclaration:
                case ParseNodeType.MultiPartName:
                case ParseNodeType.UsingNamespace:
                case ParseNodeType.PredefinedType:
                case ParseNodeType.UnaryExpression:
                case ParseNodeType.Conditional:
                case ParseNodeType.Block:
                case ParseNodeType.ExpressionStatement:
                case ParseNodeType.EmptyStatement:
                case ParseNodeType.VariableDeclarator:
                case ParseNodeType.IfElse:
                case ParseNodeType.Switch:
                case ParseNodeType.SwitchSection:
                case ParseNodeType.For:
                case ParseNodeType.Foreach:
                case ParseNodeType.While:
                case ParseNodeType.DoWhile:
                case ParseNodeType.CaseLabel:
                case ParseNodeType.DefaultLabel:
                case ParseNodeType.This:
                case ParseNodeType.Base:
                case ParseNodeType.Cast:
                case ParseNodeType.ExpressionList:
                case ParseNodeType.Break:
                case ParseNodeType.Continue:
                case ParseNodeType.Return:
                case ParseNodeType.Typeof:
                case ParseNodeType.Delegate:
                case ParseNodeType.UsingAlias:
                case ParseNodeType.AnonymousMethod:
                case ParseNodeType.BinaryExpression:
                    // No validation required
                    break;
                case ParseNodeType.PointerType:
                case ParseNodeType.OperatorDeclaration:
                case ParseNodeType.DestructorDeclaration:
                case ParseNodeType.Goto:
                case ParseNodeType.Lock:
                case ParseNodeType.UnsafeStatement:
                case ParseNodeType.YieldReturn:
                case ParseNodeType.YieldBreak:
                case ParseNodeType.LabeledStatement:
                case ParseNodeType.Checked:
                case ParseNodeType.Unchecked:
                case ParseNodeType.Using:
                case ParseNodeType.Sizeof:
                case ParseNodeType.Fixed:
                case ParseNodeType.StackAlloc:
                case ParseNodeType.DefaultValueExpression:
                case ParseNodeType.ExternAlias:
                case ParseNodeType.AliasQualifiedName:
                case ParseNodeType.TypeParameter:
                case ParseNodeType.ConstraintClause:
                    return typeof(UnsupportedParseNodeValidator);
                default:
                    Debug.Fail("Unexpected node type in validator: " + nodeType);
                    break;
            }

            return null;
        }
Beispiel #20
0
 protected MemberNode(ParseNodeType nodeType, Token token)
     : base(nodeType, token)
 {
 }
Beispiel #21
0
 protected AtomicNameNode(ParseNodeType nodeType, IdentifierToken identifier)
     : base(nodeType, identifier)
 {
     _identifier = identifier;
 }
Beispiel #22
0
 protected StatementNode(ParseNodeType nodeType, Token token)
     : base(nodeType, token)
 {
 }
Beispiel #23
0
 protected ExpressionNode(ParseNodeType nodeType, Token token)
     : base(nodeType, token)
 {
 }
Beispiel #24
0
 protected StatementNode(ParseNodeType nodeType, Token token)
     : base(nodeType, token) {
 }