title: ASN.1 Type References in Value Assignments
body: <p>In ASN.1, Value Assignment syntax requires an identifier, a Type Reference, and a Value. Such as:</p>
  
  <pre><code>age INTEGER ::= 45
  </code></pre>
  
  <p>or</p>
  
  <pre><code>name UTF8String ::= "bob"
  </code></pre>
  
  <p>Generally, a user-defined type would be a more complex type, such as a SEQUENCE or a type with constraints.  Suppose we have a SEQUENCE type like this:</p>
  
  <pre><code>MySequence ::= SEQUENCE {
    age INTEGER,
    name UTF8String
  }
  </code></pre>
  
  <p>I could then create a Value Assignment like:</p>
  
  <pre><code>seq MySequence ::= { 50, "bob" }
  </code></pre>
  
  <p>But suppose <code>MySequence</code> was never defined.  Is it legal to define types on the fly when creating a Value Assignment?  For example, could I say:</p>
  
  <pre><code>seq SEQUENCE {  age INTEGER, name UTF8String } ::= { 50, "bob" }
  </code></pre>
  
  <p>I realize this syntax is ugly, but I'm simply asking if this ALLOWED by the ASN.1 standard.</p>
  
  <p>Or what about creating a Sub Type on the fly in a Value Assignment?  Is it valid ASN.1 syntax to say:</p>
  
  <pre><code>int INTEGER (0..10) ::= 5
  </code></pre>