Using an object's string variable in a switch statement
<p>I'm trying to figure out why I'm getting this error:</p>

<pre><code>    switch (token.type.GetName()) 
    {
        case PascalTokenType.BEGIN.name: // ERROR: A CONSTANT VALUE IS EXPECTED
        {
            CompoundStatementParser compoundParser = new CompoundStatementParser(this);
            statementNode = compoundParser.parse(token);
            break;
        }
    }
</code></pre>

<p><code>GetName()</code> and <code>name</code> both return strings. This is what the object looks like:</p>

<pre><code>    public static readonly PascalTokenType BEGIN = new PascalTokenType("BEGIN");
</code></pre>

<p>I know I could get around this problem by changing it to an <code>if</code> statement but when this is complete I'm going to have at least 20 conditions so I'd rather not. I'm supposing it's because <code>BEGIN.name</code> isn't assigned until runtime?</p>
