public static WordClassification?ToWordClassification(this DelimClassification Delim)
        {
            switch (Delim)
            {
            case DelimClassification.CloseBraced:
                return(WordClassification.CloseBraced);

            case DelimClassification.CommentToEnd:
                return(WordClassification.CommentToEnd);

            // dividers, whitespace, end of line - never considered a word.
            case DelimClassification.DividerSymbol:
                return(null);

            case DelimClassification.EmbeddedComment:
                return(WordClassification.EmbeddedComment);

            case DelimClassification.EndOfString:
                return(null);

            case DelimClassification.EndStmt:
                return(null);

            case DelimClassification.ExpressionSymbol:
                return(WordClassification.ExpressionSymbol);

            case DelimClassification.Assignment:
                return(WordClassification.Assignment);

            case DelimClassification.NewLine:
                return(null);

            case DelimClassification.OpenContentBraced:
                return(WordClassification.OpenContentBraced);

            case DelimClassification.OpenNamedBraced:
                return(WordClassification.OpenNamedBraced);

            case DelimClassification.PathSep:
                return(null);

            case DelimClassification.Quote:
                return(null);

            case DelimClassification.VirtualWhitespace:
                return(null);

            case DelimClassification.Whitespace:
                return(null);

            case DelimClassification.None:
                return(null);

            default:
                throw new ApplicationException(
                          "unexpected DelimClassification " + Delim.ToString());
            }
        }
        public static ScanAtomCode?ToScanAtomCode(this DelimClassification Delim)
        {
            switch (Delim)
            {
            case DelimClassification.CloseBraced:
                return(ScanAtomCode.EnclosureSymbol);

            case DelimClassification.CommentToEnd:
                return(ScanAtomCode.CommentToEnd);

            case DelimClassification.DividerSymbol:
                return(ScanAtomCode.DividerSymbol);

            case DelimClassification.EmbeddedComment:
                return(ScanAtomCode.EmbeddedComment);

            case DelimClassification.EndOfString:
                return(ScanAtomCode.EndOfString);

            case DelimClassification.EndStmt:
                return(ScanAtomCode.EndStmt);

            case DelimClassification.ExpressionSymbol:
                return(ScanAtomCode.ExpressionSymbol);

            case DelimClassification.Assignment:
                return(ScanAtomCode.Assignment);

            case DelimClassification.NewLine:
                return(null);

            case DelimClassification.OpenContentBraced:
                return(ScanAtomCode.EnclosureSymbol);

            case DelimClassification.OpenNamedBraced:
                return(ScanAtomCode.EnclosureSymbol);

            case DelimClassification.PathSep:
                return(null);

            case DelimClassification.Quote:
                return(null);

            case DelimClassification.VirtualWhitespace:
                return(null);

            case DelimClassification.Whitespace:
                return(ScanAtomCode.Whitespace);

            case DelimClassification.Keyword:
                return(ScanAtomCode.Keyword);

            case DelimClassification.SpecialValueStarter:
                return(ScanAtomCode.SpecialValue);

            case DelimClassification.None:
                return(null);

            default:
                throw new ApplicationException(
                          "unexpected DelimClassification " + Delim.ToString());
            }
        }