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; }
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; }
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); }
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); }
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); }
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); }
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; }
protected ExpressionNode(ParseNodeType nodeType, Token token) : base(nodeType, token) { }
protected ParseNode(ParseNodeType nodeType, Token token) { this.nodeType = nodeType; this.token = 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); }
protected TypeNode(ParseNodeType nodeType, Token token) : base(nodeType, token) { }
protected ParseNode(ParseNodeType nodeType, Token token) { this.nodeType = nodeType; this.token = token; }
protected AtomicNameNode(ParseNodeType nodeType, IdentifierToken identifier) : base(nodeType, identifier) { _identifier = identifier; }
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; }
protected MemberNode(ParseNodeType nodeType, Token token) : base(nodeType, token) { }
protected AtomicNameNode(ParseNodeType nodeType, IdentifierToken identifier) : base(nodeType, identifier) { _identifier = identifier; }
protected StatementNode(ParseNodeType nodeType, Token token) : base(nodeType, token) { }
protected ExpressionNode(ParseNodeType nodeType, Token token) : base(nodeType, token) { }
protected StatementNode(ParseNodeType nodeType, Token token) : base(nodeType, token) { }