/// <summary> /// Creates a new variable instance based on the provided variable declaration. /// </summary> /// <param name="variableDeclaration">The variable declaration this variable is based on.</param> public PVariable(VariableDeclaration variableDeclaration) { if (variableDeclaration == null) throw new ArgumentNullException("variableDeclaration"); _declaration = variableDeclaration; }
/// <summary> /// Creates a new (global) variable. /// </summary> /// <param name = "name">An identifier to be stored in the variable's <see cref = "Meta">MetaTable</see>.</param> /// <remarks> /// This constructor creates a <see cref = "MetaTable" />. /// </remarks> /// <exception cref = "ArgumentNullException"><paramref name = "name" /> is null.</exception> /// <exception cref = "ArgumentException"><paramref name = "name" /> is empty.</exception> public PVariable(string name) { if (name == null) throw new ArgumentNullException("name"); if (name.Length == 0) throw new ArgumentException("name is expected to contain at least one character."); _declaration = VariableDeclaration.Create(name); }