public FormalParameterNode(string name, TypeNameNode typeName, IEnumerable<AttributeNode> attributes)
        {
            if (name == null) throw new ArgumentNullException("name", "The name is ");
            if (typeName == null) throw new ArgumentNullException("typeName");

            if (attributes == null)
                ThrowHelper.ThrowArgumentNullException(() => attributes);

            Name = name;
            TypeName = typeName;
            Attributes = attributes.ToList();
        }
Exemple #2
0
 public Variable(IdentifierNode identifier, TypeNameNode typeName, BlockStatementNode scope)
 {
     if (identifier == null)
         throw new ArgumentNullException("identifier", "The identifier is null!");
     if (typeName == null) 
         throw new ArgumentNullException("typeName", "The typeName is null!");
     if (scope == null) 
         throw new ArgumentNullException("scope", "The scope is null!");
     
     Identifier = identifier;
     TypeName = typeName;
     Scope = scope;
 }
        public static ConcreteTypeDeclaration CreateTypeDeclarationFromTypeName(TypeNameNode typeNameNode, Scope scope)
        {
            if (typeNameNode == null)
                ThrowHelper.ThrowArgumentNullException(() => typeNameNode);

            if (scope == null)
                ThrowHelper.ThrowArgumentNullException(() => scope);

            Type result;
            if (_standardTypes.TryGetValue(typeNameNode.Type, out result))
                return new ConcreteTypeDeclaration(typeNameNode.Type, scope, result);

            return null;
        }
 public FormalParameterNode(string name, TypeNameNode typeName)
     : this(name, typeName, new AttributeNode[0])
 {
 }